aboutsummaryrefslogtreecommitdiff
path: root/.eslintrc.json
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-12 19:06:36 -0500
committerGitHub <noreply@github.com>2020-02-12 19:06:36 -0500
commitaf89659751f72ae282f2c81d797cc224d1077b0a (patch)
tree5bd6b317242a42bbd04fc73d8f607e2daae447e6 /.eslintrc.json
parent65dfb855fb23d8279367651ab650f3347aa236ac (diff)
parentc8e7a1543ee52943157ff54b2a9983ad20deaa15 (diff)
Merge pull request #344 from toasted-nutbread/eslint-strengthening
Eslint strengthening
Diffstat (limited to '.eslintrc.json')
-rw-r--r--.eslintrc.json57
1 files changed, 54 insertions, 3 deletions
diff --git a/.eslintrc.json b/.eslintrc.json
index 0e3b939a..d4ae215b 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1,7 +1,14 @@
{
+ "root": true,
"extends": "eslint:recommended",
"parserOptions": {
- "ecmaVersion": 8
+ "ecmaVersion": 8,
+ "sourceType": "script"
+ },
+ "env": {
+ "browser": true,
+ "es2017": true,
+ "webextensions": true
},
"ignorePatterns": [
"/ext/mixed/lib/",
@@ -16,13 +23,57 @@
"no-case-declarations": "error",
"no-const-assign": "error",
"no-constant-condition": "off",
- "no-undef": "off",
+ "no-global-assign": "error",
+ "no-undef": "error",
"no-unused-vars": ["error", {"vars": "local", "args": "after-used", "argsIgnorePattern": "^_", "caughtErrors": "none"}],
+ "no-unused-expressions": "error",
"no-var": "error",
"prefer-const": ["error", {"destructuring": "all"}],
"quote-props": ["error", "consistent"],
"quotes": ["error", "single", "avoid-escape"],
"require-atomic-updates": "off",
"semi": "error"
- }
+ },
+ "overrides": [
+ {
+ "files": ["*.js"],
+ "excludedFiles": ["ext/mixed/js/core.js"],
+ "globals": {
+ "yomichan": "readonly",
+ "errorToJson": "readonly",
+ "jsonToError": "readonly",
+ "logError": "readonly",
+ "isObject": "readonly",
+ "hasOwn": "readonly",
+ "toIterable": "readonly",
+ "stringReverse": "readonly",
+ "promiseTimeout": "readonly",
+ "stringReplaceAsync": "readonly",
+ "parseUrl": "readonly",
+ "EventDispatcher": "readonly",
+ "EXTENSION_IS_BROWSER_EDGE": "readonly"
+ }
+ },
+ {
+ "files": ["ext/mixed/js/core.js"],
+ "globals": {
+ "chrome": "writable"
+ }
+ },
+ {
+ "files": ["ext/bg/js/settings/*.js"],
+ "env": {
+ "jquery": true
+ }
+ },
+ {
+ "files": ["test/**/*.js"],
+ "env": {
+ "browser": false,
+ "es2017": false,
+ "webextensions": false,
+ "node": true
+ }
+ }
+ ]
}