Skip to content

Commit 0ae8ca1

Browse files
Updated typescript-eslint to v6 (#54693)
Co-authored-by: Jake Bailey <[email protected]>
1 parent 8a85b2a commit 0ae8ca1

23 files changed

+210
-233
lines changed

.eslintrc.json

Lines changed: 37 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"node": true,
1111
"es6": true
1212
},
13+
"extends": [
14+
"eslint:recommended",
15+
"plugin:@typescript-eslint/recommended",
16+
"plugin:@typescript-eslint/stylistic"
17+
],
1318
"plugins": [
1419
"@typescript-eslint", "no-null", "import", "eslint-plugin-local", "simple-import-sort"
1520
],
@@ -25,16 +30,10 @@
2530
"/coverage/**"
2631
],
2732
"rules": {
33+
"max-statements-per-line": ["error", { "max": 1 }],
2834
"simple-import-sort/imports": "error",
2935
"simple-import-sort/exports": "error",
3036

31-
"@typescript-eslint/adjacent-overload-signatures": "error",
32-
"@typescript-eslint/array-type": "error",
33-
"@typescript-eslint/no-array-constructor": "error",
34-
35-
"brace-style": "off",
36-
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
37-
3837
"@typescript-eslint/naming-convention": [
3938
"error",
4039
{ "selector": "typeLike", "format": ["PascalCase"], "filter": { "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
@@ -48,45 +47,44 @@
4847
{ "selector": "property", "format": null }
4948
],
5049

51-
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
52-
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }],
53-
54-
"max-statements-per-line": ["error", { "max": 1 }],
55-
56-
"no-duplicate-imports": "off",
57-
"@typescript-eslint/no-duplicate-imports": "error",
58-
59-
"@typescript-eslint/no-inferrable-types": "error",
60-
"@typescript-eslint/no-misused-new": "error",
61-
"@typescript-eslint/no-this-alias": "error",
62-
63-
"no-unused-expressions": "off",
64-
"@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }],
65-
66-
"@typescript-eslint/prefer-for-of": "error",
67-
"@typescript-eslint/prefer-function-type": "error",
68-
"@typescript-eslint/prefer-namespace-keyword": "error",
69-
"@typescript-eslint/prefer-as-const": "error",
70-
71-
"quotes": "off",
50+
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
51+
"@typescript-eslint/no-extra-semi": "error",
7252
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
73-
74-
"semi": "off",
7553
"@typescript-eslint/semi": "error",
76-
"@typescript-eslint/no-extra-semi": "error",
77-
78-
"space-before-function-paren": "off",
7954
"@typescript-eslint/space-before-function-paren": ["error", {
8055
"asyncArrow": "always",
8156
"anonymous": "always",
8257
"named": "never"
8358
}],
8459

85-
"@typescript-eslint/triple-slash-reference": "error",
86-
"@typescript-eslint/type-annotation-spacing": "error",
87-
"@typescript-eslint/unified-signatures": "error",
88-
89-
"@typescript-eslint/no-extra-non-null-assertion": "error",
60+
// Todo: For each of these, investigate whether we want to enable them ✨
61+
"@typescript-eslint/ban-types": "off",
62+
"no-case-declarations": "off",
63+
"no-cond-assign": "off",
64+
"no-constant-condition": "off",
65+
"no-control-regex": "off",
66+
"no-debugger": "off",
67+
"no-extra-boolean-cast": "off",
68+
"no-inner-declarations": "off",
69+
"no-useless-escape": "off",
70+
"prefer-rest-params": "off",
71+
"prefer-spread": "off",
72+
"@typescript-eslint/no-empty-function": "off",
73+
"@typescript-eslint/no-empty-interface": "off",
74+
"@typescript-eslint/no-explicit-any": "off",
75+
"@typescript-eslint/no-unused-vars": "off",
76+
77+
// Pending https://github.com/typescript-eslint/typescript-eslint/issues/4820
78+
"@typescript-eslint/prefer-optional-chain": "off",
79+
80+
// Rules enabled in typescript-eslint configs that are not applicable here
81+
"@typescript-eslint/ban-ts-comment": "off",
82+
"@typescript-eslint/class-literal-property-style": "off",
83+
"@typescript-eslint/consistent-indexed-object-style": "off",
84+
"@typescript-eslint/no-duplicate-enum-values": "off",
85+
"@typescript-eslint/no-namespace": "off",
86+
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
87+
"@typescript-eslint/no-var-requires": "off",
9088

9189
// scripts/eslint/rules
9290
"local/object-literal-surrounding-space": "error",
@@ -111,18 +109,14 @@
111109
"no-null/no-null": "error",
112110

113111
// eslint
114-
"constructor-super": "error",
115112
"curly": ["error", "multi-line"],
116113
"dot-notation": "error",
117114
"eqeqeq": "error",
118115
"linebreak-style": ["error", "windows"],
119116
"new-parens": "error",
120117
"no-caller": "error",
121-
"no-duplicate-case": "error",
122-
"no-empty": "error",
123118
"no-eval": "error",
124119
"no-extra-bind": "error",
125-
"no-fallthrough": "error",
126120
"no-new-func": "error",
127121
"no-new-wrappers": "error",
128122
"no-return-await": "error",
@@ -134,24 +128,17 @@
134128
{ "name": "setImmediate" },
135129
{ "name": "clearImmediate" }
136130
],
137-
"no-sparse-arrays": "error",
138131
"no-template-curly-in-string": "error",
139132
"no-throw-literal": "error",
140133
"no-trailing-spaces": "error",
141134
"no-undef-init": "error",
142-
"no-unsafe-finally": "error",
143-
"no-unused-labels": "error",
144135
"no-var": "error",
145136
"object-shorthand": "error",
146137
"prefer-const": "error",
147138
"prefer-object-spread": "error",
148139
"quote-props": ["error", "consistent-as-needed"],
149140
"space-in-parens": "error",
150-
"unicode-bom": ["error", "never"],
151-
"use-isnan": "error",
152-
"no-prototype-builtins": "error",
153-
"no-self-assign": "error",
154-
"no-dupe-else-if": "error"
141+
"unicode-bom": ["error", "never"]
155142
},
156143
"overrides": [
157144
// By default, the ESLint CLI only looks at .js files. But, it will also look at

0 commit comments

Comments
 (0)