2019-11-25 05:40:30 +00:00
|
|
|
{
|
2020-02-01 20:00:11 +00:00
|
|
|
"root": true,
|
2019-11-25 05:40:30 +00:00
|
|
|
"extends": "eslint:recommended",
|
|
|
|
"parserOptions": {
|
2020-02-01 20:00:11 +00:00
|
|
|
"ecmaVersion": 8,
|
|
|
|
"sourceType": "script"
|
|
|
|
},
|
|
|
|
"env": {
|
|
|
|
"browser": true,
|
|
|
|
"es2017": true,
|
|
|
|
"webextensions": true
|
2019-11-25 05:40:30 +00:00
|
|
|
},
|
2020-02-12 03:11:28 +00:00
|
|
|
"plugins": ["no-unsanitized"],
|
2019-11-25 19:48:20 +00:00
|
|
|
"ignorePatterns": [
|
2021-02-14 16:24:43 +00:00
|
|
|
"/ext/lib/"
|
2019-11-25 19:48:20 +00:00
|
|
|
],
|
2019-11-25 05:40:30 +00:00
|
|
|
"rules": {
|
2019-11-27 03:01:54 +00:00
|
|
|
"arrow-parens": ["error", "always"],
|
2019-11-25 05:40:30 +00:00
|
|
|
"comma-dangle": ["error", "never"],
|
2019-11-25 19:48:20 +00:00
|
|
|
"curly": ["error", "all"],
|
2019-11-25 05:40:30 +00:00
|
|
|
"dot-notation": "error",
|
2019-11-25 19:48:20 +00:00
|
|
|
"eqeqeq": "error",
|
2020-02-16 01:11:29 +00:00
|
|
|
"func-names": ["error", "always"],
|
2020-02-26 03:11:33 +00:00
|
|
|
"guard-for-in": "error",
|
2020-05-02 17:04:17 +00:00
|
|
|
"new-parens": "error",
|
2019-11-25 05:40:30 +00:00
|
|
|
"no-case-declarations": "error",
|
2019-11-25 19:48:20 +00:00
|
|
|
"no-const-assign": "error",
|
|
|
|
"no-constant-condition": "off",
|
2020-02-01 20:00:34 +00:00
|
|
|
"no-global-assign": "error",
|
2020-02-17 20:28:10 +00:00
|
|
|
"no-param-reassign": "off",
|
2020-02-17 20:30:41 +00:00
|
|
|
"no-prototype-builtins": "error",
|
2020-02-17 20:21:30 +00:00
|
|
|
"no-shadow": ["error", {"builtinGlobals": false}],
|
2020-02-01 20:00:34 +00:00
|
|
|
"no-undef": "error",
|
2021-01-17 17:20:06 +00:00
|
|
|
"no-undefined": "error",
|
2020-07-03 20:10:08 +00:00
|
|
|
"no-underscore-dangle": ["error", {"allowAfterThis": true, "allowAfterSuper": false, "allowAfterThisConstructor": false}],
|
2020-05-02 17:04:17 +00:00
|
|
|
"no-unexpected-multiline": "error",
|
2020-02-16 01:11:29 +00:00
|
|
|
"no-unneeded-ternary": "error",
|
2019-11-25 19:48:20 +00:00
|
|
|
"no-unused-vars": ["error", {"vars": "local", "args": "after-used", "argsIgnorePattern": "^_", "caughtErrors": "none"}],
|
2020-02-01 20:00:11 +00:00
|
|
|
"no-unused-expressions": "error",
|
2019-11-25 19:48:20 +00:00
|
|
|
"no-var": "error",
|
|
|
|
"prefer-const": ["error", {"destructuring": "all"}],
|
2019-11-25 05:40:30 +00:00
|
|
|
"quote-props": ["error", "consistent"],
|
2019-11-25 19:48:20 +00:00
|
|
|
"quotes": ["error", "single", "avoid-escape"],
|
|
|
|
"require-atomic-updates": "off",
|
2020-02-12 03:11:28 +00:00
|
|
|
"semi": "error",
|
2020-05-02 17:04:17 +00:00
|
|
|
"wrap-iife": ["error", "inside"],
|
2020-02-16 01:11:29 +00:00
|
|
|
|
|
|
|
"brace-style": ["error", "1tbs", {"allowSingleLine": true}],
|
|
|
|
"indent": ["error", 4, {"SwitchCase": 1, "MemberExpression": 1, "flatTernaryExpressions": true, "ignoredNodes": ["ConditionalExpression"]}],
|
|
|
|
"object-curly-newline": "error",
|
|
|
|
"padded-blocks": ["error", "never"],
|
|
|
|
|
|
|
|
"array-bracket-spacing": ["error", "never"],
|
|
|
|
"arrow-spacing": ["error", {"before": true, "after": true}],
|
|
|
|
"block-spacing": ["error", "always"],
|
|
|
|
"comma-spacing": ["error", { "before": false, "after": true }],
|
|
|
|
"computed-property-spacing": ["error", "never"],
|
|
|
|
"func-call-spacing": ["error", "never"],
|
2020-05-02 17:04:17 +00:00
|
|
|
"function-paren-newline": ["error", "multiline-arguments"],
|
2020-02-16 01:11:29 +00:00
|
|
|
"generator-star-spacing": ["error", "before"],
|
|
|
|
"key-spacing": ["error", {"beforeColon": false, "afterColon": true, "mode": "strict"}],
|
|
|
|
"keyword-spacing": ["error", {"before": true, "after": true}],
|
|
|
|
"no-trailing-spaces": "error",
|
|
|
|
"no-whitespace-before-property": "error",
|
|
|
|
"object-curly-spacing": ["error", "never"],
|
|
|
|
"rest-spread-spacing": ["error", "never"],
|
|
|
|
"semi-spacing": ["error", {"before": false, "after": true}],
|
2020-05-02 17:04:17 +00:00
|
|
|
"space-before-function-paren": ["error", {
|
|
|
|
"anonymous": "never",
|
|
|
|
"named": "never",
|
|
|
|
"asyncArrow": "always"
|
|
|
|
}],
|
2020-02-16 01:11:29 +00:00
|
|
|
"space-in-parens": ["error", "never"],
|
|
|
|
"space-unary-ops": "error",
|
2020-03-11 02:30:36 +00:00
|
|
|
"spaced-comment": ["error", "always"],
|
2020-02-16 01:11:29 +00:00
|
|
|
"switch-colon-spacing": ["error", {"after": true, "before": false}],
|
|
|
|
"template-curly-spacing": ["error", "never"],
|
|
|
|
"template-tag-spacing": ["error", "never"],
|
|
|
|
|
2020-02-12 03:11:28 +00:00
|
|
|
"no-unsanitized/method": "error",
|
|
|
|
"no-unsanitized/property": "error"
|
2020-02-01 20:00:34 +00:00
|
|
|
},
|
|
|
|
"overrides": [
|
2020-06-28 16:40:02 +00:00
|
|
|
{
|
2020-09-04 22:19:43 +00:00
|
|
|
"files": [
|
2021-02-14 03:52:28 +00:00
|
|
|
"ext/js/core.js",
|
2021-02-14 16:19:54 +00:00
|
|
|
"ext/js/templates/template-renderer.js",
|
2021-02-14 03:52:28 +00:00
|
|
|
"ext/js/language/dictionary-data-util.js"
|
2020-09-04 22:19:43 +00:00
|
|
|
],
|
2020-06-28 16:40:02 +00:00
|
|
|
"env": {
|
|
|
|
"webextensions": false
|
|
|
|
}
|
|
|
|
},
|
2020-02-01 20:00:34 +00:00
|
|
|
{
|
2020-02-26 03:30:29 +00:00
|
|
|
"files": ["ext/**/*.js"],
|
2020-09-04 22:19:43 +00:00
|
|
|
"excludedFiles": [
|
2021-02-14 03:52:28 +00:00
|
|
|
"ext/js/core.js",
|
2021-02-14 16:19:54 +00:00
|
|
|
"ext/js/templates/template-renderer.js",
|
|
|
|
"ext/js/data/anki-note-data.js",
|
2021-02-14 03:52:28 +00:00
|
|
|
"ext/js/language/dictionary-data-util.js"
|
2020-09-04 22:19:43 +00:00
|
|
|
],
|
2020-02-01 20:00:34 +00:00
|
|
|
"globals": {
|
2021-01-08 02:36:20 +00:00
|
|
|
"serializeError": "readonly",
|
|
|
|
"deserializeError": "readonly",
|
2020-02-01 20:00:34 +00:00
|
|
|
"isObject": "readonly",
|
|
|
|
"stringReverse": "readonly",
|
|
|
|
"promiseTimeout": "readonly",
|
2020-05-23 00:03:34 +00:00
|
|
|
"escapeRegExp": "readonly",
|
2020-06-28 15:23:51 +00:00
|
|
|
"deferPromise": "readonly",
|
2020-06-28 16:38:34 +00:00
|
|
|
"clone": "readonly",
|
2020-11-10 02:47:25 +00:00
|
|
|
"deepEqual": "readonly",
|
2020-08-22 19:49:24 +00:00
|
|
|
"generateId": "readonly",
|
2020-08-23 16:43:53 +00:00
|
|
|
"promiseAnimationFrame": "readonly",
|
2020-08-22 21:50:56 +00:00
|
|
|
"DynamicProperty": "readonly",
|
2020-02-01 20:00:34 +00:00
|
|
|
"EventDispatcher": "readonly",
|
2020-06-28 16:40:02 +00:00
|
|
|
"EventListenerCollection": "readonly"
|
2020-02-01 20:00:34 +00:00
|
|
|
}
|
|
|
|
},
|
2020-06-28 15:26:43 +00:00
|
|
|
{
|
|
|
|
"files": ["ext/**/*.js"],
|
|
|
|
"excludedFiles": [
|
2021-02-14 03:52:28 +00:00
|
|
|
"ext/js/core.js",
|
|
|
|
"ext/js/yomichan.js"
|
2020-06-28 15:26:43 +00:00
|
|
|
],
|
|
|
|
"globals": {
|
|
|
|
"yomichan": "readonly"
|
|
|
|
}
|
|
|
|
},
|
2020-02-01 20:00:34 +00:00
|
|
|
{
|
2021-02-14 03:52:28 +00:00
|
|
|
"files": ["ext/js/yomichan.js"],
|
2020-02-01 20:00:34 +00:00
|
|
|
"globals": {
|
|
|
|
"chrome": "writable"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2021-02-14 16:24:43 +00:00
|
|
|
"files": ["ext/js/settings/modal-jquery.js"],
|
2020-02-01 20:00:34 +00:00
|
|
|
"env": {
|
|
|
|
"jquery": true
|
|
|
|
}
|
2020-02-12 03:21:30 +00:00
|
|
|
},
|
|
|
|
{
|
2020-08-09 17:09:06 +00:00
|
|
|
"files": [
|
|
|
|
"test/**/*.js",
|
|
|
|
"dev/**/*.js"
|
|
|
|
],
|
2020-04-04 20:56:06 +00:00
|
|
|
"excludedFiles": ["test/data/html/*.js"],
|
2020-02-20 01:00:27 +00:00
|
|
|
"parserOptions": {
|
|
|
|
"ecmaVersion": 8,
|
|
|
|
"sourceType": "module"
|
|
|
|
},
|
2020-02-12 03:21:30 +00:00
|
|
|
"env": {
|
|
|
|
"browser": false,
|
2020-02-20 01:00:27 +00:00
|
|
|
"es2017": true,
|
|
|
|
"node": true,
|
|
|
|
"webextensions": false
|
2020-02-12 03:21:30 +00:00
|
|
|
}
|
2020-12-18 20:54:05 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"files": [
|
2021-02-14 03:52:28 +00:00
|
|
|
"ext/js/core.js",
|
|
|
|
"ext/js/yomichan.js",
|
|
|
|
"ext/js/background/environment.js",
|
|
|
|
"ext/js/language/japanese-util.js",
|
|
|
|
"ext/js/general/cache-map.js",
|
|
|
|
"ext/js/language/dictionary-data-util.js",
|
|
|
|
"ext/js/general/object-property-accessor.js",
|
2021-02-14 16:19:54 +00:00
|
|
|
"ext/js/comm/anki.js",
|
|
|
|
"ext/js/media/audio-downloader.js",
|
|
|
|
"ext/js/comm/clipboard-monitor.js",
|
|
|
|
"ext/js/comm/clipboard-reader.js",
|
|
|
|
"ext/js/data/database.js",
|
|
|
|
"ext/js/language/deinflector.js",
|
|
|
|
"ext/js/language/dictionary-database.js",
|
|
|
|
"ext/js/data/json-schema.js",
|
|
|
|
"ext/js/comm/mecab.js",
|
2021-02-14 16:32:30 +00:00
|
|
|
"ext/js/media/media-util.js",
|
2021-02-14 16:19:54 +00:00
|
|
|
"ext/js/data/options-util.js",
|
|
|
|
"ext/js/data/permissions-util.js",
|
2021-02-14 16:32:30 +00:00
|
|
|
"ext/js/background/profile-conditions-util.js",
|
2021-02-14 16:19:54 +00:00
|
|
|
"ext/js/background/request-builder.js",
|
|
|
|
"ext/js/dom/simple-dom-parser.js",
|
|
|
|
"ext/js/templates/template-patcher.js",
|
|
|
|
"ext/js/general/text-source-map.js",
|
|
|
|
"ext/js/language/translator.js",
|
|
|
|
"ext/js/background/backend.js",
|
|
|
|
"ext/js/background/background-main.js"
|
2020-12-18 20:54:05 +00:00
|
|
|
],
|
|
|
|
"env": {
|
|
|
|
"browser": false,
|
|
|
|
"serviceworker": true,
|
|
|
|
"es2017": true,
|
|
|
|
"webextensions": true
|
|
|
|
},
|
|
|
|
"globals": {
|
|
|
|
"FileReader": "readonly",
|
|
|
|
"Intl": "readonly",
|
|
|
|
"crypto": "readonly"
|
|
|
|
}
|
2020-02-01 20:00:34 +00:00
|
|
|
}
|
|
|
|
]
|
2019-11-25 05:40:30 +00:00
|
|
|
}
|