Apply new ESLint rules for braces around ifs and unnecessary checks

This commit is contained in:
Adam Gastineau 2024-12-16 12:12:16 -08:00
parent 512cb36c9b
commit 818063d521
2 changed files with 7 additions and 2 deletions

View file

@ -4,6 +4,7 @@ module.exports = {
parserOptions: {
ecmaVersion: 9,
sourceType: "module",
project: "./tsconfig.json"
},
extends: [
"plugin:react/recommended",
@ -26,6 +27,8 @@ module.exports = {
rules: {
"@typescript-eslint/no-unused-vars": [2, {args: "none"}],
"@typescript-eslint/consistent-type-imports": [2, {disallowTypeAnnotations: false}],
"@typescript-eslint/no-unnecessary-condition": [2],
/**
* Enforced rules
*/
@ -48,8 +51,8 @@ module.exports = {
"getWithoutSet": false,
"setWithoutGet": false
}],
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
"curly": [2, "multi-or-nest", "consistent"],
"brace-style": [2, "1tbs"],
"curly": [2, "all"],
"new-parens": 2,
"arrow-parens": [2, "as-needed"],
"prefer-const": 2,

View file

@ -12,5 +12,7 @@ module.exports = {
rules: {
'@typescript-eslint/no-floating-promises': 'error',
"@typescript-eslint/no-unnecessary-boolean-literal-compare": 2,
// Not strictly necessary for tests and there are some config issues with it
"@typescript-eslint/no-unnecessary-condition": 0,
},
};