yomichan/.eslintrc.json

83 lines
2.5 KiB
JSON
Raw Normal View History

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": [
"/ext/mixed/lib/",
"/ext/bg/js/templates.js"
],
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",
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",
"no-undef": "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",
"no-unsanitized/method": "error",
"no-unsanitized/property": "error"
2020-02-01 20:00:34 +00:00
},
"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",
2020-02-12 03:19:47 +00:00
"parseUrl": "readonly",
2020-02-01 20:00:34 +00:00
"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
}
2020-02-12 03:21:30 +00:00
},
{
"files": ["test/**/*.js"],
"env": {
"browser": false,
"es2017": false,
"webextensions": false,
"node": true
}
2020-02-01 20:00:34 +00:00
}
]
2019-11-25 05:40:30 +00:00
}