From 3cfccd8ab56a38819013dcf28b739c0f51e7453b Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 26 Apr 2024 09:35:00 -0400 Subject: [PATCH 01/26] feat: support ESLint 9 --- package.json | 8 +- .../snapshots/2-Babel-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../fixtures-with-differences-errors.shot | 1 - packages/eslint-plugin/package.json | 2 +- packages/eslint-plugin/tests/docs.test.ts | 2 +- .../no-restricted-imports.shot | 27 ++ .../fixtures/eslint-v8/package.json | 2 +- packages/parser/package.json | 2 +- packages/rule-tester/package.json | 2 +- packages/rule-tester/src/RuleTester.ts | 2 +- packages/type-utils/package.json | 2 +- packages/typescript-eslint/package.json | 2 +- packages/utils/package.json | 2 +- packages/website-eslint/src/index.js | 2 +- packages/website-eslint/types/eslint.d.ts | 4 + yarn.lock | 278 +++++------------- 17 files changed, 119 insertions(+), 223 deletions(-) diff --git a/package.json b/package.json index 751e12977bc..19d2fa7c199 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "@babel/eslint-parser": "^7.24.1", "@babel/parser": "^7.24.4", "@babel/types": "^7.24.0", - "@eslint/eslintrc": "^2.1.4", + "@eslint/eslintrc": "^3.0.2", "@eslint/js": "^8.57.0", "@nx/eslint": "18.2.3", "@nx/jest": "18.2.3", @@ -87,7 +87,7 @@ "cross-fetch": "^4.0.0", "cspell": "^8.6.1", "downlevel-dts": ">=0.11.0", - "eslint": "8.57.0", + "eslint": "9.1.1", "eslint-plugin-deprecation": "^2.0.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-eslint-plugin": "^5.5.0", @@ -124,6 +124,8 @@ "yargs": "17.7.2" }, "resolutions": { + "@eslint/eslintrc": "^3.0.2", + "@eslint/js": "9.1.1", "@jest/create-cache-key-function": "^29", "@jest/reporters": "^29", "@jest/test-result": "^29", @@ -133,7 +135,7 @@ "@types/estree": "link:./tools/dummypkg", "@types/node": "^20.0.0", "@types/react": "^18.2.14", - "eslint": "8.57.0", + "eslint": "9.1.1", "eslint-visitor-keys": "^3.4.1", "jest-config": "^29", "jest-resolve": "^29", diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-value-in-using/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-value-in-using/snapshots/2-Babel-Error.shot index 05e3f2fa460..d261e20d3f4 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-value-in-using/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-value-in-using/snapshots/2-Babel-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ missing-value-in-using Babel - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ missing-value-in-using Babel - Error 1`] = `[SyntaxError: Missing initializer in using declaration. (1:7)]`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-value-in-using/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-value-in-using/snapshots/3-Alignment-Error.shot index 71344766bf9..62b811d2845 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-value-in-using/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-value-in-using/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration VariableDeclaration _error_ missing-value-in-using Error Alignment 1`] = `"TSESTree errored but Babel didn't"`; +exports[`AST Fixtures declaration VariableDeclaration _error_ missing-value-in-using Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index 0fa210c0721..3baa5a85efc 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -49,7 +49,6 @@ exports[`AST Fixtures List fixtures with Error differences 1`] = ` "TSESTree errored but Babel didn't": [ "declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/fixture.ts", - "declaration/VariableDeclaration/fixtures/_error_/missing-value-in-using/fixture.ts", "element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/fixture.ts", "legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/fixture.ts", diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 8e6230ba384..171aba1712d 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -103,7 +103,7 @@ }, "peerDependencies": { "@typescript-eslint/parser": "^7.0.0", - "eslint": "^8.57.0" + "eslint": "^9.0.0" }, "peerDependenciesMeta": { "typescript": { diff --git a/packages/eslint-plugin/tests/docs.test.ts b/packages/eslint-plugin/tests/docs.test.ts index 3c3842793ad..968e0415211 100644 --- a/packages/eslint-plugin/tests/docs.test.ts +++ b/packages/eslint-plugin/tests/docs.test.ts @@ -100,7 +100,7 @@ function renderLintResults(code: string, errors: Linter.LintMessage[]): string { return output.join('\n').trim() + '\n'; } -const linter = new Linter(); +const linter = new Linter({ configType: 'eslintrc' }); linter.defineParser('@typescript-eslint/parser', tseslintParser); const eslintOutputSnapshotFolder = path.resolve( diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-restricted-imports.shot b/packages/eslint-plugin/tests/schema-snapshots/no-restricted-imports.shot index 1fbe61748f3..55bec533996 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-restricted-imports.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-restricted-imports.shot @@ -15,6 +15,12 @@ exports[`Rule schemas should be convertible to TS types for documentation purpos { "additionalProperties": false, "properties": { + "allowImportNames": { + "items": { + "type": "string" + }, + "type": "array" + }, "allowTypeImports": { "description": "Disallow value imports, but allow type-only imports.", "type": "boolean" @@ -56,6 +62,12 @@ exports[`Rule schemas should be convertible to TS types for documentation purpos { "additionalProperties": false, "properties": { + "allowImportNames": { + "items": { + "type": "string" + }, + "type": "array" + }, "allowTypeImports": { "description": "Disallow value imports, but allow type-only imports.", "type": "boolean" @@ -95,6 +107,17 @@ exports[`Rule schemas should be convertible to TS types for documentation purpos "items": { "additionalProperties": false, "properties": { + "allowImportNamePattern": { + "type": "string" + }, + "allowImportNames": { + "items": { + "type": "string" + }, + "minItems": 1, + "type": "array", + "uniqueItems": true + }, "allowTypeImports": { "description": "Disallow value imports, but allow type-only imports.", "type": "boolean" @@ -149,6 +172,7 @@ exports[`Rule schemas should be convertible to TS types for documentation purpos type Options = | ( | { + allowImportNames?: string[]; /** Disallow value imports, but allow type-only imports. */ allowTypeImports?: boolean; importNames?: string[]; @@ -162,6 +186,7 @@ type Options = { paths?: ( | { + allowImportNames?: string[]; /** Disallow value imports, but allow type-only imports. */ allowTypeImports?: boolean; importNames?: string[]; @@ -172,6 +197,8 @@ type Options = )[]; patterns?: | { + allowImportNamePattern?: string; + allowImportNames?: [string, ...string[]]; /** Disallow value imports, but allow type-only imports. */ allowTypeImports?: boolean; caseSensitive?: boolean; diff --git a/packages/integration-tests/fixtures/eslint-v8/package.json b/packages/integration-tests/fixtures/eslint-v8/package.json index abf15108e91..2a34b5205cf 100644 --- a/packages/integration-tests/fixtures/eslint-v8/package.json +++ b/packages/integration-tests/fixtures/eslint-v8/package.json @@ -1,5 +1,5 @@ { "devDependencies": { - "eslint": "8.57.0" + "eslint": "9.0.0" } } diff --git a/packages/parser/package.json b/packages/parser/package.json index 782af905166..514da006ffe 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -49,7 +49,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "peerDependencies": { - "eslint": "^8.57.0" + "eslint": "^9.0.0" }, "dependencies": { "@typescript-eslint/scope-manager": "7.7.1", diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index ca33315d40c..baeb4dffa4c 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -56,7 +56,7 @@ }, "peerDependencies": { "@eslint/eslintrc": ">=2", - "eslint": "^8.57.0" + "eslint": "^9.0.0" }, "devDependencies": { "@types/lodash.merge": "4.6.9", diff --git a/packages/rule-tester/src/RuleTester.ts b/packages/rule-tester/src/RuleTester.ts index f0ac7ca3dca..82bae3859ab 100644 --- a/packages/rule-tester/src/RuleTester.ts +++ b/packages/rule-tester/src/RuleTester.ts @@ -76,7 +76,7 @@ let defaultConfig = deepMerge( export class RuleTester extends TestFramework { readonly #testerConfig: TesterConfigWithDefaults; readonly #rules: Record = {}; - readonly #linter: Linter = new Linter(); + readonly #linter: Linter = new Linter({ configType: 'eslintrc' }); /** * Creates a new instance of RuleTester. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 9d1cdee2392..36a6f772f4f 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -61,7 +61,7 @@ "typescript": "*" }, "peerDependencies": { - "eslint": "^8.57.0" + "eslint": "^9.0.0" }, "peerDependenciesMeta": { "typescript": { diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 3cc2acaa617..c1ad6b907a2 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -52,7 +52,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "peerDependencies": { - "eslint": "^8.57.0" + "eslint": "^9.0.0" }, "dependencies": { "@typescript-eslint/eslint-plugin": "7.7.1", diff --git a/packages/utils/package.json b/packages/utils/package.json index f6fe36fb7da..1bd704921f1 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -76,7 +76,7 @@ "semver": "^7.6.0" }, "peerDependencies": { - "eslint": "^8.57.0" + "eslint": "^9.0.0" }, "devDependencies": { "@typescript-eslint/parser": "7.7.1", diff --git a/packages/website-eslint/src/index.js b/packages/website-eslint/src/index.js index 1c16db4da84..9121a97c7d5 100644 --- a/packages/website-eslint/src/index.js +++ b/packages/website-eslint/src/index.js @@ -24,7 +24,7 @@ exports.astConverter = astConverter; exports.esquery = esquery; exports.createLinter = function () { - const linter = new Linter(); + const linter = new Linter({ configType: 'eslintrc' }); for (const name in plugin.rules) { linter.defineRule(`@typescript-eslint/${name}`, plugin.rules[name]); } diff --git a/packages/website-eslint/types/eslint.d.ts b/packages/website-eslint/types/eslint.d.ts index 82c78be17ef..cda0b0da579 100644 --- a/packages/website-eslint/types/eslint.d.ts +++ b/packages/website-eslint/types/eslint.d.ts @@ -9,7 +9,11 @@ it just uses `any` for the import - marking it as an untyped export. So adding t cannot use VSCode's cache ever - stubbing it out permanently. */ declare module 'eslint' { + export interface LinterOptions { + configType?: 'eslintrc'; + } export class Linter { + constructor(options: LinterOptions); defineRule(name: string, rule: unknown): void; } } diff --git a/yarn.lock b/yarn.lock index d53f6f76fa5..fc23413ffdf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -266,30 +266,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:*, @babel/core@npm:^7.11.1, @babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.19.6, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.3": - version: 7.24.3 - resolution: "@babel/core@npm:7.24.3" - dependencies: - "@ampproject/remapping": ^2.2.0 - "@babel/code-frame": ^7.24.2 - "@babel/generator": ^7.24.1 - "@babel/helper-compilation-targets": ^7.23.6 - "@babel/helper-module-transforms": ^7.23.3 - "@babel/helpers": ^7.24.1 - "@babel/parser": ^7.24.1 - "@babel/template": ^7.24.0 - "@babel/traverse": ^7.24.1 - "@babel/types": ^7.24.0 - convert-source-map: ^2.0.0 - debug: ^4.1.0 - gensync: ^1.0.0-beta.2 - json5: ^2.2.3 - semver: ^6.3.1 - checksum: 1a33460794f4122cf255b656f4d6586913f41078a1afdf1bcf0365ddbd99c1ddb68f904062f9079445ab26b507c36bc297055192bc26e5c8e6e3def42195f9ab - languageName: node - linkType: hard - -"@babel/core@npm:^7.24.4": +"@babel/core@npm:*, @babel/core@npm:^7.11.1, @babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.19.6, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.3, @babel/core@npm:^7.24.4": version: 7.24.4 resolution: "@babel/core@npm:7.24.4" dependencies: @@ -326,19 +303,7 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.23.3, @babel/generator@npm:^7.24.1, @babel/generator@npm:^7.7.2": - version: 7.24.1 - resolution: "@babel/generator@npm:7.24.1" - dependencies: - "@babel/types": ^7.24.0 - "@jridgewell/gen-mapping": ^0.3.5 - "@jridgewell/trace-mapping": ^0.3.25 - jsesc: ^2.5.1 - checksum: 98c6ce5ec7a1cba2bdf35cdf607273b90cf7cf82bbe75cd0227363fb84d7e1bd8efa74f40247d5900c8c009123f10132ad209a05283757698de918278c3c6700 - languageName: node - linkType: hard - -"@babel/generator@npm:^7.24.4": +"@babel/generator@npm:^7.23.3, @babel/generator@npm:^7.24.1, @babel/generator@npm:^7.24.4, @babel/generator@npm:^7.7.2": version: 7.24.4 resolution: "@babel/generator@npm:7.24.4" dependencies: @@ -588,17 +553,6 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/helpers@npm:7.24.1" - dependencies: - "@babel/template": ^7.24.0 - "@babel/traverse": ^7.24.1 - "@babel/types": ^7.24.0 - checksum: 0643b8ccf3358682303aea65f0798e482b2c3642040d32ffe130a245f4a46d0d23fe575a5e06e3cda4e8ec4af89d52b94ff1c444a74465d47ccc27da6ddbbb9f - languageName: node - linkType: hard - "@babel/helpers@npm:^7.24.4": version: 7.24.4 resolution: "@babel/helpers@npm:7.24.4" @@ -622,16 +576,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:*, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/parser@npm:7.24.1" - bin: - parser: ./bin/babel-parser.js - checksum: a1068941dddf82ffdf572565b8b7b2cddb963ff9ddf97e6e28f50e843d820b4285e6def8f59170104a94e2a91ae2e3b326489886d77a57ea29d468f6a5e79bf9 - languageName: node - linkType: hard - -"@babel/parser@npm:^7.24.4": +"@babel/parser@npm:*, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.24.4": version: 7.24.4 resolution: "@babel/parser@npm:7.24.4" bin: @@ -1764,16 +1709,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.3, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.22.6, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.8.4": - version: 7.24.1 - resolution: "@babel/runtime@npm:7.24.1" - dependencies: - regenerator-runtime: ^0.14.0 - checksum: 5c8f3b912ba949865f03b3cf8395c60e1f4ebd1033fbd835bdfe81b6cac8a87d85bc3c7aded5fcdf07be044c9ab8c818f467abe0deca50020c72496782639572 - languageName: node - linkType: hard - -"@babel/runtime@npm:^7.24.4": +"@babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.3, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.22.6, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.24.4, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.8.4": version: 7.24.4 resolution: "@babel/runtime@npm:7.24.4" dependencies: @@ -3344,27 +3280,27 @@ __metadata: languageName: node linkType: hard -"@eslint/eslintrc@npm:^2.1.4": - version: 2.1.4 - resolution: "@eslint/eslintrc@npm:2.1.4" +"@eslint/eslintrc@npm:^3.0.2": + version: 3.0.2 + resolution: "@eslint/eslintrc@npm:3.0.2" dependencies: ajv: ^6.12.4 debug: ^4.3.2 - espree: ^9.6.0 - globals: ^13.19.0 + espree: ^10.0.1 + globals: ^14.0.0 ignore: ^5.2.0 import-fresh: ^3.2.1 js-yaml: ^4.1.0 minimatch: ^3.1.2 strip-json-comments: ^3.1.1 - checksum: 10957c7592b20ca0089262d8c2a8accbad14b4f6507e35416c32ee6b4dbf9cad67dfb77096bbd405405e9ada2b107f3797fe94362e1c55e0b09d6e90dd149127 + checksum: 05bf516b60fbb1c1bdc264e081118b2172c5feb071cd665976482c5614b8e7950991175fea3ca6b1f482ced7cb0d0aa34ceab3a508d6bf1ff17b4efc0911e293 languageName: node linkType: hard -"@eslint/js@npm:*, @eslint/js@npm:8.57.0, @eslint/js@npm:^8.57.0": - version: 8.57.0 - resolution: "@eslint/js@npm:8.57.0" - checksum: 315dc65b0e9893e2bff139bddace7ea601ad77ed47b4550e73da8c9c2d2766c7a575c3cddf17ef85b8fd6a36ff34f91729d0dcca56e73ca887c10df91a41b0bb +"@eslint/js@npm:9.1.1": + version: 9.1.1 + resolution: "@eslint/js@npm:9.1.1" + checksum: b71844776d582de74a3599abcbccd2b9009a9292aaf81cb780469c9037985eb8c220c0a08708db205d7fecb54cf087c3c2b2066bd04819b1bc325fa72a52e3e0 languageName: node linkType: hard @@ -3391,14 +3327,14 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.11.14": - version: 0.11.14 - resolution: "@humanwhocodes/config-array@npm:0.11.14" +"@humanwhocodes/config-array@npm:^0.13.0": + version: 0.13.0 + resolution: "@humanwhocodes/config-array@npm:0.13.0" dependencies: - "@humanwhocodes/object-schema": ^2.0.2 + "@humanwhocodes/object-schema": ^2.0.3 debug: ^4.3.1 minimatch: ^3.0.5 - checksum: 861ccce9eaea5de19546653bccf75bf09fe878bc39c3aab00aeee2d2a0e654516adad38dd1098aab5e3af0145bbcbf3f309bdf4d964f8dab9dcd5834ae4c02f2 + checksum: eae69ff9134025dd2924f0b430eb324981494be26f0fddd267a33c28711c4db643242cf9fddf7dadb9d16c96b54b2d2c073e60a56477df86e0173149313bd5d6 languageName: node linkType: hard @@ -3409,10 +3345,17 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/object-schema@npm:^2.0.2": - version: 2.0.2 - resolution: "@humanwhocodes/object-schema@npm:2.0.2" - checksum: 2fc11503361b5fb4f14714c700c02a3f4c7c93e9acd6b87a29f62c522d90470f364d6161b03d1cc618b979f2ae02aed1106fd29d302695d8927e2fc8165ba8ee +"@humanwhocodes/object-schema@npm:^2.0.3": + version: 2.0.3 + resolution: "@humanwhocodes/object-schema@npm:2.0.3" + checksum: d3b78f6c5831888c6ecc899df0d03bcc25d46f3ad26a11d7ea52944dc36a35ef543fad965322174238d677a43d5c694434f6607532cff7077062513ad7022631 + languageName: node + linkType: hard + +"@humanwhocodes/retry@npm:^0.2.3": + version: 0.2.3 + resolution: "@humanwhocodes/retry@npm:0.2.3" + checksum: 24c224ad8564c0d28b6295d6fd42ddab524629f7872bd78c06cf96fe54d981ad589273222a4e37a0ec9fad72200cbab586bb7552b28109dfaae2bf332ecb9abf languageName: node linkType: hard @@ -5591,7 +5534,7 @@ __metadata: unist-util-visit: ^5.0.0 peerDependencies: "@typescript-eslint/parser": ^7.0.0 - eslint: ^8.57.0 + eslint: ^9.0.0 peerDependenciesMeta: typescript: optional: true @@ -5626,7 +5569,7 @@ __metadata: rimraf: "*" typescript: "*" peerDependencies: - eslint: ^8.57.0 + eslint: ^9.0.0 peerDependenciesMeta: typescript: optional: true @@ -5677,7 +5620,7 @@ __metadata: typescript: "*" peerDependencies: "@eslint/eslintrc": ">=2" - eslint: ^8.57.0 + eslint: ^9.0.0 languageName: unknown linkType: soft @@ -5733,7 +5676,7 @@ __metadata: ts-api-utils: ^1.3.0 typescript: "*" peerDependencies: - eslint: ^8.57.0 + eslint: ^9.0.0 peerDependenciesMeta: typescript: optional: true @@ -5777,7 +5720,7 @@ __metadata: "@babel/eslint-parser": ^7.24.1 "@babel/parser": ^7.24.4 "@babel/types": ^7.24.0 - "@eslint/eslintrc": ^2.1.4 + "@eslint/eslintrc": ^3.0.2 "@eslint/js": ^8.57.0 "@nx/eslint": 18.2.3 "@nx/jest": 18.2.3 @@ -5802,7 +5745,7 @@ __metadata: cross-fetch: ^4.0.0 cspell: ^8.6.1 downlevel-dts: ">=0.11.0" - eslint: 8.57.0 + eslint: 9.1.1 eslint-plugin-deprecation: ^2.0.0 eslint-plugin-eslint-comments: ^3.2.0 eslint-plugin-eslint-plugin: ^5.5.0 @@ -5923,7 +5866,7 @@ __metadata: semver: ^7.6.0 typescript: "*" peerDependencies: - eslint: ^8.57.0 + eslint: ^9.0.0 languageName: unknown linkType: soft @@ -6020,7 +5963,7 @@ __metadata: languageName: unknown linkType: soft -"@ungap/structured-clone@npm:^1.0.0, @ungap/structured-clone@npm:^1.2.0": +"@ungap/structured-clone@npm:^1.0.0": version: 1.2.0 resolution: "@ungap/structured-clone@npm:1.2.0" checksum: 4f656b7b4672f2ce6e272f2427d8b0824ed11546a601d8d5412b9d7704e83db38a8d9f402ecdf2b9063fc164af842ad0ec4a55819f621ed7e7ea4d1efcc74524 @@ -6262,7 +6205,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.4.1, acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": +"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.11.3, acorn@npm:^8.4.1, acorn@npm:^8.7.1, acorn@npm:^8.8.2": version: 8.11.3 resolution: "acorn@npm:8.11.3" bin: @@ -8943,15 +8886,6 @@ __metadata: languageName: node linkType: hard -"doctrine@npm:^3.0.0": - version: 3.0.0 - resolution: "doctrine@npm:3.0.0" - dependencies: - esutils: ^2.0.2 - checksum: fd7673ca77fe26cd5cba38d816bc72d641f500f1f9b25b83e8ce28827fe2da7ad583a8da26ab6af85f834138cf8dae9f69b0cd6ab925f52ddab1754db44d99ce - languageName: node - linkType: hard - "dom-converter@npm:^0.2.0": version: 0.2.0 resolution: "dom-converter@npm:0.2.0" @@ -9824,13 +9758,13 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:^7.2.2": - version: 7.2.2 - resolution: "eslint-scope@npm:7.2.2" +"eslint-scope@npm:^8.0.1": + version: 8.0.1 + resolution: "eslint-scope@npm:8.0.1" dependencies: esrecurse: ^4.3.0 estraverse: ^5.2.0 - checksum: ec97dbf5fb04b94e8f4c5a91a7f0a6dd3c55e46bfc7bbcd0e3138c3a76977570e02ed89a1810c778dcd72072ff0e9621ba1379b4babe53921d71e2e4486fda3e + checksum: 67a5a39312dadb8c9a677df0f2e8add8daf15280b08bfe07f898d5347ee2d7cd2a1f5c2760f34e46e8f5f13f7192f47c2c10abe676bfa4173ae5539365551940 languageName: node linkType: hard @@ -9852,40 +9786,36 @@ __metadata: languageName: node linkType: hard -"eslint@npm:8.57.0": - version: 8.57.0 - resolution: "eslint@npm:8.57.0" +"eslint@npm:9.1.1": + version: 9.1.1 + resolution: "eslint@npm:9.1.1" dependencies: "@eslint-community/eslint-utils": ^4.2.0 "@eslint-community/regexpp": ^4.6.1 - "@eslint/eslintrc": ^2.1.4 - "@eslint/js": 8.57.0 - "@humanwhocodes/config-array": ^0.11.14 + "@eslint/eslintrc": ^3.0.2 + "@eslint/js": 9.1.1 + "@humanwhocodes/config-array": ^0.13.0 "@humanwhocodes/module-importer": ^1.0.1 + "@humanwhocodes/retry": ^0.2.3 "@nodelib/fs.walk": ^1.2.8 - "@ungap/structured-clone": ^1.2.0 ajv: ^6.12.4 chalk: ^4.0.0 cross-spawn: ^7.0.2 debug: ^4.3.2 - doctrine: ^3.0.0 escape-string-regexp: ^4.0.0 - eslint-scope: ^7.2.2 - eslint-visitor-keys: ^3.4.3 - espree: ^9.6.1 + eslint-scope: ^8.0.1 + eslint-visitor-keys: ^4.0.0 + espree: ^10.0.1 esquery: ^1.4.2 esutils: ^2.0.2 fast-deep-equal: ^3.1.3 - file-entry-cache: ^6.0.1 + file-entry-cache: ^8.0.0 find-up: ^5.0.0 glob-parent: ^6.0.2 - globals: ^13.19.0 - graphemer: ^1.4.0 ignore: ^5.2.0 imurmurhash: ^0.1.4 is-glob: ^4.0.0 is-path-inside: ^3.0.3 - js-yaml: ^4.1.0 json-stable-stringify-without-jsonify: ^1.0.1 levn: ^0.4.1 lodash.merge: ^4.6.2 @@ -9896,18 +9826,18 @@ __metadata: text-table: ^0.2.0 bin: eslint: bin/eslint.js - checksum: 3a48d7ff85ab420a8447e9810d8087aea5b1df9ef68c9151732b478de698389ee656fd895635b5f2871c89ee5a2652b3f343d11e9db6f8486880374ebc74a2d9 + checksum: b96852334eb8397cbee4d8d2342c247a304bf59ba38573e0229e28b6f4589a315af065e5a19989133103b09ada8c958f7cd83e95d327b1d3532e9b2c119d6692 languageName: node linkType: hard -"espree@npm:^9.6.0, espree@npm:^9.6.1": - version: 9.6.1 - resolution: "espree@npm:9.6.1" +"espree@npm:^10.0.1": + version: 10.0.1 + resolution: "espree@npm:10.0.1" dependencies: - acorn: ^8.9.0 + acorn: ^8.11.3 acorn-jsx: ^5.3.2 - eslint-visitor-keys: ^3.4.1 - checksum: eb8c149c7a2a77b3f33a5af80c10875c3abd65450f60b8af6db1bfcfa8f101e21c1e56a561c6dc13b848e18148d43469e7cd208506238554fb5395a9ea5a1ab9 + eslint-visitor-keys: ^4.0.0 + checksum: 62c9242a84c6741cebd35ede6574131d0419be7e5559566403e384087d99c4ddb2ced44e32acd44a4c3d8a8a84997cf8d78810c4e46b3fe25a804f1a92dc6b9d languageName: node linkType: hard @@ -10347,15 +10277,6 @@ __metadata: languageName: node linkType: hard -"file-entry-cache@npm:^6.0.1": - version: 6.0.1 - resolution: "file-entry-cache@npm:6.0.1" - dependencies: - flat-cache: ^3.0.4 - checksum: f49701feaa6314c8127c3c2f6173cfefff17612f5ed2daaafc6da13b5c91fd43e3b2a58fd0d63f9f94478a501b167615931e7200e31485e320f74a33885a9c74 - languageName: node - linkType: hard - "file-entry-cache@npm:^8.0.0": version: 8.0.0 resolution: "file-entry-cache@npm:8.0.0" @@ -10473,17 +10394,6 @@ __metadata: languageName: node linkType: hard -"flat-cache@npm:^3.0.4": - version: 3.1.1 - resolution: "flat-cache@npm:3.1.1" - dependencies: - flatted: ^3.2.9 - keyv: ^4.5.3 - rimraf: ^3.0.2 - checksum: 4958cfe0f46acf84953d4e16676ef5f0d38eab3a92d532a1e8d5f88f11eea8b36d5d598070ff2aeae15f1fde18f8d7d089eefaf9db10b5a587cc1c9072325c7a - languageName: node - linkType: hard - "flat-cache@npm:^4.0.0": version: 4.0.1 resolution: "flat-cache@npm:4.0.1" @@ -10993,12 +10903,10 @@ __metadata: languageName: node linkType: hard -"globals@npm:^13.19.0": - version: 13.24.0 - resolution: "globals@npm:13.24.0" - dependencies: - type-fest: ^0.20.2 - checksum: 56066ef058f6867c04ff203b8a44c15b038346a62efbc3060052a1016be9f56f4cf0b2cd45b74b22b81e521a889fc7786c73691b0549c2f3a6e825b3d394f43c +"globals@npm:^14.0.0": + version: 14.0.0 + resolution: "globals@npm:14.0.0" + checksum: 534b8216736a5425737f59f6e6a5c7f386254560c9f41d24a9227d60ee3ad4a9e82c5b85def0e212e9d92162f83a92544be4c7fd4c902cb913736c10e08237ac languageName: node linkType: hard @@ -16368,7 +16276,7 @@ __metadata: languageName: node linkType: hard -"postcss-selector-parser@npm:^6.0.16": +"postcss-selector-parser@npm:^6.0.16, postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4, postcss-selector-parser@npm:^6.0.5, postcss-selector-parser@npm:^6.0.9": version: 6.0.16 resolution: "postcss-selector-parser@npm:6.0.16" dependencies: @@ -16378,16 +16286,6 @@ __metadata: languageName: node linkType: hard -"postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4, postcss-selector-parser@npm:^6.0.5, postcss-selector-parser@npm:^6.0.9": - version: 6.0.13 - resolution: "postcss-selector-parser@npm:6.0.13" - dependencies: - cssesc: ^3.0.0 - util-deprecate: ^1.0.2 - checksum: f89163338a1ce3b8ece8e9055cd5a3165e79a15e1c408e18de5ad8f87796b61ec2d48a2902d179ae0c4b5de10fccd3a325a4e660596549b040bc5ad1b465f096 - languageName: node - linkType: hard - "postcss-sort-media-queries@npm:^4.4.1": version: 4.4.1 resolution: "postcss-sort-media-queries@npm:4.4.1" @@ -16447,18 +16345,7 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.4.17, postcss@npm:^8.4.21, postcss@npm:^8.4.26, postcss@npm:^8.4.32, postcss@npm:^8.4.33": - version: 8.4.35 - resolution: "postcss@npm:8.4.35" - dependencies: - nanoid: ^3.3.7 - picocolors: ^1.0.0 - source-map-js: ^1.0.2 - checksum: cf3c3124d3912a507603f6d9a49b3783f741075e9aa73eb592a6dd9194f9edab9d20a8875d16d137d4f779fe7b6fbd1f5727e39bfd1c3003724980ee4995e1da - languageName: node - linkType: hard - -"postcss@npm:^8.4.38": +"postcss@npm:^8.4.17, postcss@npm:^8.4.21, postcss@npm:^8.4.26, postcss@npm:^8.4.32, postcss@npm:^8.4.33, postcss@npm:^8.4.38": version: 8.4.38 resolution: "postcss@npm:8.4.38" dependencies: @@ -17511,7 +17398,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": +"rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: @@ -18131,14 +18018,7 @@ __metadata: languageName: node linkType: hard -"source-map-js@npm:^1.0.1, source-map-js@npm:^1.0.2": - version: 1.0.2 - resolution: "source-map-js@npm:1.0.2" - checksum: c049a7fc4deb9a7e9b481ae3d424cc793cb4845daa690bc5a05d428bf41bf231ced49b4cf0c9e77f9d42fdb3d20d6187619fc586605f5eabe995a316da8d377c - languageName: node - linkType: hard - -"source-map-js@npm:^1.2.0": +"source-map-js@npm:^1.0.1, source-map-js@npm:^1.2.0": version: 1.2.0 resolution: "source-map-js@npm:1.2.0" checksum: 791a43306d9223792e84293b00458bf102a8946e7188f3db0e4e22d8d530b5f80a4ce468eb5ec0bf585443ad55ebbd630bf379c98db0b1f317fd902500217f97 @@ -18928,16 +18808,7 @@ __metadata: languageName: node linkType: hard -"tmp@npm:*, tmp@npm:~0.2.1": - version: 0.2.1 - resolution: "tmp@npm:0.2.1" - dependencies: - rimraf: ^3.0.0 - checksum: 8b1214654182575124498c87ca986ac53dc76ff36e8f0e0b67139a8d221eaecfdec108c0e6ec54d76f49f1f72ab9325500b246f562b926f85bcdfca8bf35df9e - languageName: node - linkType: hard - -"tmp@npm:^0.2.3": +"tmp@npm:*, tmp@npm:^0.2.3, tmp@npm:~0.2.1": version: 0.2.3 resolution: "tmp@npm:0.2.3" checksum: 73b5c96b6e52da7e104d9d44afb5d106bb1e16d9fa7d00dbeb9e6522e61b571fbdb165c756c62164be9a3bbe192b9b268c236d370a2a0955c7689cd2ae377b95 @@ -19152,13 +19023,6 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^0.20.2": - version: 0.20.2 - resolution: "type-fest@npm:0.20.2" - checksum: 4fb3272df21ad1c552486f8a2f8e115c09a521ad7a8db3d56d53718d0c907b62c6e9141ba5f584af3f6830d0872c521357e512381f24f7c44acae583ad517d73 - languageName: node - linkType: hard - "type-fest@npm:^0.21.3": version: 0.21.3 resolution: "type-fest@npm:0.21.3" @@ -19285,7 +19149,7 @@ __metadata: rimraf: "*" typescript: "*" peerDependencies: - eslint: ^8.57.0 + eslint: ^9.0.0 peerDependenciesMeta: typescript: optional: true From 6f4fdd72f83622fea3443a01b6311eb355d248f2 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 26 Apr 2024 10:00:51 -0400 Subject: [PATCH 02/26] Fix some eslint-plugin tests --- .../tests/rules/array-type.test.ts | 2 +- .../no-unused-vars-eslint.test.ts | 30 ++++++++++++------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/array-type.test.ts b/packages/eslint-plugin/tests/rules/array-type.test.ts index 44be83ff63d..09b5e39d2d5 100644 --- a/packages/eslint-plugin/tests/rules/array-type.test.ts +++ b/packages/eslint-plugin/tests/rules/array-type.test.ts @@ -1924,7 +1924,7 @@ interface FooInterface { // -- eslint rule tester is not working with multi-pass // https://github.com/eslint/eslint/issues/11187 describe('array-type (nested)', () => { - const linter = new TSESLint.Linter(); + const linter = new TSESLint.Linter({ configType: 'eslintrc' }); linter.defineRule('array-type', rule); linter.defineParser('@typescript-eslint/parser', parser); diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts index 82e86755861..f5abbf90d18 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts @@ -17,17 +17,25 @@ const ruleTester = new RuleTester({ }, }); -ruleTester.defineRule('use-every-a', context => { - /** - * Mark a variable as used - */ - function useA(node: TSESTree.Node): void { - context.sourceCode.markVariableAsUsed('a', node); - } - return { - VariableDeclaration: useA, - ReturnStatement: useA, - }; +ruleTester.defineRule('use-every-a', { + create: context => { + /** + * Mark a variable as used + */ + function useA(node: TSESTree.Node): void { + context.sourceCode.markVariableAsUsed('a', node); + } + return { + VariableDeclaration: useA, + ReturnStatement: useA, + }; + }, + defaultOptions: [], + meta: { + messages: {}, + type: 'problem', + schema: [], + }, }); /** From 7c3a18508ce7787a0c44b89f88bdcc26bdf7a03d Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 28 Apr 2024 12:51:23 -0400 Subject: [PATCH 03/26] Re-add v8 and remove unnecessary peerDependencies --- packages/eslint-plugin/package.json | 2 +- .../fixtures/eslint-v8/package.json | 2 +- packages/parser/package.json | 2 +- packages/rule-tester/package.json | 2 +- packages/type-utils/package.json | 3 --- packages/typescript-eslint/package.json | 3 --- packages/utils/package.json | 2 +- yarn.lock | 12 ++++-------- 8 files changed, 9 insertions(+), 19 deletions(-) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 171aba1712d..9e4879b719c 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -103,7 +103,7 @@ }, "peerDependencies": { "@typescript-eslint/parser": "^7.0.0", - "eslint": "^9.0.0" + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { diff --git a/packages/integration-tests/fixtures/eslint-v8/package.json b/packages/integration-tests/fixtures/eslint-v8/package.json index 2a34b5205cf..abf15108e91 100644 --- a/packages/integration-tests/fixtures/eslint-v8/package.json +++ b/packages/integration-tests/fixtures/eslint-v8/package.json @@ -1,5 +1,5 @@ { "devDependencies": { - "eslint": "9.0.0" + "eslint": "8.57.0" } } diff --git a/packages/parser/package.json b/packages/parser/package.json index 514da006ffe..be441ce68f6 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -49,7 +49,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "peerDependencies": { - "eslint": "^9.0.0" + "eslint": "^8.57.0 || ^9.0.0" }, "dependencies": { "@typescript-eslint/scope-manager": "7.7.1", diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index baeb4dffa4c..5aa2a2a965b 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -56,7 +56,7 @@ }, "peerDependencies": { "@eslint/eslintrc": ">=2", - "eslint": "^9.0.0" + "eslint": "^8.57.0 || ^9.0.0" }, "devDependencies": { "@types/lodash.merge": "4.6.9", diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 36a6f772f4f..bfdca3eb977 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -60,9 +60,6 @@ "rimraf": "*", "typescript": "*" }, - "peerDependencies": { - "eslint": "^9.0.0" - }, "peerDependenciesMeta": { "typescript": { "optional": true diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index c1ad6b907a2..1691ea7ada5 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -51,9 +51,6 @@ "test": "jest --coverage --passWithNoTests", "typecheck": "tsc -p tsconfig.json --noEmit" }, - "peerDependencies": { - "eslint": "^9.0.0" - }, "dependencies": { "@typescript-eslint/eslint-plugin": "7.7.1", "@typescript-eslint/parser": "7.7.1", diff --git a/packages/utils/package.json b/packages/utils/package.json index 1bd704921f1..1eb5c7b8a51 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -76,7 +76,7 @@ "semver": "^7.6.0" }, "peerDependencies": { - "eslint": "^9.0.0" + "eslint": "^8.57.0 || ^9.0.0" }, "devDependencies": { "@typescript-eslint/parser": "7.7.1", diff --git a/yarn.lock b/yarn.lock index fc23413ffdf..ed14164d072 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5534,7 +5534,7 @@ __metadata: unist-util-visit: ^5.0.0 peerDependencies: "@typescript-eslint/parser": ^7.0.0 - eslint: ^9.0.0 + eslint: ^8.57.0 || ^9.0.0 peerDependenciesMeta: typescript: optional: true @@ -5569,7 +5569,7 @@ __metadata: rimraf: "*" typescript: "*" peerDependencies: - eslint: ^9.0.0 + eslint: ^8.57.0 || ^9.0.0 peerDependenciesMeta: typescript: optional: true @@ -5620,7 +5620,7 @@ __metadata: typescript: "*" peerDependencies: "@eslint/eslintrc": ">=2" - eslint: ^9.0.0 + eslint: ^8.57.0 || ^9.0.0 languageName: unknown linkType: soft @@ -5675,8 +5675,6 @@ __metadata: rimraf: "*" ts-api-utils: ^1.3.0 typescript: "*" - peerDependencies: - eslint: ^9.0.0 peerDependenciesMeta: typescript: optional: true @@ -5866,7 +5864,7 @@ __metadata: semver: ^7.6.0 typescript: "*" peerDependencies: - eslint: ^9.0.0 + eslint: ^8.57.0 || ^9.0.0 languageName: unknown linkType: soft @@ -19148,8 +19146,6 @@ __metadata: prettier: ^3.2.5 rimraf: "*" typescript: "*" - peerDependencies: - eslint: ^9.0.0 peerDependenciesMeta: typescript: optional: true From eae61eb09a1ee513a9bca476655d96e9aa071947 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 28 Apr 2024 13:08:10 -0400 Subject: [PATCH 04/26] Fix no-unused-vars test rule --- .../rules/no-unused-vars/no-unused-vars.test.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts index 04c218b7631..e87a5002da6 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts @@ -20,9 +20,17 @@ const withMetaParserOptions = { }; // this is used to ensure that the caching the utility does does not impact the results done by no-unused-vars -ruleTester.defineRule('collect-unused-vars', context => { - collectUnusedVariables(context); - return {}; +ruleTester.defineRule('collect-unused-vars', { + create(context) { + collectUnusedVariables(context); + return {}; + }, + defaultOptions: [], + meta: { + messages: {}, + type: 'problem', + schema: [], + }, }); ruleTester.run('no-unused-vars', rule, { From 13f3964ff9fd3f5cadc406ade4f51b86c4a57b9c Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 29 Apr 2024 17:44:02 -0400 Subject: [PATCH 05/26] Updated snapshots --- .../fixtures/legacy-config/.eslintrc.js | 23 ++ .../fixtures/legacy-config/file.ts | 8 + .../fixtures/legacy-config/package.json | 1 + .../fixtures/legacy-config/tsconfig.json | 7 + .../fixtures/markdown/.eslintrc.js | 30 -- .../fixtures/markdown/eslint.config.js | 27 ++ .../{.eslintrc.js => eslint.config.js} | 12 +- .../fixtures/vue-jsx/.eslintrc.js | 21 -- .../fixtures/vue-jsx/eslint.config.js | 24 ++ .../fixtures/vue-sfc/.eslintrc.js | 21 -- .../fixtures/vue-sfc/eslint.config.js | 24 ++ .../fixtures/vue-sfc/package-lock.json | 356 ++++++++++++++++++ .../fixtures/vue-sfc/package.json | 6 +- .../__snapshots__/legacy-config.test.ts.snap | 130 +++++++ ...nded-does-not-require-program.test.ts.snap | 11 +- .../integration-tests/tests/eslint-v8.test.ts | 2 +- .../tests/flat-config-types.test.ts | 2 +- .../tests/legacy-config.test.ts | 3 + .../tools/integration-test-base.ts | 4 +- 19 files changed, 613 insertions(+), 99 deletions(-) create mode 100644 packages/integration-tests/fixtures/legacy-config/.eslintrc.js create mode 100644 packages/integration-tests/fixtures/legacy-config/file.ts create mode 100644 packages/integration-tests/fixtures/legacy-config/package.json create mode 100644 packages/integration-tests/fixtures/legacy-config/tsconfig.json delete mode 100644 packages/integration-tests/fixtures/markdown/.eslintrc.js create mode 100644 packages/integration-tests/fixtures/markdown/eslint.config.js rename packages/integration-tests/fixtures/recommended-does-not-require-program/{.eslintrc.js => eslint.config.js} (50%) delete mode 100644 packages/integration-tests/fixtures/vue-jsx/.eslintrc.js create mode 100644 packages/integration-tests/fixtures/vue-jsx/eslint.config.js delete mode 100644 packages/integration-tests/fixtures/vue-sfc/.eslintrc.js create mode 100644 packages/integration-tests/fixtures/vue-sfc/eslint.config.js create mode 100644 packages/integration-tests/fixtures/vue-sfc/package-lock.json create mode 100644 packages/integration-tests/tests/__snapshots__/legacy-config.test.ts.snap create mode 100644 packages/integration-tests/tests/legacy-config.test.ts diff --git a/packages/integration-tests/fixtures/legacy-config/.eslintrc.js b/packages/integration-tests/fixtures/legacy-config/.eslintrc.js new file mode 100644 index 00000000000..cec5c9bcb57 --- /dev/null +++ b/packages/integration-tests/fixtures/legacy-config/.eslintrc.js @@ -0,0 +1,23 @@ +const eslint = require('@eslint/js'); +const tseslint = require('typescript-eslint'); + +module.exports = tseslint.config({ + extends: [ + eslint.configs.recommended, + ...tseslint.configs.recommendedTypeChecked, + ], + languageOptions: { + parser: tseslint.parser, + parserOptions: { + project: true, + tsconfigRootDir: __dirname, + }, + }, + plugins: { + '@typescript-eslint': tseslint.plugin, + }, + rules: { + '@typescript-eslint/no-unsafe-argument': 'warn', + '@typescript-eslint/no-unsafe-return': 'warn', + }, +}); diff --git a/packages/integration-tests/fixtures/legacy-config/file.ts b/packages/integration-tests/fixtures/legacy-config/file.ts new file mode 100644 index 00000000000..ab56ced38be --- /dev/null +++ b/packages/integration-tests/fixtures/legacy-config/file.ts @@ -0,0 +1,8 @@ +async function unsafeLog(...values: any[]) { + for (const value of values) { + console.log(value.toUpperCase()); + } + return values; +} + +unsafeLog(); diff --git a/packages/integration-tests/fixtures/legacy-config/package.json b/packages/integration-tests/fixtures/legacy-config/package.json new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/packages/integration-tests/fixtures/legacy-config/package.json @@ -0,0 +1 @@ +{} diff --git a/packages/integration-tests/fixtures/legacy-config/tsconfig.json b/packages/integration-tests/fixtures/legacy-config/tsconfig.json new file mode 100644 index 00000000000..d75abccdc38 --- /dev/null +++ b/packages/integration-tests/fixtures/legacy-config/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "noEmit": true, + "strict": true + }, + "include": ["file.ts"] +} diff --git a/packages/integration-tests/fixtures/markdown/.eslintrc.js b/packages/integration-tests/fixtures/markdown/.eslintrc.js deleted file mode 100644 index 9dd8a5505b9..00000000000 --- a/packages/integration-tests/fixtures/markdown/.eslintrc.js +++ /dev/null @@ -1,30 +0,0 @@ -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - env: { - es6: true, - node: true, - }, - parserOptions: { - sourceType: 'module', - extraFileExtensions: ['.vue'], - ecmaFeatures: { - jsx: true, - }, - }, - plugins: ['markdown', '@typescript-eslint'], - overrides: [ - { - // this will also ensure that eslint will force lint the markdown files - files: ['**/*.md'], - processor: 'markdown/markdown', - }, - { - files: ['**/*.md/*.{js,ts,jsx,tsx,javascript,node}'], - rules: { - '@typescript-eslint/no-explicit-any': 'error', - 'no-console': 'error', - }, - }, - ], -}; diff --git a/packages/integration-tests/fixtures/markdown/eslint.config.js b/packages/integration-tests/fixtures/markdown/eslint.config.js new file mode 100644 index 00000000000..0b272f2e76a --- /dev/null +++ b/packages/integration-tests/fixtures/markdown/eslint.config.js @@ -0,0 +1,27 @@ +const markdown = require('eslint-plugin-markdown'); +const tseslint = require('typescript-eslint'); + +module.exports = [ + ...markdown.configs.recommended, + { + files: ['**/*.md/*.{js,ts,jsx,tsx,javascript,node}'], + languageOptions: { + parser: tseslint.parser, + parserOptions: { + sourceType: 'module', + extraFileExtensions: ['.vue'], + ecmaFeatures: { + jsx: true, + }, + }, + }, + plugins: { + ['@typescript-eslint']: tseslint.plugin, + markdown, + }, + rules: { + '@typescript-eslint/no-explicit-any': 'error', + 'no-console': 'error', + }, + }, +]; diff --git a/packages/integration-tests/fixtures/recommended-does-not-require-program/.eslintrc.js b/packages/integration-tests/fixtures/recommended-does-not-require-program/eslint.config.js similarity index 50% rename from packages/integration-tests/fixtures/recommended-does-not-require-program/.eslintrc.js rename to packages/integration-tests/fixtures/recommended-does-not-require-program/eslint.config.js index 0f28905d8de..7984b71f821 100644 --- a/packages/integration-tests/fixtures/recommended-does-not-require-program/.eslintrc.js +++ b/packages/integration-tests/fixtures/recommended-does-not-require-program/eslint.config.js @@ -2,13 +2,5 @@ // not require a program to be specified to ensure a fast and simple initial // setup. Users can add on one of our other configs if they want to opt in to // more expensive checks. -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/eslint-recommended', - 'plugin:@typescript-eslint/recommended', - ], - plugins: ['@typescript-eslint'], -}; +const tseslint = require('typescript-eslint'); +module.exports = tseslint.config(...tseslint.configs.recommended); diff --git a/packages/integration-tests/fixtures/vue-jsx/.eslintrc.js b/packages/integration-tests/fixtures/vue-jsx/.eslintrc.js deleted file mode 100644 index 750fe39d0bd..00000000000 --- a/packages/integration-tests/fixtures/vue-jsx/.eslintrc.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = { - root: true, - parser: 'vue-eslint-parser', - env: { - es6: true, - node: true, - }, - extends: ['plugin:vue/essential'], - parserOptions: { - parser: '@typescript-eslint/parser', - sourceType: 'module', - extraFileExtensions: ['.vue'], - ecmaFeatures: { - jsx: true, - }, - }, - plugins: ['@typescript-eslint'], - rules: { - '@typescript-eslint/no-explicit-any': 'error', - }, -}; diff --git a/packages/integration-tests/fixtures/vue-jsx/eslint.config.js b/packages/integration-tests/fixtures/vue-jsx/eslint.config.js new file mode 100644 index 00000000000..5266c6d8892 --- /dev/null +++ b/packages/integration-tests/fixtures/vue-jsx/eslint.config.js @@ -0,0 +1,24 @@ +const vue = require('eslint-plugin-vue'); +const tseslint = require('typescript-eslint'); + +module.exports = [ + ...vue.configs['flat/essential'], + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + sourceType: 'module', + extraFileExtensions: ['.vue'], + ecmaFeatures: { + jsx: true, + }, + }, + }, + plugins: { + ['@typescript-eslint']: tseslint.plugin, + }, + rules: { + '@typescript-eslint/no-explicit-any': 'error', + }, + }, +]; diff --git a/packages/integration-tests/fixtures/vue-sfc/.eslintrc.js b/packages/integration-tests/fixtures/vue-sfc/.eslintrc.js deleted file mode 100644 index 3306fe23755..00000000000 --- a/packages/integration-tests/fixtures/vue-sfc/.eslintrc.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = { - root: true, - parser: 'vue-eslint-parser', - env: { - es6: true, - node: true, - }, - extends: ['plugin:vue/essential'], - parserOptions: { - parser: '@typescript-eslint/parser', - project: '/usr/linked/tsconfig.json', - sourceType: 'module', - extraFileExtensions: ['.vue'], - }, - plugins: ['@typescript-eslint'], - rules: { - '@typescript-eslint/no-explicit-any': 'error', - '@typescript-eslint/no-unnecessary-type-assertion': 'error', - 'semi-spacing': 'error', - }, -}; diff --git a/packages/integration-tests/fixtures/vue-sfc/eslint.config.js b/packages/integration-tests/fixtures/vue-sfc/eslint.config.js new file mode 100644 index 00000000000..0d1daad3139 --- /dev/null +++ b/packages/integration-tests/fixtures/vue-sfc/eslint.config.js @@ -0,0 +1,24 @@ +const vue = require('eslint-plugin-vue'); +const tseslint = require('typescript-eslint'); + +module.exports = [ + ...vue.configs['flat/essential'], + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + project: '/usr/linked/tsconfig.json', + sourceType: 'module', + extraFileExtensions: ['.vue'], + }, + }, + plugins: { + ['@typescript-eslint']: tseslint.plugin, + }, + rules: { + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + 'semi-spacing': 'error', + }, + }, +]; diff --git a/packages/integration-tests/fixtures/vue-sfc/package-lock.json b/packages/integration-tests/fixtures/vue-sfc/package-lock.json new file mode 100644 index 00000000000..ba397dee137 --- /dev/null +++ b/packages/integration-tests/fixtures/vue-sfc/package-lock.json @@ -0,0 +1,356 @@ +{ + "name": "vue-sfc", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "devDependencies": { + "eslint-plugin-vue": "latest", + "vue-eslint-parser": "^9.4.2", + "vue-property-decorator": "^9.1.2", + "vuex": "^4.1.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@vue/devtools-api": { + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.1.tgz", + "integrity": "sha512-LgPscpE3Vs0x96PzSSB4IGVSZXZBZHpfxs+ZA1d+VEPwHdOXowy/Y2CsvCAIFrf+ssVU1pD1jidj505EpUnfbA==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-vue": { + "version": "9.25.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.25.0.tgz", + "integrity": "sha512-tDWlx14bVe6Bs+Nnh3IGrD+hb11kf2nukfm6jLsmJIhmiRQ1SUaksvwY9U5MvPB0pcrg0QK0xapQkfITs3RKOA==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "globals": "^13.24.0", + "natural-compare": "^1.4.0", + "nth-check": "^2.1.1", + "postcss-selector-parser": "^6.0.15", + "semver": "^7.6.0", + "vue-eslint-parser": "^9.4.2", + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": "^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.2.0 || ^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.16", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.16.tgz", + "integrity": "sha512-A0RVJrX+IUkVZbW3ClroRWurercFhieevHB38sr2+l9eUClMqome3LmEmnhlNy+5Mr2EYN6B2Kaw9wYdd+VHiw==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/vue-eslint-parser": { + "version": "9.4.2", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.4.2.tgz", + "integrity": "sha512-Ry9oiGmCAK91HrKMtCrKFWmSFWvYkpGglCeFAIqDdr9zdXmMMpJOmUJS7WWsW7fX81h6mwHmUZCQQ1E0PkSwYQ==", + "dev": true, + "dependencies": { + "debug": "^4.3.4", + "eslint-scope": "^7.1.1", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.1", + "esquery": "^1.4.0", + "lodash": "^4.17.21", + "semver": "^7.3.6" + }, + "engines": { + "node": "^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, + "node_modules/vue-property-decorator": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/vue-property-decorator/-/vue-property-decorator-9.1.2.tgz", + "integrity": "sha512-xYA8MkZynPBGd/w5QFJ2d/NM0z/YeegMqYTphy7NJQXbZcuU6FC6AOdUAcy4SXP+YnkerC6AfH+ldg7PDk9ESQ==", + "dev": true, + "peerDependencies": { + "vue": "*", + "vue-class-component": "*" + } + }, + "node_modules/vuex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/vuex/-/vuex-4.1.0.tgz", + "integrity": "sha512-hmV6UerDrPcgbSy9ORAtNXDr9M4wlNP4pEFKye4ujJF8oqgFFuxDCdOLS3eNoRTtq5O3hoBDh9Doj1bQMYHRbQ==", + "dev": true, + "dependencies": { + "@vue/devtools-api": "^6.0.0-beta.11" + }, + "peerDependencies": { + "vue": "^3.2.0" + } + }, + "node_modules/xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } +} diff --git a/packages/integration-tests/fixtures/vue-sfc/package.json b/packages/integration-tests/fixtures/vue-sfc/package.json index bef3a893533..b2f88af8ea5 100644 --- a/packages/integration-tests/fixtures/vue-sfc/package.json +++ b/packages/integration-tests/fixtures/vue-sfc/package.json @@ -1,8 +1,8 @@ { "devDependencies": { - "vue-eslint-parser": "latest", "eslint-plugin-vue": "latest", - "vuex": "latest", - "vue-property-decorator": "latest" + "vue-eslint-parser": "^9.4.2", + "vue-property-decorator": "^9.1.2", + "vuex": "^4.1.0" } } diff --git a/packages/integration-tests/tests/__snapshots__/legacy-config.test.ts.snap b/packages/integration-tests/tests/__snapshots__/legacy-config.test.ts.snap new file mode 100644 index 00000000000..2c0ba19a2f3 --- /dev/null +++ b/packages/integration-tests/tests/__snapshots__/legacy-config.test.ts.snap @@ -0,0 +1,130 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`legacy-config eslint should work successfully 1`] = ` +[ + { + "errorCount": 5, + "fatalErrorCount": 0, + "filePath": "/file.ts", + "fixableErrorCount": 0, + "fixableWarningCount": 0, + "messages": [ + { + "column": 1, + "endColumn": 25, + "endLine": 1, + "line": 1, + "message": "Async function 'unsafeLog' has no 'await' expression.", + "messageId": "missingAwait", + "nodeType": "FunctionDeclaration", + "ruleId": "@typescript-eslint/require-await", + "severity": 2, + }, + { + "column": 37, + "endColumn": 40, + "endLine": 1, + "line": 1, + "message": "Unexpected any. Specify a different type.", + "messageId": "unexpectedAny", + "nodeType": "TSAnyKeyword", + "ruleId": "@typescript-eslint/no-explicit-any", + "severity": 2, + "suggestions": [ + { + "desc": "Use \`unknown\` instead, this will force you to explicitly, and safely assert the type is correct.", + "fix": { + "range": [ + 36, + 39, + ], + "text": "unknown", + }, + "messageId": "suggestUnknown", + }, + { + "desc": "Use \`never\` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.", + "fix": { + "range": [ + 36, + 39, + ], + "text": "never", + }, + "messageId": "suggestNever", + }, + ], + }, + { + "column": 17, + "endColumn": 34, + "endLine": 3, + "line": 3, + "message": "Unsafe call of an \`any\` typed value.", + "messageId": "unsafeCall", + "nodeType": "MemberExpression", + "ruleId": "@typescript-eslint/no-unsafe-call", + "severity": 2, + }, + { + "column": 23, + "endColumn": 34, + "endLine": 3, + "line": 3, + "message": "Unsafe member access .toUpperCase on an \`any\` value.", + "messageId": "unsafeMemberExpression", + "nodeType": "Identifier", + "ruleId": "@typescript-eslint/no-unsafe-member-access", + "severity": 2, + }, + { + "column": 3, + "endColumn": 17, + "endLine": 5, + "line": 5, + "message": "Unsafe return of an \`any[]\` typed value.", + "messageId": "unsafeReturn", + "nodeType": "ReturnStatement", + "ruleId": "@typescript-eslint/no-unsafe-return", + "severity": 1, + }, + { + "column": 1, + "endColumn": 13, + "endLine": 8, + "line": 8, + "message": "Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the \`void\` operator.", + "messageId": "floatingVoid", + "nodeType": "ExpressionStatement", + "ruleId": "@typescript-eslint/no-floating-promises", + "severity": 2, + "suggestions": [ + { + "desc": "Add void operator to ignore.", + "fix": { + "range": [ + 139, + 139, + ], + "text": "void ", + }, + "messageId": "floatingFixVoid", + }, + ], + }, + ], + "source": "async function unsafeLog(...values: any[]) { + for (const value of values) { + console.log(value.toUpperCase()); + } + return values; +} + +unsafeLog(); +", + "suppressedMessages": [], + "usedDeprecatedRules": [], + "warningCount": 1, + }, +] +`; diff --git a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap index ae2bd5a863e..059dfb803b0 100644 --- a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap @@ -24,16 +24,7 @@ exports[`recommended-does-not-require-program eslint should work successfully 1` "output": "const foo: unknown = true; ", "suppressedMessages": [], - "usedDeprecatedRules": [ - { - "replacedBy": [], - "ruleId": "no-extra-semi", - }, - { - "replacedBy": [], - "ruleId": "no-mixed-spaces-and-tabs", - }, - ], + "usedDeprecatedRules": [], "warningCount": 0, }, ] diff --git a/packages/integration-tests/tests/eslint-v8.test.ts b/packages/integration-tests/tests/eslint-v8.test.ts index fe0b175c3f8..69f0626ea19 100644 --- a/packages/integration-tests/tests/eslint-v8.test.ts +++ b/packages/integration-tests/tests/eslint-v8.test.ts @@ -1,3 +1,3 @@ import { eslintIntegrationTest } from '../tools/integration-test-base'; -eslintIntegrationTest(__filename, '*.ts'); +eslintIntegrationTest(__filename, '*.ts', true); diff --git a/packages/integration-tests/tests/flat-config-types.test.ts b/packages/integration-tests/tests/flat-config-types.test.ts index a8483fba3fc..15c8481b543 100644 --- a/packages/integration-tests/tests/flat-config-types.test.ts +++ b/packages/integration-tests/tests/flat-config-types.test.ts @@ -25,4 +25,4 @@ for (const additionalFlags of [ }, ); } -eslintIntegrationTest(__filename, 'eslint.config.js', true); +eslintIntegrationTest(__filename, 'eslint.config.js'); diff --git a/packages/integration-tests/tests/legacy-config.test.ts b/packages/integration-tests/tests/legacy-config.test.ts new file mode 100644 index 00000000000..69f0626ea19 --- /dev/null +++ b/packages/integration-tests/tests/legacy-config.test.ts @@ -0,0 +1,3 @@ +import { eslintIntegrationTest } from '../tools/integration-test-base'; + +eslintIntegrationTest(__filename, '*.ts', true); diff --git a/packages/integration-tests/tools/integration-test-base.ts b/packages/integration-tests/tools/integration-test-base.ts index 548df55030e..1dd200442bb 100644 --- a/packages/integration-tests/tools/integration-test-base.ts +++ b/packages/integration-tests/tools/integration-test-base.ts @@ -128,7 +128,7 @@ function integrationTest( export function eslintIntegrationTest( testFilename: string, filesGlob: string, - flatConfig = false, + legacyConfig = false, ): void { integrationTest('eslint', testFilename, async testFolder => { // lint, outputting to a JSON file @@ -144,7 +144,7 @@ export function eslintIntegrationTest( '--output-file', outFile, '--config', - flatConfig ? './eslint.config.js' : './.eslintrc.js', + legacyConfig ? './.eslintrc.js' : './eslint.config.js', '--fix-dry-run', filesGlob, ], From 0948bf25d170a4f09d0c5e5ef1ca7b0b5aaa0875 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 29 Apr 2024 23:00:32 -0400 Subject: [PATCH 06/26] put back tmp@0.2.1 --- packages/eslint-plugin/src/rules/no-unused-vars.ts | 3 +++ yarn.lock | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index ad6fd271952..e22ef052cb0 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -433,6 +433,9 @@ export default createRule({ }; context.report({ + node: writeReferences.length + ? writeReferences[writeReferences.length - 1].identifier + : unusedVar.identifiers[0], loc, messageId: 'unusedVar', data: unusedVar.references.some(ref => ref.isWrite()) diff --git a/yarn.lock b/yarn.lock index 125168cd3ad..0bfdf0fe06b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17396,7 +17396,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.2": +"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: @@ -18806,7 +18806,16 @@ __metadata: languageName: node linkType: hard -"tmp@npm:*, tmp@npm:^0.2.3, tmp@npm:~0.2.1": +"tmp@npm:*, tmp@npm:~0.2.1": + version: 0.2.1 + resolution: "tmp@npm:0.2.1" + dependencies: + rimraf: ^3.0.0 + checksum: 8b1214654182575124498c87ca986ac53dc76ff36e8f0e0b67139a8d221eaecfdec108c0e6ec54d76f49f1f72ab9325500b246f562b926f85bcdfca8bf35df9e + languageName: node + linkType: hard + +"tmp@npm:^0.2.3": version: 0.2.3 resolution: "tmp@npm:0.2.3" checksum: 73b5c96b6e52da7e104d9d44afb5d106bb1e16d9fa7d00dbeb9e6522e61b571fbdb165c756c62164be9a3bbe192b9b268c236d370a2a0955c7689cd2ae377b95 From 8bcb0e2766ab56060a14c3f46f16ab4e8160dbce Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 30 Apr 2024 00:37:09 -0400 Subject: [PATCH 07/26] Fixed linting by disabling plugins temporarily --- eslint.config.mjs | 38 +++++++++++-------- packages/eslint-plugin/rules.d.ts | 3 +- .../rules/consistent-type-assertions.test.ts | 3 +- .../rules/strict-boolean-expressions.test.ts | 3 +- packages/typescript-estree/src/convert.ts | 24 ++++++++---- .../typescript-estree/src/getModifiers.ts | 12 ++++-- packages/typescript-estree/src/node-utils.ts | 9 +++-- .../src/ts-estree/estree-to-ts-node-types.ts | 3 +- .../src/ts-estree/ts-nodes.ts | 12 ++++-- .../tests/lib/convert.test.ts | 37 +++++++++++------- packages/utils/src/eslint-utils/context.ts | 3 +- .../components/editor/useSandboxServices.ts | 3 +- .../website/src/components/inputs/Text.tsx | 3 +- packages/website/src/hooks/useMediaQuery.ts | 6 ++- 14 files changed, 103 insertions(+), 56 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index bde1e5edd58..b1188fd79f0 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -95,7 +95,8 @@ export default tseslint.config( }, rules: { // make sure we're not leveraging any deprecated APIs - 'deprecation/deprecation': 'error', + // TODO: Bring this back in once it supports ESLint 9 + // 'deprecation/deprecation': 'error', // TODO(#7130): Investigate changing these in or removing these from presets '@typescript-eslint/no-confusing-void-expression': 'off', @@ -239,11 +240,13 @@ export default tseslint.config( // disallow non-import statements appearing before import statements 'import/first': 'error', // Require a newline after the last import/require in a group - 'import/newline-after-import': 'error', + // TODO: Bring this back in once it supports ESLint 9 + // 'import/newline-after-import': 'error', // Forbid import of modules using absolute paths 'import/no-absolute-path': 'error', // disallow AMD require/define - 'import/no-amd': 'error', + // TODO: Bring this back in once it supports ESLint 9 + // 'import/no-amd': 'error', // forbid default exports - we want to standardize on named exports so that imported names are consistent 'import/no-default-export': 'error', // disallow imports from duplicate paths @@ -258,7 +261,8 @@ export default tseslint.config( }, ], // Forbid mutable exports - 'import/no-mutable-exports': 'error', + // TODO: Bring this back in once it supports ESLint 9 + // 'import/no-mutable-exports': 'error', // Prevent importing the default as if it were named 'import/no-named-default': 'error', // Prohibit named exports @@ -299,7 +303,7 @@ export default tseslint.config( extends: [tseslint.configs.disableTypeChecked], rules: { // turn off other type-aware rules - 'deprecation/deprecation': 'off', + // 'deprecation/deprecation': 'off', '@typescript-eslint/internal/no-poorly-typed-ts-props': 'off', // turn off rules that don't apply to JS code @@ -498,21 +502,25 @@ export default tseslint.config( files: ['packages/website/**/*.{ts,tsx,mts,cts,js,jsx}'], extends: [ ...compat.config(jsxA11yPlugin.configs.recommended), - ...compat.config(reactPlugin.configs.recommended), - ...compat.config(reactHooksPlugin.configs.recommended), + // TODO: Bring this back in once it supports ESLint 9 + // https://github.com/jsx-eslint/eslint-plugin-react/issues/3699 + // ...compat.config(reactPlugin.configs.recommended), + // TODO: Bring this back in once it supports ESLint 9 + // https://github.com/facebook/react/issues/28313 + // ...compat.config(reactHooksPlugin.configs.recommended), ], rules: { '@typescript-eslint/internal/prefer-ast-types-enum': 'off', 'import/no-default-export': 'off', - 'react/jsx-no-target-blank': 'off', - 'react/no-unescaped-entities': 'off', - 'react-hooks/exhaustive-deps': 'warn', // TODO: enable it later - }, - settings: { - react: { - version: 'detect', - }, + // 'react/jsx-no-target-blank': 'off', + // 'react/no-unescaped-entities': 'off', + // 'react-hooks/exhaustive-deps': 'warn', // TODO: enable it later }, + // settings: { + // react: { + // version: 'detect', + // }, + // }, }, { files: ['packages/website/src/**/*.{ts,tsx,cts,mts}'], diff --git a/packages/eslint-plugin/rules.d.ts b/packages/eslint-plugin/rules.d.ts index 71745fe4ef7..24eca40b868 100644 --- a/packages/eslint-plugin/rules.d.ts +++ b/packages/eslint-plugin/rules.d.ts @@ -42,5 +42,6 @@ export type TypeScriptESLintRules = Record< RuleModule >; declare const rules: TypeScriptESLintRules; -// eslint-disable-next-line import/no-default-export +// TODO: Bring this back in once it supports ESLint 9 +// (eslint-disable-next-line) import/no-default-export export default rules; diff --git a/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts index 6d3b64bbfde..a83531f6a91 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts @@ -1,4 +1,5 @@ -/* eslint-disable deprecation/deprecation -- TODO - migrate this test away from `batchedSingleLineTests` */ +// TODO: Bring this back in once it supports ESLint 9 +/* (eslint-disable) deprecation/deprecation -- TODO - migrate this test away from `batchedSingleLineTests` */ import { RuleTester } from '@typescript-eslint/rule-tester'; diff --git a/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts b/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts index bd25e35fe13..0216a029877 100644 --- a/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts @@ -1,4 +1,5 @@ -/* eslint-disable deprecation/deprecation -- TODO - migrate this test away from `batchedSingleLineTests` */ +// TODO: Bring this back in once it supports ESLint 9 +/* (eslint-disable) deprecation/deprecation -- TODO - migrate this test away from `batchedSingleLineTests` */ import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; import * as path from 'path'; diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 5ffe6008d7d..f315e8ca247 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1137,7 +1137,8 @@ export class Converter { } case SyntaxKind.PropertyAssignment: { - // eslint-disable-next-line deprecation/deprecation + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation const { questionToken, exclamationToken } = node; if (questionToken) { @@ -1167,7 +1168,8 @@ export class Converter { } case SyntaxKind.ShorthandPropertyAssignment: { - // eslint-disable-next-line deprecation/deprecation + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation const { modifiers, questionToken, exclamationToken } = node; if (modifiers) { @@ -1889,7 +1891,8 @@ export class Converter { specifiers: [], importKind: 'value', attributes: this.convertImportAttributes( - // eslint-disable-next-line deprecation/deprecation -- TS <5.3 + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation -- TS <5.3 node.attributes ?? node.assertClause, ), }, @@ -1970,7 +1973,8 @@ export class Converter { exportKind: node.isTypeOnly ? 'type' : 'value', declaration: null, attributes: this.convertImportAttributes( - // eslint-disable-next-line deprecation/deprecation -- TS <5.3 + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation -- TS <5.3 node.attributes ?? node.assertClause, ), }, @@ -1993,7 +1997,8 @@ export class Converter { ? this.convertChild(node.exportClause.name) : null, attributes: this.convertImportAttributes( - // eslint-disable-next-line deprecation/deprecation -- TS <5.3 + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation -- TS <5.3 node.attributes ?? node.assertClause, ), }, @@ -2688,7 +2693,8 @@ export class Converter { } case SyntaxKind.PropertySignature: { - // eslint-disable-next-line deprecation/deprecation + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation const { initializer } = node; if (initializer) { this.#throwError( @@ -2737,7 +2743,8 @@ export class Converter { } case SyntaxKind.FunctionType: { - // eslint-disable-next-line deprecation/deprecation + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation const { modifiers } = node; if (modifiers) { this.#throwError( @@ -3214,7 +3221,8 @@ export class Converter { }); } - // eslint-disable-next-line deprecation/deprecation -- required for backwards-compatibility + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation -- required for backwards-compatibility case SyntaxKind.AssertEntry: case SyntaxKind.ImportAttribute: { return this.createNode(node, { diff --git a/packages/typescript-estree/src/getModifiers.ts b/packages/typescript-estree/src/getModifiers.ts index 42609a518c5..b8f0d024fc7 100644 --- a/packages/typescript-estree/src/getModifiers.ts +++ b/packages/typescript-estree/src/getModifiers.ts @@ -13,9 +13,11 @@ export function getModifiers( } if (isAtLeast48) { - // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation -- this is safe as it's guarded if (includeIllegalModifiers || ts.canHaveModifiers(node)) { - // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation -- this is safe as it's guarded const modifiers = ts.getModifiers(node as ts.HasModifiers); return modifiers ? Array.from(modifiers) : undefined; } @@ -40,9 +42,11 @@ export function getDecorators( } if (isAtLeast48) { - // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation -- this is safe as it's guarded if (includeIllegalDecorators || ts.canHaveDecorators(node)) { - // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation -- this is safe as it's guarded const decorators = ts.getDecorators(node as ts.HasDecorators); return decorators ? Array.from(decorators) : undefined; } diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 5dc42f06dbb..ace5fb6a815 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -189,7 +189,8 @@ export function isComment(node: ts.Node): boolean { * @param node the TypeScript node */ function isJSDocComment(node: ts.Node): node is ts.JSDoc { - // eslint-disable-next-line deprecation/deprecation -- SyntaxKind.JSDoc was only added in TS4.7 so we can't use it yet + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation -- SyntaxKind.JSDoc was only added in TS4.7 so we can't use it yet return node.kind === SyntaxKind.JSDocComment; } @@ -523,7 +524,8 @@ export function getTokenType( if (isAtLeast50 && token.kind === SyntaxKind.Identifier) { keywordKind = ts.identifierToKeywordKind(token as ts.Identifier); } else if ('originalKeywordKind' in token) { - // eslint-disable-next-line deprecation/deprecation -- intentional fallback for older TS versions + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation -- intentional fallback for older TS versions keywordKind = token.originalKeywordKind; } if (keywordKind) { @@ -788,7 +790,8 @@ export function firstDefined( export function identifierIsThisKeyword(id: ts.Identifier): boolean { return ( - // eslint-disable-next-line deprecation/deprecation -- intentional for older TS versions + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line deprecation/deprecation) -- intentional for older TS versions (isAtLeast50 ? ts.identifierToKeywordKind(id) : id.originalKeywordKind) === SyntaxKind.ThisKeyword ); diff --git a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts index 1797ffd6230..3f9d50fb0a8 100644 --- a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts +++ b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts @@ -80,7 +80,8 @@ export interface EstreeToTsNodeTypes { // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum [AST_NODE_TYPES.ImportAttribute]: 'ImportAttribute' extends keyof typeof ts ? ts.ImportAttribute - : // eslint-disable-next-line deprecation/deprecation + : // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation ts.AssertEntry; [AST_NODE_TYPES.ImportDeclaration]: ts.ImportDeclaration; [AST_NODE_TYPES.ImportDefaultSpecifier]: ts.ImportClause; diff --git a/packages/typescript-estree/src/ts-estree/ts-nodes.ts b/packages/typescript-estree/src/ts-estree/ts-nodes.ts index 2a07ee0e7ea..eb00d5ea4fc 100644 --- a/packages/typescript-estree/src/ts-estree/ts-nodes.ts +++ b/packages/typescript-estree/src/ts-estree/ts-nodes.ts @@ -24,9 +24,11 @@ export type TSNode = | ts.Identifier | ts.ImportAttribute | ts.ImportAttributes - /* eslint-disable-next-line deprecation/deprecation -- intentional for old TS versions */ + // TODO: Bring this back in once it supports ESLint 9 + /* (eslint-disable-next-line) deprecation/deprecation -- intentional for old TS versions */ | ts.AssertClause - /* eslint-disable-next-line deprecation/deprecation -- intentional for old TS versions */ + // TODO: Bring this back in once it supports ESLint 9 + /* (eslint-disable-next-line) deprecation/deprecation -- intentional for old TS versions */ | ts.AssertEntry | ts.PrivateIdentifier | ts.QualifiedName @@ -185,9 +187,11 @@ export type TSNode = | ts.ExportAssignment | ts.SourceFile | ts.Bundle - /* eslint-disable-next-line deprecation/deprecation -- intentional for old TS versions */ + // TODO: Bring this back in once it supports ESLint 9 + /* (eslint-disable-next-line) deprecation/deprecation -- intentional for old TS versions */ | ts.InputFiles - /* eslint-disable-next-line deprecation/deprecation -- intentional for old TS versions */ + // TODO: Bring this back in once it supports ESLint 9 + /* (eslint-disable-next-line) deprecation/deprecation -- intentional for old TS versions */ | ts.UnparsedSource | ts.JsonMinusNumericLiteral | ts.TemplateLiteralTypeNode diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index 640a3d9946a..ca623f30b87 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -28,8 +28,9 @@ describe('convert', () => { function fakeUnknownKind(node: ts.Node): void { ts.forEachChild(node, fakeUnknownKind); + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation // @ts-expect-error -- intentionally writing to a readonly field - // eslint-disable-next-line deprecation/deprecation node.kind = ts.SyntaxKind.UnparsedPrologue; } @@ -327,7 +328,8 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: false, }); - // eslint-disable-next-line deprecation/deprecation + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation esCallExpression.typeParameters; expect(emitWarning).toHaveBeenCalledWith( @@ -344,10 +346,11 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: false, }); - /* eslint-disable deprecation/deprecation */ + // TODO: Bring this back in once it supports ESLint 9 + /* (eslint-disable) deprecation/deprecation */ esCallExpression.typeParameters; esCallExpression.typeParameters; - /* eslint-enable deprecation/deprecation */ + /* (eslint-enable) deprecation/deprecation */ expect(emitWarning).toHaveBeenCalledTimes(1); }); @@ -360,7 +363,8 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: true, }); - // eslint-disable-next-line deprecation/deprecation + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation esCallExpression.typeParameters; expect(emitWarning).not.toHaveBeenCalled(); @@ -375,10 +379,12 @@ describe('convert', () => { it('allows writing to the deprecated aliased property as a new enumerable value', () => { const esCallExpression = getEsCallExpression(); - // eslint-disable-next-line deprecation/deprecation + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation esCallExpression.typeParameters = undefined; - // eslint-disable-next-line deprecation/deprecation + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation expect(esCallExpression.typeParameters).toBeUndefined(); expect(Object.keys(esCallExpression)).toContain('typeParameters'); }); @@ -391,7 +397,8 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: false, }); - // eslint-disable-next-line deprecation/deprecation + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation tsMappedType.typeParameter; expect(emitWarning).toHaveBeenCalledWith( @@ -408,10 +415,11 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: false, }); - /* eslint-disable deprecation/deprecation */ + // TODO: Bring this back in once it supports ESLint 9 + /* (eslint-disable) deprecation/deprecation */ tsMappedType.typeParameter; tsMappedType.typeParameter; - /* eslint-enable deprecation/deprecation */ + /* (eslint-enable) deprecation/deprecation */ expect(emitWarning).toHaveBeenCalledTimes(1); }); @@ -424,7 +432,8 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: true, }); - // eslint-disable-next-line deprecation/deprecation + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation tsMappedType.typeParameter; expect(emitWarning).not.toHaveBeenCalled(); @@ -439,10 +448,12 @@ describe('convert', () => { it('allows writing to the deprecated getter property as a new enumerable value', () => { const tsMappedType = getTsMappedType(); - // eslint-disable-next-line deprecation/deprecation + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation tsMappedType.typeParameter = undefined!; - // eslint-disable-next-line deprecation/deprecation + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation expect(tsMappedType.typeParameter).toBeUndefined(); expect(Object.keys(tsMappedType)).toContain('typeParameter'); }); diff --git a/packages/utils/src/eslint-utils/context.ts b/packages/utils/src/eslint-utils/context.ts index 1229d72dbaf..b0277daa0d6 100644 --- a/packages/utils/src/eslint-utils/context.ts +++ b/packages/utils/src/eslint-utils/context.ts @@ -1,5 +1,6 @@ // Wrappers around ESLint's deprecation of existing methods -/* eslint-disable deprecation/deprecation -- TODO - delete in the next major (v8) */ +// TODO: Bring this back in once it supports ESLint 9 +/* (eslint-disable) deprecation/deprecation -- TODO - delete in the next major (v8) */ import type { Scope, SourceCode } from '../ts-eslint'; import type { RuleContext } from '../ts-eslint/Rule'; import type { TSESTree } from '../ts-estree'; diff --git a/packages/website/src/components/editor/useSandboxServices.ts b/packages/website/src/components/editor/useSandboxServices.ts index c2855c8af6c..01936726359 100644 --- a/packages/website/src/components/editor/useSandboxServices.ts +++ b/packages/website/src/components/editor/useSandboxServices.ts @@ -146,7 +146,8 @@ export const useSandboxServices = ( }; // colorMode and jsx can't be reactive here because we don't want to force a recreation // updating of colorMode and jsx is handled in LoadedEditor - // eslint-disable-next-line react-hooks/exhaustive-deps + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) react-hooks/exhaustive-deps }, []); return services; diff --git a/packages/website/src/components/inputs/Text.tsx b/packages/website/src/components/inputs/Text.tsx index 71f921fc67e..b93d8c0123a 100644 --- a/packages/website/src/components/inputs/Text.tsx +++ b/packages/website/src/components/inputs/Text.tsx @@ -12,7 +12,8 @@ export interface DropdownProps { readonly placeholder?: string; } -// eslint-disable-next-line react/display-name +// TODO: Bring this back in once it supports ESLint 9 +// (eslint-disable-next-line) react/display-name const Text = React.forwardRef( (props, ref): React.JSX.Element => { return ( diff --git a/packages/website/src/hooks/useMediaQuery.ts b/packages/website/src/hooks/useMediaQuery.ts index 422570aee8e..3e4a07350f5 100644 --- a/packages/website/src/hooks/useMediaQuery.ts +++ b/packages/website/src/hooks/useMediaQuery.ts @@ -24,7 +24,8 @@ const useMediaQuery = (mediaQuery: string): boolean => { mediaQueryList.addEventListener('change', documentChangeHandler); } catch { // Safari isn't supporting mediaQueryList.addEventListener - // eslint-disable-next-line deprecation/deprecation + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation mediaQueryList.addListener(documentChangeHandler); } @@ -34,7 +35,8 @@ const useMediaQuery = (mediaQuery: string): boolean => { mediaQueryList.removeEventListener('change', documentChangeHandler); } catch { // Safari isn't supporting mediaQueryList.removeEventListener - // eslint-disable-next-line deprecation/deprecation + // TODO: Bring this back in once it supports ESLint 9 + // (eslint-disable-next-line) deprecation/deprecation mediaQueryList.removeListener(documentChangeHandler); } }; From e9b890823b071e79333562098862d8bec979cdff Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 30 Apr 2024 00:48:36 -0400 Subject: [PATCH 08/26] Update two more integration snapshots for no-unused-vars --- .../tests/__snapshots__/flat-config-types.test.ts.snap | 2 +- .../recommended-does-not-require-program.test.ts.snap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap b/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap index e6313ebeb82..31c182ce621 100644 --- a/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap @@ -16,7 +16,7 @@ exports[`flat-config-types eslint should work successfully 1`] = ` "line": 38, "message": "'_otherCases' is defined but never used.", "messageId": "unusedVar", - "nodeType": null, + "nodeType": "Identifier", "ruleId": "@typescript-eslint/no-unused-vars", "severity": 2, }, diff --git a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap index 059dfb803b0..163984f5636 100644 --- a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap @@ -16,7 +16,7 @@ exports[`recommended-does-not-require-program eslint should work successfully 1` "line": 1, "message": "'foo' is assigned a value but never used.", "messageId": "unusedVar", - "nodeType": null, + "nodeType": "Identifier, "ruleId": "@typescript-eslint/no-unused-vars", "severity": 2, }, From 1fc6fa2b5cc1da040586ee4486c10f2a1f5d937b Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 30 Apr 2024 00:57:45 -0400 Subject: [PATCH 09/26] Ugh, missing " --- .../recommended-does-not-require-program.test.ts.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap index 163984f5636..3f4ca88387b 100644 --- a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap @@ -16,7 +16,7 @@ exports[`recommended-does-not-require-program eslint should work successfully 1` "line": 1, "message": "'foo' is assigned a value but never used.", "messageId": "unusedVar", - "nodeType": "Identifier, + "nodeType": "Identifier", "ruleId": "@typescript-eslint/no-unused-vars", "severity": 2, }, From e05317915fe57efde6f7bb6d78208472666725ec Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 6 May 2024 18:14:40 -0700 Subject: [PATCH 10/26] Remove legacy rule function form --- packages/rule-tester/src/RuleTester.ts | 5 ++-- .../src/eslint-utils/InferTypesFromRule.ts | 12 +++------- packages/utils/src/ts-eslint/Linter.ts | 23 ++++--------------- packages/utils/src/ts-eslint/Rule.ts | 20 ++++------------ packages/utils/src/ts-eslint/RuleTester.ts | 5 +--- 5 files changed, 14 insertions(+), 51 deletions(-) diff --git a/packages/rule-tester/src/RuleTester.ts b/packages/rule-tester/src/RuleTester.ts index 3deea7fd224..1d4b1878405 100644 --- a/packages/rule-tester/src/RuleTester.ts +++ b/packages/rule-tester/src/RuleTester.ts @@ -9,7 +9,6 @@ import type * as ParserType from '@typescript-eslint/parser'; import type { TSESTree } from '@typescript-eslint/utils'; import { deepMerge } from '@typescript-eslint/utils/eslint-utils'; import type { - AnyRuleCreateFunction, AnyRuleModule, Parser, ParserOptions, @@ -75,7 +74,7 @@ let defaultConfig = deepMerge( export class RuleTester extends TestFramework { readonly #testerConfig: TesterConfigWithDefaults; - readonly #rules: Record = {}; + readonly #rules: Record = {}; readonly #linter: Linter = new Linter({ configType: 'eslintrc' }); /** @@ -171,7 +170,7 @@ export class RuleTester extends TestFramework { /** * Define a rule for one particular run of tests. */ - defineRule(name: string, rule: AnyRuleCreateFunction | AnyRuleModule): void { + defineRule(name: string, rule: AnyRuleModule): void { this.#rules[name] = rule; } diff --git a/packages/utils/src/eslint-utils/InferTypesFromRule.ts b/packages/utils/src/eslint-utils/InferTypesFromRule.ts index c716912cdf1..195f5c6e48d 100644 --- a/packages/utils/src/eslint-utils/InferTypesFromRule.ts +++ b/packages/utils/src/eslint-utils/InferTypesFromRule.ts @@ -1,14 +1,10 @@ -import type { RuleCreateFunction, RuleModule } from '../ts-eslint'; +import type { RuleModule } from '../ts-eslint'; /** * Uses type inference to fetch the Options type from the given RuleModule */ type InferOptionsTypeFromRule = - T extends RuleModule - ? Options - : T extends RuleCreateFunction - ? Options - : unknown; + T extends RuleModule ? Options : unknown; /** * Uses type inference to fetch the MessageIds type from the given RuleModule @@ -16,8 +12,6 @@ type InferOptionsTypeFromRule = type InferMessageIdsTypeFromRule = T extends RuleModule ? MessageIds - : T extends RuleCreateFunction - ? MessageIds - : unknown; + : unknown; export { InferOptionsTypeFromRule, InferMessageIdsTypeFromRule }; diff --git a/packages/utils/src/ts-eslint/Linter.ts b/packages/utils/src/ts-eslint/Linter.ts index bad397d8cfb..012ab2a005c 100644 --- a/packages/utils/src/ts-eslint/Linter.ts +++ b/packages/utils/src/ts-eslint/Linter.ts @@ -5,13 +5,7 @@ import { Linter as ESLintLinter } from 'eslint'; import type { ClassicConfig, FlatConfig, SharedConfig } from './Config'; import type { Parser } from './Parser'; import type { Processor as ProcessorType } from './Processor'; -import type { - AnyRuleCreateFunction, - AnyRuleModule, - RuleCreateFunction, - RuleFix, - RuleModule, -} from './Rule'; +import type { AnyRuleModule, RuleFix, RuleModule } from './Rule'; import type { SourceCode } from './SourceCode'; export type MinimalRuleModule< @@ -41,7 +35,7 @@ declare class LinterBase { */ defineRule( ruleId: string, - ruleModule: MinimalRuleModule | RuleCreateFunction, + ruleModule: MinimalRuleModule, ): void; /** @@ -49,11 +43,7 @@ declare class LinterBase { * @param rulesToDefine map from unique rule identifier to rule */ defineRules( - rulesToDefine: Record< - string, - | MinimalRuleModule - | RuleCreateFunction - >, + rulesToDefine: Record>, ): void; /** @@ -276,11 +266,6 @@ namespace Linter { parserOptions?: ParserOptions; } - // TODO - RuleCreateFunction is no longer supported in ESLint v9 - export type LegacyPluginRules = Record< - string, - AnyRuleCreateFunction | AnyRuleModule - >; export type PluginRules = Record; export interface Plugin { @@ -303,7 +288,7 @@ namespace Linter { /** * The definition of plugin rules. */ - rules?: LegacyPluginRules; + rules?: PluginRules; } } diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 838a55217a8..04eea3270f3 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -663,13 +663,10 @@ export type AnyRuleModule = RuleModule; * * @see {@link LooseParserModule}, {@link LooseProcessorModule} */ -export type LooseRuleDefinition = - // TODO - ESLint v9 will remove support for RuleCreateFunction - | LooseRuleCreateFunction - | { - meta?: object | undefined; - create: LooseRuleCreateFunction; - }; +export interface LooseRuleDefinition { + meta?: object | undefined; + create: LooseRuleCreateFunction; +} /* eslint-disable-next-line @typescript-eslint/no-explicit-any -- intentionally using `any` to allow bi-directional assignment (unknown and @@ -685,12 +682,3 @@ export type LooseRuleCreateFunction = (context: any) => Record< */ Function | undefined >; - -export type RuleCreateFunction< - MessageIds extends string = never, - Options extends readonly unknown[] = unknown[], -> = (context: Readonly>) => RuleListener; -export type AnyRuleCreateFunction = RuleCreateFunction< - string, - readonly unknown[] ->; diff --git a/packages/utils/src/ts-eslint/RuleTester.ts b/packages/utils/src/ts-eslint/RuleTester.ts index 11696716222..f63900e57cb 100644 --- a/packages/utils/src/ts-eslint/RuleTester.ts +++ b/packages/utils/src/ts-eslint/RuleTester.ts @@ -6,7 +6,6 @@ import type { Linter } from './Linter'; import type { ParserOptions } from './ParserOptions'; import type { ReportDescriptorMessageData, - RuleCreateFunction, RuleModule, SharedConfigurationSettings, } from './Rule'; @@ -192,9 +191,7 @@ declare class RuleTesterBase { */ defineRule>( name: string, - rule: - | RuleCreateFunction - | RuleModule, + rule: RuleModule, ): void; } From 6b6e249ef9d9b7c6f49a37bc38bb217e6b345431 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 08:19:35 -0700 Subject: [PATCH 11/26] Fix legacy-config test to actually use legacy config --- .../fixtures/legacy-config/.eslintrc.js | 26 +++++++------------ .../tools/integration-test-base.ts | 1 + 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/packages/integration-tests/fixtures/legacy-config/.eslintrc.js b/packages/integration-tests/fixtures/legacy-config/.eslintrc.js index cec5c9bcb57..952635144b8 100644 --- a/packages/integration-tests/fixtures/legacy-config/.eslintrc.js +++ b/packages/integration-tests/fixtures/legacy-config/.eslintrc.js @@ -1,23 +1,17 @@ -const eslint = require('@eslint/js'); -const tseslint = require('typescript-eslint'); - -module.exports = tseslint.config({ +module.exports = { extends: [ - eslint.configs.recommended, - ...tseslint.configs.recommendedTypeChecked, + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended-type-checked', ], - languageOptions: { - parser: tseslint.parser, - parserOptions: { - project: true, - tsconfigRootDir: __dirname, - }, - }, - plugins: { - '@typescript-eslint': tseslint.plugin, + root: true, + parser: '@typescript-eslint/parser', + parserOptions: { + project: true, + tsconfigRootDir: __dirname, }, + plugins: ['@typescript-eslint'], rules: { '@typescript-eslint/no-unsafe-argument': 'warn', '@typescript-eslint/no-unsafe-return': 'warn', }, -}); +}; diff --git a/packages/integration-tests/tools/integration-test-base.ts b/packages/integration-tests/tools/integration-test-base.ts index 1dd200442bb..9c91dab9b52 100644 --- a/packages/integration-tests/tools/integration-test-base.ts +++ b/packages/integration-tests/tools/integration-test-base.ts @@ -149,6 +149,7 @@ export function eslintIntegrationTest( filesGlob, ], { + env: legacyConfig ? { ESLINT_USE_FLAT_CONFIG: 'false' } : undefined, cwd: testFolder, }, ); From bc6d611e6a7075f0d46f9d273fe0371aa1fbc27e Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 08:19:57 -0700 Subject: [PATCH 12/26] Revert "Remove legacy rule function form" This reverts commit e05317915fe57efde6f7bb6d78208472666725ec. --- packages/rule-tester/src/RuleTester.ts | 5 ++-- .../src/eslint-utils/InferTypesFromRule.ts | 12 +++++++--- packages/utils/src/ts-eslint/Linter.ts | 23 +++++++++++++++---- packages/utils/src/ts-eslint/Rule.ts | 20 ++++++++++++---- packages/utils/src/ts-eslint/RuleTester.ts | 5 +++- 5 files changed, 51 insertions(+), 14 deletions(-) diff --git a/packages/rule-tester/src/RuleTester.ts b/packages/rule-tester/src/RuleTester.ts index 1d4b1878405..3deea7fd224 100644 --- a/packages/rule-tester/src/RuleTester.ts +++ b/packages/rule-tester/src/RuleTester.ts @@ -9,6 +9,7 @@ import type * as ParserType from '@typescript-eslint/parser'; import type { TSESTree } from '@typescript-eslint/utils'; import { deepMerge } from '@typescript-eslint/utils/eslint-utils'; import type { + AnyRuleCreateFunction, AnyRuleModule, Parser, ParserOptions, @@ -74,7 +75,7 @@ let defaultConfig = deepMerge( export class RuleTester extends TestFramework { readonly #testerConfig: TesterConfigWithDefaults; - readonly #rules: Record = {}; + readonly #rules: Record = {}; readonly #linter: Linter = new Linter({ configType: 'eslintrc' }); /** @@ -170,7 +171,7 @@ export class RuleTester extends TestFramework { /** * Define a rule for one particular run of tests. */ - defineRule(name: string, rule: AnyRuleModule): void { + defineRule(name: string, rule: AnyRuleCreateFunction | AnyRuleModule): void { this.#rules[name] = rule; } diff --git a/packages/utils/src/eslint-utils/InferTypesFromRule.ts b/packages/utils/src/eslint-utils/InferTypesFromRule.ts index 195f5c6e48d..c716912cdf1 100644 --- a/packages/utils/src/eslint-utils/InferTypesFromRule.ts +++ b/packages/utils/src/eslint-utils/InferTypesFromRule.ts @@ -1,10 +1,14 @@ -import type { RuleModule } from '../ts-eslint'; +import type { RuleCreateFunction, RuleModule } from '../ts-eslint'; /** * Uses type inference to fetch the Options type from the given RuleModule */ type InferOptionsTypeFromRule = - T extends RuleModule ? Options : unknown; + T extends RuleModule + ? Options + : T extends RuleCreateFunction + ? Options + : unknown; /** * Uses type inference to fetch the MessageIds type from the given RuleModule @@ -12,6 +16,8 @@ type InferOptionsTypeFromRule = type InferMessageIdsTypeFromRule = T extends RuleModule ? MessageIds - : unknown; + : T extends RuleCreateFunction + ? MessageIds + : unknown; export { InferOptionsTypeFromRule, InferMessageIdsTypeFromRule }; diff --git a/packages/utils/src/ts-eslint/Linter.ts b/packages/utils/src/ts-eslint/Linter.ts index 012ab2a005c..bad397d8cfb 100644 --- a/packages/utils/src/ts-eslint/Linter.ts +++ b/packages/utils/src/ts-eslint/Linter.ts @@ -5,7 +5,13 @@ import { Linter as ESLintLinter } from 'eslint'; import type { ClassicConfig, FlatConfig, SharedConfig } from './Config'; import type { Parser } from './Parser'; import type { Processor as ProcessorType } from './Processor'; -import type { AnyRuleModule, RuleFix, RuleModule } from './Rule'; +import type { + AnyRuleCreateFunction, + AnyRuleModule, + RuleCreateFunction, + RuleFix, + RuleModule, +} from './Rule'; import type { SourceCode } from './SourceCode'; export type MinimalRuleModule< @@ -35,7 +41,7 @@ declare class LinterBase { */ defineRule( ruleId: string, - ruleModule: MinimalRuleModule, + ruleModule: MinimalRuleModule | RuleCreateFunction, ): void; /** @@ -43,7 +49,11 @@ declare class LinterBase { * @param rulesToDefine map from unique rule identifier to rule */ defineRules( - rulesToDefine: Record>, + rulesToDefine: Record< + string, + | MinimalRuleModule + | RuleCreateFunction + >, ): void; /** @@ -266,6 +276,11 @@ namespace Linter { parserOptions?: ParserOptions; } + // TODO - RuleCreateFunction is no longer supported in ESLint v9 + export type LegacyPluginRules = Record< + string, + AnyRuleCreateFunction | AnyRuleModule + >; export type PluginRules = Record; export interface Plugin { @@ -288,7 +303,7 @@ namespace Linter { /** * The definition of plugin rules. */ - rules?: PluginRules; + rules?: LegacyPluginRules; } } diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 04eea3270f3..838a55217a8 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -663,10 +663,13 @@ export type AnyRuleModule = RuleModule; * * @see {@link LooseParserModule}, {@link LooseProcessorModule} */ -export interface LooseRuleDefinition { - meta?: object | undefined; - create: LooseRuleCreateFunction; -} +export type LooseRuleDefinition = + // TODO - ESLint v9 will remove support for RuleCreateFunction + | LooseRuleCreateFunction + | { + meta?: object | undefined; + create: LooseRuleCreateFunction; + }; /* eslint-disable-next-line @typescript-eslint/no-explicit-any -- intentionally using `any` to allow bi-directional assignment (unknown and @@ -682,3 +685,12 @@ export type LooseRuleCreateFunction = (context: any) => Record< */ Function | undefined >; + +export type RuleCreateFunction< + MessageIds extends string = never, + Options extends readonly unknown[] = unknown[], +> = (context: Readonly>) => RuleListener; +export type AnyRuleCreateFunction = RuleCreateFunction< + string, + readonly unknown[] +>; diff --git a/packages/utils/src/ts-eslint/RuleTester.ts b/packages/utils/src/ts-eslint/RuleTester.ts index f63900e57cb..11696716222 100644 --- a/packages/utils/src/ts-eslint/RuleTester.ts +++ b/packages/utils/src/ts-eslint/RuleTester.ts @@ -6,6 +6,7 @@ import type { Linter } from './Linter'; import type { ParserOptions } from './ParserOptions'; import type { ReportDescriptorMessageData, + RuleCreateFunction, RuleModule, SharedConfigurationSettings, } from './Rule'; @@ -191,7 +192,9 @@ declare class RuleTesterBase { */ defineRule>( name: string, - rule: RuleModule, + rule: + | RuleCreateFunction + | RuleModule, ): void; } From 0451e84575a5d4b39e9cb7ac309ec428de0cdf0f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 08:25:43 -0700 Subject: [PATCH 13/26] Update ESLint 8/9 RuleCreateFunction comments --- packages/utils/src/ts-eslint/Linter.ts | 2 +- packages/utils/src/ts-eslint/Rule.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/utils/src/ts-eslint/Linter.ts b/packages/utils/src/ts-eslint/Linter.ts index bad397d8cfb..4e0f5ead0bd 100644 --- a/packages/utils/src/ts-eslint/Linter.ts +++ b/packages/utils/src/ts-eslint/Linter.ts @@ -276,7 +276,7 @@ namespace Linter { parserOptions?: ParserOptions; } - // TODO - RuleCreateFunction is no longer supported in ESLint v9 + // TODO - remove RuleCreateFunction once we no longer support ESLint 8 export type LegacyPluginRules = Record< string, AnyRuleCreateFunction | AnyRuleModule diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 838a55217a8..dcac3f5789f 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -664,7 +664,7 @@ export type AnyRuleModule = RuleModule; * @see {@link LooseParserModule}, {@link LooseProcessorModule} */ export type LooseRuleDefinition = - // TODO - ESLint v9 will remove support for RuleCreateFunction + // TODO - remove RuleCreateFunction once we no longer support ESLint 8 | LooseRuleCreateFunction | { meta?: object | undefined; From 129eb6510348c1199615a8b35b77ba662e7487d7 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 17:29:33 -0700 Subject: [PATCH 14/26] Start reverting the local dev changes --- eslint.config.mjs | 20 +-- package.json | 8 +- packages/eslint-plugin/rules.d.ts | 3 +- .../rules/consistent-type-assertions.test.ts | 3 +- .../rules/strict-boolean-expressions.test.ts | 3 +- .../fixtures/legacy-config/.eslintrc.js | 17 -- .../fixtures/legacy-config/file.ts | 8 - .../fixtures/legacy-config/package.json | 1 - .../fixtures/legacy-config/tsconfig.json | 7 - .../fixtures/markdown/.eslintrc.js | 30 ++++ .../.eslintrc.js | 14 ++ .../fixtures/vue-jsx/.eslintrc.js | 21 +++ .../fixtures/vue-sfc/.eslintrc.js | 21 +++ .../fixtures/vue-sfc/package.json | 6 +- .../flat-config-types.test.ts.snap | 2 +- .../__snapshots__/legacy-config.test.ts.snap | 130 --------------- ...nded-does-not-require-program.test.ts.snap | 13 +- .../tests/__snapshots__/vue-sfc.test.ts.snap | 6 +- .../integration-tests/tests/eslint-v8.test.ts | 2 +- .../tests/flat-config-types.test.ts | 2 +- .../tests/legacy-config.test.ts | 3 - .../tools/integration-test-base.ts | 5 +- packages/typescript-estree/src/convert.ts | 24 +-- .../typescript-estree/src/getModifiers.ts | 12 +- packages/typescript-estree/src/node-utils.ts | 9 +- .../src/ts-estree/estree-to-ts-node-types.ts | 3 +- .../src/ts-estree/ts-nodes.ts | 12 +- .../tests/lib/convert.test.ts | 37 ++--- .../components/editor/useSandboxServices.ts | 3 +- .../website/src/components/inputs/Text.tsx | 3 +- packages/website/src/hooks/useMediaQuery.ts | 6 +- yarn.lock | 148 +++++++++++------- 32 files changed, 252 insertions(+), 330 deletions(-) delete mode 100644 packages/integration-tests/fixtures/legacy-config/.eslintrc.js delete mode 100644 packages/integration-tests/fixtures/legacy-config/file.ts delete mode 100644 packages/integration-tests/fixtures/legacy-config/package.json delete mode 100644 packages/integration-tests/fixtures/legacy-config/tsconfig.json create mode 100644 packages/integration-tests/fixtures/markdown/.eslintrc.js create mode 100644 packages/integration-tests/fixtures/recommended-does-not-require-program/.eslintrc.js create mode 100644 packages/integration-tests/fixtures/vue-jsx/.eslintrc.js create mode 100644 packages/integration-tests/fixtures/vue-sfc/.eslintrc.js delete mode 100644 packages/integration-tests/tests/__snapshots__/legacy-config.test.ts.snap delete mode 100644 packages/integration-tests/tests/legacy-config.test.ts diff --git a/eslint.config.mjs b/eslint.config.mjs index b1188fd79f0..077640ec24e 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -95,8 +95,7 @@ export default tseslint.config( }, rules: { // make sure we're not leveraging any deprecated APIs - // TODO: Bring this back in once it supports ESLint 9 - // 'deprecation/deprecation': 'error', + 'deprecation/deprecation': 'error', // TODO(#7130): Investigate changing these in or removing these from presets '@typescript-eslint/no-confusing-void-expression': 'off', @@ -240,13 +239,11 @@ export default tseslint.config( // disallow non-import statements appearing before import statements 'import/first': 'error', // Require a newline after the last import/require in a group - // TODO: Bring this back in once it supports ESLint 9 - // 'import/newline-after-import': 'error', + 'import/newline-after-import': 'error', // Forbid import of modules using absolute paths 'import/no-absolute-path': 'error', // disallow AMD require/define - // TODO: Bring this back in once it supports ESLint 9 - // 'import/no-amd': 'error', + 'import/no-amd': 'error', // forbid default exports - we want to standardize on named exports so that imported names are consistent 'import/no-default-export': 'error', // disallow imports from duplicate paths @@ -261,8 +258,7 @@ export default tseslint.config( }, ], // Forbid mutable exports - // TODO: Bring this back in once it supports ESLint 9 - // 'import/no-mutable-exports': 'error', + 'import/no-mutable-exports': 'error', // Prevent importing the default as if it were named 'import/no-named-default': 'error', // Prohibit named exports @@ -502,12 +498,8 @@ export default tseslint.config( files: ['packages/website/**/*.{ts,tsx,mts,cts,js,jsx}'], extends: [ ...compat.config(jsxA11yPlugin.configs.recommended), - // TODO: Bring this back in once it supports ESLint 9 - // https://github.com/jsx-eslint/eslint-plugin-react/issues/3699 - // ...compat.config(reactPlugin.configs.recommended), - // TODO: Bring this back in once it supports ESLint 9 - // https://github.com/facebook/react/issues/28313 - // ...compat.config(reactHooksPlugin.configs.recommended), + ...compat.config(reactPlugin.configs.recommended), + ...compat.config(reactHooksPlugin.configs.recommended), ], rules: { '@typescript-eslint/internal/prefer-ast-types-enum': 'off', diff --git a/package.json b/package.json index 19d2fa7c199..751e12977bc 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "@babel/eslint-parser": "^7.24.1", "@babel/parser": "^7.24.4", "@babel/types": "^7.24.0", - "@eslint/eslintrc": "^3.0.2", + "@eslint/eslintrc": "^2.1.4", "@eslint/js": "^8.57.0", "@nx/eslint": "18.2.3", "@nx/jest": "18.2.3", @@ -87,7 +87,7 @@ "cross-fetch": "^4.0.0", "cspell": "^8.6.1", "downlevel-dts": ">=0.11.0", - "eslint": "9.1.1", + "eslint": "8.57.0", "eslint-plugin-deprecation": "^2.0.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-eslint-plugin": "^5.5.0", @@ -124,8 +124,6 @@ "yargs": "17.7.2" }, "resolutions": { - "@eslint/eslintrc": "^3.0.2", - "@eslint/js": "9.1.1", "@jest/create-cache-key-function": "^29", "@jest/reporters": "^29", "@jest/test-result": "^29", @@ -135,7 +133,7 @@ "@types/estree": "link:./tools/dummypkg", "@types/node": "^20.0.0", "@types/react": "^18.2.14", - "eslint": "9.1.1", + "eslint": "8.57.0", "eslint-visitor-keys": "^3.4.1", "jest-config": "^29", "jest-resolve": "^29", diff --git a/packages/eslint-plugin/rules.d.ts b/packages/eslint-plugin/rules.d.ts index 24eca40b868..71745fe4ef7 100644 --- a/packages/eslint-plugin/rules.d.ts +++ b/packages/eslint-plugin/rules.d.ts @@ -42,6 +42,5 @@ export type TypeScriptESLintRules = Record< RuleModule >; declare const rules: TypeScriptESLintRules; -// TODO: Bring this back in once it supports ESLint 9 -// (eslint-disable-next-line) import/no-default-export +// eslint-disable-next-line import/no-default-export export default rules; diff --git a/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts index a83531f6a91..6d3b64bbfde 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts @@ -1,5 +1,4 @@ -// TODO: Bring this back in once it supports ESLint 9 -/* (eslint-disable) deprecation/deprecation -- TODO - migrate this test away from `batchedSingleLineTests` */ +/* eslint-disable deprecation/deprecation -- TODO - migrate this test away from `batchedSingleLineTests` */ import { RuleTester } from '@typescript-eslint/rule-tester'; diff --git a/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts b/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts index 0216a029877..bd25e35fe13 100644 --- a/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts @@ -1,5 +1,4 @@ -// TODO: Bring this back in once it supports ESLint 9 -/* (eslint-disable) deprecation/deprecation -- TODO - migrate this test away from `batchedSingleLineTests` */ +/* eslint-disable deprecation/deprecation -- TODO - migrate this test away from `batchedSingleLineTests` */ import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; import * as path from 'path'; diff --git a/packages/integration-tests/fixtures/legacy-config/.eslintrc.js b/packages/integration-tests/fixtures/legacy-config/.eslintrc.js deleted file mode 100644 index 952635144b8..00000000000 --- a/packages/integration-tests/fixtures/legacy-config/.eslintrc.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended-type-checked', - ], - root: true, - parser: '@typescript-eslint/parser', - parserOptions: { - project: true, - tsconfigRootDir: __dirname, - }, - plugins: ['@typescript-eslint'], - rules: { - '@typescript-eslint/no-unsafe-argument': 'warn', - '@typescript-eslint/no-unsafe-return': 'warn', - }, -}; diff --git a/packages/integration-tests/fixtures/legacy-config/file.ts b/packages/integration-tests/fixtures/legacy-config/file.ts deleted file mode 100644 index ab56ced38be..00000000000 --- a/packages/integration-tests/fixtures/legacy-config/file.ts +++ /dev/null @@ -1,8 +0,0 @@ -async function unsafeLog(...values: any[]) { - for (const value of values) { - console.log(value.toUpperCase()); - } - return values; -} - -unsafeLog(); diff --git a/packages/integration-tests/fixtures/legacy-config/package.json b/packages/integration-tests/fixtures/legacy-config/package.json deleted file mode 100644 index 0967ef424bc..00000000000 --- a/packages/integration-tests/fixtures/legacy-config/package.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/packages/integration-tests/fixtures/legacy-config/tsconfig.json b/packages/integration-tests/fixtures/legacy-config/tsconfig.json deleted file mode 100644 index d75abccdc38..00000000000 --- a/packages/integration-tests/fixtures/legacy-config/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "noEmit": true, - "strict": true - }, - "include": ["file.ts"] -} diff --git a/packages/integration-tests/fixtures/markdown/.eslintrc.js b/packages/integration-tests/fixtures/markdown/.eslintrc.js new file mode 100644 index 00000000000..9dd8a5505b9 --- /dev/null +++ b/packages/integration-tests/fixtures/markdown/.eslintrc.js @@ -0,0 +1,30 @@ +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + env: { + es6: true, + node: true, + }, + parserOptions: { + sourceType: 'module', + extraFileExtensions: ['.vue'], + ecmaFeatures: { + jsx: true, + }, + }, + plugins: ['markdown', '@typescript-eslint'], + overrides: [ + { + // this will also ensure that eslint will force lint the markdown files + files: ['**/*.md'], + processor: 'markdown/markdown', + }, + { + files: ['**/*.md/*.{js,ts,jsx,tsx,javascript,node}'], + rules: { + '@typescript-eslint/no-explicit-any': 'error', + 'no-console': 'error', + }, + }, + ], +}; diff --git a/packages/integration-tests/fixtures/recommended-does-not-require-program/.eslintrc.js b/packages/integration-tests/fixtures/recommended-does-not-require-program/.eslintrc.js new file mode 100644 index 00000000000..0f28905d8de --- /dev/null +++ b/packages/integration-tests/fixtures/recommended-does-not-require-program/.eslintrc.js @@ -0,0 +1,14 @@ +// This integration test exists to make sure that the recommended config does +// not require a program to be specified to ensure a fast and simple initial +// setup. Users can add on one of our other configs if they want to opt in to +// more expensive checks. +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + ], + plugins: ['@typescript-eslint'], +}; diff --git a/packages/integration-tests/fixtures/vue-jsx/.eslintrc.js b/packages/integration-tests/fixtures/vue-jsx/.eslintrc.js new file mode 100644 index 00000000000..750fe39d0bd --- /dev/null +++ b/packages/integration-tests/fixtures/vue-jsx/.eslintrc.js @@ -0,0 +1,21 @@ +module.exports = { + root: true, + parser: 'vue-eslint-parser', + env: { + es6: true, + node: true, + }, + extends: ['plugin:vue/essential'], + parserOptions: { + parser: '@typescript-eslint/parser', + sourceType: 'module', + extraFileExtensions: ['.vue'], + ecmaFeatures: { + jsx: true, + }, + }, + plugins: ['@typescript-eslint'], + rules: { + '@typescript-eslint/no-explicit-any': 'error', + }, +}; diff --git a/packages/integration-tests/fixtures/vue-sfc/.eslintrc.js b/packages/integration-tests/fixtures/vue-sfc/.eslintrc.js new file mode 100644 index 00000000000..3306fe23755 --- /dev/null +++ b/packages/integration-tests/fixtures/vue-sfc/.eslintrc.js @@ -0,0 +1,21 @@ +module.exports = { + root: true, + parser: 'vue-eslint-parser', + env: { + es6: true, + node: true, + }, + extends: ['plugin:vue/essential'], + parserOptions: { + parser: '@typescript-eslint/parser', + project: '/usr/linked/tsconfig.json', + sourceType: 'module', + extraFileExtensions: ['.vue'], + }, + plugins: ['@typescript-eslint'], + rules: { + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/no-unnecessary-type-assertion': 'error', + 'semi-spacing': 'error', + }, +}; diff --git a/packages/integration-tests/fixtures/vue-sfc/package.json b/packages/integration-tests/fixtures/vue-sfc/package.json index b2f88af8ea5..bef3a893533 100644 --- a/packages/integration-tests/fixtures/vue-sfc/package.json +++ b/packages/integration-tests/fixtures/vue-sfc/package.json @@ -1,8 +1,8 @@ { "devDependencies": { + "vue-eslint-parser": "latest", "eslint-plugin-vue": "latest", - "vue-eslint-parser": "^9.4.2", - "vue-property-decorator": "^9.1.2", - "vuex": "^4.1.0" + "vuex": "latest", + "vue-property-decorator": "latest" } } diff --git a/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap b/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap index 31c182ce621..e6313ebeb82 100644 --- a/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap @@ -16,7 +16,7 @@ exports[`flat-config-types eslint should work successfully 1`] = ` "line": 38, "message": "'_otherCases' is defined but never used.", "messageId": "unusedVar", - "nodeType": "Identifier", + "nodeType": null, "ruleId": "@typescript-eslint/no-unused-vars", "severity": 2, }, diff --git a/packages/integration-tests/tests/__snapshots__/legacy-config.test.ts.snap b/packages/integration-tests/tests/__snapshots__/legacy-config.test.ts.snap deleted file mode 100644 index 2c0ba19a2f3..00000000000 --- a/packages/integration-tests/tests/__snapshots__/legacy-config.test.ts.snap +++ /dev/null @@ -1,130 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`legacy-config eslint should work successfully 1`] = ` -[ - { - "errorCount": 5, - "fatalErrorCount": 0, - "filePath": "/file.ts", - "fixableErrorCount": 0, - "fixableWarningCount": 0, - "messages": [ - { - "column": 1, - "endColumn": 25, - "endLine": 1, - "line": 1, - "message": "Async function 'unsafeLog' has no 'await' expression.", - "messageId": "missingAwait", - "nodeType": "FunctionDeclaration", - "ruleId": "@typescript-eslint/require-await", - "severity": 2, - }, - { - "column": 37, - "endColumn": 40, - "endLine": 1, - "line": 1, - "message": "Unexpected any. Specify a different type.", - "messageId": "unexpectedAny", - "nodeType": "TSAnyKeyword", - "ruleId": "@typescript-eslint/no-explicit-any", - "severity": 2, - "suggestions": [ - { - "desc": "Use \`unknown\` instead, this will force you to explicitly, and safely assert the type is correct.", - "fix": { - "range": [ - 36, - 39, - ], - "text": "unknown", - }, - "messageId": "suggestUnknown", - }, - { - "desc": "Use \`never\` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.", - "fix": { - "range": [ - 36, - 39, - ], - "text": "never", - }, - "messageId": "suggestNever", - }, - ], - }, - { - "column": 17, - "endColumn": 34, - "endLine": 3, - "line": 3, - "message": "Unsafe call of an \`any\` typed value.", - "messageId": "unsafeCall", - "nodeType": "MemberExpression", - "ruleId": "@typescript-eslint/no-unsafe-call", - "severity": 2, - }, - { - "column": 23, - "endColumn": 34, - "endLine": 3, - "line": 3, - "message": "Unsafe member access .toUpperCase on an \`any\` value.", - "messageId": "unsafeMemberExpression", - "nodeType": "Identifier", - "ruleId": "@typescript-eslint/no-unsafe-member-access", - "severity": 2, - }, - { - "column": 3, - "endColumn": 17, - "endLine": 5, - "line": 5, - "message": "Unsafe return of an \`any[]\` typed value.", - "messageId": "unsafeReturn", - "nodeType": "ReturnStatement", - "ruleId": "@typescript-eslint/no-unsafe-return", - "severity": 1, - }, - { - "column": 1, - "endColumn": 13, - "endLine": 8, - "line": 8, - "message": "Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the \`void\` operator.", - "messageId": "floatingVoid", - "nodeType": "ExpressionStatement", - "ruleId": "@typescript-eslint/no-floating-promises", - "severity": 2, - "suggestions": [ - { - "desc": "Add void operator to ignore.", - "fix": { - "range": [ - 139, - 139, - ], - "text": "void ", - }, - "messageId": "floatingFixVoid", - }, - ], - }, - ], - "source": "async function unsafeLog(...values: any[]) { - for (const value of values) { - console.log(value.toUpperCase()); - } - return values; -} - -unsafeLog(); -", - "suppressedMessages": [], - "usedDeprecatedRules": [], - "warningCount": 1, - }, -] -`; diff --git a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap index 3f4ca88387b..ae2bd5a863e 100644 --- a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap @@ -16,7 +16,7 @@ exports[`recommended-does-not-require-program eslint should work successfully 1` "line": 1, "message": "'foo' is assigned a value but never used.", "messageId": "unusedVar", - "nodeType": "Identifier", + "nodeType": null, "ruleId": "@typescript-eslint/no-unused-vars", "severity": 2, }, @@ -24,7 +24,16 @@ exports[`recommended-does-not-require-program eslint should work successfully 1` "output": "const foo: unknown = true; ", "suppressedMessages": [], - "usedDeprecatedRules": [], + "usedDeprecatedRules": [ + { + "replacedBy": [], + "ruleId": "no-extra-semi", + }, + { + "replacedBy": [], + "ruleId": "no-mixed-spaces-and-tabs", + }, + ], "warningCount": 0, }, ] diff --git a/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap b/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap index e9bdbb48349..f012057ae90 100644 --- a/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap @@ -11,7 +11,7 @@ exports[`vue-sfc eslint should work successfully 1`] = ` "messages": [ { "fatal": true, - "message": "Parsing error: error TS5012: Cannot read file '/usr/linked/tsconfig.json': ENOENT: no such file or directory, open '/usr/linked/tsconfig.json'.", + "message": "Parsing error: Cannot read file '/usr/linked/tsconfig.json'.", "nodeType": null, "ruleId": null, "severity": 2, @@ -75,7 +75,7 @@ export default Vue.extend({ "messages": [ { "fatal": true, - "message": "Parsing error: error TS5012: Cannot read file '/usr/linked/tsconfig.json': ENOENT: no such file or directory, open '/usr/linked/tsconfig.json'.", + "message": "Parsing error: Cannot read file '/usr/linked/tsconfig.json'.", "nodeType": null, "ruleId": null, "severity": 2, @@ -115,7 +115,7 @@ export default class Utility { "messages": [ { "fatal": true, - "message": "Parsing error: error TS5012: Cannot read file '/usr/linked/tsconfig.json': ENOENT: no such file or directory, open '/usr/linked/tsconfig.json'.", + "message": "Parsing error: Cannot read file '/usr/linked/tsconfig.json'.", "nodeType": null, "ruleId": null, "severity": 2, diff --git a/packages/integration-tests/tests/eslint-v8.test.ts b/packages/integration-tests/tests/eslint-v8.test.ts index 69f0626ea19..fe0b175c3f8 100644 --- a/packages/integration-tests/tests/eslint-v8.test.ts +++ b/packages/integration-tests/tests/eslint-v8.test.ts @@ -1,3 +1,3 @@ import { eslintIntegrationTest } from '../tools/integration-test-base'; -eslintIntegrationTest(__filename, '*.ts', true); +eslintIntegrationTest(__filename, '*.ts'); diff --git a/packages/integration-tests/tests/flat-config-types.test.ts b/packages/integration-tests/tests/flat-config-types.test.ts index 15c8481b543..a8483fba3fc 100644 --- a/packages/integration-tests/tests/flat-config-types.test.ts +++ b/packages/integration-tests/tests/flat-config-types.test.ts @@ -25,4 +25,4 @@ for (const additionalFlags of [ }, ); } -eslintIntegrationTest(__filename, 'eslint.config.js'); +eslintIntegrationTest(__filename, 'eslint.config.js', true); diff --git a/packages/integration-tests/tests/legacy-config.test.ts b/packages/integration-tests/tests/legacy-config.test.ts deleted file mode 100644 index 69f0626ea19..00000000000 --- a/packages/integration-tests/tests/legacy-config.test.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { eslintIntegrationTest } from '../tools/integration-test-base'; - -eslintIntegrationTest(__filename, '*.ts', true); diff --git a/packages/integration-tests/tools/integration-test-base.ts b/packages/integration-tests/tools/integration-test-base.ts index 9c91dab9b52..548df55030e 100644 --- a/packages/integration-tests/tools/integration-test-base.ts +++ b/packages/integration-tests/tools/integration-test-base.ts @@ -128,7 +128,7 @@ function integrationTest( export function eslintIntegrationTest( testFilename: string, filesGlob: string, - legacyConfig = false, + flatConfig = false, ): void { integrationTest('eslint', testFilename, async testFolder => { // lint, outputting to a JSON file @@ -144,12 +144,11 @@ export function eslintIntegrationTest( '--output-file', outFile, '--config', - legacyConfig ? './.eslintrc.js' : './eslint.config.js', + flatConfig ? './eslint.config.js' : './.eslintrc.js', '--fix-dry-run', filesGlob, ], { - env: legacyConfig ? { ESLINT_USE_FLAT_CONFIG: 'false' } : undefined, cwd: testFolder, }, ); diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index f315e8ca247..6ff94aae788 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1137,8 +1137,7 @@ export class Converter { } case SyntaxKind.PropertyAssignment: { - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + /// eslint-disable-next-line deprecation/deprecation const { questionToken, exclamationToken } = node; if (questionToken) { @@ -1168,8 +1167,7 @@ export class Converter { } case SyntaxKind.ShorthandPropertyAssignment: { - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + /// eslint-disable-next-line deprecation/deprecation const { modifiers, questionToken, exclamationToken } = node; if (modifiers) { @@ -1891,8 +1889,7 @@ export class Converter { specifiers: [], importKind: 'value', attributes: this.convertImportAttributes( - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation -- TS <5.3 + // eslint-disable-next-line deprecation/deprecation -- TS <5.3 node.attributes ?? node.assertClause, ), }, @@ -1973,8 +1970,7 @@ export class Converter { exportKind: node.isTypeOnly ? 'type' : 'value', declaration: null, attributes: this.convertImportAttributes( - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation -- TS <5.3 + // eslint-disable-next-line deprecation/deprecation -- TS <5.3 node.attributes ?? node.assertClause, ), }, @@ -1997,8 +1993,7 @@ export class Converter { ? this.convertChild(node.exportClause.name) : null, attributes: this.convertImportAttributes( - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation -- TS <5.3 + // eslint-disable-next-line deprecation/deprecation -- TS <5.3 node.attributes ?? node.assertClause, ), }, @@ -2693,8 +2688,7 @@ export class Converter { } case SyntaxKind.PropertySignature: { - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + /// eslint-disable-next-line deprecation/deprecation const { initializer } = node; if (initializer) { this.#throwError( @@ -2743,8 +2737,7 @@ export class Converter { } case SyntaxKind.FunctionType: { - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + /// eslint-disable-next-line deprecation/deprecation const { modifiers } = node; if (modifiers) { this.#throwError( @@ -3221,8 +3214,7 @@ export class Converter { }); } - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation -- required for backwards-compatibility + // eslint-disable-next-line deprecation/deprecation -- required for backwards-compatibility case SyntaxKind.AssertEntry: case SyntaxKind.ImportAttribute: { return this.createNode(node, { diff --git a/packages/typescript-estree/src/getModifiers.ts b/packages/typescript-estree/src/getModifiers.ts index b8f0d024fc7..42609a518c5 100644 --- a/packages/typescript-estree/src/getModifiers.ts +++ b/packages/typescript-estree/src/getModifiers.ts @@ -13,11 +13,9 @@ export function getModifiers( } if (isAtLeast48) { - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation -- this is safe as it's guarded + // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded if (includeIllegalModifiers || ts.canHaveModifiers(node)) { - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation -- this is safe as it's guarded + // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded const modifiers = ts.getModifiers(node as ts.HasModifiers); return modifiers ? Array.from(modifiers) : undefined; } @@ -42,11 +40,9 @@ export function getDecorators( } if (isAtLeast48) { - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation -- this is safe as it's guarded + // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded if (includeIllegalDecorators || ts.canHaveDecorators(node)) { - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation -- this is safe as it's guarded + // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded const decorators = ts.getDecorators(node as ts.HasDecorators); return decorators ? Array.from(decorators) : undefined; } diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index ace5fb6a815..5dc42f06dbb 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -189,8 +189,7 @@ export function isComment(node: ts.Node): boolean { * @param node the TypeScript node */ function isJSDocComment(node: ts.Node): node is ts.JSDoc { - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation -- SyntaxKind.JSDoc was only added in TS4.7 so we can't use it yet + // eslint-disable-next-line deprecation/deprecation -- SyntaxKind.JSDoc was only added in TS4.7 so we can't use it yet return node.kind === SyntaxKind.JSDocComment; } @@ -524,8 +523,7 @@ export function getTokenType( if (isAtLeast50 && token.kind === SyntaxKind.Identifier) { keywordKind = ts.identifierToKeywordKind(token as ts.Identifier); } else if ('originalKeywordKind' in token) { - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation -- intentional fallback for older TS versions + // eslint-disable-next-line deprecation/deprecation -- intentional fallback for older TS versions keywordKind = token.originalKeywordKind; } if (keywordKind) { @@ -790,8 +788,7 @@ export function firstDefined( export function identifierIsThisKeyword(id: ts.Identifier): boolean { return ( - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line deprecation/deprecation) -- intentional for older TS versions + // eslint-disable-next-line deprecation/deprecation -- intentional for older TS versions (isAtLeast50 ? ts.identifierToKeywordKind(id) : id.originalKeywordKind) === SyntaxKind.ThisKeyword ); diff --git a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts index 3f9d50fb0a8..1797ffd6230 100644 --- a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts +++ b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts @@ -80,8 +80,7 @@ export interface EstreeToTsNodeTypes { // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum [AST_NODE_TYPES.ImportAttribute]: 'ImportAttribute' extends keyof typeof ts ? ts.ImportAttribute - : // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + : // eslint-disable-next-line deprecation/deprecation ts.AssertEntry; [AST_NODE_TYPES.ImportDeclaration]: ts.ImportDeclaration; [AST_NODE_TYPES.ImportDefaultSpecifier]: ts.ImportClause; diff --git a/packages/typescript-estree/src/ts-estree/ts-nodes.ts b/packages/typescript-estree/src/ts-estree/ts-nodes.ts index eb00d5ea4fc..2a07ee0e7ea 100644 --- a/packages/typescript-estree/src/ts-estree/ts-nodes.ts +++ b/packages/typescript-estree/src/ts-estree/ts-nodes.ts @@ -24,11 +24,9 @@ export type TSNode = | ts.Identifier | ts.ImportAttribute | ts.ImportAttributes - // TODO: Bring this back in once it supports ESLint 9 - /* (eslint-disable-next-line) deprecation/deprecation -- intentional for old TS versions */ + /* eslint-disable-next-line deprecation/deprecation -- intentional for old TS versions */ | ts.AssertClause - // TODO: Bring this back in once it supports ESLint 9 - /* (eslint-disable-next-line) deprecation/deprecation -- intentional for old TS versions */ + /* eslint-disable-next-line deprecation/deprecation -- intentional for old TS versions */ | ts.AssertEntry | ts.PrivateIdentifier | ts.QualifiedName @@ -187,11 +185,9 @@ export type TSNode = | ts.ExportAssignment | ts.SourceFile | ts.Bundle - // TODO: Bring this back in once it supports ESLint 9 - /* (eslint-disable-next-line) deprecation/deprecation -- intentional for old TS versions */ + /* eslint-disable-next-line deprecation/deprecation -- intentional for old TS versions */ | ts.InputFiles - // TODO: Bring this back in once it supports ESLint 9 - /* (eslint-disable-next-line) deprecation/deprecation -- intentional for old TS versions */ + /* eslint-disable-next-line deprecation/deprecation -- intentional for old TS versions */ | ts.UnparsedSource | ts.JsonMinusNumericLiteral | ts.TemplateLiteralTypeNode diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index ca623f30b87..f96811420e5 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -28,8 +28,7 @@ describe('convert', () => { function fakeUnknownKind(node: ts.Node): void { ts.forEachChild(node, fakeUnknownKind); - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + /// eslint-disable-next-line deprecation/deprecation // @ts-expect-error -- intentionally writing to a readonly field node.kind = ts.SyntaxKind.UnparsedPrologue; } @@ -328,8 +327,7 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: false, }); - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation esCallExpression.typeParameters; expect(emitWarning).toHaveBeenCalledWith( @@ -346,11 +344,10 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: false, }); - // TODO: Bring this back in once it supports ESLint 9 - /* (eslint-disable) deprecation/deprecation */ + /* eslint-disable deprecation/deprecation */ esCallExpression.typeParameters; esCallExpression.typeParameters; - /* (eslint-enable) deprecation/deprecation */ + /* eslint-enable deprecation/deprecation */ expect(emitWarning).toHaveBeenCalledTimes(1); }); @@ -363,8 +360,7 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: true, }); - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation esCallExpression.typeParameters; expect(emitWarning).not.toHaveBeenCalled(); @@ -379,12 +375,10 @@ describe('convert', () => { it('allows writing to the deprecated aliased property as a new enumerable value', () => { const esCallExpression = getEsCallExpression(); - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation esCallExpression.typeParameters = undefined; - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation expect(esCallExpression.typeParameters).toBeUndefined(); expect(Object.keys(esCallExpression)).toContain('typeParameters'); }); @@ -397,8 +391,7 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: false, }); - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation tsMappedType.typeParameter; expect(emitWarning).toHaveBeenCalledWith( @@ -415,11 +408,10 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: false, }); - // TODO: Bring this back in once it supports ESLint 9 - /* (eslint-disable) deprecation/deprecation */ + /* eslint-disable deprecation/deprecation */ tsMappedType.typeParameter; tsMappedType.typeParameter; - /* (eslint-enable) deprecation/deprecation */ + /* eslint-enable deprecation/deprecation */ expect(emitWarning).toHaveBeenCalledTimes(1); }); @@ -432,8 +424,7 @@ describe('convert', () => { suppressDeprecatedPropertyWarnings: true, }); - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation tsMappedType.typeParameter; expect(emitWarning).not.toHaveBeenCalled(); @@ -448,12 +439,10 @@ describe('convert', () => { it('allows writing to the deprecated getter property as a new enumerable value', () => { const tsMappedType = getTsMappedType(); - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation tsMappedType.typeParameter = undefined!; - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation expect(tsMappedType.typeParameter).toBeUndefined(); expect(Object.keys(tsMappedType)).toContain('typeParameter'); }); diff --git a/packages/website/src/components/editor/useSandboxServices.ts b/packages/website/src/components/editor/useSandboxServices.ts index 01936726359..c2855c8af6c 100644 --- a/packages/website/src/components/editor/useSandboxServices.ts +++ b/packages/website/src/components/editor/useSandboxServices.ts @@ -146,8 +146,7 @@ export const useSandboxServices = ( }; // colorMode and jsx can't be reactive here because we don't want to force a recreation // updating of colorMode and jsx is handled in LoadedEditor - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) react-hooks/exhaustive-deps + // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return services; diff --git a/packages/website/src/components/inputs/Text.tsx b/packages/website/src/components/inputs/Text.tsx index b93d8c0123a..71f921fc67e 100644 --- a/packages/website/src/components/inputs/Text.tsx +++ b/packages/website/src/components/inputs/Text.tsx @@ -12,8 +12,7 @@ export interface DropdownProps { readonly placeholder?: string; } -// TODO: Bring this back in once it supports ESLint 9 -// (eslint-disable-next-line) react/display-name +// eslint-disable-next-line react/display-name const Text = React.forwardRef( (props, ref): React.JSX.Element => { return ( diff --git a/packages/website/src/hooks/useMediaQuery.ts b/packages/website/src/hooks/useMediaQuery.ts index 3e4a07350f5..c91efac0521 100644 --- a/packages/website/src/hooks/useMediaQuery.ts +++ b/packages/website/src/hooks/useMediaQuery.ts @@ -24,8 +24,7 @@ const useMediaQuery = (mediaQuery: string): boolean => { mediaQueryList.addEventListener('change', documentChangeHandler); } catch { // Safari isn't supporting mediaQueryList.addEventListener - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation mediaQueryList.addListener(documentChangeHandler); } @@ -35,8 +34,7 @@ const useMediaQuery = (mediaQuery: string): boolean => { mediaQueryList.removeEventListener('change', documentChangeHandler); } catch { // Safari isn't supporting mediaQueryList.removeEventListener - // TODO: Bring this back in once it supports ESLint 9 - // (eslint-disable-next-line) deprecation/deprecation + /// eslint-disable-next-line deprecation/deprecation mediaQueryList.removeListener(documentChangeHandler); } }; diff --git a/yarn.lock b/yarn.lock index 0bfdf0fe06b..cceea28ba62 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3280,27 +3280,34 @@ __metadata: languageName: node linkType: hard -"@eslint/eslintrc@npm:^3.0.2": - version: 3.0.2 - resolution: "@eslint/eslintrc@npm:3.0.2" +"@eslint/eslintrc@npm:^2.1.4": + version: 2.1.4 + resolution: "@eslint/eslintrc@npm:2.1.4" dependencies: ajv: ^6.12.4 debug: ^4.3.2 - espree: ^10.0.1 - globals: ^14.0.0 + espree: ^9.6.0 + globals: ^13.19.0 ignore: ^5.2.0 import-fresh: ^3.2.1 js-yaml: ^4.1.0 minimatch: ^3.1.2 strip-json-comments: ^3.1.1 - checksum: 05bf516b60fbb1c1bdc264e081118b2172c5feb071cd665976482c5614b8e7950991175fea3ca6b1f482ced7cb0d0aa34ceab3a508d6bf1ff17b4efc0911e293 + checksum: 10957c7592b20ca0089262d8c2a8accbad14b4f6507e35416c32ee6b4dbf9cad67dfb77096bbd405405e9ada2b107f3797fe94362e1c55e0b09d6e90dd149127 + languageName: node + linkType: hard + +"@eslint/js@npm:*": + version: 9.2.0 + resolution: "@eslint/js@npm:9.2.0" + checksum: b5617fd35bd4d9521c6b21c1dc6692b29b65be54d35905f2ed529f02e4014b9ad9d1fcdbd3dfea589636a98c8396489625c94f5dd05ce3c35ca5ac5537904764 languageName: node linkType: hard -"@eslint/js@npm:9.1.1": - version: 9.1.1 - resolution: "@eslint/js@npm:9.1.1" - checksum: b71844776d582de74a3599abcbccd2b9009a9292aaf81cb780469c9037985eb8c220c0a08708db205d7fecb54cf087c3c2b2066bd04819b1bc325fa72a52e3e0 +"@eslint/js@npm:8.57.0, @eslint/js@npm:^8.57.0": + version: 8.57.0 + resolution: "@eslint/js@npm:8.57.0" + checksum: 315dc65b0e9893e2bff139bddace7ea601ad77ed47b4550e73da8c9c2d2766c7a575c3cddf17ef85b8fd6a36ff34f91729d0dcca56e73ca887c10df91a41b0bb languageName: node linkType: hard @@ -3327,14 +3334,14 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.13.0": - version: 0.13.0 - resolution: "@humanwhocodes/config-array@npm:0.13.0" +"@humanwhocodes/config-array@npm:^0.11.14": + version: 0.11.14 + resolution: "@humanwhocodes/config-array@npm:0.11.14" dependencies: - "@humanwhocodes/object-schema": ^2.0.3 + "@humanwhocodes/object-schema": ^2.0.2 debug: ^4.3.1 minimatch: ^3.0.5 - checksum: eae69ff9134025dd2924f0b430eb324981494be26f0fddd267a33c28711c4db643242cf9fddf7dadb9d16c96b54b2d2c073e60a56477df86e0173149313bd5d6 + checksum: 861ccce9eaea5de19546653bccf75bf09fe878bc39c3aab00aeee2d2a0e654516adad38dd1098aab5e3af0145bbcbf3f309bdf4d964f8dab9dcd5834ae4c02f2 languageName: node linkType: hard @@ -3345,20 +3352,13 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/object-schema@npm:^2.0.3": +"@humanwhocodes/object-schema@npm:^2.0.2": version: 2.0.3 resolution: "@humanwhocodes/object-schema@npm:2.0.3" checksum: d3b78f6c5831888c6ecc899df0d03bcc25d46f3ad26a11d7ea52944dc36a35ef543fad965322174238d677a43d5c694434f6607532cff7077062513ad7022631 languageName: node linkType: hard -"@humanwhocodes/retry@npm:^0.2.3": - version: 0.2.3 - resolution: "@humanwhocodes/retry@npm:0.2.3" - checksum: 24c224ad8564c0d28b6295d6fd42ddab524629f7872bd78c06cf96fe54d981ad589273222a4e37a0ec9fad72200cbab586bb7552b28109dfaae2bf332ecb9abf - languageName: node - linkType: hard - "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -5718,7 +5718,7 @@ __metadata: "@babel/eslint-parser": ^7.24.1 "@babel/parser": ^7.24.4 "@babel/types": ^7.24.0 - "@eslint/eslintrc": ^3.0.2 + "@eslint/eslintrc": ^2.1.4 "@eslint/js": ^8.57.0 "@nx/eslint": 18.2.3 "@nx/jest": 18.2.3 @@ -5743,7 +5743,7 @@ __metadata: cross-fetch: ^4.0.0 cspell: ^8.6.1 downlevel-dts: ">=0.11.0" - eslint: 9.1.1 + eslint: 8.57.0 eslint-plugin-deprecation: ^2.0.0 eslint-plugin-eslint-comments: ^3.2.0 eslint-plugin-eslint-plugin: ^5.5.0 @@ -5961,7 +5961,7 @@ __metadata: languageName: unknown linkType: soft -"@ungap/structured-clone@npm:^1.0.0": +"@ungap/structured-clone@npm:^1.0.0, @ungap/structured-clone@npm:^1.2.0": version: 1.2.0 resolution: "@ungap/structured-clone@npm:1.2.0" checksum: 4f656b7b4672f2ce6e272f2427d8b0824ed11546a601d8d5412b9d7704e83db38a8d9f402ecdf2b9063fc164af842ad0ec4a55819f621ed7e7ea4d1efcc74524 @@ -6203,7 +6203,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.11.3, acorn@npm:^8.4.1, acorn@npm:^8.7.1, acorn@npm:^8.8.2": +"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.4.1, acorn@npm:^8.7.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": version: 8.11.3 resolution: "acorn@npm:8.11.3" bin: @@ -8884,6 +8884,15 @@ __metadata: languageName: node linkType: hard +"doctrine@npm:^3.0.0": + version: 3.0.0 + resolution: "doctrine@npm:3.0.0" + dependencies: + esutils: ^2.0.2 + checksum: fd7673ca77fe26cd5cba38d816bc72d641f500f1f9b25b83e8ce28827fe2da7ad583a8da26ab6af85f834138cf8dae9f69b0cd6ab925f52ddab1754db44d99ce + languageName: node + linkType: hard + "dom-converter@npm:^0.2.0": version: 0.2.0 resolution: "dom-converter@npm:0.2.0" @@ -9756,13 +9765,13 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:^8.0.1": - version: 8.0.1 - resolution: "eslint-scope@npm:8.0.1" +"eslint-scope@npm:^7.2.2": + version: 7.2.2 + resolution: "eslint-scope@npm:7.2.2" dependencies: esrecurse: ^4.3.0 estraverse: ^5.2.0 - checksum: 67a5a39312dadb8c9a677df0f2e8add8daf15280b08bfe07f898d5347ee2d7cd2a1f5c2760f34e46e8f5f13f7192f47c2c10abe676bfa4173ae5539365551940 + checksum: ec97dbf5fb04b94e8f4c5a91a7f0a6dd3c55e46bfc7bbcd0e3138c3a76977570e02ed89a1810c778dcd72072ff0e9621ba1379b4babe53921d71e2e4486fda3e languageName: node linkType: hard @@ -9784,36 +9793,40 @@ __metadata: languageName: node linkType: hard -"eslint@npm:9.1.1": - version: 9.1.1 - resolution: "eslint@npm:9.1.1" +"eslint@npm:8.57.0": + version: 8.57.0 + resolution: "eslint@npm:8.57.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 "@eslint-community/regexpp": ^4.6.1 - "@eslint/eslintrc": ^3.0.2 - "@eslint/js": 9.1.1 - "@humanwhocodes/config-array": ^0.13.0 + "@eslint/eslintrc": ^2.1.4 + "@eslint/js": 8.57.0 + "@humanwhocodes/config-array": ^0.11.14 "@humanwhocodes/module-importer": ^1.0.1 - "@humanwhocodes/retry": ^0.2.3 "@nodelib/fs.walk": ^1.2.8 + "@ungap/structured-clone": ^1.2.0 ajv: ^6.12.4 chalk: ^4.0.0 cross-spawn: ^7.0.2 debug: ^4.3.2 + doctrine: ^3.0.0 escape-string-regexp: ^4.0.0 - eslint-scope: ^8.0.1 - eslint-visitor-keys: ^4.0.0 - espree: ^10.0.1 + eslint-scope: ^7.2.2 + eslint-visitor-keys: ^3.4.3 + espree: ^9.6.1 esquery: ^1.4.2 esutils: ^2.0.2 fast-deep-equal: ^3.1.3 - file-entry-cache: ^8.0.0 + file-entry-cache: ^6.0.1 find-up: ^5.0.0 glob-parent: ^6.0.2 + globals: ^13.19.0 + graphemer: ^1.4.0 ignore: ^5.2.0 imurmurhash: ^0.1.4 is-glob: ^4.0.0 is-path-inside: ^3.0.3 + js-yaml: ^4.1.0 json-stable-stringify-without-jsonify: ^1.0.1 levn: ^0.4.1 lodash.merge: ^4.6.2 @@ -9824,18 +9837,18 @@ __metadata: text-table: ^0.2.0 bin: eslint: bin/eslint.js - checksum: b96852334eb8397cbee4d8d2342c247a304bf59ba38573e0229e28b6f4589a315af065e5a19989133103b09ada8c958f7cd83e95d327b1d3532e9b2c119d6692 + checksum: 3a48d7ff85ab420a8447e9810d8087aea5b1df9ef68c9151732b478de698389ee656fd895635b5f2871c89ee5a2652b3f343d11e9db6f8486880374ebc74a2d9 languageName: node linkType: hard -"espree@npm:^10.0.1": - version: 10.0.1 - resolution: "espree@npm:10.0.1" +"espree@npm:^9.6.0, espree@npm:^9.6.1": + version: 9.6.1 + resolution: "espree@npm:9.6.1" dependencies: - acorn: ^8.11.3 + acorn: ^8.9.0 acorn-jsx: ^5.3.2 - eslint-visitor-keys: ^4.0.0 - checksum: 62c9242a84c6741cebd35ede6574131d0419be7e5559566403e384087d99c4ddb2ced44e32acd44a4c3d8a8a84997cf8d78810c4e46b3fe25a804f1a92dc6b9d + eslint-visitor-keys: ^3.4.1 + checksum: eb8c149c7a2a77b3f33a5af80c10875c3abd65450f60b8af6db1bfcfa8f101e21c1e56a561c6dc13b848e18148d43469e7cd208506238554fb5395a9ea5a1ab9 languageName: node linkType: hard @@ -10275,6 +10288,15 @@ __metadata: languageName: node linkType: hard +"file-entry-cache@npm:^6.0.1": + version: 6.0.1 + resolution: "file-entry-cache@npm:6.0.1" + dependencies: + flat-cache: ^3.0.4 + checksum: f49701feaa6314c8127c3c2f6173cfefff17612f5ed2daaafc6da13b5c91fd43e3b2a58fd0d63f9f94478a501b167615931e7200e31485e320f74a33885a9c74 + languageName: node + linkType: hard + "file-entry-cache@npm:^8.0.0": version: 8.0.0 resolution: "file-entry-cache@npm:8.0.0" @@ -10392,6 +10414,17 @@ __metadata: languageName: node linkType: hard +"flat-cache@npm:^3.0.4": + version: 3.2.0 + resolution: "flat-cache@npm:3.2.0" + dependencies: + flatted: ^3.2.9 + keyv: ^4.5.3 + rimraf: ^3.0.2 + checksum: e7e0f59801e288b54bee5cb9681e9ee21ee28ef309f886b312c9d08415b79fc0f24ac842f84356ce80f47d6a53de62197ce0e6e148dc42d5db005992e2a756ec + languageName: node + linkType: hard + "flat-cache@npm:^4.0.0": version: 4.0.1 resolution: "flat-cache@npm:4.0.1" @@ -10901,10 +10934,12 @@ __metadata: languageName: node linkType: hard -"globals@npm:^14.0.0": - version: 14.0.0 - resolution: "globals@npm:14.0.0" - checksum: 534b8216736a5425737f59f6e6a5c7f386254560c9f41d24a9227d60ee3ad4a9e82c5b85def0e212e9d92162f83a92544be4c7fd4c902cb913736c10e08237ac +"globals@npm:^13.19.0": + version: 13.24.0 + resolution: "globals@npm:13.24.0" + dependencies: + type-fest: ^0.20.2 + checksum: 56066ef058f6867c04ff203b8a44c15b038346a62efbc3060052a1016be9f56f4cf0b2cd45b74b22b81e521a889fc7786c73691b0549c2f3a6e825b3d394f43c languageName: node linkType: hard @@ -19030,6 +19065,13 @@ __metadata: languageName: node linkType: hard +"type-fest@npm:^0.20.2": + version: 0.20.2 + resolution: "type-fest@npm:0.20.2" + checksum: 4fb3272df21ad1c552486f8a2f8e115c09a521ad7a8db3d56d53718d0c907b62c6e9141ba5f584af3f6830d0872c521357e512381f24f7c44acae583ad517d73 + languageName: node + linkType: hard + "type-fest@npm:^0.21.3": version: 0.21.3 resolution: "type-fest@npm:0.21.3" From 88024e2ecd1c51c1dbd6382c5c0c8eb1587248f7 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 17:45:02 -0700 Subject: [PATCH 15/26] Some more reverts --- .../fixtures/markdown/eslint.config.js | 27 -- .../eslint.config.js | 6 - .../fixtures/vue-jsx/eslint.config.js | 24 -- .../fixtures/vue-sfc/eslint.config.js | 24 -- .../fixtures/vue-sfc/package-lock.json | 356 ------------------ 5 files changed, 437 deletions(-) delete mode 100644 packages/integration-tests/fixtures/markdown/eslint.config.js delete mode 100644 packages/integration-tests/fixtures/recommended-does-not-require-program/eslint.config.js delete mode 100644 packages/integration-tests/fixtures/vue-jsx/eslint.config.js delete mode 100644 packages/integration-tests/fixtures/vue-sfc/eslint.config.js delete mode 100644 packages/integration-tests/fixtures/vue-sfc/package-lock.json diff --git a/packages/integration-tests/fixtures/markdown/eslint.config.js b/packages/integration-tests/fixtures/markdown/eslint.config.js deleted file mode 100644 index 0b272f2e76a..00000000000 --- a/packages/integration-tests/fixtures/markdown/eslint.config.js +++ /dev/null @@ -1,27 +0,0 @@ -const markdown = require('eslint-plugin-markdown'); -const tseslint = require('typescript-eslint'); - -module.exports = [ - ...markdown.configs.recommended, - { - files: ['**/*.md/*.{js,ts,jsx,tsx,javascript,node}'], - languageOptions: { - parser: tseslint.parser, - parserOptions: { - sourceType: 'module', - extraFileExtensions: ['.vue'], - ecmaFeatures: { - jsx: true, - }, - }, - }, - plugins: { - ['@typescript-eslint']: tseslint.plugin, - markdown, - }, - rules: { - '@typescript-eslint/no-explicit-any': 'error', - 'no-console': 'error', - }, - }, -]; diff --git a/packages/integration-tests/fixtures/recommended-does-not-require-program/eslint.config.js b/packages/integration-tests/fixtures/recommended-does-not-require-program/eslint.config.js deleted file mode 100644 index 7984b71f821..00000000000 --- a/packages/integration-tests/fixtures/recommended-does-not-require-program/eslint.config.js +++ /dev/null @@ -1,6 +0,0 @@ -// This integration test exists to make sure that the recommended config does -// not require a program to be specified to ensure a fast and simple initial -// setup. Users can add on one of our other configs if they want to opt in to -// more expensive checks. -const tseslint = require('typescript-eslint'); -module.exports = tseslint.config(...tseslint.configs.recommended); diff --git a/packages/integration-tests/fixtures/vue-jsx/eslint.config.js b/packages/integration-tests/fixtures/vue-jsx/eslint.config.js deleted file mode 100644 index 5266c6d8892..00000000000 --- a/packages/integration-tests/fixtures/vue-jsx/eslint.config.js +++ /dev/null @@ -1,24 +0,0 @@ -const vue = require('eslint-plugin-vue'); -const tseslint = require('typescript-eslint'); - -module.exports = [ - ...vue.configs['flat/essential'], - { - languageOptions: { - parserOptions: { - parser: '@typescript-eslint/parser', - sourceType: 'module', - extraFileExtensions: ['.vue'], - ecmaFeatures: { - jsx: true, - }, - }, - }, - plugins: { - ['@typescript-eslint']: tseslint.plugin, - }, - rules: { - '@typescript-eslint/no-explicit-any': 'error', - }, - }, -]; diff --git a/packages/integration-tests/fixtures/vue-sfc/eslint.config.js b/packages/integration-tests/fixtures/vue-sfc/eslint.config.js deleted file mode 100644 index 0d1daad3139..00000000000 --- a/packages/integration-tests/fixtures/vue-sfc/eslint.config.js +++ /dev/null @@ -1,24 +0,0 @@ -const vue = require('eslint-plugin-vue'); -const tseslint = require('typescript-eslint'); - -module.exports = [ - ...vue.configs['flat/essential'], - { - languageOptions: { - parserOptions: { - parser: '@typescript-eslint/parser', - project: '/usr/linked/tsconfig.json', - sourceType: 'module', - extraFileExtensions: ['.vue'], - }, - }, - plugins: { - ['@typescript-eslint']: tseslint.plugin, - }, - rules: { - '@typescript-eslint/no-explicit-any': 'error', - '@typescript-eslint/no-unnecessary-type-assertion': 'error', - 'semi-spacing': 'error', - }, - }, -]; diff --git a/packages/integration-tests/fixtures/vue-sfc/package-lock.json b/packages/integration-tests/fixtures/vue-sfc/package-lock.json deleted file mode 100644 index ba397dee137..00000000000 --- a/packages/integration-tests/fixtures/vue-sfc/package-lock.json +++ /dev/null @@ -1,356 +0,0 @@ -{ - "name": "vue-sfc", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "devDependencies": { - "eslint-plugin-vue": "latest", - "vue-eslint-parser": "^9.4.2", - "vue-property-decorator": "^9.1.2", - "vuex": "^4.1.0" - } - }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@vue/devtools-api": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.1.tgz", - "integrity": "sha512-LgPscpE3Vs0x96PzSSB4IGVSZXZBZHpfxs+ZA1d+VEPwHdOXowy/Y2CsvCAIFrf+ssVU1pD1jidj505EpUnfbA==", - "dev": true - }, - "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", - "dev": true - }, - "node_modules/cssesc": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", - "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", - "dev": true, - "bin": { - "cssesc": "bin/cssesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/eslint-plugin-vue": { - "version": "9.25.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-9.25.0.tgz", - "integrity": "sha512-tDWlx14bVe6Bs+Nnh3IGrD+hb11kf2nukfm6jLsmJIhmiRQ1SUaksvwY9U5MvPB0pcrg0QK0xapQkfITs3RKOA==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "globals": "^13.24.0", - "natural-compare": "^1.4.0", - "nth-check": "^2.1.1", - "postcss-selector-parser": "^6.0.15", - "semver": "^7.6.0", - "vue-eslint-parser": "^9.4.2", - "xml-name-validator": "^4.0.0" - }, - "engines": { - "node": "^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.2.0 || ^7.0.0 || ^8.0.0 || ^9.0.0" - } - }, - "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", - "dev": true, - "dependencies": { - "acorn": "^8.9.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true - }, - "node_modules/nth-check": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", - "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", - "dev": true, - "dependencies": { - "boolbase": "^1.0.0" - }, - "funding": { - "url": "https://github.com/fb55/nth-check?sponsor=1" - } - }, - "node_modules/postcss-selector-parser": { - "version": "6.0.16", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.16.tgz", - "integrity": "sha512-A0RVJrX+IUkVZbW3ClroRWurercFhieevHB38sr2+l9eUClMqome3LmEmnhlNy+5Mr2EYN6B2Kaw9wYdd+VHiw==", - "dev": true, - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, - "node_modules/vue-eslint-parser": { - "version": "9.4.2", - "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-9.4.2.tgz", - "integrity": "sha512-Ry9oiGmCAK91HrKMtCrKFWmSFWvYkpGglCeFAIqDdr9zdXmMMpJOmUJS7WWsW7fX81h6mwHmUZCQQ1E0PkSwYQ==", - "dev": true, - "dependencies": { - "debug": "^4.3.4", - "eslint-scope": "^7.1.1", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", - "esquery": "^1.4.0", - "lodash": "^4.17.21", - "semver": "^7.3.6" - }, - "engines": { - "node": "^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=6.0.0" - } - }, - "node_modules/vue-property-decorator": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/vue-property-decorator/-/vue-property-decorator-9.1.2.tgz", - "integrity": "sha512-xYA8MkZynPBGd/w5QFJ2d/NM0z/YeegMqYTphy7NJQXbZcuU6FC6AOdUAcy4SXP+YnkerC6AfH+ldg7PDk9ESQ==", - "dev": true, - "peerDependencies": { - "vue": "*", - "vue-class-component": "*" - } - }, - "node_modules/vuex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/vuex/-/vuex-4.1.0.tgz", - "integrity": "sha512-hmV6UerDrPcgbSy9ORAtNXDr9M4wlNP4pEFKye4ujJF8oqgFFuxDCdOLS3eNoRTtq5O3hoBDh9Doj1bQMYHRbQ==", - "dev": true, - "dependencies": { - "@vue/devtools-api": "^6.0.0-beta.11" - }, - "peerDependencies": { - "vue": "^3.2.0" - } - }, - "node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - } - } -} From 1cae50daa2bca51870c5d37a392903eaac0cb14d Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 17:46:30 -0700 Subject: [PATCH 16/26] oopsies comment level --- packages/typescript-estree/src/convert.ts | 8 ++++---- packages/typescript-estree/tests/lib/convert.test.ts | 2 +- packages/website/src/hooks/useMediaQuery.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 6ff94aae788..5ffe6008d7d 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1137,7 +1137,7 @@ export class Converter { } case SyntaxKind.PropertyAssignment: { - /// eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation const { questionToken, exclamationToken } = node; if (questionToken) { @@ -1167,7 +1167,7 @@ export class Converter { } case SyntaxKind.ShorthandPropertyAssignment: { - /// eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation const { modifiers, questionToken, exclamationToken } = node; if (modifiers) { @@ -2688,7 +2688,7 @@ export class Converter { } case SyntaxKind.PropertySignature: { - /// eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation const { initializer } = node; if (initializer) { this.#throwError( @@ -2737,7 +2737,7 @@ export class Converter { } case SyntaxKind.FunctionType: { - /// eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation const { modifiers } = node; if (modifiers) { this.#throwError( diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index f96811420e5..93635e8d758 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -28,7 +28,7 @@ describe('convert', () => { function fakeUnknownKind(node: ts.Node): void { ts.forEachChild(node, fakeUnknownKind); - /// eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation // @ts-expect-error -- intentionally writing to a readonly field node.kind = ts.SyntaxKind.UnparsedPrologue; } diff --git a/packages/website/src/hooks/useMediaQuery.ts b/packages/website/src/hooks/useMediaQuery.ts index c91efac0521..422570aee8e 100644 --- a/packages/website/src/hooks/useMediaQuery.ts +++ b/packages/website/src/hooks/useMediaQuery.ts @@ -34,7 +34,7 @@ const useMediaQuery = (mediaQuery: string): boolean => { mediaQueryList.removeEventListener('change', documentChangeHandler); } catch { // Safari isn't supporting mediaQueryList.removeEventListener - /// eslint-disable-next-line deprecation/deprecation + // eslint-disable-next-line deprecation/deprecation mediaQueryList.removeListener(documentChangeHandler); } }; From 2bb898a16f6febb2b8c8ee7cf856b78ab0dab58b Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 17:49:28 -0700 Subject: [PATCH 17/26] yarn test -u the integration tests --- .../tests/__snapshots__/flat-config-types.test.ts.snap | 2 +- .../recommended-does-not-require-program.test.ts.snap | 2 +- .../tests/__snapshots__/vue-sfc.test.ts.snap | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap b/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap index e6313ebeb82..31c182ce621 100644 --- a/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap @@ -16,7 +16,7 @@ exports[`flat-config-types eslint should work successfully 1`] = ` "line": 38, "message": "'_otherCases' is defined but never used.", "messageId": "unusedVar", - "nodeType": null, + "nodeType": "Identifier", "ruleId": "@typescript-eslint/no-unused-vars", "severity": 2, }, diff --git a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap index ae2bd5a863e..4d18019e6b8 100644 --- a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap @@ -16,7 +16,7 @@ exports[`recommended-does-not-require-program eslint should work successfully 1` "line": 1, "message": "'foo' is assigned a value but never used.", "messageId": "unusedVar", - "nodeType": null, + "nodeType": "Identifier", "ruleId": "@typescript-eslint/no-unused-vars", "severity": 2, }, diff --git a/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap b/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap index f012057ae90..e9bdbb48349 100644 --- a/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap @@ -11,7 +11,7 @@ exports[`vue-sfc eslint should work successfully 1`] = ` "messages": [ { "fatal": true, - "message": "Parsing error: Cannot read file '/usr/linked/tsconfig.json'.", + "message": "Parsing error: error TS5012: Cannot read file '/usr/linked/tsconfig.json': ENOENT: no such file or directory, open '/usr/linked/tsconfig.json'.", "nodeType": null, "ruleId": null, "severity": 2, @@ -75,7 +75,7 @@ export default Vue.extend({ "messages": [ { "fatal": true, - "message": "Parsing error: Cannot read file '/usr/linked/tsconfig.json'.", + "message": "Parsing error: error TS5012: Cannot read file '/usr/linked/tsconfig.json': ENOENT: no such file or directory, open '/usr/linked/tsconfig.json'.", "nodeType": null, "ruleId": null, "severity": 2, @@ -115,7 +115,7 @@ export default class Utility { "messages": [ { "fatal": true, - "message": "Parsing error: Cannot read file '/usr/linked/tsconfig.json'.", + "message": "Parsing error: error TS5012: Cannot read file '/usr/linked/tsconfig.json': ENOENT: no such file or directory, open '/usr/linked/tsconfig.json'.", "nodeType": null, "ruleId": null, "severity": 2, From 53193dd355c443d881f32aa1bb57d750ac8f05c6 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 17:59:53 -0700 Subject: [PATCH 18/26] regenerate yarn.lock --- yarn.lock | 127 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 106 insertions(+), 21 deletions(-) diff --git a/yarn.lock b/yarn.lock index cceea28ba62..cc3ec59faa2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -266,7 +266,30 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:*, @babel/core@npm:^7.11.1, @babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.19.6, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.3, @babel/core@npm:^7.24.4": +"@babel/core@npm:*, @babel/core@npm:^7.11.1, @babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.19.6, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.3": + version: 7.24.3 + resolution: "@babel/core@npm:7.24.3" + dependencies: + "@ampproject/remapping": ^2.2.0 + "@babel/code-frame": ^7.24.2 + "@babel/generator": ^7.24.1 + "@babel/helper-compilation-targets": ^7.23.6 + "@babel/helper-module-transforms": ^7.23.3 + "@babel/helpers": ^7.24.1 + "@babel/parser": ^7.24.1 + "@babel/template": ^7.24.0 + "@babel/traverse": ^7.24.1 + "@babel/types": ^7.24.0 + convert-source-map: ^2.0.0 + debug: ^4.1.0 + gensync: ^1.0.0-beta.2 + json5: ^2.2.3 + semver: ^6.3.1 + checksum: 1a33460794f4122cf255b656f4d6586913f41078a1afdf1bcf0365ddbd99c1ddb68f904062f9079445ab26b507c36bc297055192bc26e5c8e6e3def42195f9ab + languageName: node + linkType: hard + +"@babel/core@npm:^7.24.4": version: 7.24.4 resolution: "@babel/core@npm:7.24.4" dependencies: @@ -303,7 +326,19 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.23.3, @babel/generator@npm:^7.24.1, @babel/generator@npm:^7.24.4, @babel/generator@npm:^7.7.2": +"@babel/generator@npm:^7.23.3, @babel/generator@npm:^7.24.1, @babel/generator@npm:^7.7.2": + version: 7.24.1 + resolution: "@babel/generator@npm:7.24.1" + dependencies: + "@babel/types": ^7.24.0 + "@jridgewell/gen-mapping": ^0.3.5 + "@jridgewell/trace-mapping": ^0.3.25 + jsesc: ^2.5.1 + checksum: 98c6ce5ec7a1cba2bdf35cdf607273b90cf7cf82bbe75cd0227363fb84d7e1bd8efa74f40247d5900c8c009123f10132ad209a05283757698de918278c3c6700 + languageName: node + linkType: hard + +"@babel/generator@npm:^7.24.4": version: 7.24.4 resolution: "@babel/generator@npm:7.24.4" dependencies: @@ -553,6 +588,17 @@ __metadata: languageName: node linkType: hard +"@babel/helpers@npm:^7.24.1": + version: 7.24.1 + resolution: "@babel/helpers@npm:7.24.1" + dependencies: + "@babel/template": ^7.24.0 + "@babel/traverse": ^7.24.1 + "@babel/types": ^7.24.0 + checksum: 0643b8ccf3358682303aea65f0798e482b2c3642040d32ffe130a245f4a46d0d23fe575a5e06e3cda4e8ec4af89d52b94ff1c444a74465d47ccc27da6ddbbb9f + languageName: node + linkType: hard + "@babel/helpers@npm:^7.24.4": version: 7.24.4 resolution: "@babel/helpers@npm:7.24.4" @@ -576,7 +622,16 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:*, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.24.4": +"@babel/parser@npm:*, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.1": + version: 7.24.1 + resolution: "@babel/parser@npm:7.24.1" + bin: + parser: ./bin/babel-parser.js + checksum: a1068941dddf82ffdf572565b8b7b2cddb963ff9ddf97e6e28f50e843d820b4285e6def8f59170104a94e2a91ae2e3b326489886d77a57ea29d468f6a5e79bf9 + languageName: node + linkType: hard + +"@babel/parser@npm:^7.24.4": version: 7.24.4 resolution: "@babel/parser@npm:7.24.4" bin: @@ -1709,7 +1764,16 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.3, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.22.6, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.24.4, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.8.4": +"@babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.3, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.22.6, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.8.4": + version: 7.24.1 + resolution: "@babel/runtime@npm:7.24.1" + dependencies: + regenerator-runtime: ^0.14.0 + checksum: 5c8f3b912ba949865f03b3cf8395c60e1f4ebd1033fbd835bdfe81b6cac8a87d85bc3c7aded5fcdf07be044c9ab8c818f467abe0deca50020c72496782639572 + languageName: node + linkType: hard + +"@babel/runtime@npm:^7.24.4": version: 7.24.4 resolution: "@babel/runtime@npm:7.24.4" dependencies: @@ -3297,14 +3361,7 @@ __metadata: languageName: node linkType: hard -"@eslint/js@npm:*": - version: 9.2.0 - resolution: "@eslint/js@npm:9.2.0" - checksum: b5617fd35bd4d9521c6b21c1dc6692b29b65be54d35905f2ed529f02e4014b9ad9d1fcdbd3dfea589636a98c8396489625c94f5dd05ce3c35ca5ac5537904764 - languageName: node - linkType: hard - -"@eslint/js@npm:8.57.0, @eslint/js@npm:^8.57.0": +"@eslint/js@npm:*, @eslint/js@npm:8.57.0, @eslint/js@npm:^8.57.0": version: 8.57.0 resolution: "@eslint/js@npm:8.57.0" checksum: 315dc65b0e9893e2bff139bddace7ea601ad77ed47b4550e73da8c9c2d2766c7a575c3cddf17ef85b8fd6a36ff34f91729d0dcca56e73ca887c10df91a41b0bb @@ -3353,9 +3410,9 @@ __metadata: linkType: hard "@humanwhocodes/object-schema@npm:^2.0.2": - version: 2.0.3 - resolution: "@humanwhocodes/object-schema@npm:2.0.3" - checksum: d3b78f6c5831888c6ecc899df0d03bcc25d46f3ad26a11d7ea52944dc36a35ef543fad965322174238d677a43d5c694434f6607532cff7077062513ad7022631 + version: 2.0.2 + resolution: "@humanwhocodes/object-schema@npm:2.0.2" + checksum: 2fc11503361b5fb4f14714c700c02a3f4c7c93e9acd6b87a29f62c522d90470f364d6161b03d1cc618b979f2ae02aed1106fd29d302695d8927e2fc8165ba8ee languageName: node linkType: hard @@ -10415,13 +10472,13 @@ __metadata: linkType: hard "flat-cache@npm:^3.0.4": - version: 3.2.0 - resolution: "flat-cache@npm:3.2.0" + version: 3.1.1 + resolution: "flat-cache@npm:3.1.1" dependencies: flatted: ^3.2.9 keyv: ^4.5.3 rimraf: ^3.0.2 - checksum: e7e0f59801e288b54bee5cb9681e9ee21ee28ef309f886b312c9d08415b79fc0f24ac842f84356ce80f47d6a53de62197ce0e6e148dc42d5db005992e2a756ec + checksum: 4958cfe0f46acf84953d4e16676ef5f0d38eab3a92d532a1e8d5f88f11eea8b36d5d598070ff2aeae15f1fde18f8d7d089eefaf9db10b5a587cc1c9072325c7a languageName: node linkType: hard @@ -16309,7 +16366,7 @@ __metadata: languageName: node linkType: hard -"postcss-selector-parser@npm:^6.0.16, postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4, postcss-selector-parser@npm:^6.0.5, postcss-selector-parser@npm:^6.0.9": +"postcss-selector-parser@npm:^6.0.16": version: 6.0.16 resolution: "postcss-selector-parser@npm:6.0.16" dependencies: @@ -16319,6 +16376,16 @@ __metadata: languageName: node linkType: hard +"postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4, postcss-selector-parser@npm:^6.0.5, postcss-selector-parser@npm:^6.0.9": + version: 6.0.13 + resolution: "postcss-selector-parser@npm:6.0.13" + dependencies: + cssesc: ^3.0.0 + util-deprecate: ^1.0.2 + checksum: f89163338a1ce3b8ece8e9055cd5a3165e79a15e1c408e18de5ad8f87796b61ec2d48a2902d179ae0c4b5de10fccd3a325a4e660596549b040bc5ad1b465f096 + languageName: node + linkType: hard + "postcss-sort-media-queries@npm:^4.4.1": version: 4.4.1 resolution: "postcss-sort-media-queries@npm:4.4.1" @@ -16378,7 +16445,18 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.4.17, postcss@npm:^8.4.21, postcss@npm:^8.4.26, postcss@npm:^8.4.32, postcss@npm:^8.4.33, postcss@npm:^8.4.38": +"postcss@npm:^8.4.17, postcss@npm:^8.4.21, postcss@npm:^8.4.26, postcss@npm:^8.4.32, postcss@npm:^8.4.33": + version: 8.4.35 + resolution: "postcss@npm:8.4.35" + dependencies: + nanoid: ^3.3.7 + picocolors: ^1.0.0 + source-map-js: ^1.0.2 + checksum: cf3c3124d3912a507603f6d9a49b3783f741075e9aa73eb592a6dd9194f9edab9d20a8875d16d137d4f779fe7b6fbd1f5727e39bfd1c3003724980ee4995e1da + languageName: node + linkType: hard + +"postcss@npm:^8.4.38": version: 8.4.38 resolution: "postcss@npm:8.4.38" dependencies: @@ -18051,7 +18129,14 @@ __metadata: languageName: node linkType: hard -"source-map-js@npm:^1.0.1, source-map-js@npm:^1.2.0": +"source-map-js@npm:^1.0.1, source-map-js@npm:^1.0.2": + version: 1.0.2 + resolution: "source-map-js@npm:1.0.2" + checksum: c049a7fc4deb9a7e9b481ae3d424cc793cb4845daa690bc5a05d428bf41bf231ced49b4cf0c9e77f9d42fdb3d20d6187619fc586605f5eabe995a316da8d377c + languageName: node + linkType: hard + +"source-map-js@npm:^1.2.0": version: 1.2.0 resolution: "source-map-js@npm:1.2.0" checksum: 791a43306d9223792e84293b00458bf102a8946e7188f3db0e4e22d8d530b5f80a4ce468eb5ec0bf585443ad55ebbd630bf379c98db0b1f317fd902500217f97 From ed41f48e58f2dda676eeba5eb68a28af53552535 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 18:00:51 -0700 Subject: [PATCH 19/26] yarn dedupe, and undo some eslint.config changes --- eslint.config.mjs | 18 +++---- yarn.lock | 119 ++++------------------------------------------ 2 files changed, 18 insertions(+), 119 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 077640ec24e..bde1e5edd58 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -299,7 +299,7 @@ export default tseslint.config( extends: [tseslint.configs.disableTypeChecked], rules: { // turn off other type-aware rules - // 'deprecation/deprecation': 'off', + 'deprecation/deprecation': 'off', '@typescript-eslint/internal/no-poorly-typed-ts-props': 'off', // turn off rules that don't apply to JS code @@ -504,15 +504,15 @@ export default tseslint.config( rules: { '@typescript-eslint/internal/prefer-ast-types-enum': 'off', 'import/no-default-export': 'off', - // 'react/jsx-no-target-blank': 'off', - // 'react/no-unescaped-entities': 'off', - // 'react-hooks/exhaustive-deps': 'warn', // TODO: enable it later + 'react/jsx-no-target-blank': 'off', + 'react/no-unescaped-entities': 'off', + 'react-hooks/exhaustive-deps': 'warn', // TODO: enable it later + }, + settings: { + react: { + version: 'detect', + }, }, - // settings: { - // react: { - // version: 'detect', - // }, - // }, }, { files: ['packages/website/src/**/*.{ts,tsx,cts,mts}'], diff --git a/yarn.lock b/yarn.lock index cc3ec59faa2..32a683b5a52 100644 --- a/yarn.lock +++ b/yarn.lock @@ -266,30 +266,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:*, @babel/core@npm:^7.11.1, @babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.19.6, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.3": - version: 7.24.3 - resolution: "@babel/core@npm:7.24.3" - dependencies: - "@ampproject/remapping": ^2.2.0 - "@babel/code-frame": ^7.24.2 - "@babel/generator": ^7.24.1 - "@babel/helper-compilation-targets": ^7.23.6 - "@babel/helper-module-transforms": ^7.23.3 - "@babel/helpers": ^7.24.1 - "@babel/parser": ^7.24.1 - "@babel/template": ^7.24.0 - "@babel/traverse": ^7.24.1 - "@babel/types": ^7.24.0 - convert-source-map: ^2.0.0 - debug: ^4.1.0 - gensync: ^1.0.0-beta.2 - json5: ^2.2.3 - semver: ^6.3.1 - checksum: 1a33460794f4122cf255b656f4d6586913f41078a1afdf1bcf0365ddbd99c1ddb68f904062f9079445ab26b507c36bc297055192bc26e5c8e6e3def42195f9ab - languageName: node - linkType: hard - -"@babel/core@npm:^7.24.4": +"@babel/core@npm:*, @babel/core@npm:^7.11.1, @babel/core@npm:^7.11.6, @babel/core@npm:^7.12.3, @babel/core@npm:^7.19.6, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.3, @babel/core@npm:^7.24.4": version: 7.24.4 resolution: "@babel/core@npm:7.24.4" dependencies: @@ -326,19 +303,7 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.23.3, @babel/generator@npm:^7.24.1, @babel/generator@npm:^7.7.2": - version: 7.24.1 - resolution: "@babel/generator@npm:7.24.1" - dependencies: - "@babel/types": ^7.24.0 - "@jridgewell/gen-mapping": ^0.3.5 - "@jridgewell/trace-mapping": ^0.3.25 - jsesc: ^2.5.1 - checksum: 98c6ce5ec7a1cba2bdf35cdf607273b90cf7cf82bbe75cd0227363fb84d7e1bd8efa74f40247d5900c8c009123f10132ad209a05283757698de918278c3c6700 - languageName: node - linkType: hard - -"@babel/generator@npm:^7.24.4": +"@babel/generator@npm:^7.23.3, @babel/generator@npm:^7.24.1, @babel/generator@npm:^7.24.4, @babel/generator@npm:^7.7.2": version: 7.24.4 resolution: "@babel/generator@npm:7.24.4" dependencies: @@ -588,17 +553,6 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/helpers@npm:7.24.1" - dependencies: - "@babel/template": ^7.24.0 - "@babel/traverse": ^7.24.1 - "@babel/types": ^7.24.0 - checksum: 0643b8ccf3358682303aea65f0798e482b2c3642040d32ffe130a245f4a46d0d23fe575a5e06e3cda4e8ec4af89d52b94ff1c444a74465d47ccc27da6ddbbb9f - languageName: node - linkType: hard - "@babel/helpers@npm:^7.24.4": version: 7.24.4 resolution: "@babel/helpers@npm:7.24.4" @@ -622,16 +576,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:*, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/parser@npm:7.24.1" - bin: - parser: ./bin/babel-parser.js - checksum: a1068941dddf82ffdf572565b8b7b2cddb963ff9ddf97e6e28f50e843d820b4285e6def8f59170104a94e2a91ae2e3b326489886d77a57ea29d468f6a5e79bf9 - languageName: node - linkType: hard - -"@babel/parser@npm:^7.24.4": +"@babel/parser@npm:*, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.24.4": version: 7.24.4 resolution: "@babel/parser@npm:7.24.4" bin: @@ -1764,16 +1709,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.3, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.22.6, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.8.4": - version: 7.24.1 - resolution: "@babel/runtime@npm:7.24.1" - dependencies: - regenerator-runtime: ^0.14.0 - checksum: 5c8f3b912ba949865f03b3cf8395c60e1f4ebd1033fbd835bdfe81b6cac8a87d85bc3c7aded5fcdf07be044c9ab8c818f467abe0deca50020c72496782639572 - languageName: node - linkType: hard - -"@babel/runtime@npm:^7.24.4": +"@babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.3, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.22.6, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.24.4, @babel/runtime@npm:^7.7.2, @babel/runtime@npm:^7.8.4": version: 7.24.4 resolution: "@babel/runtime@npm:7.24.4" dependencies: @@ -16366,7 +16302,7 @@ __metadata: languageName: node linkType: hard -"postcss-selector-parser@npm:^6.0.16": +"postcss-selector-parser@npm:^6.0.16, postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4, postcss-selector-parser@npm:^6.0.5, postcss-selector-parser@npm:^6.0.9": version: 6.0.16 resolution: "postcss-selector-parser@npm:6.0.16" dependencies: @@ -16376,16 +16312,6 @@ __metadata: languageName: node linkType: hard -"postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4, postcss-selector-parser@npm:^6.0.5, postcss-selector-parser@npm:^6.0.9": - version: 6.0.13 - resolution: "postcss-selector-parser@npm:6.0.13" - dependencies: - cssesc: ^3.0.0 - util-deprecate: ^1.0.2 - checksum: f89163338a1ce3b8ece8e9055cd5a3165e79a15e1c408e18de5ad8f87796b61ec2d48a2902d179ae0c4b5de10fccd3a325a4e660596549b040bc5ad1b465f096 - languageName: node - linkType: hard - "postcss-sort-media-queries@npm:^4.4.1": version: 4.4.1 resolution: "postcss-sort-media-queries@npm:4.4.1" @@ -16445,18 +16371,7 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.4.17, postcss@npm:^8.4.21, postcss@npm:^8.4.26, postcss@npm:^8.4.32, postcss@npm:^8.4.33": - version: 8.4.35 - resolution: "postcss@npm:8.4.35" - dependencies: - nanoid: ^3.3.7 - picocolors: ^1.0.0 - source-map-js: ^1.0.2 - checksum: cf3c3124d3912a507603f6d9a49b3783f741075e9aa73eb592a6dd9194f9edab9d20a8875d16d137d4f779fe7b6fbd1f5727e39bfd1c3003724980ee4995e1da - languageName: node - linkType: hard - -"postcss@npm:^8.4.38": +"postcss@npm:^8.4.17, postcss@npm:^8.4.21, postcss@npm:^8.4.26, postcss@npm:^8.4.32, postcss@npm:^8.4.33, postcss@npm:^8.4.38": version: 8.4.38 resolution: "postcss@npm:8.4.38" dependencies: @@ -17509,7 +17424,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": +"rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: @@ -18129,14 +18044,7 @@ __metadata: languageName: node linkType: hard -"source-map-js@npm:^1.0.1, source-map-js@npm:^1.0.2": - version: 1.0.2 - resolution: "source-map-js@npm:1.0.2" - checksum: c049a7fc4deb9a7e9b481ae3d424cc793cb4845daa690bc5a05d428bf41bf231ced49b4cf0c9e77f9d42fdb3d20d6187619fc586605f5eabe995a316da8d377c - languageName: node - linkType: hard - -"source-map-js@npm:^1.2.0": +"source-map-js@npm:^1.0.1, source-map-js@npm:^1.2.0": version: 1.2.0 resolution: "source-map-js@npm:1.2.0" checksum: 791a43306d9223792e84293b00458bf102a8946e7188f3db0e4e22d8d530b5f80a4ce468eb5ec0bf585443ad55ebbd630bf379c98db0b1f317fd902500217f97 @@ -18926,16 +18834,7 @@ __metadata: languageName: node linkType: hard -"tmp@npm:*, tmp@npm:~0.2.1": - version: 0.2.1 - resolution: "tmp@npm:0.2.1" - dependencies: - rimraf: ^3.0.0 - checksum: 8b1214654182575124498c87ca986ac53dc76ff36e8f0e0b67139a8d221eaecfdec108c0e6ec54d76f49f1f72ab9325500b246f562b926f85bcdfca8bf35df9e - languageName: node - linkType: hard - -"tmp@npm:^0.2.3": +"tmp@npm:*, tmp@npm:^0.2.3, tmp@npm:~0.2.1": version: 0.2.3 resolution: "tmp@npm:0.2.3" checksum: 73b5c96b6e52da7e104d9d44afb5d106bb1e16d9fa7d00dbeb9e6522e61b571fbdb165c756c62164be9a3bbe192b9b268c236d370a2a0955c7689cd2ae377b95 From 0594a7a137dc168627657e683f58b4004915a51c Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 18:01:13 -0700 Subject: [PATCH 20/26] Remove extra node: --- packages/eslint-plugin/src/rules/no-unused-vars.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index e22ef052cb0..ad6fd271952 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -433,9 +433,6 @@ export default createRule({ }; context.report({ - node: writeReferences.length - ? writeReferences[writeReferences.length - 1].identifier - : unusedVar.identifiers[0], loc, messageId: 'unusedVar', data: unusedVar.references.some(ref => ref.isWrite()) From 5b4c85f99156e68f678d74830d764131b59df7d7 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 18:04:21 -0700 Subject: [PATCH 21/26] Finally revert nodeType changes --- .../tests/__snapshots__/flat-config-types.test.ts.snap | 2 +- .../recommended-does-not-require-program.test.ts.snap | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap b/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap index 31c182ce621..e6313ebeb82 100644 --- a/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/flat-config-types.test.ts.snap @@ -16,7 +16,7 @@ exports[`flat-config-types eslint should work successfully 1`] = ` "line": 38, "message": "'_otherCases' is defined but never used.", "messageId": "unusedVar", - "nodeType": "Identifier", + "nodeType": null, "ruleId": "@typescript-eslint/no-unused-vars", "severity": 2, }, diff --git a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap index 4d18019e6b8..ae2bd5a863e 100644 --- a/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap @@ -16,7 +16,7 @@ exports[`recommended-does-not-require-program eslint should work successfully 1` "line": 1, "message": "'foo' is assigned a value but never used.", "messageId": "unusedVar", - "nodeType": "Identifier", + "nodeType": null, "ruleId": "@typescript-eslint/no-unused-vars", "severity": 2, }, From 175c2925425088475d7eafc0255b1917b802076f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 18:19:14 -0700 Subject: [PATCH 22/26] one more deprecation fix --- packages/typescript-estree/tests/lib/convert.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index 93635e8d758..640a3d9946a 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -28,8 +28,8 @@ describe('convert', () => { function fakeUnknownKind(node: ts.Node): void { ts.forEachChild(node, fakeUnknownKind); - // eslint-disable-next-line deprecation/deprecation // @ts-expect-error -- intentionally writing to a readonly field + // eslint-disable-next-line deprecation/deprecation node.kind = ts.SyntaxKind.UnparsedPrologue; } From 9a7d27f283eba40d047e807885ef29c91f51ea67 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 18:19:51 -0700 Subject: [PATCH 23/26] Update eslint-plugin schemas snapshot --- .../no-restricted-imports.shot | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-restricted-imports.shot b/packages/eslint-plugin/tests/schema-snapshots/no-restricted-imports.shot index 55bec533996..1fbe61748f3 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-restricted-imports.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-restricted-imports.shot @@ -15,12 +15,6 @@ exports[`Rule schemas should be convertible to TS types for documentation purpos { "additionalProperties": false, "properties": { - "allowImportNames": { - "items": { - "type": "string" - }, - "type": "array" - }, "allowTypeImports": { "description": "Disallow value imports, but allow type-only imports.", "type": "boolean" @@ -62,12 +56,6 @@ exports[`Rule schemas should be convertible to TS types for documentation purpos { "additionalProperties": false, "properties": { - "allowImportNames": { - "items": { - "type": "string" - }, - "type": "array" - }, "allowTypeImports": { "description": "Disallow value imports, but allow type-only imports.", "type": "boolean" @@ -107,17 +95,6 @@ exports[`Rule schemas should be convertible to TS types for documentation purpos "items": { "additionalProperties": false, "properties": { - "allowImportNamePattern": { - "type": "string" - }, - "allowImportNames": { - "items": { - "type": "string" - }, - "minItems": 1, - "type": "array", - "uniqueItems": true - }, "allowTypeImports": { "description": "Disallow value imports, but allow type-only imports.", "type": "boolean" @@ -172,7 +149,6 @@ exports[`Rule schemas should be convertible to TS types for documentation purpos type Options = | ( | { - allowImportNames?: string[]; /** Disallow value imports, but allow type-only imports. */ allowTypeImports?: boolean; importNames?: string[]; @@ -186,7 +162,6 @@ type Options = { paths?: ( | { - allowImportNames?: string[]; /** Disallow value imports, but allow type-only imports. */ allowTypeImports?: boolean; importNames?: string[]; @@ -197,8 +172,6 @@ type Options = )[]; patterns?: | { - allowImportNamePattern?: string; - allowImportNames?: [string, ...string[]]; /** Disallow value imports, but allow type-only imports. */ allowTypeImports?: boolean; caseSensitive?: boolean; From 4a79978b3acba513cb88d985432132ab468b2958 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 19:00:38 -0700 Subject: [PATCH 24/26] Annoying tmp version update --- yarn.lock | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 32a683b5a52..863a0d350e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18834,7 +18834,16 @@ __metadata: languageName: node linkType: hard -"tmp@npm:*, tmp@npm:^0.2.3, tmp@npm:~0.2.1": +"tmp@npm:*, tmp@npm:~0.2.1": + version: 0.2.1 + resolution: "tmp@npm:0.2.1" + dependencies: + rimraf: ^3.0.0 + checksum: 8b1214654182575124498c87ca986ac53dc76ff36e8f0e0b67139a8d221eaecfdec108c0e6ec54d76f49f1f72ab9325500b246f562b926f85bcdfca8bf35df9e + languageName: node + linkType: hard + +"tmp@npm:^0.2.3": version: 0.2.3 resolution: "tmp@npm:0.2.3" checksum: 73b5c96b6e52da7e104d9d44afb5d106bb1e16d9fa7d00dbeb9e6522e61b571fbdb165c756c62164be9a3bbe192b9b268c236d370a2a0955c7689cd2ae377b95 From 72d19bd826a490ac6c932cfed55320e13c1aafad Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 8 May 2024 19:08:23 -0700 Subject: [PATCH 25/26] Add eslint_v9_tests --- .github/workflows/ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2a42d3dc83..94cd1db7a27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,6 +134,25 @@ jobs: run: yarn stylelint working-directory: packages/website + eslint_v9_tests: + name: Run tests on ESLint v9 + needs: [build] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install + uses: ./.github/actions/prepare-install + with: + node-version: ${{ env.PRIMARY_NODE_VERSION }} + - name: Build + uses: ./.github/actions/prepare-build + - run: yarn add eslint@9 + - name: Run tests + run: yarn test + env: + CI: true + integration_tests: name: Run integration tests on primary Node.js version needs: [build] From ee1d91c22693af64245de2bfc2ac873a3a819b08 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 9 May 2024 07:43:08 -0700 Subject: [PATCH 26/26] Fix yarn.lock --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 863a0d350e3..7941e2bec62 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17424,7 +17424,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^3.0.2": +"rimraf@npm:^3.0.0, rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" dependencies: