1adece89d6
As discussed [on Matrix](https://col.la/suppresseslintindevelopment) the set of things we want to pick up in CI and development are different. Specifically, there are some things that only get in the way during development but should not be allowed in merged code. Examples are 'debugger' statemens, dead code (e.g. resulting from 'if (false)') and unused variables. After #7822 there are no more eslint warnings, so we can use it as a separate state for these issues that should only block in CI. This commit make make check run eslint and fail if it receives any warnings, and changes those 3 errors so that they only emit warnings. It's expected that there are more annoying warnings which I've missed, if you have any please make a followup change! This commit explicitly does not deal with formatting-related issues (e.g. requiring single quotes for strings in eslint) as though they can be annoying there's no reason why they should change between development and master... another followup to improve linting experience could be to use an autoformatter so the computer fixes the formatting for you, however that's out-of-scope for this commit Change-Id: I036afac5ef5056a9cc2effc21e31165aa1436ad2 Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
61 lines
1.5 KiB
Text
61 lines
1.5 KiB
Text
{
|
|
"extends": "eslint:recommended",
|
|
"rules": {
|
|
"camelcase": 2,
|
|
"quotes": [2, "single"],
|
|
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
|
|
"space-in-parens": 2,
|
|
"space-before-blocks": 2,
|
|
"keyword-spacing": 2,
|
|
"no-lonely-if": 2,
|
|
"comma-style": 2,
|
|
"indent": "off",
|
|
"no-underscore-dangle": 0,
|
|
"no-constant-condition": 0,
|
|
"no-multi-spaces": 0,
|
|
"strict": 0,
|
|
"key-spacing": 0,
|
|
"no-shadow": 0,
|
|
"no-console": 0,
|
|
"no-control-regex": 0,
|
|
"no-useless-escape": 0,
|
|
"semi": 2,
|
|
"no-redeclare": 0,
|
|
/// Rules that are set to warn will fail in CI but not when building for development:
|
|
"no-debugger": 1,
|
|
"no-unreachable": 1,
|
|
"no-unused-vars": 1,
|
|
},
|
|
"globals": {
|
|
"L": true,
|
|
"module": false,
|
|
"define": false
|
|
},
|
|
"env": {
|
|
"browser": true
|
|
},
|
|
"overrides": [
|
|
{
|
|
"files": ["**/*.ts"],
|
|
"parser": "@typescript-eslint/parser",
|
|
"plugins": [
|
|
"@typescript-eslint"
|
|
],
|
|
"extends": [
|
|
"eslint:recommended",
|
|
"plugin:@typescript-eslint/eslint-recommended",
|
|
"plugin:@typescript-eslint/recommended"
|
|
],
|
|
"rules": {
|
|
"@typescript-eslint/no-unused-vars": "off",
|
|
"@typescript-eslint/no-inferrable-types": "off",
|
|
"no-var": "off",
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
"@typescript-eslint/no-namespace": "off",
|
|
"no-inner-declarations": "off",
|
|
"no-constant-condition": "off",
|
|
"@typescript-eslint/triple-slash-reference": "off"
|
|
}
|
|
}
|
|
]
|
|
}
|