Skip to content

Commit 1d81d1a

Browse files
authored
build(eslint-config-fluid): update @typescript-eslint to v8 (#25663)
Updates @typescript-eslint packages from v7 to v8 with necessary rule migrations and configuration adjustments. ## Changes - Update @typescript-eslint/eslint-plugin and @typescript-eslint/parser to v8 - Migrate rule: `no-throw-literal` → `only-throw-error` - Remove deprecated and deleted rules: `ban-types`, `no-empty-interface`, and others - I removed all typescript-eslint rules that are deleted or deprecated. This resulted in some trivial changes to the config of some rules (rulesets often keep the old, even deleted, rules around for awhile "just in case" -- they just set them to "off" -- so we'll still see them in the printed configs). - Update codebase for new rule requirements (explicit returns, type annotations) ## Test plan - CI passes with updated ESLint configuration - All lint errors resolved across codebase
1 parent 3bb132c commit 1d81d1a

File tree

112 files changed

+466
-582
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+466
-582
lines changed

azure/packages/azure-local-service/tsconfig.eslint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"extends": "../../../common/build/build-common/tsconfig.node16.json",
55
"include": ["index.js"],
66
"compilerOptions": {
7+
"allowJs": true,
78
"noEmit": true,
89
},
910
}

common/build/eslint-config-fluid/base.js

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ module.exports = {
3939
plugins: ["import-x", "unicorn"],
4040
reportUnusedDisableDirectives: true,
4141
rules: {
42-
// These rules were deprecated, then removed in `@typescript-eslint/eslint-plugin` v8.
43-
// They are replaced by a set of more specific rules, which have been enabled in the list below.
44-
// These explicit disable will need to be removed when this package is updated to v8+ of the plugin.
45-
"@typescript-eslint/ban-types": "off",
46-
"@typescript-eslint/no-empty-interface": "off",
47-
4842
// Please keep entries alphabetized within a group
4943

5044
// #region Fluid Custom Rules
@@ -72,9 +66,6 @@ module.exports = {
7266
"@typescript-eslint/adjacent-overload-signatures": "error",
7367
"@typescript-eslint/array-type": "error",
7468
"@typescript-eslint/await-thenable": "error",
75-
"@typescript-eslint/brace-style": "off",
76-
"@typescript-eslint/comma-dangle": ["error", "always-multiline"],
77-
"@typescript-eslint/comma-spacing": "off",
7869
"@typescript-eslint/consistent-type-assertions": [
7970
"error",
8071
{
@@ -85,14 +76,10 @@ module.exports = {
8576
"@typescript-eslint/consistent-type-definitions": "error",
8677
"@typescript-eslint/dot-notation": "error",
8778
"@typescript-eslint/explicit-function-return-type": "off",
88-
"@typescript-eslint/func-call-spacing": "off",
89-
"@typescript-eslint/keyword-spacing": "off",
90-
"@typescript-eslint/member-delimiter-style": "off",
9179
"@typescript-eslint/no-dynamic-delete": "error",
9280
"@typescript-eslint/no-empty-function": "off",
9381
"@typescript-eslint/no-empty-object-type": "error",
9482
"@typescript-eslint/no-explicit-any": "off",
95-
"@typescript-eslint/no-extra-semi": "error",
9683
"@typescript-eslint/no-extraneous-class": "error",
9784
"@typescript-eslint/no-floating-promises": "error",
9885
"@typescript-eslint/no-for-in-array": "error",
@@ -110,45 +97,24 @@ module.exports = {
11097
},
11198
],
11299
"@typescript-eslint/no-this-alias": "error",
113-
"@typescript-eslint/no-throw-literal": "error",
114100
"@typescript-eslint/no-unused-expressions": "error",
115101
"@typescript-eslint/no-unused-vars": "off",
116102
"@typescript-eslint/no-unnecessary-qualifier": "error",
117103
"@typescript-eslint/no-unnecessary-type-arguments": "error",
118104
"@typescript-eslint/no-unnecessary-type-assertion": "error",
119105
"@typescript-eslint/no-unsafe-function-type": "error",
120-
"@typescript-eslint/no-var-requires": "error",
121-
"@typescript-eslint/object-curly-spacing": "off",
106+
"@typescript-eslint/only-throw-error": "error",
122107
"@typescript-eslint/prefer-for-of": "error",
123108
"@typescript-eslint/prefer-function-type": "error",
124109
"@typescript-eslint/prefer-namespace-keyword": "error",
125110
"@typescript-eslint/prefer-readonly": "error",
126111
"@typescript-eslint/promise-function-async": "error",
127-
"@typescript-eslint/quotes": [
128-
"error",
129-
"double",
130-
{
131-
allowTemplateLiterals: true,
132-
avoidEscape: true,
133-
},
134-
],
135112
"@typescript-eslint/require-await": "off",
136113
"@typescript-eslint/restrict-plus-operands": "error",
137114
"@typescript-eslint/restrict-template-expressions": "off",
138115
"@typescript-eslint/return-await": "error",
139-
"@typescript-eslint/semi": ["error", "always"],
140-
"@typescript-eslint/space-infix-ops": "error",
141-
"@typescript-eslint/space-before-function-paren": [
142-
"error",
143-
{
144-
anonymous: "never",
145-
asyncArrow: "always",
146-
named: "never",
147-
},
148-
],
149116
"@typescript-eslint/strict-boolean-expressions": "error",
150117
"@typescript-eslint/triple-slash-reference": "error",
151-
"@typescript-eslint/type-annotation-spacing": "error",
152118
"@typescript-eslint/unbound-method": [
153119
"error",
154120
{
@@ -361,7 +327,6 @@ module.exports = {
361327
// Rules only for type validation files
362328
files: ["**/types/*validate*Previous*.ts"],
363329
rules: {
364-
"@typescript-eslint/comma-spacing": "off",
365330
"import-x/order": "off",
366331
},
367332
},

common/build/eslint-config-fluid/minimal-deprecated.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,6 @@ module.exports = {
232232
"@typescript-eslint/explicit-function-return-type": "off",
233233
"@typescript-eslint/explicit-member-accessibility": "off",
234234

235-
/**
236-
* Disabled because we will lean on the formatter (i.e. prettier) to enforce indentation policy.
237-
*/
238-
"@typescript-eslint/indent": "off",
239235
"@typescript-eslint/member-ordering": "off",
240236
"@typescript-eslint/no-explicit-any": "off",
241237
"@typescript-eslint/no-unused-vars": "off",
@@ -288,22 +284,7 @@ module.exports = {
288284

289285
// #region FORMATTING RULES
290286

291-
// We use formatting tools like Biome or prettier to format code, so most formatting-related rules are superfluous
292-
// and are disabled. Running fewer rules also improves lint performance.
293-
294-
// The rules below are also deprecated in more recent versions of eslint/plugins
295-
"@typescript-eslint/brace-style": "off",
296-
"@typescript-eslint/comma-spacing": "off",
297-
"@typescript-eslint/func-call-spacing": "off",
298-
"@typescript-eslint/keyword-spacing": "off",
299-
"@typescript-eslint/member-delimiter-style": "off",
300-
"@typescript-eslint/semi": "off",
301-
"@typescript-eslint/space-before-function-paren": "off",
302-
"@typescript-eslint/space-infix-ops": "off",
303-
"@typescript-eslint/type-annotation-spacing": "off",
304-
305287
// The rules below are deprecated in our current version of eslint/plugins
306-
"@typescript-eslint/object-curly-spacing": "off",
307288
"array-bracket-spacing": "off",
308289
"arrow-spacing": "off",
309290
"block-spacing": "off",

common/build/eslint-config-fluid/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"@rushstack/eslint-patch": "~1.12.0",
2929
"@rushstack/eslint-plugin": "~0.19.0",
3030
"@rushstack/eslint-plugin-security": "~0.11.0",
31-
"@typescript-eslint/eslint-plugin": "~7.18.0",
32-
"@typescript-eslint/parser": "~7.18.0",
31+
"@typescript-eslint/eslint-plugin": "~8.18.2",
32+
"@typescript-eslint/parser": "~8.18.2",
3333
"eslint-config-biome": "~2.1.3",
3434
"eslint-config-prettier": "~10.1.8",
3535
"eslint-import-resolver-typescript": "~4.4.4",

0 commit comments

Comments
 (0)