Eslint: update rules and adjust code accordingly.

Some of the rules were the eslint rules instead of the correct typescript-eslint
ones. Some were just missing.
master
Tom Hacohen 5 years ago
parent ab26880033
commit 444ab72c80

@ -60,9 +60,9 @@ module.exports = {
"react/jsx-key": ["error", { "checkFragmentShorthand": true }], "react/jsx-key": ["error", { "checkFragmentShorthand": true }],
"quotes": "off", "quotes": "off",
"@typescript-eslint/quotes": ["error", "single", { "allowTemplateLiterals": true }], "@typescript-eslint/quotes": ["error", "single", { "allowTemplateLiterals": true, "avoidEscape": true }],
"semi": ["error", "always", { "omitLastInOneLineBlock": true }], "semi": "off",
"camelcase": ["error"], "@typescript-eslint/semi": ["error", "always", { "omitLastInOneLineBlock": true }],
"comma-dangle": ["error", { "comma-dangle": ["error", {
"arrays": "always-multiline", "arrays": "always-multiline",
"objects": "always-multiline", "objects": "always-multiline",
@ -72,7 +72,8 @@ module.exports = {
}], }],
"comma-spacing": ["error"], "comma-spacing": ["error"],
"eqeqeq": ["error", "smart"], "eqeqeq": ["error", "smart"],
"indent": ["error", 2, { "indent": "off",
"@typescript-eslint/indent": ["error", 2, {
"SwitchCase": 1, "SwitchCase": 1,
}], }],
"no-multi-spaces": "error", "no-multi-spaces": "error",
@ -93,8 +94,15 @@ module.exports = {
"curly": ["error", "all"], "curly": ["error", "all"],
"space-infix-ops": "error", "space-infix-ops": "error",
"consistent-return": "error", "consistent-return": "error",
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"jsx-quotes": ["error"], "jsx-quotes": ["error"],
"array-bracket-spacing": "error", "array-bracket-spacing": "error",
"brace-style": "off",
"@typescript-eslint/brace-style": [
"error",
"1tbs",
{ allowSingleLine: true },
],
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "warn",
} }
}; };

Loading…
Cancel
Save