Skip to content

Commit

Permalink
fix(eslintrc): configure eslint and run on codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
cmnord committed Aug 24, 2023
1 parent afe2b4e commit 6e38012
Show file tree
Hide file tree
Showing 4 changed files with 260 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,9 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
env: {
node: true,
},
// ignore the dist folder
ignorePatterns: ["dist", "*.config.js"],
};
247 changes: 247 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -4,6 +4,7 @@
"scripts": {
"build": "webpack --mode=production",
"dev": "webpack --mode=development --watch",
"lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
"release:cws": "chrome-webstore-upload upload --source=dist --auto-publish",
"release:amo": "web-ext-submit --source-dir dist",
"release": "VER=$(npx dot-json src/manifest.json version) run-s build version release:*",
Expand All @@ -14,6 +15,8 @@
"devDependencies": {
"@types/firefox-webext-browser": "^109.0.0",
"@types/webextension-polyfill": "^0.10.2",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"chrome-webstore-upload-cli": "^2.2.2",
"copy-webpack-plugin": "^11.0.0",
"dot-json": "^1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/content-script.ts
Expand Up @@ -5,7 +5,7 @@ import { parseGame } from "./parser";
// On a message from the popup script, the content script parses the body of the
// page and returns it to the client in JSON form.
browser.runtime.onMessage.addListener(
(message, _sender, sendResponse: (response?: any) => void) => {
(message, _sender, sendResponse: (response?: unknown) => void) => {
if (message.message === "parse") {
const { game, error } = parseGame(document.body);
sendResponse({ game, error });
Expand Down

0 comments on commit 6e38012

Please sign in to comment.