mirror of https://github.com/zulip/zulip.git
eslint: Make subdirectory configurations more consistent.
Enable ES2020 everywhere except Casper. Disable Node-specific globals in static. Disable browser-specific and CommonJS globals in shared. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
c9ce77c28b
commit
a83c2c6296
|
@ -1,12 +1,11 @@
|
|||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"es6": true
|
||||
"es2020": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": ["eslint:recommended", "prettier"],
|
||||
"parser": "babel-eslint",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2019,
|
||||
"warnOnUnsupportedTypeScriptVersion": false,
|
||||
"sourceType": "module"
|
||||
},
|
||||
|
@ -86,7 +85,7 @@
|
|||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["frontend_tests/**/*.{js,ts}", "static/js/**/*.{js,ts}"],
|
||||
"files": ["frontend_tests/**", "static/js/**"],
|
||||
"globals": {
|
||||
"$": false,
|
||||
"ClipboardJS": false,
|
||||
|
@ -296,15 +295,6 @@
|
|||
"zxcvbn": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["frontend_tests/casper_tests/*.js", "frontend_tests/casper_lib/*.js"],
|
||||
"rules": {
|
||||
// Don’t require ES features that PhantomJS doesn’t support
|
||||
"no-var": "off",
|
||||
"object-shorthand": "off",
|
||||
"prefer-arrow-callback": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["**/*.ts"],
|
||||
"extends": ["plugin:@typescript-eslint/recommended", "prettier/@typescript-eslint"],
|
||||
|
@ -340,6 +330,52 @@
|
|||
"@typescript-eslint/promise-function-async": "error",
|
||||
"@typescript-eslint/unified-signatures": "error"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["frontend_tests/**"],
|
||||
"globals": {
|
||||
"assert": false,
|
||||
"casper": false,
|
||||
"document": false,
|
||||
"set_global": false,
|
||||
"window": false,
|
||||
"zrequire": false
|
||||
},
|
||||
"rules": {
|
||||
"no-sync": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["frontend_tests/casper_lib/**", "frontend_tests/casper_tests/**"],
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2020": false
|
||||
},
|
||||
"rules": {
|
||||
// Don’t require ES features that PhantomJS doesn’t support
|
||||
"no-var": "off",
|
||||
"object-shorthand": "off",
|
||||
"prefer-arrow-callback": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["static/**"],
|
||||
"env": {
|
||||
"browser": true,
|
||||
"commonjs": true,
|
||||
"node": false
|
||||
},
|
||||
"rules": {
|
||||
"no-console": "error"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["static/shared/**"],
|
||||
"env": {
|
||||
"browser": false,
|
||||
"commonjs": false,
|
||||
"shared-node-browser": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"env": {
|
||||
"shared-node-browser": true,
|
||||
"es6": true
|
||||
},
|
||||
"parserOptions": {"ecmaVersion": 2018},
|
||||
"globals": {
|
||||
"assert": false,
|
||||
"casper": false,
|
||||
"document": false,
|
||||
"set_global": false,
|
||||
"window": false,
|
||||
"zrequire": false
|
||||
},
|
||||
"rules": {
|
||||
"no-sync": 0,
|
||||
"prefer-const": "error"
|
||||
}
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"env": {
|
||||
"browser": true
|
||||
},
|
||||
"rules": {
|
||||
"no-console": "error"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue