diff --git a/docs/linting/Troubleshooting.mdx b/docs/linting/Troubleshooting.mdx index 526a79e03c63..d915d8d50ba6 100644 --- a/docs/linting/Troubleshooting.mdx +++ b/docs/linting/Troubleshooting.mdx @@ -240,22 +240,22 @@ For example, you can ban enums (or some variation of) using one of the following // ban all enums { "selector": "TSEnumDeclaration", - "message": "My reason for not using any enums at all" + "message": "My reason for not using any enums at all", }, // ban just const enums { "selector": "TSEnumDeclaration[const=true]", - "message": "My reason for not using const enums" + "message": "My reason for not using const enums", }, // ban just non-const enums { "selector": "TSEnumDeclaration:not([const=true])", - "message": "My reason for not using non-const enums" - } - ] - } + "message": "My reason for not using non-const enums", + }, + ], + }, } ``` diff --git a/docs/linting/typed-linting/Monorepos.mdx b/docs/linting/typed-linting/Monorepos.mdx index 43f688062b79..6c172cb29398 100644 --- a/docs/linting/typed-linting/Monorepos.mdx +++ b/docs/linting/typed-linting/Monorepos.mdx @@ -23,14 +23,14 @@ If its `include` paths cannot include all files to be linted, we suggest creatin "extends": "./tsconfig.json", "compilerOptions": { // ensure that nobody can accidentally use this config for a build - "noEmit": true + "noEmit": true, }, "include": [ // whatever paths you intend to lint "src", "test", - "tools" - ] + "tools", + ], } ``` diff --git a/docs/packages/Parser.mdx b/docs/packages/Parser.mdx index 5d5860493103..9f661328e56e 100644 --- a/docs/packages/Parser.mdx +++ b/docs/packages/Parser.mdx @@ -237,8 +237,8 @@ This option allows you to provide a path to your project's `tsconfig.json`. **Th // etc // if you have a mixed JS/TS codebase, don't forget to include your JS files - "src/**/*.js" - ] + "src/**/*.js", + ], } ``` diff --git a/package.json b/package.json index 675beebdc8b4..2d1b08e1f17c 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ "ncp": "^2.0.0", "netlify": "^13.1.9", "nx": "17.2.8", - "prettier": "3.1.0", + "prettier": "3.2.4", "pretty-format": "^29.6.2", "raw-loader": "^4.0.2", "rimraf": "^5.0.1", diff --git a/packages/ast-spec/tsconfig.json b/packages/ast-spec/tsconfig.json index f1eefac4eb93..7303adfd8021 100644 --- a/packages/ast-spec/tsconfig.json +++ b/packages/ast-spec/tsconfig.json @@ -2,9 +2,9 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "composite": false, - "rootDir": "." + "rootDir": ".", }, "include": ["src", "typings", "tests", "tools", "**/fixtures/**/config.ts"], "exclude": ["**/fixtures/**/fixture.ts", "**/fixtures/**/fixture.tsx"], - "references": [{ "path": "../typescript-estree/tsconfig.build.json" }] + "references": [{ "path": "../typescript-estree/tsconfig.build.json" }], } diff --git a/packages/eslint-plugin-internal/tests/fixtures/tsconfig.json b/packages/eslint-plugin-internal/tests/fixtures/tsconfig.json index 7e9126b848c7..93bd2daed8ac 100644 --- a/packages/eslint-plugin-internal/tests/fixtures/tsconfig.json +++ b/packages/eslint-plugin-internal/tests/fixtures/tsconfig.json @@ -6,7 +6,7 @@ "strict": true, "esModuleInterop": true, "lib": ["es2015", "es2017", "esnext"], - "experimentalDecorators": true + "experimentalDecorators": true, }, - "include": ["file.ts"] + "include": ["file.ts"], } diff --git a/packages/eslint-plugin-internal/tsconfig.json b/packages/eslint-plugin-internal/tsconfig.json index cc78ba59388e..e6b1a56b81a0 100644 --- a/packages/eslint-plugin-internal/tsconfig.json +++ b/packages/eslint-plugin-internal/tsconfig.json @@ -3,8 +3,8 @@ "compilerOptions": { "composite": false, "target": "ES2022", - "rootDir": "." + "rootDir": ".", }, "include": ["src", "typings", "tests"], - "references": [{ "path": "../utils/tsconfig.build.json" }] + "references": [{ "path": "../utils/tsconfig.build.json" }], } diff --git a/packages/eslint-plugin-tslint/tests/fixtures/test-project/tsconfig.json b/packages/eslint-plugin-tslint/tests/fixtures/test-project/tsconfig.json index fcd054ab4880..e901e843b118 100644 --- a/packages/eslint-plugin-tslint/tests/fixtures/test-project/tsconfig.json +++ b/packages/eslint-plugin-tslint/tests/fixtures/test-project/tsconfig.json @@ -4,6 +4,6 @@ "module": "commonjs", "strict": true, "noUnusedLocals": true, - "noImplicitAny": true - } + "noImplicitAny": true, + }, } diff --git a/packages/eslint-plugin-tslint/tsconfig.json b/packages/eslint-plugin-tslint/tsconfig.json index 4ba17c6d60ab..c2b862690de9 100644 --- a/packages/eslint-plugin-tslint/tsconfig.json +++ b/packages/eslint-plugin-tslint/tsconfig.json @@ -2,9 +2,9 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "composite": false, - "rootDir": "." + "rootDir": ".", }, "include": ["src", "tests"], "exclude": ["tests/fixtures"], - "references": [{ "path": "../utils/tsconfig.build.json" }] + "references": [{ "path": "../utils/tsconfig.build.json" }], } diff --git a/packages/eslint-plugin/docs/rules/ban-types.md b/packages/eslint-plugin/docs/rules/ban-types.md index 818528451e09..0539fb2dd2d8 100644 --- a/packages/eslint-plugin/docs/rules/ban-types.md +++ b/packages/eslint-plugin/docs/rules/ban-types.md @@ -114,15 +114,15 @@ Example configuration: // add a custom message, AND tell the plugin how to fix it "OldAPI": { "message": "Use NewAPI instead", - "fixWith": "NewAPI" + "fixWith": "NewAPI", }, // un-ban a type that's banned by default - "{}": false + "{}": false, }, - "extendDefaults": true - } - ] + "extendDefaults": true, + }, + ], } ``` diff --git a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md index 2d02e06bdf01..d33de3e02b0e 100644 --- a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md +++ b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md @@ -76,17 +76,17 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e. { "rules": { // disable the rule for all files - "@typescript-eslint/explicit-function-return-type": "off" + "@typescript-eslint/explicit-function-return-type": "off", }, "overrides": [ { // enable the rule specifically for TypeScript files "files": ["*.ts", "*.mts", "*.cts", "*.tsx"], "rules": { - "@typescript-eslint/explicit-function-return-type": "error" - } - } - ] + "@typescript-eslint/explicit-function-return-type": "error", + }, + }, + ], } ``` diff --git a/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md b/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md index cf124524deb0..0dbec98c5c40 100644 --- a/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md +++ b/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md @@ -30,17 +30,17 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e. { "rules": { // disable the rule for all files - "@typescript-eslint/explicit-member-accessibility": "off" + "@typescript-eslint/explicit-member-accessibility": "off", }, "overrides": [ { // enable the rule specifically for TypeScript files "files": ["*.ts", "*.mts", "*.cts", "*.tsx"], "rules": { - "@typescript-eslint/explicit-member-accessibility": "error" - } - } - ] + "@typescript-eslint/explicit-member-accessibility": "error", + }, + }, + ], } ``` diff --git a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md index 657f34152e4f..879e30638114 100644 --- a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md +++ b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md @@ -75,17 +75,17 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e. { "rules": { // disable the rule for all files - "@typescript-eslint/explicit-module-boundary-types": "off" + "@typescript-eslint/explicit-module-boundary-types": "off", }, "overrides": [ { // enable the rule specifically for TypeScript files "files": ["*.ts", "*.mts", "*.cts", "*.tsx"], "rules": { - "@typescript-eslint/explicit-module-boundary-types": "error" - } - } - ] + "@typescript-eslint/explicit-module-boundary-types": "error", + }, + }, + ], } ``` diff --git a/packages/eslint-plugin/docs/rules/member-ordering.md b/packages/eslint-plugin/docs/rules/member-ordering.md index de2fff0f4d60..fc505ff9d276 100644 --- a/packages/eslint-plugin/docs/rules/member-ordering.md +++ b/packages/eslint-plugin/docs/rules/member-ordering.md @@ -249,9 +249,9 @@ The default configuration looks as follows: "decorated-method", - "method" - ] - } + "method", + ], + }, } ``` @@ -279,9 +279,9 @@ It also ignores accessibility and scope. "rules": { "@typescript-eslint/member-ordering": [ "error", - { "default": ["signature", "method", "constructor", "field"] } - ] - } + { "default": ["signature", "method", "constructor", "field"] }, + ], + }, } ``` @@ -414,9 +414,9 @@ It doesn't apply to interfaces or type literals as accessibility and scope are n "rules": { "@typescript-eslint/member-ordering": [ "error", - { "default": ["public-instance-method", "public-static-field"] } - ] - } + { "default": ["public-instance-method", "public-static-field"] }, + ], + }, } ``` @@ -508,9 +508,9 @@ It doesn't apply to interfaces or type literals as accessibility and scope are n "rules": { "@typescript-eslint/member-ordering": [ "error", - { "default": ["public-static-field", "static-field", "instance-field"] } - ] - } + { "default": ["public-static-field", "static-field", "instance-field"] }, + ], + }, } ``` @@ -597,9 +597,9 @@ Default settings will be used for class declarations and all other syntax constr "rules": { "@typescript-eslint/member-ordering": [ "error", - { "classes": ["method", "constructor", "field"] } - ] - } + { "classes": ["method", "constructor", "field"] }, + ], + }, } ``` @@ -647,9 +647,9 @@ Default settings will be used for class declarations and all other syntax constr "rules": { "@typescript-eslint/member-ordering": [ "error", - { "classExpressions": ["method", "constructor", "field"] } - ] - } + { "classExpressions": ["method", "constructor", "field"] }, + ], + }, } ``` @@ -701,9 +701,9 @@ These member types are the only ones allowed for `interfaces`. "rules": { "@typescript-eslint/member-ordering": [ "error", - { "interfaces": ["signature", "method", "constructor", "field"] } - ] - } + { "interfaces": ["signature", "method", "constructor", "field"] }, + ], + }, } ``` @@ -753,9 +753,9 @@ These member types are the only ones allowed for `typeLiterals`. "rules": { "@typescript-eslint/member-ordering": [ "error", - { "typeLiterals": ["signature", "method", "constructor", "field"] } - ] - } + { "typeLiterals": ["signature", "method", "constructor", "field"] }, + ], + }, } ``` @@ -805,11 +805,11 @@ You can see the default order in [Default Configuration](#default-configuration) "error", { "default": { - "order": "alphabetically" - } - } - ] - } + "order": "alphabetically", + }, + }, + ], + }, } ``` @@ -856,11 +856,11 @@ This config specifies that within each custom `memberTypes` group, members are i { "default": { "memberTypes": ["method", "field"], - "order": "alphabetically" - } - } - ] - } + "order": "alphabetically", + }, + }, + ], + }, } ``` @@ -908,11 +908,11 @@ You can see the default order in [Default Configuration](#default-configuration) "error", { "default": { - "order": "alphabetically-case-insensitive" - } - } - ] - } + "order": "alphabetically-case-insensitive", + }, + }, + ], + }, } ``` @@ -957,9 +957,9 @@ It ignores any member group types completely by specifying `"never"` for `member "rules": { "@typescript-eslint/member-ordering": [ "error", - { "default": { "memberTypes": "never", "order": "alphabetically" } } - ] - } + { "default": { "memberTypes": "never", "order": "alphabetically" } }, + ], + }, } ``` @@ -1006,11 +1006,11 @@ This config places all optional members before all required members: { "default": { "optionalityOrder": "optional-first", - "order": "alphabetically" - } - } - ] - } + "order": "alphabetically", + }, + }, + ], + }, } ``` @@ -1049,11 +1049,11 @@ This config places all required members before all optional members: { "default": { "optionalityOrder": "required-first", - "order": "alphabetically" - } - } - ] - } + "order": "alphabetically", + }, + }, + ], + }, } ``` @@ -1271,7 +1271,7 @@ It is also possible to group member types by their accessibility (`static`, `ins // Methods "public-method", // = ["public-static-method", "public-instance-method"] "protected-method", // = ["protected-static-method", "protected-instance-method"] - "private-method" // = ["private-static-method", "private-instance-method"] + "private-method", // = ["private-static-method", "private-instance-method"] ] ``` @@ -1317,7 +1317,7 @@ their accessibility. "protected-decorated-method", "private-decorated-method", - "decorated-method" // = ["public-decorated-method", "protected-decorated-method", "private-decorated-method"] + "decorated-method", // = ["public-decorated-method", "protected-decorated-method", "private-decorated-method"] ] ``` @@ -1354,7 +1354,7 @@ Another option is to group the member types by their scope (`public`, `protected // Methods "static-method", // = ["public-static-method", "protected-static-method", "private-static-method"] "instance-method", // = ["public-instance-method", "protected-instance-method", "private-instance-method"] - "abstract-method" // = ["public-abstract-method", "protected-abstract-method"] + "abstract-method", // = ["public-abstract-method", "protected-abstract-method"] ] ``` @@ -1386,7 +1386,7 @@ The third grouping option is to ignore both scope and accessibility. // "public-abstract-set", "protected-abstract-set"] // Methods - "method" // = ["public-static-method", "protected-static-method", "private-static-method", "public-instance-method", "protected-instance-method", "private-instance-method", + "method", // = ["public-static-method", "protected-static-method", "private-static-method", "public-instance-method", "protected-instance-method", "private-instance-method", // "public-abstract-method", "protected-abstract-method"] ] ``` @@ -1403,7 +1403,7 @@ It is possible to group fields by their `readonly` modifiers. // Fields "readonly-field", // = ["public-static-readonly-field", "protected-static-readonly-field", "private-static-readonly-field", "public-instance-readonly-field", "protected-instance-readonly-field", "private-instance-readonly-field", "public-abstract-readonly-field", "protected-abstract-readonly-field"] - "field" // = ["public-static-field", "protected-static-field", "private-static-field", "public-instance-field", "protected-instance-field", "private-instance-field", "public-abstract-field", "protected-abstract-field"] + "field", // = ["public-static-field", "protected-static-field", "private-static-field", "public-instance-field", "protected-instance-field", "private-instance-field", "public-abstract-field", "protected-abstract-field"] ] ``` @@ -1429,7 +1429,7 @@ It is also possible to group different member types at the same rank. ["get", "set"], // Methods - "method" + "method", ] ``` diff --git a/packages/eslint-plugin/docs/rules/naming-convention.md b/packages/eslint-plugin/docs/rules/naming-convention.md index ba5a59adda96..9d3a52aa8816 100644 --- a/packages/eslint-plugin/docs/rules/naming-convention.md +++ b/packages/eslint-plugin/docs/rules/naming-convention.md @@ -602,12 +602,12 @@ If you simply want to allow all property names that require quotes, you can use "objectLiteralMethod", "typeMethod", "accessor", - "enumMember" + "enumMember", ], "format": null, - "modifiers": ["requiresQuotes"] - } - ] + "modifiers": ["requiresQuotes"], + }, + ], } ``` @@ -623,10 +623,10 @@ If you have a small and known list of exceptions, you can use the `filter` optio "filter": { // you can expand this regex to add more allowed names "regex": "^(Property-Name-One|Property-Name-Two)$", - "match": false - } - } - ] + "match": false, + }, + }, + ], } ``` @@ -642,10 +642,10 @@ You can use the `filter` option to ignore names with specific characters: "filter": { // you can expand this regex as you find more cases that require quoting that you want to allow "regex": "[- ]", - "match": false - } - } - ] + "match": false, + }, + }, + ], } ``` @@ -666,9 +666,9 @@ You can use the `destructured` modifier to match these names, and explicitly set { "selector": "variable", "modifiers": ["destructured"], - "format": null - } - ] + "format": null, + }, + ], } ``` diff --git a/packages/eslint-plugin/docs/rules/no-restricted-imports.md b/packages/eslint-plugin/docs/rules/no-restricted-imports.md index 8b483a61c11a..1fe6333b6682 100644 --- a/packages/eslint-plugin/docs/rules/no-restricted-imports.md +++ b/packages/eslint-plugin/docs/rules/no-restricted-imports.md @@ -28,17 +28,17 @@ You can specify this option for a specific path or pattern as follows: { "name": "import-foo", "message": "Please use import-bar instead.", - "allowTypeImports": true + "allowTypeImports": true, }, { "name": "import-baz", "message": "Please use import-quux instead.", - "allowTypeImports": true - } - ] - } - ] - } + "allowTypeImports": true, + }, + ], + }, + ], + }, } ``` diff --git a/packages/eslint-plugin/docs/rules/padding-line-between-statements.md b/packages/eslint-plugin/docs/rules/padding-line-between-statements.md index 6d2904e57cd5..8cf091b4e25f 100644 --- a/packages/eslint-plugin/docs/rules/padding-line-between-statements.md +++ b/packages/eslint-plugin/docs/rules/padding-line-between-statements.md @@ -24,9 +24,9 @@ For example, to add blank lines before interfaces and type definitions: { "blankLine": "always", "prev": "*", - "next": ["interface", "type"] - } - ] + "next": ["interface", "type"], + }, + ], } ``` diff --git a/packages/eslint-plugin/docs/rules/prefer-readonly.md b/packages/eslint-plugin/docs/rules/prefer-readonly.md index 3843ddbc7416..bd201c0d6bfe 100644 --- a/packages/eslint-plugin/docs/rules/prefer-readonly.md +++ b/packages/eslint-plugin/docs/rules/prefer-readonly.md @@ -68,7 +68,10 @@ You may pass `"onlyInlineLambdas": true` as a rule option within an object to re ```jsonc { - "@typescript-eslint/prefer-readonly": ["error", { "onlyInlineLambdas": true }] + "@typescript-eslint/prefer-readonly": [ + "error", + { "onlyInlineLambdas": true }, + ], } ``` diff --git a/packages/eslint-plugin/tests/fixtures/tsconfig.json b/packages/eslint-plugin/tests/fixtures/tsconfig.json index 6ae5e64730b1..0e210fb1197d 100644 --- a/packages/eslint-plugin/tests/fixtures/tsconfig.json +++ b/packages/eslint-plugin/tests/fixtures/tsconfig.json @@ -6,12 +6,12 @@ "strict": true, "esModuleInterop": true, "lib": ["es2015", "es2017", "esnext"], - "experimentalDecorators": true + "experimentalDecorators": true, }, "include": [ "file.ts", "consistent-type-exports.ts", "mixed-enums-decl.ts", - "react.tsx" - ] + "react.tsx", + ], } diff --git a/packages/eslint-plugin/tests/fixtures/unstrict/tsconfig.json b/packages/eslint-plugin/tests/fixtures/unstrict/tsconfig.json index 0c68dfe1f044..c2e06e8187fe 100644 --- a/packages/eslint-plugin/tests/fixtures/unstrict/tsconfig.json +++ b/packages/eslint-plugin/tests/fixtures/unstrict/tsconfig.json @@ -6,7 +6,7 @@ "strict": false, "esModuleInterop": true, "lib": ["es2015", "es2017", "esnext"], - "experimentalDecorators": true + "experimentalDecorators": true, }, - "include": ["file.ts", "react.tsx"] + "include": ["file.ts", "react.tsx"], } diff --git a/packages/eslint-plugin/tsconfig.json b/packages/eslint-plugin/tsconfig.json index ae5a5e0f9887..d2ce92aacd2d 100644 --- a/packages/eslint-plugin/tsconfig.json +++ b/packages/eslint-plugin/tsconfig.json @@ -2,7 +2,7 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "composite": false, - "rootDir": "." + "rootDir": ".", }, "include": ["src", "typings", "tests", "tools", "index.d.ts", "rules.d.ts"], "references": [ @@ -10,6 +10,6 @@ { "path": "../parser/tsconfig.build.json" }, { "path": "../rule-schema-to-typescript-types/tsconfig.build.json" }, { "path": "../scope-manager/tsconfig.build.json" }, - { "path": "../type-utils/tsconfig.build.json" } - ] + { "path": "../type-utils/tsconfig.build.json" }, + ], } diff --git a/packages/integration-tests/fixtures/eslint-v7/tsconfig.json b/packages/integration-tests/fixtures/eslint-v7/tsconfig.json index aee0ec940fcd..43ea9c0cc51c 100644 --- a/packages/integration-tests/fixtures/eslint-v7/tsconfig.json +++ b/packages/integration-tests/fixtures/eslint-v7/tsconfig.json @@ -1,5 +1,5 @@ { "compilerOptions": { - "strict": true - } + "strict": true, + }, } diff --git a/packages/integration-tests/fixtures/markdown/tsconfig.json b/packages/integration-tests/fixtures/markdown/tsconfig.json index eb32eba20a37..465f8422df19 100644 --- a/packages/integration-tests/fixtures/markdown/tsconfig.json +++ b/packages/integration-tests/fixtures/markdown/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "strict": true + "strict": true, }, - "include": [] + "include": [], } diff --git a/packages/integration-tests/fixtures/typescript-and-tslint-plugins-together/tsconfig.json b/packages/integration-tests/fixtures/typescript-and-tslint-plugins-together/tsconfig.json index aee0ec940fcd..43ea9c0cc51c 100644 --- a/packages/integration-tests/fixtures/typescript-and-tslint-plugins-together/tsconfig.json +++ b/packages/integration-tests/fixtures/typescript-and-tslint-plugins-together/tsconfig.json @@ -1,5 +1,5 @@ { "compilerOptions": { - "strict": true - } + "strict": true, + }, } diff --git a/packages/integration-tests/fixtures/vue-jsx/tsconfig.json b/packages/integration-tests/fixtures/vue-jsx/tsconfig.json index f49818af019d..efdd16f4a1db 100644 --- a/packages/integration-tests/fixtures/vue-jsx/tsconfig.json +++ b/packages/integration-tests/fixtures/vue-jsx/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "strict": true + "strict": true, }, - "include": ["*.vue"] + "include": ["*.vue"], } diff --git a/packages/integration-tests/fixtures/vue-sfc/tsconfig.json b/packages/integration-tests/fixtures/vue-sfc/tsconfig.json index f49818af019d..efdd16f4a1db 100644 --- a/packages/integration-tests/fixtures/vue-sfc/tsconfig.json +++ b/packages/integration-tests/fixtures/vue-sfc/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "strict": true + "strict": true, }, - "include": ["*.vue"] + "include": ["*.vue"], } diff --git a/packages/integration-tests/tsconfig.json b/packages/integration-tests/tsconfig.json index 23640f1c418e..961079273d4a 100644 --- a/packages/integration-tests/tsconfig.json +++ b/packages/integration-tests/tsconfig.json @@ -2,8 +2,8 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "composite": false, - "rootDir": "." + "rootDir": ".", }, "include": ["src", "typings", "tests", "jest.config.js", "tools"], - "references": [] + "references": [], } diff --git a/packages/parser/tests/fixtures/services/tsconfig.json b/packages/parser/tests/fixtures/services/tsconfig.json index 914d17298c56..771c0aba918a 100644 --- a/packages/parser/tests/fixtures/services/tsconfig.json +++ b/packages/parser/tests/fixtures/services/tsconfig.json @@ -3,6 +3,6 @@ "target": "es5", "module": "commonjs", "strict": true, - "esModuleInterop": true - } + "esModuleInterop": true, + }, } diff --git a/packages/parser/tsconfig.json b/packages/parser/tsconfig.json index eebdf92705d9..bf112bf2409b 100644 --- a/packages/parser/tsconfig.json +++ b/packages/parser/tsconfig.json @@ -2,13 +2,13 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "composite": false, - "rootDir": "." + "rootDir": ".", }, "include": ["src", "tests", "tools"], "exclude": ["tests/fixtures"], "references": [ { "path": "../scope-manager/tsconfig.build.json" }, { "path": "../types/tsconfig.build.json" }, - { "path": "../typescript-estree/tsconfig.build.json" } - ] + { "path": "../typescript-estree/tsconfig.build.json" }, + ], } diff --git a/packages/repo-tools/tsconfig.json b/packages/repo-tools/tsconfig.json index 60f0b96451e3..5371d5094d43 100644 --- a/packages/repo-tools/tsconfig.json +++ b/packages/repo-tools/tsconfig.json @@ -5,8 +5,8 @@ "allowImportingTsExtensions": true, "noEmit": true, "composite": false, - "rootDir": "." + "rootDir": ".", }, "include": ["src", "tests", "typings"], - "references": [] + "references": [], } diff --git a/packages/rule-schema-to-typescript-types/tsconfig.json b/packages/rule-schema-to-typescript-types/tsconfig.json index 06b94d057faf..1fd66bbb4b62 100644 --- a/packages/rule-schema-to-typescript-types/tsconfig.json +++ b/packages/rule-schema-to-typescript-types/tsconfig.json @@ -2,8 +2,8 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "composite": false, - "rootDir": "." + "rootDir": ".", }, "include": ["src", "tests", "typings"], - "references": [] + "references": [], } diff --git a/packages/rule-tester/tsconfig.json b/packages/rule-tester/tsconfig.json index 9cea515ba6b2..8bfcb3fcd20a 100644 --- a/packages/rule-tester/tsconfig.json +++ b/packages/rule-tester/tsconfig.json @@ -2,7 +2,7 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "composite": false, - "rootDir": "." + "rootDir": ".", }, - "include": ["src", "typings", "tests", "tools"] + "include": ["src", "typings", "tests", "tools"], } diff --git a/packages/scope-manager/tests/fixtures/type-declaration/conditional-nested.ts b/packages/scope-manager/tests/fixtures/type-declaration/conditional-nested.ts index bc70b490fc1b..3a0472bd7138 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/conditional-nested.ts +++ b/packages/scope-manager/tests/fixtures/type-declaration/conditional-nested.ts @@ -1,5 +1,2 @@ -type Test = T extends Array - ? U - : T extends Set - ? U - : never; +type Test = + T extends Array ? U : T extends Set ? U : never; diff --git a/packages/scope-manager/tsconfig.json b/packages/scope-manager/tsconfig.json index c25e84fa6c63..4e2b058027b8 100644 --- a/packages/scope-manager/tsconfig.json +++ b/packages/scope-manager/tsconfig.json @@ -4,16 +4,16 @@ "include": [], "references": [ { - "path": "./tsconfig.build.json" + "path": "./tsconfig.build.json", }, { - "path": "./tsconfig.spec.json" - } + "path": "./tsconfig.spec.json", + }, ], "compilerOptions": { "forceConsistentCasingInFileNames": true, "strict": true, "noImplicitReturns": true, - "noFallthroughCasesInSwitch": false - } + "noFallthroughCasesInSwitch": false, + }, } diff --git a/packages/type-utils/tests/fixtures/tsconfig.json b/packages/type-utils/tests/fixtures/tsconfig.json index 7e9126b848c7..93bd2daed8ac 100644 --- a/packages/type-utils/tests/fixtures/tsconfig.json +++ b/packages/type-utils/tests/fixtures/tsconfig.json @@ -6,7 +6,7 @@ "strict": true, "esModuleInterop": true, "lib": ["es2015", "es2017", "esnext"], - "experimentalDecorators": true + "experimentalDecorators": true, }, - "include": ["file.ts"] + "include": ["file.ts"], } diff --git a/packages/type-utils/tsconfig.json b/packages/type-utils/tsconfig.json index 93bec73e74ac..a39bdb35fb8b 100644 --- a/packages/type-utils/tsconfig.json +++ b/packages/type-utils/tsconfig.json @@ -2,8 +2,8 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "composite": false, - "rootDir": "." + "rootDir": ".", }, "include": ["src", "typings", "tests", "tools"], - "references": [{ "path": "../utils/tsconfig.build.json" }] + "references": [{ "path": "../utils/tsconfig.build.json" }], } diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index d1305674c8bb..816d63ef9496 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -2,8 +2,8 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "composite": false, - "rootDir": "." + "rootDir": ".", }, "include": ["src", "typings", "tests", "tools"], - "references": [] + "references": [], } diff --git a/packages/typescript-eslint/tsconfig.json b/packages/typescript-eslint/tsconfig.json index ac9e78203f68..60313c08322f 100644 --- a/packages/typescript-eslint/tsconfig.json +++ b/packages/typescript-eslint/tsconfig.json @@ -2,9 +2,9 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "composite": false, - "rootDir": "." + "rootDir": ".", }, "include": ["src", "tests", "tools"], "exclude": ["tests/fixtures"], - "references": [{ "path": "../parser/tsconfig.build.json" }] + "references": [{ "path": "../parser/tsconfig.build.json" }], } diff --git a/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.json b/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.json index f4d9ad5a8d7e..66ee0f1acb91 100644 --- a/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.json +++ b/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.json @@ -1,12 +1,12 @@ { "compilerOptions": { - "allowJs": true + "allowJs": true, }, "include": [ "ts/included01.ts", "ts/included02.tsx", "js/included01.js", "js/included02.jsx", - "other/included.vue" - ] + "other/included.vue", + ], } diff --git a/packages/typescript-estree/tests/fixtures/moduleResolver/tsconfig.json b/packages/typescript-estree/tests/fixtures/moduleResolver/tsconfig.json index e7f769a18418..5f1b7f201bab 100644 --- a/packages/typescript-estree/tests/fixtures/moduleResolver/tsconfig.json +++ b/packages/typescript-estree/tests/fixtures/moduleResolver/tsconfig.json @@ -1,3 +1,3 @@ { - "include": ["./file.ts", "./something.ts"] + "include": ["./file.ts", "./something.ts"], } diff --git a/packages/typescript-estree/tests/fixtures/projectFolderIgnoreList/ignoreme/tsconfig.json b/packages/typescript-estree/tests/fixtures/projectFolderIgnoreList/ignoreme/tsconfig.json index a01e8a941e84..5012e8a2e805 100644 --- a/packages/typescript-estree/tests/fixtures/projectFolderIgnoreList/ignoreme/tsconfig.json +++ b/packages/typescript-estree/tests/fixtures/projectFolderIgnoreList/ignoreme/tsconfig.json @@ -1,3 +1,3 @@ { - "include": ["./file.ts"] + "include": ["./file.ts"], } diff --git a/packages/typescript-estree/tests/fixtures/projectFolderIgnoreList/includeme/tsconfig.json b/packages/typescript-estree/tests/fixtures/projectFolderIgnoreList/includeme/tsconfig.json index a01e8a941e84..5012e8a2e805 100644 --- a/packages/typescript-estree/tests/fixtures/projectFolderIgnoreList/includeme/tsconfig.json +++ b/packages/typescript-estree/tests/fixtures/projectFolderIgnoreList/includeme/tsconfig.json @@ -1,3 +1,3 @@ { - "include": ["./file.ts"] + "include": ["./file.ts"], } diff --git a/packages/typescript-estree/tests/fixtures/projectTrue/nested/tsconfig.json b/packages/typescript-estree/tests/fixtures/projectTrue/nested/tsconfig.json index d144c8ddb02c..4e48fe3968c7 100644 --- a/packages/typescript-estree/tests/fixtures/projectTrue/nested/tsconfig.json +++ b/packages/typescript-estree/tests/fixtures/projectTrue/nested/tsconfig.json @@ -1,3 +1,3 @@ { - "include": ["."] + "include": ["."], } diff --git a/packages/typescript-estree/tests/fixtures/semanticInfo/badTSConfig/tsconfig.json b/packages/typescript-estree/tests/fixtures/semanticInfo/badTSConfig/tsconfig.json index 3fa1bfc0e661..976acd14d6d9 100644 --- a/packages/typescript-estree/tests/fixtures/semanticInfo/badTSConfig/tsconfig.json +++ b/packages/typescript-estree/tests/fixtures/semanticInfo/badTSConfig/tsconfig.json @@ -4,6 +4,6 @@ "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */, "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, "strict": true /* Enable all strict type-checking options. */, - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ - } + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, + }, } diff --git a/packages/typescript-estree/tests/fixtures/semanticInfo/tsconfig.json b/packages/typescript-estree/tests/fixtures/semanticInfo/tsconfig.json index 914d17298c56..771c0aba918a 100644 --- a/packages/typescript-estree/tests/fixtures/semanticInfo/tsconfig.json +++ b/packages/typescript-estree/tests/fixtures/semanticInfo/tsconfig.json @@ -3,6 +3,6 @@ "target": "es5", "module": "commonjs", "strict": true, - "esModuleInterop": true - } + "esModuleInterop": true, + }, } diff --git a/packages/typescript-estree/tests/fixtures/simpleProject/tsconfig.json b/packages/typescript-estree/tests/fixtures/simpleProject/tsconfig.json index a32c9a1e3281..27406298a1bb 100644 --- a/packages/typescript-estree/tests/fixtures/simpleProject/tsconfig.json +++ b/packages/typescript-estree/tests/fixtures/simpleProject/tsconfig.json @@ -2,6 +2,6 @@ "compilerOptions": { "skipLibCheck": true, "strict": true, - "target": "ES2022" - } + "target": "ES2022", + }, } diff --git a/packages/typescript-estree/tsconfig.json b/packages/typescript-estree/tsconfig.json index bc1141dd051a..a289e21fa5e1 100644 --- a/packages/typescript-estree/tsconfig.json +++ b/packages/typescript-estree/tsconfig.json @@ -2,12 +2,12 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "composite": false, - "rootDir": "." + "rootDir": ".", }, "include": ["src", "typings", "tests", "tools"], "exclude": ["tests/fixtures/**/*"], "references": [ { "path": "../types/tsconfig.build.json" }, - { "path": "../visitor-keys/tsconfig.build.json" } - ] + { "path": "../visitor-keys/tsconfig.build.json" }, + ], } diff --git a/packages/utils/src/eslint-utils/InferTypesFromRule.ts b/packages/utils/src/eslint-utils/InferTypesFromRule.ts index 4aca4b0dac25..215a869eaddf 100644 --- a/packages/utils/src/eslint-utils/InferTypesFromRule.ts +++ b/packages/utils/src/eslint-utils/InferTypesFromRule.ts @@ -3,25 +3,21 @@ import type { RuleCreateFunction, RuleModule } from '../ts-eslint'; /** * Uses type inference to fetch the TOptions type from the given RuleModule */ -type InferOptionsTypeFromRule = T extends RuleModule< - infer _TMessageIds, - infer TOptions -> - ? TOptions - : T extends RuleCreateFunction +type InferOptionsTypeFromRule = + T extends RuleModule ? TOptions - : unknown; + : T extends RuleCreateFunction + ? TOptions + : unknown; /** * Uses type inference to fetch the TMessageIds type from the given RuleModule */ -type InferMessageIdsTypeFromRule = T extends RuleModule< - infer TMessageIds, - infer _TOptions -> - ? TMessageIds - : T extends RuleCreateFunction +type InferMessageIdsTypeFromRule = + T extends RuleModule ? TMessageIds - : unknown; + : T extends RuleCreateFunction + ? TMessageIds + : unknown; export { InferOptionsTypeFromRule, InferMessageIdsTypeFromRule }; diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json index 20ea2496c6b0..64a7fc9ac767 100644 --- a/packages/utils/tsconfig.json +++ b/packages/utils/tsconfig.json @@ -2,12 +2,12 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "composite": false, - "rootDir": "." + "rootDir": ".", }, "include": ["src", "typings", "tests", "tools"], "references": [ { "path": "../scope-manager/tsconfig.build.json" }, { "path": "../types/tsconfig.build.json" }, - { "path": "../typescript-estree/tsconfig.build.json" } - ] + { "path": "../typescript-estree/tsconfig.build.json" }, + ], } diff --git a/packages/visitor-keys/tsconfig.json b/packages/visitor-keys/tsconfig.json index 9cea515ba6b2..8bfcb3fcd20a 100644 --- a/packages/visitor-keys/tsconfig.json +++ b/packages/visitor-keys/tsconfig.json @@ -2,7 +2,7 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "composite": false, - "rootDir": "." + "rootDir": ".", }, - "include": ["src", "typings", "tests", "tools"] + "include": ["src", "typings", "tests", "tools"], } diff --git a/packages/website-eslint/tsconfig.json b/packages/website-eslint/tsconfig.json index aeafdb4d3f30..77ebda3176dc 100644 --- a/packages/website-eslint/tsconfig.json +++ b/packages/website-eslint/tsconfig.json @@ -6,8 +6,8 @@ "checkJs": false, // build is done via esbuild "noEmit": true, - "skipLibCheck": true + "skipLibCheck": true, }, "include": ["src", "types", "build.ts"], - "references": [] + "references": [], } diff --git a/packages/website/tsconfig.json b/packages/website/tsconfig.json index e8715739403b..ca69978173e7 100644 --- a/packages/website/tsconfig.json +++ b/packages/website/tsconfig.json @@ -12,9 +12,9 @@ "resolveJsonModule": true, "baseUrl": ".", "paths": { - "@site/*": ["./*"] + "@site/*": ["./*"], }, - "types": ["@docusaurus/module-type-aliases", "@docusaurus/theme-classic"] + "types": ["@docusaurus/module-type-aliases", "@docusaurus/theme-classic"], }, "include": [ "src", @@ -23,6 +23,6 @@ "plugins", "typings", "sidebars/*.js", - "./*.ts" - ] + "./*.ts", + ], } diff --git a/yarn.lock b/yarn.lock index 524744b88f37..f80169def7ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5659,7 +5659,7 @@ __metadata: ncp: ^2.0.0 netlify: ^13.1.9 nx: 17.2.8 - prettier: 3.1.0 + prettier: 3.2.4 pretty-format: ^29.6.2 raw-loader: ^4.0.2 rimraf: ^5.0.1 @@ -15467,16 +15467,7 @@ __metadata: languageName: node linkType: hard -"prettier@npm:3.1.0": - version: 3.1.0 - resolution: "prettier@npm:3.1.0" - bin: - prettier: bin/prettier.cjs - checksum: 44b556bd56f74d7410974fbb2418bb4e53a894d3e7b42f6f87779f69f27a6c272fa7fc27cec0118cd11730ef3246478052e002cbd87e9a253f9cd04a56aa7d9b - languageName: node - linkType: hard - -"prettier@npm:^3.0.3": +"prettier@npm:3.2.4, prettier@npm:^3.0.3": version: 3.2.4 resolution: "prettier@npm:3.2.4" bin: