diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..bfd66ef7 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,32 @@ +{ + "root": true, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module", + "project": "./tsconfig.json" + }, + "plugins": ["@typescript-eslint"], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_" + } + ], + "no-console": "off" + }, + "env": { + "browser": true, + "es2020": true, + "node": true, + "webextensions": true + }, + "ignorePatterns": ["dist/", "node_modules/", "webpack/", ".temp/"] +} diff --git a/package.json b/package.json index 86181a7f..f93706e7 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,8 @@ "test": "npx jest", "build-test": "npm build & npm test", "style": "prettier --write \"src/**/*.{ts}\"", + "lint": "eslint \"src/**/*.{ts,tsx}\"", + "lint:fix": "eslint \"src/**/*.{ts,tsx}\" --fix", "gen-licenses": "rimraf .temp && tsc --outDir .temp/codegen-js ./src/__codegen__/genLicenses.ts && node .temp/codegen-js/__codegen__/genLicenses.js && rimraf .temp" }, "author": "Michael Weiss", @@ -22,7 +24,10 @@ "@types/chrome": "0.0.154", "@types/jest": "^27.0.2", "@types/node": "^16.4.13", + "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/parser": "^5.62.0", "copy-webpack-plugin": "^9.0.1", + "eslint": "^8.57.0", "front-matter": "4.0.2", "glob": "^7.2.0", "jest": "^27.3.1",