From f06fd3e8cfa700dc9012fd766a48c65948bed228 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" <53356952+typescript-eslint[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 18:40:11 +0930 Subject: [PATCH 001/283] chore: update sponsors (#11222) Co-authored-by: typescript-eslint[bot] --- packages/website/data/sponsors.json | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/packages/website/data/sponsors.json b/packages/website/data/sponsors.json index e68c673c6f43..7cb8bcdc4b12 100644 --- a/packages/website/data/sponsors.json +++ b/packages/website/data/sponsors.json @@ -227,7 +227,7 @@ "id": "syntaxfm", "image": "https://avatars.githubusercontent.com/u/130389858?v=4", "name": "Syntax", - "totalDonations": 34399, + "totalDonations": 37639, "website": "https://syntax.fm" }, { @@ -328,6 +328,13 @@ "totalDonations": 15000, "website": "https://paddn.com/" }, + { + "id": "getsentry", + "image": "https://avatars.githubusercontent.com/u/1396951?v=4", + "name": "Sentry", + "totalDonations": 14729, + "website": "https://sentry.io" + }, { "id": "Now4real", "image": "https://images.opencollective.com/now4real/54ca7d9/logo.png", @@ -339,16 +346,9 @@ "id": "codecov", "image": "https://avatars.githubusercontent.com/u/8226205?v=4", "name": "Codecov", - "totalDonations": 13431, + "totalDonations": 14456, "website": "https://codecov.io/" }, - { - "id": "getsentry", - "image": "https://avatars.githubusercontent.com/u/1396951?v=4", - "name": "Sentry", - "totalDonations": 13394, - "website": "https://sentry.io" - }, { "id": "gitbutlerapp", "image": "https://avatars.githubusercontent.com/u/123460877?v=4", @@ -363,6 +363,13 @@ "totalDonations": 11200, "website": "https://kwork.studio/" }, + { + "id": "charmed-kubernetes", + "image": "https://avatars.githubusercontent.com/u/49082977?v=4", + "name": "Charmed Kubernetes", + "totalDonations": 10488, + "website": "https://www.ubuntu.com/kubernetes" + }, { "id": "Gianfranco Palumbo", "image": "https://images.opencollective.com/gianpaj/5d62d25/avatar.png", From ff2a7858bba82851ddc91064695ebf72e44f1c18 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 16 May 2025 07:04:39 -0500 Subject: [PATCH 002/283] chore: clean up ESLint config post `vitest` migration (#11135) * chore: cleanup ESLint config file * remove `jiti` --- eslint.config.mjs | 109 ++++++++++++++++++++++++++-------------------- nx.json | 25 ++++++++--- package.json | 1 - project.json | 5 ++- yarn.lock | 19 ++++---- 5 files changed, 92 insertions(+), 67 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 6ffdaa9831a3..bb3e53430f9e 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -31,6 +31,7 @@ const restrictNamedDeclarations = { export default tseslint.config( // register all of the plugins up-front { + name: 'register-all-plugins', // note - intentionally uses computed syntax to make it easy to sort the keys /* eslint-disable no-useless-computed-key */ plugins: { @@ -85,11 +86,12 @@ export default tseslint.config( // see the file header in eslint-base.test.js for more info 'packages/rule-tester/tests/eslint-base/', ], + name: 'global-ignores', }, // extends ... eslintCommentsPlugin.recommended, - eslint.configs.recommended, + { name: `${eslint.meta.name}/recommended`, ...eslint.configs.recommended }, tseslint.configs.strictTypeChecked, tseslint.configs.stylisticTypeChecked, jsdocPlugin.configs['flat/recommended-typescript-error'], @@ -108,6 +110,7 @@ export default tseslint.config( }, }, linterOptions: { reportUnusedDisableDirectives: 'error' }, + name: 'base-config', rules: { // // our plugin :D @@ -345,6 +348,7 @@ export default tseslint.config( { extends: [tseslint.configs.disableTypeChecked], files: ['**/*.js'], + name: 'js-files-only', rules: { // turn off other type-aware rules '@typescript-eslint/internal/no-poorly-typed-ts-props': 'off', @@ -361,7 +365,7 @@ export default tseslint.config( // test file specific configuration { files: [ - 'packages/*/tests/**/*.{ts,tsx,cts,mts}', + 'packages/*/tests/**/*.?(m|c)ts?(x)', 'packages/integration-tests/tools/**/*.ts', ], ...vitestPlugin.configs.env, @@ -406,11 +410,11 @@ export default tseslint.config( // plugin rule tests { files: [ - 'packages/eslint-plugin-internal/tests/rules/**/*.test.{ts,tsx,cts,mts}', - 'packages/eslint-plugin-tslint/tests/rules/**/*.test.{ts,tsx,cts,mts}', - 'packages/eslint-plugin/tests/rules/**/*.test.{ts,tsx,cts,mts}', - 'packages/eslint-plugin/tests/eslint-rules/**/*.test.{ts,tsx,cts,mts}', + 'packages/eslint-plugin-internal/tests/rules/**/*.test.?(m|c)ts?(x)', + 'packages/eslint-plugin/tests/rules/**/*.test.?(m|c)ts?(x)', + 'packages/eslint-plugin/tests/eslint-rules/**/*.test.?(m|c)ts?(x)', ], + name: 'eslint-plugin-and-eslint-plugin-internal/test-files/rules', rules: { '@typescript-eslint/internal/plugin-test-formatting': 'error', }, @@ -421,10 +425,11 @@ export default tseslint.config( // { files: [ - '**/tools/**/*.{ts,tsx,cts,mts}', - '**/tests/**/*.{ts,tsx,cts,mts}', - 'packages/integration-tests/**/*.{ts,tsx,cts,mts}', + '**/tools/**/*.?(m|c)ts?(x)', + '**/tests/**/*.?(m|c)ts?(x)', + 'packages/integration-tests/**/*.?(m|c)ts?(x)', ], + name: 'tools-and-test-files', rules: { // allow console logs in tools and tests 'no-console': 'off', @@ -432,12 +437,13 @@ export default tseslint.config( }, { files: [ - 'eslint.config.{js,cjs,mjs}', + 'eslint.config.mjs', 'knip.ts', 'packages/*/src/index.ts', 'vitest.config.mts', 'packages/*/vitest.config.mts', ], + name: 'no-default-export', rules: { // requirement 'import/no-default-export': 'off', @@ -451,10 +457,10 @@ export default tseslint.config( { extends: [eslintPluginPlugin.configs['flat/recommended']], files: [ - 'packages/eslint-plugin-internal/**/*.{ts,tsx,cts,mts}', - 'packages/eslint-plugin-tslint/**/*.{ts,tsx,cts,mts}', - 'packages/eslint-plugin/**/*.{ts,tsx,cts,mts}', + 'packages/eslint-plugin-internal/**/*.?(m|c)ts?(x)', + 'packages/eslint-plugin/**/*.?(m|c)ts?(x)', ], + name: 'eslint-plugin-and-eslint-plugin-internal', rules: { '@typescript-eslint/internal/no-typescript-estree-import': 'error', @@ -462,13 +468,12 @@ export default tseslint.config( }, { files: [ - 'packages/eslint-plugin-internal/src/rules/**/*.{ts,tsx,cts,mts}', - 'packages/eslint-plugin-tslint/src/rules/**/*.{ts,tsx,cts,mts}', - 'packages/eslint-plugin/src/configs/**/*.{ts,tsx,cts,mts}', - 'packages/typescript-eslint/src/configs/**/*.{ts,tsx,cts,mts}', - 'packages/core/src/configs/**/*.{ts,tsx,cts,mts}', - 'packages/eslint-plugin/src/rules/**/*.{ts,tsx,cts,mts}', + 'packages/eslint-plugin-internal/src/rules/**/*.?(m|c)ts?(x)', + 'packages/eslint-plugin/src/configs/**/*.?(m|c)ts?(x)', + 'packages/typescript-eslint/src/configs/**/*.?(m|c)ts?(x)', + 'packages/eslint-plugin/src/rules/**/*.?(m|c)ts?(x)', ], + name: 'configs-and-rules', rules: { 'eslint-plugin/no-property-in-node': [ 'error', @@ -500,6 +505,7 @@ export default tseslint.config( }, { files: ['packages/eslint-plugin/src/rules/index.ts'], + name: 'eslint-plugin/source-files/rules-index-file', rules: { // enforce alphabetical ordering 'import/order': ['error', { alphabetize: { order: 'asc' } }], @@ -513,10 +519,10 @@ export default tseslint.config( { files: [ - 'packages/scope-manager/src/lib/*.{ts,tsx,cts,mts}', - 'packages/eslint-plugin/src/configs/*.{ts,tsx,cts,mts}', - 'packages/core/src/configs/*.{ts,tsx,cts,mts}', + 'packages/scope-manager/src/lib/*.?(m|c)ts?(x)', + 'packages/eslint-plugin/src/configs/*.?(m|c)ts?(x)', ], + name: 'generated-files', rules: { '@typescript-eslint/internal/no-poorly-typed-ts-props': 'off', '@typescript-eslint/internal/no-typescript-default-import': 'off', @@ -529,15 +535,27 @@ export default tseslint.config( // { - files: ['packages/ast-spec/src/**/*.{ts,tsx,cts,mts}'], + files: ['packages/ast-spec/src/**/*.?(m|c)ts?(x)'], + name: 'ast-spec/source-files', rules: { // disallow ALL unused vars '@typescript-eslint/no-unused-vars': ['error', { caughtErrors: 'all' }], '@typescript-eslint/sort-type-constituents': 'error', + + 'perfectionist/sort-interfaces': [ + 'error', + { + customGroups: { + first: ['type'], + }, + groups: ['first', 'unknown'], + }, + ], }, }, { - files: ['packages/ast-spec/**/*.{ts,tsx,cts,mts}'], + files: ['packages/ast-spec/**/*.?(m|c)ts?(x)'], + name: 'ast-spec', rules: { 'no-restricted-imports': [ 'error', @@ -559,12 +577,18 @@ export default tseslint.config( jsxA11yPlugin.flatConfigs.recommended, // https://github.com/facebook/react/pull/30774 // @ts-expect-error -- Temporary types incompatibility pending flat config support - reactPlugin.configs.flat.recommended, - // https://github.com/facebook/react/pull/30774 - // @ts-expect-error -- Temporary types incompatibility pending flat config support - fixupConfigRules(compat.config(reactHooksPlugin.configs.recommended)), + { name: 'react/recommended', ...reactPlugin.configs.flat.recommended }, + fixupConfigRules([ + { + name: 'react-hooks/recommended', + // https://github.com/facebook/react/pull/30774 + // @ts-expect-error -- Temporary types incompatibility pending flat config support + ...compat.config(reactHooksPlugin.configs.recommended)[0], + }, + ]), ], - files: ['packages/website/**/*.{ts,tsx,mts,cts,js,jsx}'], + files: ['packages/website/**/*.?(c|m)[tj]s?(x)'], + name: 'website', rules: { '@typescript-eslint/internal/prefer-ast-types-enum': 'off', 'import/no-default-export': 'off', @@ -580,7 +604,8 @@ export default tseslint.config( }, }, { - files: ['packages/website/src/**/*.{ts,tsx,cts,mts}'], + files: ['packages/website/src/**/*.?(m|c)ts?(x)'], + name: 'website/source-files', rules: { 'import/no-default-export': 'off', // allow console logs in the website to help with debugging things in production @@ -588,10 +613,8 @@ export default tseslint.config( }, }, { - files: [ - 'packages/website-eslint/src/mock/**/*.js', - '**/*.d.{ts,tsx,cts,mts}', - ], + files: ['packages/website-eslint/src/mock/**/*.js', '**/*.d.?(m|c)ts?(x)'], + name: 'website/source-files/mocks-and-declaration-files', rules: { // mocks and declaration files have to mirror their original package 'import/no-default-export': 'off', @@ -604,6 +627,7 @@ export default tseslint.config( 'packages/eslint-plugin/src/configs/flat/*', 'packages/scope-manager/src/configs/*', ], + name: 'all-files', rules: { '@typescript-eslint/sort-type-constituents': 'off', 'perfectionist/sort-classes': 'error', @@ -618,25 +642,12 @@ export default tseslint.config( ], }, }, - { - files: ['packages/ast-spec/src/**/*.ts'], - rules: { - 'perfectionist/sort-interfaces': [ - 'error', - { - customGroups: { - first: ['type'], - }, - groups: ['first', 'unknown'], - }, - ], - }, - }, { files: [ 'packages/eslint-plugin/src/rules/*.ts', 'packages/eslint-plugin-internal/src/rules/*.ts', ], + name: 'eslint-plugin-and-eslint-plugin-internal/source-files/rules', rules: { 'perfectionist/sort-objects': [ 'error', @@ -654,6 +665,7 @@ export default tseslint.config( }, { files: ['packages/eslint-plugin/tests/rules/*.test.ts'], + name: 'eslint-plugin-rules-test-files', rules: { 'perfectionist/sort-objects': [ 'error', @@ -666,6 +678,7 @@ export default tseslint.config( }, { files: ['packages/typescript-estree/src/**/*.ts'], + name: 'typescript-estree/source-files', rules: { 'perfectionist/sort-objects': [ 'error', diff --git a/nx.json b/nx.json index af3c7dc74658..b48badbaad3f 100644 --- a/nx.json +++ b/nx.json @@ -29,6 +29,13 @@ "buildDepsTargetName": "vite:build-deps", "watchDepsTargetName": "vite:watch-deps" } + }, + { + "plugin": "@nx/eslint/plugin", + "include": ["packages/*"], + "options": { + "targetName": "lint" + } } ], "release": { @@ -82,16 +89,20 @@ "watch": false } }, + "@nx/eslint:lint": { + "dependsOn": ["eslint-plugin-internal:build", "typescript-eslint:build"], + "options": { + "noEslintrc": true, + "cache": true, + "eslintConfig": "{workspaceRoot}/eslint.config.mjs" + }, + "outputs": ["{options.outputFile}"], + "cache": true + }, "lint": { - "executor": "@nx/eslint:lint", - "dependsOn": [ - "eslint-plugin:build", - "eslint-plugin-internal:build", - "typescript-eslint:build" - ], + "dependsOn": ["eslint-plugin-internal:build", "typescript-eslint:build"], "inputs": [ "default", - "{workspaceRoot}/eslint.config.js", "{workspaceRoot}/eslint.config.mjs", { "dependentTasksOutputFiles": "**/*.js", diff --git a/package.json b/package.json index 2bbb81ccdede..20b013dab04d 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,6 @@ "execa": "7.2.0", "globals": "^16.0.0", "husky": "^9.1.4", - "jiti": "2.4.2", "knip": "^5.41.1", "lint-staged": "^15.2.2", "make-dir": "^4.0.0", diff --git a/project.json b/project.json index f51e50b1493a..8aa79709f045 100644 --- a/project.json +++ b/project.json @@ -9,7 +9,10 @@ "outputs": ["{workspaceRoot}/dist"] }, "lint": { - "command": "eslint . --ignore-pattern=packages --cache" + "executor": "@nx/eslint:lint", + "options": { + "lintFilePatterns": ["{workspaceRoot}/!packages"] + } }, "generate-configs": { "command": "tsx tools/scripts/generate-configs.mts" diff --git a/yarn.lock b/yarn.lock index e87ed9ec5358..c51e1648780d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5733,7 +5733,6 @@ __metadata: execa: 7.2.0 globals: ^16.0.0 husky: ^9.1.4 - jiti: 2.4.2 knip: ^5.41.1 lint-staged: ^15.2.2 make-dir: ^4.0.0 @@ -12549,15 +12548,6 @@ __metadata: languageName: node linkType: hard -"jiti@npm:2.4.2, jiti@npm:^2.4.2": - version: 2.4.2 - resolution: "jiti@npm:2.4.2" - bin: - jiti: lib/jiti-cli.mjs - checksum: c6c30c7b6b293e9f26addfb332b63d964a9f143cdd2cf5e946dbe5143db89f7c1b50ad9223b77fb1f6ddb0b9c5ecef995fea024ecf7d2861d285d779cde66e1e - languageName: node - linkType: hard - "jiti@npm:^1.20.0": version: 1.21.6 resolution: "jiti@npm:1.21.6" @@ -12567,6 +12557,15 @@ __metadata: languageName: node linkType: hard +"jiti@npm:^2.4.2": + version: 2.4.2 + resolution: "jiti@npm:2.4.2" + bin: + jiti: lib/jiti-cli.mjs + checksum: c6c30c7b6b293e9f26addfb332b63d964a9f143cdd2cf5e946dbe5143db89f7c1b50ad9223b77fb1f6ddb0b9c5ecef995fea024ecf7d2861d285d779cde66e1e + languageName: node + linkType: hard + "jju@npm:~1.4.0": version: 1.4.0 resolution: "jju@npm:1.4.0" From 8f79ad0b50fb1e6fce329d9dd23fbba50a148d03 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 16 May 2025 07:06:17 -0500 Subject: [PATCH 003/283] chore(typescript-eslint): finish migrating to `vitest` (#11137) * update `vitest` to version 3.1.2 * chore(typescript-eslint): finish migrating to `vitest` * update `vitest` to version 3.1.3 * fix unit-tests --- eslint.config.mjs | 2 + packages/typescript-eslint/package.json | 3 +- .../tests/config-helper.test.ts | 62 +-- .../typescript-eslint/tests/configs.test.ts | 376 +++++++++++------- 4 files changed, 258 insertions(+), 185 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index bb3e53430f9e..8ce7890b0867 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -395,6 +395,7 @@ export default tseslint.config( }, settings: { vitest: { typecheck: true } }, }, + { files: ['packages/*/tests/**/vitest-custom-matchers.d.ts'], name: 'vitest-custom-matchers-declaration-files', @@ -407,6 +408,7 @@ export default tseslint.config( '@typescript-eslint/no-explicit-any': 'off', }, }, + // plugin rule tests { files: [ diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index e59a531f543a..9eb271206573 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -43,8 +43,7 @@ ], "scripts": { "build": "tsc -b tsconfig.build.json", - "clean": "tsc -b tsconfig.build.json --clean", - "postclean": "rimraf dist/ coverage/", + "clean": "rimraf dist/ coverage/", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", "lint": "nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", diff --git a/packages/typescript-eslint/tests/config-helper.test.ts b/packages/typescript-eslint/tests/config-helper.test.ts index 2def1d4256c4..748f67626266 100644 --- a/packages/typescript-eslint/tests/config-helper.test.ts +++ b/packages/typescript-eslint/tests/config-helper.test.ts @@ -1,6 +1,6 @@ import type { TSESLint } from '@typescript-eslint/utils'; -import tseslint from '../src/index'; +import tseslint from '../src/index.js'; describe('config helper', () => { it('works without extends', () => { @@ -10,7 +10,7 @@ describe('config helper', () => { ignores: ['ignored'], rules: { rule: 'error' }, }), - ).toEqual([ + ).toStrictEqual([ { files: ['file'], ignores: ['ignored'], @@ -25,7 +25,7 @@ describe('config helper', () => { extends: [{ rules: { rule1: 'error' } }, { rules: { rule2: 'error' } }], rules: { rule: 'error' }, }), - ).toEqual([ + ).toStrictEqual([ { rules: { rule1: 'error' } }, { rules: { rule2: 'error' } }, { rules: { rule: 'error' } }, @@ -40,7 +40,7 @@ describe('config helper', () => { ignores: ['common-ignored'], rules: { rule: 'error' }, }), - ).toEqual([ + ).toStrictEqual([ { files: ['common-file'], ignores: ['common-ignored'], @@ -62,7 +62,7 @@ describe('config helper', () => { it('throws error containing config name when some extensions are undefined', () => { const extension: TSESLint.FlatConfig.Config = { rules: { rule1: 'error' } }; - expect(() => + expect(() => { tseslint.config( { extends: [extension], @@ -79,8 +79,8 @@ describe('config helper', () => { name: 'my-config-2', rules: { rule: 'error' }, }, - ), - ).toThrow( + ); + }).toThrow( 'tseslint.config(): Config at index 1, named "my-config-2", contains non-object ' + 'extensions at the following indices: 0, 2', ); @@ -89,7 +89,7 @@ describe('config helper', () => { it('throws error without config name when some extensions are undefined', () => { const extension: TSESLint.FlatConfig.Config = { rules: { rule1: 'error' } }; - expect(() => + expect(() => { tseslint.config( { extends: [extension], @@ -105,8 +105,8 @@ describe('config helper', () => { ignores: ['common-ignored'], rules: { rule: 'error' }, }, - ), - ).toThrow( + ); + }).toThrow( 'tseslint.config(): Config at index 1 (anonymous) contains non-object extensions at ' + 'the following indices: 0, 2', ); @@ -121,7 +121,7 @@ describe('config helper', () => { name: 'my-config', rules: { rule: 'error' }, }), - ).toEqual([ + ).toStrictEqual([ { files: ['common-file'], ignores: ['common-ignored'], @@ -154,7 +154,7 @@ describe('config helper', () => { ignores: ['common-ignored'], rules: { rule: 'error' }, }), - ).toEqual([ + ).toStrictEqual([ { files: ['common-file'], ignores: ['common-ignored'], @@ -186,7 +186,7 @@ describe('config helper', () => { name: 'my-config', rules: { rule: 'error' }, }), - ).toEqual([ + ).toStrictEqual([ { files: ['common-file'], ignores: ['common-ignored'], @@ -217,7 +217,7 @@ describe('config helper', () => { [[[{ rules: { rule4: 'error' } }]]], [[[[{ rules: { rule5: 'error' } }]]]], ), - ).toEqual([ + ).toStrictEqual([ { rules: { rule1: 'error' } }, { rules: { rule2: 'error' } }, { rules: { rule3: 'error' } }, @@ -238,7 +238,7 @@ describe('config helper', () => { ], rules: { rule: 'error' }, }), - ).toEqual([ + ).toStrictEqual([ { rules: { rule1: 'error' } }, { rules: { rule2: 'error' } }, { rules: { rule3: 'error' } }, @@ -254,7 +254,7 @@ describe('config helper', () => { ignores: ['ignored'], }); - expect(configWithIgnores).toEqual([ + expect(configWithIgnores).toStrictEqual([ { ignores: ['ignored'], rules: { rule1: 'error' } }, { ignores: ['ignored'], rules: { rule2: 'error' } }, ]); @@ -272,7 +272,7 @@ describe('config helper', () => { name: 'my-config', }); - expect(configWithMetadata).toEqual([ + expect(configWithMetadata).toStrictEqual([ { files: ['file'], ignores: ['ignored'], @@ -301,7 +301,7 @@ describe('config helper', () => { extends: [{ rules: { rule1: 'error' } }, {}], ignores: ['ignored'], }), - ).toEqual([ + ).toStrictEqual([ { ignores: ['ignored'], rules: { rule1: 'error' } }, // Should not create global ignores {}, @@ -314,23 +314,23 @@ describe('config helper', () => { extends: [{ ignores: ['files/**/*'], name: 'global-ignore-stuff' }], ignores: ['ignored'], }), - ).toEqual([{ ignores: ['files/**/*'], name: 'global-ignore-stuff' }]); + ).toStrictEqual([{ ignores: ['files/**/*'], name: 'global-ignore-stuff' }]); }); it('throws error when extends is not an array', () => { - expect(() => + expect(() => { tseslint.config({ // @ts-expect-error purposely testing invalid values extends: 42, - }), - ).toThrow( + }); + }).toThrow( "tseslint.config(): Config at index 0 (anonymous) has an 'extends' property that is not an array.", ); }); - it.each([undefined, null, 'not a config object', 42])( + it.for([[undefined], [null], ['not a config object'], [42]] as const)( 'passes invalid arguments through unchanged', - config => { + ([config], { expect }) => { expect( tseslint.config( // @ts-expect-error purposely testing invalid values @@ -341,12 +341,12 @@ describe('config helper', () => { ); it('gives a special error message for string extends', () => { - expect(() => + expect(() => { tseslint.config({ // @ts-expect-error purposely testing invalid values extends: ['some-string'], - }), - ).toThrow( + }); + }).toThrow( 'tseslint.config(): Config at index 0 (anonymous) has an \'extends\' array that contains a string ("some-string") at index 0. ' + "This is a feature of eslint's `defineConfig()` helper and is not supported by typescript-eslint. " + 'Please provide a config object instead.', @@ -360,17 +360,17 @@ describe('config helper', () => { extends: null, files: ['files'], }), - ).toEqual([{ files: ['files'] }]); + ).toStrictEqual([{ files: ['files'] }]); }); it('complains when given an object with an invalid name', () => { - expect(() => + expect(() => { tseslint.config({ extends: [], // @ts-expect-error purposely testing invalid values name: 42, - }), - ).toThrow( + }); + }).toThrow( "tseslint.config(): Config at index 0 has a 'name' property that is not a string.", ); }); diff --git a/packages/typescript-eslint/tests/configs.test.ts b/packages/typescript-eslint/tests/configs.test.ts index 3be135ea1e57..fea7a41196f4 100644 --- a/packages/typescript-eslint/tests/configs.test.ts +++ b/packages/typescript-eslint/tests/configs.test.ts @@ -5,7 +5,7 @@ import type { import rules from '@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules'; -import tseslint from '../src/index'; +import tseslint from '../src/index.js'; const RULE_NAME_PREFIX = '@typescript-eslint/'; const EXTENSION_RULES = Object.entries(rules) @@ -23,8 +23,9 @@ const EXTENSION_RULES = Object.entries(rules) function filterRules( values: FlatConfig.Rules | undefined, ): [string, FlatConfig.RuleEntry][] { - expect(values).toBeDefined(); - return Object.entries(values!) + assert.isDefined(values); + + return Object.entries(values) .filter((pair): pair is [string, FlatConfig.RuleEntry] => pair[1] != null) .filter(([name]) => name.startsWith(RULE_NAME_PREFIX)); } @@ -88,227 +89,298 @@ function filterAndMapRuleConfigs({ }); } -function itHasBaseRulesOverriden( - unfilteredConfigRules: FlatConfig.Rules | undefined, -): void { - it('has the base rules overriden by the appropriate extension rules', () => { - expect(unfilteredConfigRules).toBeDefined(); - const ruleNames = new Set(Object.keys(unfilteredConfigRules!)); - EXTENSION_RULES.forEach(([ruleName, extRuleName]) => { - if (ruleNames.has(ruleName)) { - // this looks a little weird, but it provides the cleanest test output style - expect(unfilteredConfigRules).toMatchObject({ - ...unfilteredConfigRules, - [extRuleName]: 'off', - }); - } - }); - }); -} +const localTest = test.extend<{ + unfilteredConfigRules: FlatConfig.Rules | undefined; + expectedOverrides: Record; + configRulesObject: Record; +}>({ + configRulesObject: [ + async ({ unfilteredConfigRules }, use) => { + const configRules = filterRules(unfilteredConfigRules); -describe('all.ts', () => { - const unfilteredConfigRules = tseslint.configs.all[2]?.rules; + const configRulesObject = Object.fromEntries(configRules); + + await use(configRulesObject); + }, + { auto: false }, + ], + + expectedOverrides: [ + async ({ unfilteredConfigRules }, use) => { + assert.isDefined(unfilteredConfigRules); + + const ruleNames = new Set(Object.keys(unfilteredConfigRules)); + + const expectedOverrides = Object.fromEntries( + EXTENSION_RULES.filter(([ruleName]) => ruleNames.has(ruleName)).map( + ([, extRuleName]) => [extRuleName, 'off'] as const, + ), + ); + + await use(expectedOverrides); + }, + { auto: false }, + ], - it('contains all of the rules', () => { - const configRules = filterRules(unfilteredConfigRules); + unfilteredConfigRules: [tseslint.configs.all[2]?.rules, { auto: true }], +}); + +describe('all.ts', () => { + localTest('contains all of the rules', ({ configRulesObject }) => { // note: exclude deprecated rules, this config is allowed to change between minor versions const ruleConfigs = filterAndMapRuleConfigs({ excludeDeprecated: true, }); - expect(Object.fromEntries(ruleConfigs)).toEqual( - Object.fromEntries(configRules), - ); + expect(Object.fromEntries(ruleConfigs)).toStrictEqual(configRulesObject); }); - itHasBaseRulesOverriden(unfilteredConfigRules); + localTest( + 'has the base rules overridden by the appropriate extension rules', + ({ expectedOverrides, unfilteredConfigRules }) => { + expect(unfilteredConfigRules).toMatchObject(expectedOverrides); + }, + ); }); describe('disable-type-checked.ts', () => { - const unfilteredConfigRules = tseslint.configs.disableTypeChecked.rules; - - it('disables all type checked rules', () => { - const configRules = filterRules(unfilteredConfigRules); + localTest.scoped({ + unfilteredConfigRules: tseslint.configs.disableTypeChecked.rules, + }); - const ruleConfigs: [string, string][] = Object.entries(rules) + localTest('disables all type checked rules', ({ configRulesObject }) => { + const ruleConfigs = Object.entries(rules) .filter(([, rule]) => rule.meta.docs.requiresTypeChecking) - .map(([name]) => [`${RULE_NAME_PREFIX}${name}`, 'off']); + .map(([name]) => [`${RULE_NAME_PREFIX}${name}`, 'off'] as const); - expect(Object.fromEntries(ruleConfigs)).toEqual( - Object.fromEntries(configRules), - ); + expect(Object.fromEntries(ruleConfigs)).toStrictEqual(configRulesObject); }); }); describe('recommended.ts', () => { - const unfilteredConfigRules = tseslint.configs.recommended[2]?.rules; - - it('contains all recommended rules, excluding type checked ones', () => { - const configRules = filterRules(unfilteredConfigRules); - // note: include deprecated rules so that the config doesn't change between major bumps - const ruleConfigs = filterAndMapRuleConfigs({ - recommendations: ['recommended'], - typeChecked: 'exclude', - }); - - expect(Object.fromEntries(ruleConfigs)).toEqual( - Object.fromEntries(configRules), - ); + localTest.scoped({ + unfilteredConfigRules: tseslint.configs.recommended[2]?.rules, }); - itHasBaseRulesOverriden(unfilteredConfigRules); + localTest( + 'contains all recommended rules, excluding type checked ones', + ({ configRulesObject }) => { + // note: include deprecated rules so that the config doesn't change between major bumps + const ruleConfigs = filterAndMapRuleConfigs({ + recommendations: ['recommended'], + typeChecked: 'exclude', + }); + + expect(Object.fromEntries(ruleConfigs)).toStrictEqual(configRulesObject); + }, + ); + + localTest( + 'has the base rules overridden by the appropriate extension rules', + ({ expectedOverrides, unfilteredConfigRules }) => { + expect(unfilteredConfigRules).toMatchObject(expectedOverrides); + }, + ); }); describe('recommended-type-checked.ts', () => { - const unfilteredConfigRules = - tseslint.configs.recommendedTypeChecked[2]?.rules; + localTest.scoped({ + unfilteredConfigRules: tseslint.configs.recommendedTypeChecked[2]?.rules, + }); - it('contains all recommended rules', () => { - const configRules = filterRules(unfilteredConfigRules); + localTest('contains all recommended rules', ({ configRulesObject }) => { // note: include deprecated rules so that the config doesn't change between major bumps const ruleConfigs = filterAndMapRuleConfigs({ recommendations: ['recommended'], }); - expect(Object.fromEntries(ruleConfigs)).toEqual( - Object.fromEntries(configRules), - ); + expect(Object.fromEntries(ruleConfigs)).toStrictEqual(configRulesObject); }); - itHasBaseRulesOverriden(unfilteredConfigRules); + localTest( + 'has the base rules overridden by the appropriate extension rules', + ({ expectedOverrides, unfilteredConfigRules }) => { + expect(unfilteredConfigRules).toMatchObject(expectedOverrides); + }, + ); }); describe('recommended-type-checked-only.ts', () => { - const unfilteredConfigRules = - tseslint.configs.recommendedTypeCheckedOnly[2]?.rules; - - it('contains only type-checked recommended rules', () => { - const configRules = filterRules(unfilteredConfigRules); - // note: include deprecated rules so that the config doesn't change between major bumps - const ruleConfigs = filterAndMapRuleConfigs({ - recommendations: ['recommended'], - typeChecked: 'include-only', - }).filter(([ruleName]) => ruleName); - - expect(Object.fromEntries(ruleConfigs)).toEqual( - Object.fromEntries(configRules), - ); + localTest.scoped({ + unfilteredConfigRules: + tseslint.configs.recommendedTypeCheckedOnly[2]?.rules, }); - itHasBaseRulesOverriden(unfilteredConfigRules); + localTest( + 'contains only type-checked recommended rules', + ({ configRulesObject }) => { + // note: include deprecated rules so that the config doesn't change between major bumps + const ruleConfigs = filterAndMapRuleConfigs({ + recommendations: ['recommended'], + typeChecked: 'include-only', + }).filter(([ruleName]) => ruleName); + + expect(Object.fromEntries(ruleConfigs)).toStrictEqual(configRulesObject); + }, + ); + + localTest( + 'has the base rules overridden by the appropriate extension rules', + ({ expectedOverrides, unfilteredConfigRules }) => { + expect(unfilteredConfigRules).toMatchObject(expectedOverrides); + }, + ); }); describe('strict.ts', () => { - const unfilteredConfigRules = tseslint.configs.strict[2]?.rules; - - it('contains all strict rules, excluding type checked ones', () => { - const configRules = filterRules(unfilteredConfigRules); - // note: exclude deprecated rules, this config is allowed to change between minor versions - const ruleConfigs = filterAndMapRuleConfigs({ - excludeDeprecated: true, - recommendations: ['recommended', 'strict'], - typeChecked: 'exclude', - }); - - expect(Object.fromEntries(ruleConfigs)).toEqual( - Object.fromEntries(configRules), - ); + localTest.scoped({ + unfilteredConfigRules: tseslint.configs.strict[2]?.rules, }); - itHasBaseRulesOverriden(unfilteredConfigRules); + localTest( + 'contains all strict rules, excluding type checked ones', + ({ configRulesObject }) => { + // note: exclude deprecated rules, this config is allowed to change between minor versions + const ruleConfigs = filterAndMapRuleConfigs({ + excludeDeprecated: true, + recommendations: ['recommended', 'strict'], + typeChecked: 'exclude', + }); + + expect(Object.fromEntries(ruleConfigs)).toStrictEqual(configRulesObject); + }, + ); + + localTest( + 'has the base rules overridden by the appropriate extension rules', + ({ expectedOverrides, unfilteredConfigRules }) => { + expect(unfilteredConfigRules).toMatchObject(expectedOverrides); + }, + ); }); describe('strict-type-checked.ts', () => { - const unfilteredConfigRules = tseslint.configs.strictTypeChecked[2]?.rules; + localTest.scoped({ + unfilteredConfigRules: tseslint.configs.strictTypeChecked[2]?.rules, + }); - it('contains all strict rules', () => { - const configRules = filterRules(unfilteredConfigRules); + localTest('contains all strict rules', ({ configRulesObject }) => { // note: exclude deprecated rules, this config is allowed to change between minor versions const ruleConfigs = filterAndMapRuleConfigs({ excludeDeprecated: true, recommendations: ['recommended', 'strict'], }); - expect(Object.fromEntries(ruleConfigs)).toEqual( - Object.fromEntries(configRules), - ); + expect(Object.fromEntries(ruleConfigs)).toStrictEqual(configRulesObject); }); - itHasBaseRulesOverriden(unfilteredConfigRules); + localTest( + 'has the base rules overridden by the appropriate extension rules', + ({ expectedOverrides, unfilteredConfigRules }) => { + expect(unfilteredConfigRules).toMatchObject(expectedOverrides); + }, + ); }); describe('strict-type-checked-only.ts', () => { - const unfilteredConfigRules = - tseslint.configs.strictTypeCheckedOnly[2]?.rules; - - it('contains only type-checked strict rules', () => { - const configRules = filterRules(unfilteredConfigRules); - // note: exclude deprecated rules, this config is allowed to change between minor versions - const ruleConfigs = filterAndMapRuleConfigs({ - excludeDeprecated: true, - recommendations: ['recommended', 'strict'], - typeChecked: 'include-only', - }).filter(([ruleName]) => ruleName); - - expect(Object.fromEntries(ruleConfigs)).toEqual( - Object.fromEntries(configRules), - ); + localTest.scoped({ + unfilteredConfigRules: tseslint.configs.strictTypeCheckedOnly[2]?.rules, }); - itHasBaseRulesOverriden(unfilteredConfigRules); + localTest( + 'contains only type-checked strict rules', + ({ configRulesObject }) => { + // note: exclude deprecated rules, this config is allowed to change between minor versions + const ruleConfigs = filterAndMapRuleConfigs({ + excludeDeprecated: true, + recommendations: ['recommended', 'strict'], + typeChecked: 'include-only', + }).filter(([ruleName]) => ruleName); + + expect(Object.fromEntries(ruleConfigs)).toStrictEqual(configRulesObject); + }, + ); + + localTest( + 'has the base rules overridden by the appropriate extension rules', + ({ expectedOverrides, unfilteredConfigRules }) => { + expect(unfilteredConfigRules).toMatchObject(expectedOverrides); + }, + ); }); describe('stylistic.ts', () => { - const unfilteredConfigRules = tseslint.configs.stylistic[2]?.rules; - - it('contains all stylistic rules, excluding deprecated or type checked ones', () => { - const configRules = filterRules(unfilteredConfigRules); - // note: include deprecated rules so that the config doesn't change between major bumps - const ruleConfigs = filterAndMapRuleConfigs({ - recommendations: ['stylistic'], - typeChecked: 'exclude', - }); - - expect(Object.fromEntries(ruleConfigs)).toEqual( - Object.fromEntries(configRules), - ); + localTest.scoped({ + unfilteredConfigRules: tseslint.configs.stylistic[2]?.rules, }); - itHasBaseRulesOverriden(unfilteredConfigRules); + localTest( + 'contains all stylistic rules, excluding deprecated or type checked ones', + ({ configRulesObject }) => { + // note: include deprecated rules so that the config doesn't change between major bumps + const ruleConfigs = filterAndMapRuleConfigs({ + recommendations: ['stylistic'], + typeChecked: 'exclude', + }); + + expect(Object.fromEntries(ruleConfigs)).toStrictEqual(configRulesObject); + }, + ); + + localTest( + 'has the base rules overridden by the appropriate extension rules', + ({ expectedOverrides, unfilteredConfigRules }) => { + expect(unfilteredConfigRules).toMatchObject(expectedOverrides); + }, + ); }); describe('stylistic-type-checked.ts', () => { - const unfilteredConfigRules = tseslint.configs.stylisticTypeChecked[2]?.rules; - const configRules = filterRules(unfilteredConfigRules); - // note: include deprecated rules so that the config doesn't change between major bumps - const ruleConfigs = filterAndMapRuleConfigs({ - recommendations: ['stylistic'], + localTest.scoped({ + unfilteredConfigRules: tseslint.configs.stylisticTypeChecked[2]?.rules, }); - it('contains all stylistic rules, excluding deprecated ones', () => { - expect(Object.fromEntries(ruleConfigs)).toEqual( - Object.fromEntries(configRules), - ); - }); + localTest( + 'contains all stylistic rules, excluding deprecated ones', + ({ configRulesObject }) => { + // note: include deprecated rules so that the config doesn't change between major bumps + const ruleConfigs = filterAndMapRuleConfigs({ + recommendations: ['stylistic'], + }); - itHasBaseRulesOverriden(unfilteredConfigRules); + expect(Object.fromEntries(ruleConfigs)).toStrictEqual(configRulesObject); + }, + ); + + localTest( + 'has the base rules overridden by the appropriate extension rules', + ({ expectedOverrides, unfilteredConfigRules }) => { + expect(unfilteredConfigRules).toMatchObject(expectedOverrides); + }, + ); }); describe('stylistic-type-checked-only.ts', () => { - const unfilteredConfigRules = - tseslint.configs.stylisticTypeCheckedOnly[2]?.rules; - - it('contains only type-checked stylistic rules', () => { - const configRules = filterRules(unfilteredConfigRules); - // note: include deprecated rules so that the config doesn't change between major bumps - const ruleConfigs = filterAndMapRuleConfigs({ - recommendations: ['stylistic'], - typeChecked: 'include-only', - }).filter(([ruleName]) => ruleName); - - expect(Object.fromEntries(ruleConfigs)).toEqual( - Object.fromEntries(configRules), - ); + localTest.scoped({ + unfilteredConfigRules: tseslint.configs.stylisticTypeCheckedOnly[2]?.rules, }); - itHasBaseRulesOverriden(unfilteredConfigRules); + localTest( + 'contains only type-checked stylistic rules', + ({ configRulesObject }) => { + // note: include deprecated rules so that the config doesn't change between major bumps + const ruleConfigs = filterAndMapRuleConfigs({ + recommendations: ['stylistic'], + typeChecked: 'include-only', + }).filter(([ruleName]) => ruleName); + + expect(Object.fromEntries(ruleConfigs)).toStrictEqual(configRulesObject); + }, + ); + + localTest( + 'has the base rules overridden by the appropriate extension rules', + ({ expectedOverrides, unfilteredConfigRules }) => { + expect(unfilteredConfigRules).toMatchObject(expectedOverrides); + }, + ); }); From 48a9835bfd3b4949134068234257858c9a57027c Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Fri, 16 May 2025 07:40:37 -0500 Subject: [PATCH 004/283] chore(parser): finish migrating to `vitest` (#11191) * update `vitest` to version 3.1.3 * chore(parser): finish migrating to `vitest` * fix unit-tests for `parser` --- package.json | 2 - packages/parser/package.json | 3 +- packages/parser/tests/lib/parser.test.ts | 24 ++++-- packages/parser/tests/lib/services.test.ts | 65 +++++++------- packages/parser/tests/lib/tsx.test.ts | 38 +++++---- .../parser/tests/test-utils/test-utils.ts | 84 ++++--------------- .../tests/test-utils/ts-error-serializer.ts | 4 +- yarn.lock | 3 +- 8 files changed, 88 insertions(+), 135 deletions(-) diff --git a/package.json b/package.json index 20b013dab04d..a51cd0073937 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,6 @@ "markdownlint-cli": "^0.44.0", "nx": "20.7.2", "prettier": "3.5.0", - "pretty-format": "^29.7.0", "rimraf": "^5.0.5", "semver": "7.7.0", "tsx": "*", @@ -116,7 +115,6 @@ "@types/react": "^18.2.14", "eslint-plugin-eslint-plugin@^5.5.0": "patch:eslint-plugin-eslint-plugin@npm%3A5.5.1#./.yarn/patches/eslint-plugin-eslint-plugin-npm-5.5.1-4206c2506d.patch", "prettier": "3.5.0", - "pretty-format": "^29", "react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch", "tmp": "0.2.1", "tsx": "^4.7.2", diff --git a/packages/parser/package.json b/packages/parser/package.json index 6fb66eac1ae8..ca32c3eb4d7e 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -40,8 +40,7 @@ ], "scripts": { "build": "tsc -b tsconfig.build.json", - "clean": "tsc -b tsconfig.build.json --clean", - "postclean": "rimraf dist/ coverage/", + "clean": "rimraf dist/ coverage/", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", "lint": "npx nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", diff --git a/packages/parser/tests/lib/parser.test.ts b/packages/parser/tests/lib/parser.test.ts index 39c072a8d42e..a36d76c11edd 100644 --- a/packages/parser/tests/lib/parser.test.ts +++ b/packages/parser/tests/lib/parser.test.ts @@ -2,24 +2,30 @@ import type { ParserOptions } from '@typescript-eslint/types'; import * as scopeManager from '@typescript-eslint/scope-manager'; import * as typescriptESTree from '@typescript-eslint/typescript-estree'; -import path from 'node:path'; import { ScriptTarget } from 'typescript'; -import { parse, parseForESLint } from '../../src/parser'; +import { parse, parseForESLint } from '../../src/parser.js'; +import { FIXTURES_DIR } from '../test-utils/test-utils.js'; describe('parser', () => { - beforeEach(() => { + afterEach(() => { vi.clearAllMocks(); }); + afterAll(() => { + vi.restoreAllMocks(); + }); + it('parse() should return just the AST from parseForESLint()', () => { const code = 'const valid = true;'; - expect(parse(code)).toEqual(parseForESLint(code).ast); + expect(parse(code)).toStrictEqual(parseForESLint(code).ast); }); it('parseForESLint() should work if options are `null`', () => { const code = 'const valid = true;'; - expect(() => parseForESLint(code, null)).not.toThrow(); + expect(() => { + parseForESLint(code, null); + }).not.toThrow(); }); it('parseAndGenerateServices() should be called with options', () => { @@ -36,7 +42,7 @@ describe('parser', () => { extraFileExtensions: ['.foo'], filePath: './isolated-file.src.ts', project: 'tsconfig.json', - tsconfigRootDir: path.join(__dirname, '..', 'fixtures', 'services'), + tsconfigRootDir: FIXTURES_DIR, }; parseForESLint(code, config); expect(spy).toHaveBeenCalledExactlyOnceWith(code, { @@ -107,7 +113,7 @@ describe('parser', () => { errorOnTypeScriptSyntacticAndSemanticIssues: false, filePath: 'isolated-file.src.ts', project: 'tsconfig.json', - tsconfigRootDir: path.join(__dirname, '..', 'fixtures', 'services'), + tsconfigRootDir: FIXTURES_DIR, }; parseForESLint(code, config); @@ -141,7 +147,7 @@ describe('parser', () => { const config: ParserOptions = { filePath: 'isolated-file.src.ts', project: 'tsconfig.json', - tsconfigRootDir: path.join(__dirname, '..', 'fixtures', 'services'), + tsconfigRootDir: FIXTURES_DIR, }; vi.spyOn( @@ -185,7 +191,7 @@ describe('parser', () => { extraFileExtensions: ['.foo'], filePath: 'isolated-file.src.ts', project: 'tsconfig.json', - tsconfigRootDir: path.join(__dirname, '..', 'fixtures', 'services'), + tsconfigRootDir: FIXTURES_DIR, }; parseForESLint(code, config); diff --git a/packages/parser/tests/lib/services.test.ts b/packages/parser/tests/lib/services.test.ts index 3719c7127e82..5db0a81f44fb 100644 --- a/packages/parser/tests/lib/services.test.ts +++ b/packages/parser/tests/lib/services.test.ts @@ -1,57 +1,58 @@ import { createProgram } from '@typescript-eslint/typescript-estree'; import * as glob from 'glob'; -import fs from 'node:fs/promises'; -import path from 'node:path'; - -import type { ParserOptions } from '../../src/parser'; +import * as fs from 'node:fs/promises'; +import * as path from 'node:path'; +import { parseForESLint } from '../../src/index.js'; import { - createSnapshotTestBlock, - formatSnapshotName, - testServices, -} from '../test-utils/test-utils'; + createConfig, + FIXTURES_DIR, + getRaw, +} from '../test-utils/test-utils.js'; //------------------------------------------------------------------------------ // Setup //------------------------------------------------------------------------------ -const FIXTURES_DIR = path.join( - __dirname, - '..', - '..', - 'tests', - 'fixtures', - 'services', -); -const testFiles = glob.sync(`**/*.src.ts`, { +const testFiles = glob.sync('**/*.src.ts', { + absolute: true, cwd: FIXTURES_DIR, }); -function createConfig(filename: string): ParserOptions { - return { - filePath: filename, - project: './tsconfig.json', - tsconfigRootDir: path.resolve(FIXTURES_DIR), - }; -} - //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ -const program = createProgram(path.resolve(FIXTURES_DIR, 'tsconfig.json')); +const program = createProgram(path.join(FIXTURES_DIR, 'tsconfig.json')); describe.for(testFiles)('services', async filename => { - const code = await fs.readFile(path.join(FIXTURES_DIR, filename), { + const code = await fs.readFile(filename, { encoding: 'utf-8', }); - const config = createConfig(filename); - const snapshotName = formatSnapshotName(filename, FIXTURES_DIR, '.ts'); - it(snapshotName, createSnapshotTestBlock(code, config)); + + const { base, name } = path.parse(filename); + + const config = createConfig(base); + + const snapshotName = path.posix.join('fixtures', name); + + it(snapshotName, () => { + const { ast } = parseForESLint(code, config); + + const result = getRaw(ast); + + expect(result).toMatchSnapshot(); + }); + it(`${snapshotName} services`, () => { - testServices(code, config); + const { services } = parseForESLint(code, config); + + assert.isNotNull(services.program); }); + it(`${snapshotName} services with provided program`, () => { - testServices(code, { ...config, program }); + const { services } = parseForESLint(code, { ...config, program }); + + assert.isNotNull(services.program); }); }); diff --git a/packages/parser/tests/lib/tsx.test.ts b/packages/parser/tests/lib/tsx.test.ts index f58a859f41f7..ad7d5c8fd7f3 100644 --- a/packages/parser/tests/lib/tsx.test.ts +++ b/packages/parser/tests/lib/tsx.test.ts @@ -1,5 +1,5 @@ -import { parseForESLint } from '../../src/parser'; -import { serializer } from '../test-utils/ts-error-serializer'; +import { parseForESLint } from '../../src/index.js'; +import { serializer } from '../test-utils/ts-error-serializer.js'; //------------------------------------------------------------------------------ // Tests @@ -12,7 +12,9 @@ describe('TSX', () => { it('filePath was not provided', () => { const code = 'const element = '; - expect(() => parseForESLint(code)).toThrowErrorMatchingInlineSnapshot(` + expect(() => { + parseForESLint(code); + }).toThrowErrorMatchingInlineSnapshot(` TSError { "column": 18, "index": 18, @@ -24,22 +26,22 @@ describe('TSX', () => { it("filePath was not provided and 'jsx:true' option", () => { const code = 'const element = '; - expect(() => + expect(() => { parseForESLint(code, { ecmaFeatures: { jsx: true, }, - }), - ).not.toThrow(); + }); + }).not.toThrow(); }); it('test.ts', () => { const code = 'const element = '; - expect(() => + expect(() => { parseForESLint(code, { filePath: 'test.ts', - }), - ).toThrowErrorMatchingInlineSnapshot(` + }); + }).toThrowErrorMatchingInlineSnapshot(` TSError { "column": 18, "index": 18, @@ -52,14 +54,14 @@ describe('TSX', () => { it("test.ts with 'jsx:true' option", () => { const code = 'const element = '; - expect(() => + expect(() => { parseForESLint(code, { ecmaFeatures: { jsx: true, }, filePath: 'test.ts', - }), - ).toThrowErrorMatchingInlineSnapshot(` + }); + }).toThrowErrorMatchingInlineSnapshot(` TSError { "column": 18, "index": 18, @@ -71,23 +73,23 @@ describe('TSX', () => { it('test.tsx', () => { const code = 'const element = '; - expect(() => + expect(() => { parseForESLint(code, { filePath: 'test.tsx', - }), - ).not.toThrow(); + }); + }).not.toThrow(); }); it("test.tsx with 'jsx:false' option", () => { const code = 'const element = '; - expect(() => + expect(() => { parseForESLint(code, { ecmaFeatures: { jsx: false, }, filePath: 'test.tsx', - }), - ).not.toThrow(); + }); + }).not.toThrow(); }); }); }); diff --git a/packages/parser/tests/test-utils/test-utils.ts b/packages/parser/tests/test-utils/test-utils.ts index a286f9df4a86..1177c5923236 100644 --- a/packages/parser/tests/test-utils/test-utils.ts +++ b/packages/parser/tests/test-utils/test-utils.ts @@ -1,25 +1,35 @@ +import type { ParserOptions } from '@typescript-eslint/types'; import type { TSESTree } from '@typescript-eslint/typescript-estree'; -import type { ParserOptions } from '../../src/parser'; +import * as path from 'node:path'; -import * as parser from '../../src/parser'; +export const FIXTURES_DIR = path.join(__dirname, '..', 'fixtures', 'services'); -const defaultConfig = { +const DEFAULT_PARSER_OPTIONS = { comment: true, errorOnUnknownASTType: true, loc: true, range: true, raw: true, - sourceType: 'module' as const, + sourceType: 'module', tokens: true, -}; +} as const satisfies ParserOptions; + +export function createConfig(filename: string): ParserOptions { + return { + ...DEFAULT_PARSER_OPTIONS, + filePath: filename, + project: './tsconfig.json', + tsconfigRootDir: FIXTURES_DIR, + }; +} /** * Returns a raw copy of the given AST * @param ast the AST object * @returns copy of the AST object */ -function getRaw(ast: TSESTree.Program): TSESTree.Program { +export function getRaw(ast: TSESTree.Program): TSESTree.Program { return JSON.parse( JSON.stringify(ast, (key, value) => { if ((key === 'start' || key === 'end') && typeof value === 'number') { @@ -29,65 +39,3 @@ function getRaw(ast: TSESTree.Program): TSESTree.Program { }), ); } - -/** - * Returns a function which can be used as the callback of a Jest test() block, - * and which performs an assertion on the snapshot for the given code and config. - * @param code The source code to parse - * @param config the parser configuration - * @returns callback for Jest test() block - */ -export function createSnapshotTestBlock( - code: string, - config: ParserOptions = {}, -): () => void { - config = { ...defaultConfig, ...config }; - - /** - * @returns the AST object - */ - function parse(): TSESTree.Program { - const ast = parser.parseForESLint(code, config).ast; - return getRaw(ast); - } - - return (): void => { - try { - const result = parse(); - expect(result).toMatchSnapshot(); - } catch (error) { - /** - * If we are deliberately throwing because of encountering an unknown - * AST_NODE_TYPE, we rethrow to cause the test to fail - */ - if ((error as Error).message.includes('Unknown AST_NODE_TYPE')) { - throw error; - } - expect(parse).toThrowErrorMatchingSnapshot(); - } - }; -} - -/** - * @param code The code being parsed - * @param config The configuration object for the parser - */ -export function testServices(code: string, config: ParserOptions = {}): void { - config = { ...defaultConfig, ...config }; - - const services = parser.parseForESLint(code, config).services; - expect(services).toBeDefined(); - expect(services.program).toBeDefined(); - expect(services.esTreeNodeToTSNodeMap).toBeDefined(); - expect(services.tsNodeToESTreeNodeMap).toBeDefined(); -} - -export function formatSnapshotName( - filename: string, - fixturesDir: string, - fileExtension = '.js', -): string { - return `fixtures/${filename - .replace(`${fixturesDir}/`, '') - .replace(fileExtension, '')}`; -} diff --git a/packages/parser/tests/test-utils/ts-error-serializer.ts b/packages/parser/tests/test-utils/ts-error-serializer.ts index 9c9acca97eee..98eb146ce27d 100644 --- a/packages/parser/tests/test-utils/ts-error-serializer.ts +++ b/packages/parser/tests/test-utils/ts-error-serializer.ts @@ -1,8 +1,8 @@ -import type { Plugin } from 'pretty-format'; +import type { SnapshotSerializer } from 'vitest'; import { TSError } from '@typescript-eslint/typescript-estree'; -export const serializer: Plugin = { +export const serializer: SnapshotSerializer = { serialize(val: TSError, config, indentation, depth, refs, printer) { const format = (value: unknown): string => printer(value, config, indentation, depth + 1, refs); diff --git a/yarn.lock b/yarn.lock index c51e1648780d..89d54984e2db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5739,7 +5739,6 @@ __metadata: markdownlint-cli: ^0.44.0 nx: 20.7.2 prettier: 3.5.0 - pretty-format: ^29.7.0 rimraf: ^5.0.5 semver: 7.7.0 tsx: "*" @@ -16047,7 +16046,7 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:^29": +"pretty-format@npm:^29.7.0": version: 29.7.0 resolution: "pretty-format@npm:29.7.0" dependencies: From d2dfe73b5438c668996e1028141d46796d221cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Fri, 16 May 2025 08:56:21 -0400 Subject: [PATCH 005/283] docs: add big announcement notice for old major versions (#11178) * docs: add big announcement notice for old major versions * Update banner to be a bit more verbose about crashing * Also mention in Releases * Also update release docs --- docs/maintenance/Releases.mdx | 5 +++++ docs/users/Releases.mdx | 18 +++++++++++++++++- packages/website/docusaurus.config.mts | 24 ++++++++++++++++++++++++ packages/website/src/css/custom.css | 15 +++++++++++++++ 4 files changed, 61 insertions(+), 1 deletion(-) diff --git a/docs/maintenance/Releases.mdx b/docs/maintenance/Releases.mdx index 4e8eb84a4876..5473869cf388 100644 --- a/docs/maintenance/Releases.mdx +++ b/docs/maintenance/Releases.mdx @@ -34,6 +34,7 @@ Per [Users > Releases > Major Releases](../users/Releases.mdx#major-releases), w - Its publish command should be `npx nx release publish --tag rc-v${major} --verbose`. - `README.md`: - Add a link to a `v${major}--typescript-eslint.netlify.app` preview deploy environment on Netlify that you create for the branch. + - `docusaurus.config.mts`: updating the `supportedMajorVersion` variable - Merge this into `main` once reviewed and rebase the `v${major}` branch. #### 1a. Shared Config Changes @@ -77,6 +78,7 @@ These should only be done for feedback that consistently comes up in community t - It is important to note that when merged the commit message must also include `BREAKING CHANGE:` as the first line in order for `nx release` to recognize it as a breaking change in the release notes. If you miss this it just means more manual work when writing the release documentation. 1. Write and share out a blog post announcing the new beta [example: [Docs: Blog post describing changes & migration strategy for v5->v6](https://github.com/typescript-eslint/typescript-eslint/issues/6466)]. - Keep this post up-to-date as changes land in the `v${major}` branch. +1. Send a PR to the `v${major}` branch that adds the old major version to [Users > Releases > Old Release Documentation](../users/Releases.mdx#old-release-documentation) 1. Wait until all required PRs have been merged 1. Write a blog post announcing the new release [example: [Docs: Release blog post for v6](https://github.com/typescript-eslint/typescript-eslint/issues/7153)], and land it in the `v${major}` branch. 1. Let the release wait for **at least 1 week** to allow time for early adopters to help test it and discuss the changes. @@ -93,6 +95,9 @@ They don't need any special treatment. 1. Discuss with the maintainers to be ready for an [out-of-band](#out-of-band-releases) release. Doing this manually helps ensure someone is on-hand to action any issues that might arise from the major release. 1. Prepare the release notes. `nx release` will automatically generate the release notes on GitHub, however this will be disorganized and unhelpful for users. We need to reorganize the release notes so that breaking changes are placed at the top to make them most visible. If any migrations are required, we must list the steps to make it easy for users. - Example release notes: [`v6.0.0`](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v6.0.0), [`v5.0.0`](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v5.0.0) +1. Update Netlify deploys for old sites: + 1. Update the `CURRENT_MAJOR_VERSION` environment variable to the new major version integer, such as `9` + 2. Re-deploy the `v${major}` branches listed in [Users > Releases > Old Release Documentation](../users/Releases.mdx#old-release-documentation) 1. Finally, post the release on social media with a link to the GitHub release. Make sure you include additional information about the highlights of the release! ## Out-of-Band Releases diff --git a/docs/users/Releases.mdx b/docs/users/Releases.mdx index ad5625f70f33..81c6b504dddc 100644 --- a/docs/users/Releases.mdx +++ b/docs/users/Releases.mdx @@ -98,7 +98,23 @@ We assess need on a case-by-case basis though generally an emergency is defined These releases are done manually by a maintainer with the required access privileges. -## Back-Porting Releases +## Older Versions + +Older major versions of typescript-eslint are never maintained or supported. +They may crash with the latest versions of TypeScript. +Using the latest version of typescript-eslint is strongly recommended for getting the latest rule features and fixes, supporting the latest TypeScript features and syntax, and continuous performance and stability improvements. + +### Back-Porting Releases We **_do not_** back port releases to previously released major/minor versions. We only ever release forward. + +### Old Release Documentation + +You can find the last version of some older major versions under their dedicated branch deploys: + +- v7: [v7--typescript-eslint.netlify.app](https://v7--typescript-eslint.netlify.app) +- v6: [v6--typescript-eslint.netlify.app](https://v6--typescript-eslint.netlify.app) + +Note that older documentation pages may contain outdated information and links. +We strongly recommend using the latest version of typescript-eslint and its documentation. diff --git a/packages/website/docusaurus.config.mts b/packages/website/docusaurus.config.mts index 338a013d947e..3d66c81baa90 100644 --- a/packages/website/docusaurus.config.mts +++ b/packages/website/docusaurus.config.mts @@ -18,6 +18,10 @@ const remarkPlugins: MDXPlugin[] = [[npm2yarnPlugin, { sync: true }]]; const githubUrl = 'https://github.com/typescript-eslint/typescript-eslint'; +const currentMajorVersion = + process.env.CURRENT_MAJOR_VERSION && + Number(process.env.CURRENT_MAJOR_VERSION); + const presetClassicOptions: PresetClassicOptions = { blog: { blogSidebarCount: 'ALL', @@ -60,6 +64,26 @@ const themeConfig: AlgoliaThemeConfig & ThemeCommonConfig = { appId: 'N1HUB2TU6A', indexName: 'typescript-eslint', }, + announcementBar: + currentMajorVersion && + Number(version[0].split('.')[0]) < currentMajorVersion + ? { + content: [ + 'This documentation is for an older major version of typescript-eslint.', + '
', + 'It is no longer maintained or supported. It may crash with the latest versions of TypeScript.', + '
', + 'Using the latest version of typescript-eslint is strongly recommended for', + 'getting the latest rule features and fixes, ', + 'supporting the latest TypeScript features and syntax, and', + 'continuous performance and stability improvements.', + '
', + 'Please visit typescript-eslint.io for the latest version\'s documentation.', + ].join('\n'), + id: 'old-version-announcement', + isCloseable: false, + } + : undefined, colorMode: { respectPrefersColorScheme: true, }, diff --git a/packages/website/src/css/custom.css b/packages/website/src/css/custom.css index 8c8ec55addf8..8e7f1f195d90 100644 --- a/packages/website/src/css/custom.css +++ b/packages/website/src/css/custom.css @@ -219,3 +219,18 @@ td > p:last-child { h5 { font-weight: bold; } + +/* stylelint-disable-next-line selector-id-pattern */ +#__docusaurus > div[role='banner'] { + font-size: 150%; + height: initial; + position: sticky; + padding: 1rem 1.5rem; + margin: auto; + max-width: max(60%, 70rem); +} + +/* stylelint-disable-next-line selector-id-pattern */ +#__docusaurus > div[role='banner'] a { + font-weight: bold; +} From 220c38c570359aa2a96ec9672d3436d4a3b0c043 Mon Sep 17 00:00:00 2001 From: Hugo <60015232+hugop95@users.noreply.github.com> Date: Fri, 16 May 2025 18:15:58 +0200 Subject: [PATCH 006/283] chore: update `eslint-plugin-perfectionist` to `v4` (#11185) * chore: update dependencies * chore: update eslint config - `perfectionist` v4 uses RegExp to match, and `type` will match `typeSomething`, unlike in v3 which used `minimatch` by default. * chore: `sort-classes` fixes - The default `groups` option was updated in v4 (https://github.com/azat-io/eslint-plugin-perfectionist/pull/320). Forcing back to v3 default option. * chore: `sort-imports` fixes * chore: `sort-objects` fixes * chore: `sort-union-types` fixes - This is where most of the changes are. * chore: update dependencies --------- Co-authored-by: Josh Goldberg --- eslint.config.mjs | 53 +++++++++++++++---- package.json | 2 +- .../src/expression/UnaryExpression/spec.ts | 2 +- .../src/rules/no-restricted-types.ts | 2 +- .../src/rules/prefer-nullish-coalescing.ts | 4 +- .../src/util/collectUnusedVariables.ts | 2 - packages/eslint-plugin/tests/RuleTester.ts | 4 +- .../eslint-plugin/typings/eslint-rules.d.ts | 12 ++--- .../src/types/DependencyConstraint.ts | 2 +- .../src/referencer/Referencer.ts | 2 - packages/type-utils/src/isUnsafeAssignment.ts | 4 +- packages/types/src/parser-options.ts | 2 +- packages/utils/src/ts-eslint/Rule.ts | 4 +- packages/utils/src/ts-eslint/SourceCode.ts | 8 +-- .../src/components/layout/EditorTabs.tsx | 2 +- .../website/src/theme/MDXComponents/index.tsx | 2 +- packages/website/webpack.plugin.js | 4 +- tools/scripts/generate-contributors.mts | 2 +- yarn.lock | 50 +++++++---------- 19 files changed, 89 insertions(+), 74 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 8ce7890b0867..395b8dde0dac 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,9 +1,9 @@ // @ts-check +import eslintCommentsPlugin from '@eslint-community/eslint-plugin-eslint-comments/configs'; import { fixupConfigRules, fixupPluginRules } from '@eslint/compat'; import { FlatCompat } from '@eslint/eslintrc'; import eslint from '@eslint/js'; -import eslintCommentsPlugin from '@eslint-community/eslint-plugin-eslint-comments/configs'; import tseslintInternalPlugin from '@typescript-eslint/eslint-plugin-internal'; import vitestPlugin from '@vitest/eslint-plugin'; import eslintPluginPlugin from 'eslint-plugin-eslint-plugin'; @@ -594,10 +594,10 @@ export default tseslint.config( rules: { '@typescript-eslint/internal/prefer-ast-types-enum': 'off', 'import/no-default-export': 'off', + 'react-hooks/exhaustive-deps': 'warn', // TODO: enable it later 'react/jsx-no-target-blank': 'off', 'react/no-unescaped-entities': 'off', 'react/prop-types': 'off', - 'react-hooks/exhaustive-deps': 'warn', // TODO: enable it later }, settings: { react: { @@ -632,7 +632,26 @@ export default tseslint.config( name: 'all-files', rules: { '@typescript-eslint/sort-type-constituents': 'off', - 'perfectionist/sort-classes': 'error', + 'perfectionist/sort-classes': [ + 'error', + { + groups: [ + 'index-signature', + 'static-property', + 'static-block', + ['protected-property', 'protected-accessor-property'], + ['private-property', 'private-accessor-property'], + ['property', 'accessor-property'], + 'constructor', + 'static-method', + 'protected-method', + 'private-method', + 'method', + ['get-method', 'set-method'], + 'unknown', + ], + }, + ], 'perfectionist/sort-enums': 'off', 'perfectionist/sort-objects': 'error', 'perfectionist/sort-union-types': [ @@ -644,6 +663,20 @@ export default tseslint.config( ], }, }, + { + files: ['packages/ast-spec/src/**/*.ts'], + rules: { + 'perfectionist/sort-interfaces': [ + 'error', + { + customGroups: { + first: ['^type$'], + }, + groups: ['first', 'unknown'], + }, + ], + }, + }, { files: [ 'packages/eslint-plugin/src/rules/*.ts', @@ -655,10 +688,10 @@ export default tseslint.config( 'error', { customGroups: { - first: ['loc', 'name', 'node', 'type'], - fourth: ['fix'], - second: ['meta', 'messageId', 'start'], - third: ['defaultOptions', 'data', 'end'], + first: ['^loc$', '^name$', '^node$', '^type$'], + fourth: ['^fix$'], + second: ['^meta$', '^messageId$', '^start$'], + third: ['^defaultOptions$', '^data$', '^end$'], }, groups: ['first', 'second', 'third', 'fourth', 'unknown'], }, @@ -672,7 +705,7 @@ export default tseslint.config( 'perfectionist/sort-objects': [ 'error', { - customGroups: { top: ['valid'] }, + customGroups: { top: ['^valid$'] }, groups: ['top', 'unknown'], }, ], @@ -686,8 +719,8 @@ export default tseslint.config( 'error', { customGroups: { - first: ['type'], - second: ['loc', 'range'], + first: ['^type$'], + second: ['^loc$', '^range$'], }, groups: ['first', 'second'], }, diff --git a/package.json b/package.json index a51cd0073937..5ea26cb0ba81 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-jsdoc": "^50.5.0", "eslint-plugin-jsx-a11y": "^6.10.2", - "eslint-plugin-perfectionist": "^3.9.1", + "eslint-plugin-perfectionist": "^4.12.3", "eslint-plugin-react": "^7.37.3", "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-regexp": "^2.7.0", diff --git a/packages/ast-spec/src/expression/UnaryExpression/spec.ts b/packages/ast-spec/src/expression/UnaryExpression/spec.ts index 2d9f09f317b8..b5733e5ed85a 100644 --- a/packages/ast-spec/src/expression/UnaryExpression/spec.ts +++ b/packages/ast-spec/src/expression/UnaryExpression/spec.ts @@ -3,5 +3,5 @@ import type { UnaryExpressionBase } from '../../base/UnaryExpressionBase'; export interface UnaryExpression extends UnaryExpressionBase { type: AST_NODE_TYPES.UnaryExpression; - operator: '!' | '+' | '~' | '-' | 'delete' | 'typeof' | 'void'; + operator: '!' | '+' | '-' | 'delete' | 'typeof' | 'void' | '~'; } diff --git a/packages/eslint-plugin/src/rules/no-restricted-types.ts b/packages/eslint-plugin/src/rules/no-restricted-types.ts index b4d9e427c07f..2901ac5a9cf5 100644 --- a/packages/eslint-plugin/src/rules/no-restricted-types.ts +++ b/packages/eslint-plugin/src/rules/no-restricted-types.ts @@ -36,7 +36,7 @@ function stringifyNode( } function getCustomMessage( - bannedType: string | { fixWith?: string; message?: string } | true | null, + bannedType: string | true | { fixWith?: string; message?: string } | null, ): string { if (!bannedType || bannedType === true) { return ''; diff --git a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts index d846b0bbc59b..3e8c5914fa9f 100644 --- a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts +++ b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts @@ -47,13 +47,13 @@ export type Options = [ ignoreIfStatements?: boolean; ignoreMixedLogicalExpressions?: boolean; ignorePrimitives?: + | true | { bigint?: boolean; boolean?: boolean; number?: boolean; string?: boolean; - } - | true; + }; ignoreTernaryTests?: boolean; }, ]; diff --git a/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/packages/eslint-plugin/src/util/collectUnusedVariables.ts index d61b121fa5ba..983eb1472c14 100644 --- a/packages/eslint-plugin/src/util/collectUnusedVariables.ts +++ b/packages/eslint-plugin/src/util/collectUnusedVariables.ts @@ -230,9 +230,7 @@ class UnusedVarsVisitor extends Visitor { private markVariableAsUsed( variableOrIdentifier: ScopeVariable | TSESTree.Identifier, ): void; - private markVariableAsUsed(name: string, parent: TSESTree.Node): void; - private markVariableAsUsed( variableOrIdentifierOrName: string | ScopeVariable | TSESTree.Identifier, parent?: TSESTree.Node, diff --git a/packages/eslint-plugin/tests/RuleTester.ts b/packages/eslint-plugin/tests/RuleTester.ts index bc0317c8a466..7e003e7fa5f1 100644 --- a/packages/eslint-plugin/tests/RuleTester.ts +++ b/packages/eslint-plugin/tests/RuleTester.ts @@ -46,10 +46,10 @@ export function batchedSingleLineTests< Options extends readonly unknown[], >( options: + | ValidTestCase | ({ output?: string | null; - } & Omit, 'output'>) - | ValidTestCase, + } & Omit, 'output'>), ): (InvalidTestCase | ValidTestCase)[] { // -- eslint counts lines from 1 const lineOffset = options.code.startsWith('\n') ? 2 : 1; diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts index 5a70229dd33f..0a72f5b1ed80 100644 --- a/packages/eslint-plugin/typings/eslint-rules.d.ts +++ b/packages/eslint-plugin/typings/eslint-rules.d.ts @@ -520,11 +520,11 @@ declare module 'eslint/lib/rules/prefer-destructuring' { object?: boolean; } type Option0 = + | DestructuringTypeConfig | { AssignmentExpression?: DestructuringTypeConfig; VariableDeclarator?: DestructuringTypeConfig; - } - | DestructuringTypeConfig; + }; export interface Option1 { enforceForRenamedProperties?: boolean; } @@ -554,6 +554,7 @@ declare module 'eslint/lib/rules/no-restricted-imports' { } )[]; export type ArrayOfStringOrObjectPatterns = + | string[] | { // extended allowTypeImports?: boolean; @@ -561,15 +562,14 @@ declare module 'eslint/lib/rules/no-restricted-imports' { group?: string[]; regex?: string; message?: string; - }[] - | string[]; + }[]; export type RuleListener = + | Record | { ExportAllDeclaration(node: TSESTree.ExportAllDeclaration): void; ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void; ImportDeclaration(node: TSESTree.ImportDeclaration): void; - } - | Record; + }; } export interface ObjectOfPathsAndPatterns { diff --git a/packages/rule-tester/src/types/DependencyConstraint.ts b/packages/rule-tester/src/types/DependencyConstraint.ts index c271e8bba3ff..e4ab6824000f 100644 --- a/packages/rule-tester/src/types/DependencyConstraint.ts +++ b/packages/rule-tester/src/types/DependencyConstraint.ts @@ -10,8 +10,8 @@ export interface SemverVersionConstraint { readonly range: string; } export type AtLeastVersionConstraint = - | `${number}.${number}.${number}` | `${number}.${number}.${number}-${string}` + | `${number}.${number}.${number}` | `${number}.${number}` | `${number}`; export type VersionConstraint = diff --git a/packages/scope-manager/src/referencer/Referencer.ts b/packages/scope-manager/src/referencer/Referencer.ts index 0d1231c611c5..1f621d8f7823 100644 --- a/packages/scope-manager/src/referencer/Referencer.ts +++ b/packages/scope-manager/src/referencer/Referencer.ts @@ -90,9 +90,7 @@ export class Referencer extends Visitor { } } public currentScope(): Scope; - public currentScope(throwOnNull: true): Scope | null; - public currentScope(dontThrowOnNull?: true): Scope | null { if (!dontThrowOnNull) { assert(this.scopeManager.currentScope, 'aaa'); diff --git a/packages/type-utils/src/isUnsafeAssignment.ts b/packages/type-utils/src/isUnsafeAssignment.ts index 41fcc8aab1c1..c54f7ef5b7c6 100644 --- a/packages/type-utils/src/isUnsafeAssignment.ts +++ b/packages/type-utils/src/isUnsafeAssignment.ts @@ -21,7 +21,7 @@ export function isUnsafeAssignment( receiver: ts.Type, checker: ts.TypeChecker, senderNode: TSESTree.Node | null, -): { receiver: ts.Type; sender: ts.Type } | false { +): false | { receiver: ts.Type; sender: ts.Type } { return isUnsafeAssignmentWorker( type, receiver, @@ -37,7 +37,7 @@ function isUnsafeAssignmentWorker( checker: ts.TypeChecker, senderNode: TSESTree.Node | null, visited: Map>, -): { receiver: ts.Type; sender: ts.Type } | false { +): false | { receiver: ts.Type; sender: ts.Type } { if (isTypeAnyType(type)) { // Allow assignment of any ==> unknown. if (isTypeUnknownType(receiver)) { diff --git a/packages/types/src/parser-options.ts b/packages/types/src/parser-options.ts index 6cf485d9653f..e90c42fa640a 100644 --- a/packages/types/src/parser-options.ts +++ b/packages/types/src/parser-options.ts @@ -8,7 +8,6 @@ export type DebugLevel = export type CacheDurationSeconds = number | 'Infinity'; export type EcmaVersion = - | 'latest' | 3 | 5 | 6 @@ -33,6 +32,7 @@ export type EcmaVersion = | 2023 | 2024 | 2025 + | 'latest' | undefined; export type SourceTypeClassic = 'module' | 'script'; diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 35cd1c7f7a0c..3b40254b0a6e 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -766,11 +766,11 @@ export type AnyRuleModuleWithMetaDocs = RuleModuleWithMetaDocs< */ export type LooseRuleDefinition = // TODO - remove RuleCreateFunction once we no longer support ESLint 8 + | LooseRuleCreateFunction | { create: LooseRuleCreateFunction; meta?: object | undefined; - } - | LooseRuleCreateFunction; + }; /* eslint-disable-next-line @typescript-eslint/no-explicit-any -- intentionally using `any` to allow bi-directional assignment (unknown and diff --git a/packages/utils/src/ts-eslint/SourceCode.ts b/packages/utils/src/ts-eslint/SourceCode.ts index f4afb79f2dad..7d932a7eeff0 100644 --- a/packages/utils/src/ts-eslint/SourceCode.ts +++ b/packages/utils/src/ts-eslint/SourceCode.ts @@ -416,6 +416,7 @@ namespace SourceCode { export type CursorWithSkipOptions = | number + | FilterPredicate | { /** * The predicate function to choose tokens. @@ -429,11 +430,11 @@ namespace SourceCode { * The count of tokens the cursor skips. */ skip?: number; - } - | FilterPredicate; + }; export type CursorWithCountOptions = | number + | FilterPredicate | { /** * The maximum count of tokens the cursor iterates. @@ -447,8 +448,7 @@ namespace SourceCode { * The flag to iterate comments as well. */ includeComments?: boolean; - } - | FilterPredicate; + }; } class SourceCode extends (ESLintSourceCode as typeof SourceCodeBase) {} diff --git a/packages/website/src/components/layout/EditorTabs.tsx b/packages/website/src/components/layout/EditorTabs.tsx index a093a57791c7..50f11a9b9f78 100644 --- a/packages/website/src/components/layout/EditorTabs.tsx +++ b/packages/website/src/components/layout/EditorTabs.tsx @@ -10,7 +10,7 @@ export interface EditorTabsProps { readonly change: (name: T) => void; readonly showModal?: (name: T) => void; readonly showVisualEditor?: boolean; - readonly tabs: ({ label: string; value: T } | T)[]; + readonly tabs: (T | { label: string; value: T })[]; } function EditorTabs({ diff --git a/packages/website/src/theme/MDXComponents/index.tsx b/packages/website/src/theme/MDXComponents/index.tsx index 3efbee2d2408..624cdea67c10 100644 --- a/packages/website/src/theme/MDXComponents/index.tsx +++ b/packages/website/src/theme/MDXComponents/index.tsx @@ -1,5 +1,5 @@ -import Admonition from '@theme/Admonition'; import MDXComponents from '@theme-original/MDXComponents'; +import Admonition from '@theme/Admonition'; import { BaseRuleReference } from './BaseRuleReference'; import { HiddenHeading } from './HiddenHeading'; diff --git a/packages/website/webpack.plugin.js b/packages/website/webpack.plugin.js index c49dee7706af..be18ae1179a2 100644 --- a/packages/website/webpack.plugin.js +++ b/packages/website/webpack.plugin.js @@ -1,9 +1,9 @@ // eslint-disable-next-line @typescript-eslint/no-require-imports -const webpack = require('webpack'); +const CopyPlugin = require('copy-webpack-plugin'); // eslint-disable-next-line @typescript-eslint/no-require-imports const path = require('node:path'); // eslint-disable-next-line @typescript-eslint/no-require-imports -const CopyPlugin = require('copy-webpack-plugin'); +const webpack = require('webpack'); module.exports = function (/*context, options*/) { return { diff --git a/tools/scripts/generate-contributors.mts b/tools/scripts/generate-contributors.mts index d380f0382012..d051ab6c34e0 100644 --- a/tools/scripts/generate-contributors.mts +++ b/tools/scripts/generate-contributors.mts @@ -70,7 +70,7 @@ async function getData( async function* fetchUsers(page = 1): AsyncIterableIterator { while (page <= MATCH_PAGE_NUMBER) { console.log(`Fetching page ${page} of contributors...`); - const contributors = await getData<{ message: string } | Contributor[]>( + const contributors = await getData( `${contributorsApiUrl}&page=${page}`, ); diff --git a/yarn.lock b/yarn.lock index 89d54984e2db..eb4c70f161e8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5675,7 +5675,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.32.1, @typescript-eslint/types@^8.9.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.32.1, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -5725,7 +5725,7 @@ __metadata: eslint-plugin-import: ^2.31.0 eslint-plugin-jsdoc: ^50.5.0 eslint-plugin-jsx-a11y: ^6.10.2 - eslint-plugin-perfectionist: ^3.9.1 + eslint-plugin-perfectionist: ^4.12.3 eslint-plugin-react: ^7.37.3 eslint-plugin-react-hooks: ^5.0.0 eslint-plugin-regexp: ^2.7.0 @@ -5774,7 +5774,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.32.1, @typescript-eslint/utils@^8.9.0, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.32.1, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: @@ -9642,30 +9642,16 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-perfectionist@npm:^3.9.1": - version: 3.9.1 - resolution: "eslint-plugin-perfectionist@npm:3.9.1" +"eslint-plugin-perfectionist@npm:^4.12.3": + version: 4.13.0 + resolution: "eslint-plugin-perfectionist@npm:4.13.0" dependencies: - "@typescript-eslint/types": ^8.9.0 - "@typescript-eslint/utils": ^8.9.0 - minimatch: ^9.0.5 - natural-compare-lite: ^1.4.0 + "@typescript-eslint/types": ^8.32.1 + "@typescript-eslint/utils": ^8.32.1 + natural-orderby: ^5.0.0 peerDependencies: - astro-eslint-parser: ^1.0.2 - eslint: ">=8.0.0" - svelte: ">=3.0.0" - svelte-eslint-parser: ^0.41.1 - vue-eslint-parser: ">=9.0.0" - peerDependenciesMeta: - astro-eslint-parser: - optional: true - svelte: - optional: true - svelte-eslint-parser: - optional: true - vue-eslint-parser: - optional: true - checksum: 12bdc52586dd379bb174cb90c11d280173da88c079a3100eb2676ba9e8abf02e3989706fb06fc774331dc61909be27a0ba5c7ac591e9a777c793d7f8e5eb187d + eslint: ">=8.45.0" + checksum: 8dacb19fcd1cb1c5362c8715f72946aaed91be4f35c3cf4465d8e82a0a1b436bd6e7c36973cfc8e25221413d3a9a0d1e73901d40cca295e91a0d61dcdb0f9aa6 languageName: node linkType: hard @@ -14605,13 +14591,6 @@ __metadata: languageName: node linkType: hard -"natural-compare-lite@npm:^1.4.0": - version: 1.4.0 - resolution: "natural-compare-lite@npm:1.4.0" - checksum: 5222ac3986a2b78dd6069ac62cbb52a7bf8ffc90d972ab76dfe7b01892485d229530ed20d0c62e79a6b363a663b273db3bde195a1358ce9e5f779d4453887225 - languageName: node - linkType: hard - "natural-compare@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare@npm:1.4.0" @@ -14619,6 +14598,13 @@ __metadata: languageName: node linkType: hard +"natural-orderby@npm:^5.0.0": + version: 5.0.0 + resolution: "natural-orderby@npm:5.0.0" + checksum: bfdc62b91fb1b08bd3a8a9b66ec3476c17f867544f34778ce85344ffcff257342d632e94bc125c97f02b89c746479edd62c8727a310c94cab1a1d4a016eeeb46 + languageName: node + linkType: hard + "negotiator@npm:0.6.3, negotiator@npm:^0.6.3": version: 0.6.3 resolution: "negotiator@npm:0.6.3" From 05014ff054cfa336c8ca48bac08deec3225675ab Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Fri, 16 May 2025 10:39:40 -0600 Subject: [PATCH 007/283] chore: use TLA in ESM scripts rather than async main().catch() (#11218) use TLA in ESM scripts --- .../tools/generate-breaking-changes.mts | 118 ++- packages/types/tools/copy-ast-spec.mts | 19 +- packages/website-eslint/build.mts | 13 +- .../website/tools/generate-website-dts.mts | 39 +- tools/scripts/generate-configs.mts | 714 +++++++++--------- tools/scripts/generate-contributors.mts | 61 +- tools/scripts/generate-lib.mts | 322 ++++---- tools/scripts/postinstall.mts | 30 +- 8 files changed, 624 insertions(+), 692 deletions(-) diff --git a/packages/eslint-plugin/tools/generate-breaking-changes.mts b/packages/eslint-plugin/tools/generate-breaking-changes.mts index be38bd7b1022..0ddb3563b976 100644 --- a/packages/eslint-plugin/tools/generate-breaking-changes.mts +++ b/packages/eslint-plugin/tools/generate-breaking-changes.mts @@ -1,57 +1,42 @@ -import type { - ESLintPluginRuleModule, - TypeScriptESLintRules, -} from '@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules'; +import type { TypeScriptESLintRules } from '@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules'; import { fetch } from 'cross-fetch'; -// markdown-table is ESM, hence this file needs to be `.mts` import { markdownTable } from 'markdown-table'; -async function main(): Promise { - const rulesImport = await import('../src/rules/index.js'); - /* - weird TS resolution which adds an additional default layer in the type like: - { default: { default: Rules }} - instead of just - { default: Rules } - */ - const rules = rulesImport.default as unknown as Record< - string, - ESLintPluginRuleModule - >; +import rulesImport from '../src/rules/index.js'; - // Annotate which rules are new since the last version - async function getNewRulesAsOfMajorVersion( - oldVersion: string, - ): Promise> { - // 1. Get the current list of rules (already done) - const newRuleNames = Object.keys(rules); +// Annotate which rules are new since the last version +async function getNewRulesAsOfMajorVersion( + oldVersion: string, +): Promise> { + // 1. Get the current list of rules (already done) + const newRuleNames = Object.keys(rulesImport); - // 2. Retrieve the old version of typescript-eslint from unpkg - const oldUrl = `https://unpkg.com/@typescript-eslint/eslint-plugin@${oldVersion}/dist/configs/all.js`; - const oldFileText = await (await fetch(oldUrl)).text(); - const oldObjectText = oldFileText.substring( - oldFileText.indexOf('{'), - oldFileText.lastIndexOf('}') + 1, - ); - // Normally we wouldn't condone using the 'eval' API... - // But this is an internal-only script and it's the easiest way to convert - // the JS raw text into a runtime object. 🤷 - let oldRulesObject!: { rules: TypeScriptESLintRules }; - eval(`oldRulesObject = ${oldObjectText}`); - const oldRuleNames = new Set(Object.keys(oldRulesObject.rules)); + // 2. Retrieve the old version of typescript-eslint from unpkg + const oldUrl = `https://unpkg.com/@typescript-eslint/eslint-plugin@${oldVersion}/dist/configs/all.js`; + const oldFileText = await (await fetch(oldUrl)).text(); + const oldObjectText = oldFileText.substring( + oldFileText.indexOf('{'), + oldFileText.lastIndexOf('}') + 1, + ); + // Normally we wouldn't condone using the 'eval' API... + // But this is an internal-only script and it's the easiest way to convert + // the JS raw text into a runtime object. 🤷 + let oldRulesObject!: { rules: TypeScriptESLintRules }; + eval(`oldRulesObject = ${oldObjectText}`); + const oldRuleNames = new Set(Object.keys(oldRulesObject.rules)); - // 3. Get the keys that exist in (1) (new version) and not (2) (old version) - return new Set( - newRuleNames.filter( - newRuleName => !oldRuleNames.has(`@typescript-eslint/${newRuleName}`), - ), - ); - } + // 3. Get the keys that exist in (1) (new version) and not (2) (old version) + return new Set( + newRuleNames.filter( + newRuleName => !oldRuleNames.has(`@typescript-eslint/${newRuleName}`), + ), + ); +} - const newRuleNames = await getNewRulesAsOfMajorVersion('5.0.0'); +const newRuleNames = await getNewRulesAsOfMajorVersion('5.0.0'); - console.log(`## Table Key +console.log(`## Table Key @@ -132,28 +117,23 @@ async function main(): Promise { > Hint: search for 🆕 to find newly added rules, and ➕ or ➖ to see config changes. `); - console.log( - markdownTable([ - ['Rule', 'Status', 'TC', 'Ext', "Rec'd", 'Strict', 'Style'], - ...Object.entries(rules).map(([ruleName, { meta }]) => { - const { deprecated } = meta; - const { extendsBaseRule, recommended, requiresTypeChecking } = - meta.docs; - - return [ - `[\`${ruleName}\`](https://typescript-eslint.io/rules/${ruleName})`, - newRuleNames.has(ruleName) ? '🆕' : deprecated ? '💀' : '', - requiresTypeChecking ? '💭' : '', - extendsBaseRule ? '🧱' : '', - recommended === 'recommended' ? '🟩' : '', - recommended === 'strict' ? '🔵' : '', - recommended === 'stylistic' ? '🔸' : '', - ]; - }), - ]), - ); -} +console.log( + markdownTable([ + ['Rule', 'Status', 'TC', 'Ext', "Rec'd", 'Strict', 'Style'], + ...Object.entries(rulesImport).map(([ruleName, { meta }]) => { + const { deprecated } = meta; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- all of our rules have meta.docs + const { extendsBaseRule, recommended, requiresTypeChecking } = meta.docs!; -main().catch((error: unknown) => { - console.error(error); -}); + return [ + `[\`${ruleName}\`](https://typescript-eslint.io/rules/${ruleName})`, + newRuleNames.has(ruleName) ? '🆕' : deprecated ? '💀' : '', + requiresTypeChecking ? '💭' : '', + extendsBaseRule ? '🧱' : '', + recommended === 'recommended' ? '🟩' : '', + recommended === 'strict' ? '🔵' : '', + recommended === 'stylistic' ? '🔸' : '', + ]; + }), + ]), +); diff --git a/packages/types/tools/copy-ast-spec.mts b/packages/types/tools/copy-ast-spec.mts index f3ab39fdba7d..110a92854422 100644 --- a/packages/types/tools/copy-ast-spec.mts +++ b/packages/types/tools/copy-ast-spec.mts @@ -72,18 +72,11 @@ async function copyFile( console.log('Copied', fileName); } -async function main(): Promise { - if (process.env.SKIP_AST_SPEC_REBUILD) { - // ensure the package is built - await execAsync('yarn', ['build'], { cwd: AST_SPEC_PATH }); - } - - await copyFile('dist', 'ast-spec.ts', code => - code.replaceAll('export declare enum', 'export enum'), - ); +if (process.env.SKIP_AST_SPEC_REBUILD) { + // ensure the package is built + await execAsync('yarn', ['build'], { cwd: AST_SPEC_PATH }); } -main().catch((error: unknown) => { - console.error(error); - process.exitCode = 1; -}); +await copyFile('dist', 'ast-spec.ts', code => + code.replaceAll('export declare enum', 'export enum'), +); diff --git a/packages/website-eslint/build.mts b/packages/website-eslint/build.mts index 4c445e809ff5..6a98bbb0556f 100644 --- a/packages/website-eslint/build.mts +++ b/packages/website-eslint/build.mts @@ -1,4 +1,4 @@ -/* eslint-disable no-process-exit, no-console */ +/* eslint-disable no-console */ import * as esbuild from 'esbuild'; import * as fs from 'node:fs/promises'; @@ -170,12 +170,5 @@ async function buildPackage(name: string, file: string): Promise { } console.time('building eslint for web'); - -buildPackage('index', './src/index.js') - .then(() => { - console.timeEnd('building eslint for web'); - }) - .catch((e: unknown) => { - console.error(String(e)); - process.exit(1); - }); +await buildPackage('index', './src/index.js'); +console.timeEnd('building eslint for web'); diff --git a/packages/website/tools/generate-website-dts.mts b/packages/website/tools/generate-website-dts.mts index 9a6071ac4e7e..92e3e40bb534 100644 --- a/packages/website/tools/generate-website-dts.mts +++ b/packages/website/tools/generate-website-dts.mts @@ -79,29 +79,22 @@ function processFiles(text: string): string { return result; } -async function main(): Promise { - const vendor = path.join(__dirname, '..', 'src', 'vendor'); +const vendor = path.join(__dirname, '..', 'src', 'vendor'); - console.log('Cleaning...'); - await rimraf(vendor); - await makeDirectory(vendor); +console.log('Cleaning...'); +await rimraf(vendor); +await makeDirectory(vendor); - // TS-VFS - await getFileAndStoreLocally( - '/js/sandbox/vendor/typescript-vfs.d.ts', - path.join(vendor, 'typescript-vfs.d.ts'), - processFiles, - ); - - // Sandbox - await getFileAndStoreLocally( - '/js/sandbox/index.d.ts', - path.join(vendor, 'sandbox.d.ts'), - processFiles, - ); -} +// TS-VFS +await getFileAndStoreLocally( + '/js/sandbox/vendor/typescript-vfs.d.ts', + path.join(vendor, 'typescript-vfs.d.ts'), + processFiles, +); -main().catch((error: unknown) => { - console.error(error); - process.exitCode = 1; -}); +// Sandbox +await getFileAndStoreLocally( + '/js/sandbox/index.d.ts', + path.join(vendor, 'sandbox.d.ts'), + processFiles, +); diff --git a/tools/scripts/generate-configs.mts b/tools/scripts/generate-configs.mts index 6b0971a7104d..99a428fdea85 100644 --- a/tools/scripts/generate-configs.mts +++ b/tools/scripts/generate-configs.mts @@ -48,413 +48,407 @@ const CLASSIC_EXTENDS: readonly string[] = EXTENDS_MODULES.map( mod => mod.packageRelativePath, ); -async function main(): Promise { - function addAutoGeneratedComment(code?: string): string { - return [...AUTO_GENERATED_COMMENT_LINES, code].join('\n'); - } +function addAutoGeneratedComment(code?: string): string { + return [...AUTO_GENERATED_COMMENT_LINES, code].join('\n'); +} - const prettierConfig = await prettier.resolveConfig('file.ts', { - config: PRETTIER_CONFIG_PATH, - }); +const prettierConfig = await prettier.resolveConfig('file.ts', { + config: PRETTIER_CONFIG_PATH, +}); - type LinterConfigRules = Record< - string, - [ClassicConfig.RuleLevel, ...unknown[]] | ClassicConfig.RuleLevel - >; +type LinterConfigRules = Record< + string, + [ClassicConfig.RuleLevel, ...unknown[]] | ClassicConfig.RuleLevel +>; - interface LinterConfig extends ClassicConfig.Config { - extends?: string | string[]; - plugins?: string[]; - } +interface LinterConfig extends ClassicConfig.Config { + extends?: string | string[]; + plugins?: string[]; +} - const RULE_NAME_PREFIX = '@typescript-eslint/'; - const MAX_RULE_NAME_LENGTH = Math.max( - ...Object.keys(eslintPlugin.rules).map(name => name.length), - ); - const BASE_RULES_TO_BE_OVERRIDDEN = new Map( - Object.entries(eslintPlugin.rules) - .filter(([, rule]) => rule.meta.docs.extendsBaseRule) - .map( - ([ruleName, rule]) => - [ - ruleName, - typeof rule.meta.docs.extendsBaseRule === 'string' - ? rule.meta.docs.extendsBaseRule - : ruleName, - ] as const, - ), - ); +const RULE_NAME_PREFIX = '@typescript-eslint/'; +const MAX_RULE_NAME_LENGTH = Math.max( + ...Object.keys(eslintPlugin.rules).map(name => name.length), +); +const BASE_RULES_TO_BE_OVERRIDDEN = new Map( + Object.entries(eslintPlugin.rules) + .filter(([, rule]) => rule.meta.docs.extendsBaseRule) + .map( + ([ruleName, rule]) => + [ + ruleName, + typeof rule.meta.docs.extendsBaseRule === 'string' + ? rule.meta.docs.extendsBaseRule + : ruleName, + ] as const, + ), +); - // special case - return-await used to be an extension, but no longer is. - // See https://github.com/typescript-eslint/typescript-eslint/issues/9517 - BASE_RULES_TO_BE_OVERRIDDEN.set('return-await', 'no-return-await'); +// special case - return-await used to be an extension, but no longer is. +// See https://github.com/typescript-eslint/typescript-eslint/issues/9517 +BASE_RULES_TO_BE_OVERRIDDEN.set('return-await', 'no-return-await'); - type RuleEntry = [string, ESLintPluginRuleModule]; +type RuleEntry = [string, ESLintPluginRuleModule]; - const allRuleEntries: RuleEntry[] = Object.entries(eslintPlugin.rules).sort( - (a, b) => a[0].localeCompare(b[0]), - ); +const allRuleEntries: RuleEntry[] = Object.entries(eslintPlugin.rules).sort( + (a, b) => a[0].localeCompare(b[0]), +); - type GetRuleOptions = ( - rule: ESLintPluginRuleModule, - ) => readonly unknown[] | true | undefined; +type GetRuleOptions = ( + rule: ESLintPluginRuleModule, +) => readonly unknown[] | true | undefined; - interface ConfigRuleSettings { - baseRuleForExtensionRule?: 'exclude'; - deprecated?: 'exclude'; - forcedRuleLevel?: Linter.RuleLevel; - getOptions?: GetRuleOptions | undefined; - typeChecked?: 'exclude' | 'include-only'; - } +interface ConfigRuleSettings { + baseRuleForExtensionRule?: 'exclude'; + deprecated?: 'exclude'; + forcedRuleLevel?: Linter.RuleLevel; + getOptions?: GetRuleOptions | undefined; + typeChecked?: 'exclude' | 'include-only'; +} - /** - * Helper function reduces records to key - value pairs. - */ - function reducer( - config: LinterConfigRules, - [key, value]: RuleEntry, - settings: ConfigRuleSettings = {}, - ): LinterConfigRules { - if (value.meta.deprecated) { - if (value.meta.docs.recommended) { - throw new Error(`${key} is both deprecated and recommended.`); - } - if (settings.deprecated) { - return config; - } +/** + * Helper function reduces records to key - value pairs. + */ +function reducer( + config: LinterConfigRules, + [key, value]: RuleEntry, + settings: ConfigRuleSettings = {}, +): LinterConfigRules { + if (value.meta.deprecated) { + if (value.meta.docs.recommended) { + throw new Error(`${key} is both deprecated and recommended.`); } - - // Explicitly exclude rules requiring type-checking - if ( - settings.typeChecked === 'exclude' && - value.meta.docs.requiresTypeChecking === true - ) { + if (settings.deprecated) { return config; } + } - if ( - settings.typeChecked === 'include-only' && - value.meta.docs.requiresTypeChecking !== true - ) { - return config; - } + // Explicitly exclude rules requiring type-checking + if ( + settings.typeChecked === 'exclude' && + value.meta.docs.requiresTypeChecking === true + ) { + return config; + } - const ruleName = `${RULE_NAME_PREFIX}${key}`; - - if ( - settings.baseRuleForExtensionRule !== 'exclude' && - BASE_RULES_TO_BE_OVERRIDDEN.has(key) - ) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - const baseRuleName = BASE_RULES_TO_BE_OVERRIDDEN.get(key)!; - console.log( - baseRuleName - .padStart(RULE_NAME_PREFIX.length + baseRuleName.length) - .padEnd(RULE_NAME_PREFIX.length + MAX_RULE_NAME_LENGTH), - '=', - chalk.green('off'), - ); - config[baseRuleName] = 'off'; - } + if ( + settings.typeChecked === 'include-only' && + value.meta.docs.requiresTypeChecking !== true + ) { + return config; + } + + const ruleName = `${RULE_NAME_PREFIX}${key}`; + + if ( + settings.baseRuleForExtensionRule !== 'exclude' && + BASE_RULES_TO_BE_OVERRIDDEN.has(key) + ) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const baseRuleName = BASE_RULES_TO_BE_OVERRIDDEN.get(key)!; console.log( - `${chalk.dim(RULE_NAME_PREFIX)}${key.padEnd(MAX_RULE_NAME_LENGTH)}`, + baseRuleName + .padStart(RULE_NAME_PREFIX.length + baseRuleName.length) + .padEnd(RULE_NAME_PREFIX.length + MAX_RULE_NAME_LENGTH), '=', - chalk.red('error'), + chalk.green('off'), ); + config[baseRuleName] = 'off'; + } + console.log( + `${chalk.dim(RULE_NAME_PREFIX)}${key.padEnd(MAX_RULE_NAME_LENGTH)}`, + '=', + chalk.red('error'), + ); - const ruleLevel = settings.forcedRuleLevel ?? 'error'; - const ruleOptions = settings.getOptions?.(value); + const ruleLevel = settings.forcedRuleLevel ?? 'error'; + const ruleOptions = settings.getOptions?.(value); - config[ruleName] = - ruleOptions && ruleOptions !== true - ? [ruleLevel, ...ruleOptions] - : ruleLevel; + config[ruleName] = + ruleOptions && ruleOptions !== true + ? [ruleLevel, ...ruleOptions] + : ruleLevel; - return config; - } + return config; +} - interface WriteConfigSettings { - description: string; - getConfig: () => LinterConfig; - name: string; - } +interface WriteConfigSettings { + description: string; + getConfig: () => LinterConfig; + name: string; +} - /** - * Helper function that writes configuration. - */ - async function writeConfig({ - description, - getConfig, - name, - }: WriteConfigSettings): Promise { - const hyphens = '-'.repeat(35 - Math.ceil(name.length / 2)); - console.log(chalk.blueBright(`\n${hyphens} ${name}.ts ${hyphens}`)); - - const config = getConfig(); - - // - // 1. Classic Config - written to eslint-plugin/src/configs/eslintrc - // These configs are just JSON blobs that we write as TS files - // - - // note: we use `export =` because ESLint will import these configs via a commonjs import - const classicCode = [ - "import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';", - '', - `export = ${JSON.stringify(config)} satisfies ClassicConfig.Config;`, - ].join('\n'); - const classicConfigStr = await prettier.format( - addAutoGeneratedComment(classicCode), - { - parser: 'typescript', - ...prettierConfig, - }, - ); - fs.writeFileSync( - path.join( - PACKAGES_ESLINT_PLUGIN, - 'src', - 'configs', - 'eslintrc', - `${name}.ts`, - ), - classicConfigStr, - ); +/** + * Helper function that writes configuration. + */ +async function writeConfig({ + description, + getConfig, + name, +}: WriteConfigSettings): Promise { + const hyphens = '-'.repeat(35 - Math.ceil(name.length / 2)); + console.log(chalk.blueBright(`\n${hyphens} ${name}.ts ${hyphens}`)); + + const config = getConfig(); + + // + // 1. Classic Config - written to eslint-plugin/src/configs/eslintrc + // These configs are just JSON blobs that we write as TS files + // + + // note: we use `export =` because ESLint will import these configs via a commonjs import + const classicCode = [ + "import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';", + '', + `export = ${JSON.stringify(config)} satisfies ClassicConfig.Config;`, + ].join('\n'); + const classicConfigStr = await prettier.format( + addAutoGeneratedComment(classicCode), + { + parser: 'typescript', + ...prettierConfig, + }, + ); + fs.writeFileSync( + path.join( + PACKAGES_ESLINT_PLUGIN, + 'src', + 'configs', + 'eslintrc', + `${name}.ts`, + ), + classicConfigStr, + ); - // - // 2. Flat Config - written to eslint-plugin/src/configs/flat - // These configs are actual TS modules that import other configs - // - const flatCode: string[] = [ - ...AUTO_GENERATED_COMMENT_LINES, - "import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';", - '', - ]; - const flatExtends: string[] = []; - const flatConfig: FlatConfig.Config = { - name: `typescript-eslint/${name}`, - rules: config.rules, - }; - if (config.extends) { - for (const extendPath of config.extends) { - const config = EXTENDS_MODULES.find( - mod => mod.packageRelativePath === extendPath, - ); - if (config == null) { - throw new Error("Couldn't find config"); - } - flatCode.push( - `import ${config.name} from '${config.moduleRelativePath}';`, - ); - flatExtends.push(config.name); + // + // 2. Flat Config - written to eslint-plugin/src/configs/flat + // These configs are actual TS modules that import other configs + // + const flatCode: string[] = [ + ...AUTO_GENERATED_COMMENT_LINES, + "import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';", + '', + ]; + const flatExtends: string[] = []; + const flatConfig: FlatConfig.Config = { + name: `typescript-eslint/${name}`, + rules: config.rules, + }; + if (config.extends) { + for (const extendPath of config.extends) { + const config = EXTENDS_MODULES.find( + mod => mod.packageRelativePath === extendPath, + ); + if (config == null) { + throw new Error("Couldn't find config"); } - flatCode.push(''); - } - if (config.parserOptions) { - flatConfig.languageOptions ??= {}; - flatConfig.languageOptions.parserOptions = config.parserOptions; + flatCode.push( + `import ${config.name} from '${config.moduleRelativePath}';`, + ); + flatExtends.push(config.name); } + flatCode.push(''); + } + if (config.parserOptions) { + flatConfig.languageOptions ??= {}; + flatConfig.languageOptions.parserOptions = config.parserOptions; + } - const docComment = `/** + const docComment = `/** * ${description} * @see {@link https://typescript-eslint.io/users/configs#${name}} */`; - const flatConfigJson = JSON.stringify(flatConfig); - if (flatExtends.length > 0) { - flatCode.push( - docComment, - 'export default (plugin: FlatConfig.Plugin, parser: FlatConfig.Parser): FlatConfig.ConfigArray => [', - ...flatExtends.map(ext => `${ext}(plugin, parser),`), - flatConfigJson, - '];', - ); - } else { - flatCode.push( - docComment, - `export default (_plugin: FlatConfig.Plugin, _parser: FlatConfig.Parser): FlatConfig.Config => (${flatConfigJson});`, - ); - } - const flatConfigStr = await prettier.format(flatCode.join('\n'), { - parser: 'typescript', - ...prettierConfig, - }); - fs.writeFileSync( - path.join(PACKAGES_ESLINT_PLUGIN, 'src', 'configs', 'flat', `${name}.ts`), - flatConfigStr, + const flatConfigJson = JSON.stringify(flatConfig); + if (flatExtends.length > 0) { + flatCode.push( + docComment, + 'export default (plugin: FlatConfig.Plugin, parser: FlatConfig.Parser): FlatConfig.ConfigArray => [', + ...flatExtends.map(ext => `${ext}(plugin, parser),`), + flatConfigJson, + '];', + ); + } else { + flatCode.push( + docComment, + `export default (_plugin: FlatConfig.Plugin, _parser: FlatConfig.Parser): FlatConfig.Config => (${flatConfigJson});`, ); } + const flatConfigStr = await prettier.format(flatCode.join('\n'), { + parser: 'typescript', + ...prettierConfig, + }); + fs.writeFileSync( + path.join(PACKAGES_ESLINT_PLUGIN, 'src', 'configs', 'flat', `${name}.ts`), + flatConfigStr, + ); +} - interface ExtendedConfigSettings { - description: string; - name: string; - ruleEntries: readonly RuleEntry[]; - settings?: ConfigRuleSettings; - } +interface ExtendedConfigSettings { + description: string; + name: string; + ruleEntries: readonly RuleEntry[]; + settings?: ConfigRuleSettings; +} - async function writeExtendedConfig({ +async function writeExtendedConfig({ + description, + name, + ruleEntries, + settings, +}: ExtendedConfigSettings): Promise { + await writeConfig({ description, + getConfig: () => ({ + extends: [...CLASSIC_EXTENDS], + rules: ruleEntries.reduce( + (config, entry) => reducer(config, entry, settings), + {}, + ), + }), name, - ruleEntries, - settings, - }: ExtendedConfigSettings): Promise { - await writeConfig({ - description, - getConfig: () => ({ - extends: [...CLASSIC_EXTENDS], - rules: ruleEntries.reduce( - (config, entry) => reducer(config, entry, settings), - {}, - ), - }), - name, - }); - } - - function filterRuleEntriesTo( - ...recommendations: (RuleRecommendation | undefined)[] - ): RuleEntry[] { - return allRuleEntries.filter(([, rule]) => - typeof rule.meta.docs.recommended === 'object' - ? Object.keys(rule.meta.docs.recommended).some(level => - recommendations.includes(level as RuleRecommendation), - ) - : recommendations.includes(rule.meta.docs.recommended), - ); - } + }); +} - function createGetOptionsForLevel( - level: 'recommended' | 'strict', - ): GetRuleOptions { - return rule => - typeof rule.meta.docs.recommended === 'object' - ? rule.meta.docs.recommended[level] - : undefined; - } +function filterRuleEntriesTo( + ...recommendations: (RuleRecommendation | undefined)[] +): RuleEntry[] { + return allRuleEntries.filter(([, rule]) => + typeof rule.meta.docs.recommended === 'object' + ? Object.keys(rule.meta.docs.recommended).some(level => + recommendations.includes(level as RuleRecommendation), + ) + : recommendations.includes(rule.meta.docs.recommended), + ); +} - await writeExtendedConfig({ - description: - 'Enables each the rules provided as a part of typescript-eslint. Note that many rules are not applicable in all codebases, or are meant to be configured.', - name: 'all', - ruleEntries: allRuleEntries, - settings: { - deprecated: 'exclude', - }, - }); +function createGetOptionsForLevel( + level: 'recommended' | 'strict', +): GetRuleOptions { + return rule => + typeof rule.meta.docs.recommended === 'object' + ? rule.meta.docs.recommended[level] + : undefined; +} - await writeExtendedConfig({ - description: - 'Recommended rules for code correctness that you can drop in without additional configuration.', - name: 'recommended', - ruleEntries: filterRuleEntriesTo('recommended'), - settings: { - getOptions: createGetOptionsForLevel('recommended'), - typeChecked: 'exclude', - }, - }); +await writeExtendedConfig({ + description: + 'Enables each the rules provided as a part of typescript-eslint. Note that many rules are not applicable in all codebases, or are meant to be configured.', + name: 'all', + ruleEntries: allRuleEntries, + settings: { + deprecated: 'exclude', + }, +}); - await writeExtendedConfig({ - description: - 'Contains all of `recommended` along with additional recommended rules that require type information.', - name: 'recommended-type-checked', - ruleEntries: filterRuleEntriesTo('recommended'), - settings: { - getOptions: createGetOptionsForLevel('recommended'), - }, - }); +await writeExtendedConfig({ + description: + 'Recommended rules for code correctness that you can drop in without additional configuration.', + name: 'recommended', + ruleEntries: filterRuleEntriesTo('recommended'), + settings: { + getOptions: createGetOptionsForLevel('recommended'), + typeChecked: 'exclude', + }, +}); - await writeExtendedConfig({ - description: - 'A version of `recommended` that only contains type-checked rules and disables of any corresponding core ESLint rules.', - name: 'recommended-type-checked-only', - ruleEntries: filterRuleEntriesTo('recommended'), - settings: { - getOptions: createGetOptionsForLevel('recommended'), - typeChecked: 'include-only', - }, - }); +await writeExtendedConfig({ + description: + 'Contains all of `recommended` along with additional recommended rules that require type information.', + name: 'recommended-type-checked', + ruleEntries: filterRuleEntriesTo('recommended'), + settings: { + getOptions: createGetOptionsForLevel('recommended'), + }, +}); - await writeExtendedConfig({ - description: - 'Contains all of `recommended`, as well as additional strict rules that can also catch bugs. ', - name: 'strict', - ruleEntries: filterRuleEntriesTo('recommended', 'strict'), - settings: { - getOptions: createGetOptionsForLevel('strict'), - typeChecked: 'exclude', - }, - }); +await writeExtendedConfig({ + description: + 'A version of `recommended` that only contains type-checked rules and disables of any corresponding core ESLint rules.', + name: 'recommended-type-checked-only', + ruleEntries: filterRuleEntriesTo('recommended'), + settings: { + getOptions: createGetOptionsForLevel('recommended'), + typeChecked: 'include-only', + }, +}); - await writeExtendedConfig({ - description: - 'Contains all of `recommended`, `recommended-type-checked`, and `strict`, along with additional strict rules that require type information.', - name: 'strict-type-checked', - ruleEntries: filterRuleEntriesTo('recommended', 'strict'), - settings: { - getOptions: createGetOptionsForLevel('strict'), - }, - }); +await writeExtendedConfig({ + description: + 'Contains all of `recommended`, as well as additional strict rules that can also catch bugs. ', + name: 'strict', + ruleEntries: filterRuleEntriesTo('recommended', 'strict'), + settings: { + getOptions: createGetOptionsForLevel('strict'), + typeChecked: 'exclude', + }, +}); - await writeExtendedConfig({ - description: - 'A version of `strict` that only contains type-checked rules and disables of any corresponding core ESLint rules.', - name: 'strict-type-checked-only', - ruleEntries: filterRuleEntriesTo('recommended', 'strict'), - settings: { - getOptions: createGetOptionsForLevel('strict'), - typeChecked: 'include-only', - }, - }); +await writeExtendedConfig({ + description: + 'Contains all of `recommended`, `recommended-type-checked`, and `strict`, along with additional strict rules that require type information.', + name: 'strict-type-checked', + ruleEntries: filterRuleEntriesTo('recommended', 'strict'), + settings: { + getOptions: createGetOptionsForLevel('strict'), + }, +}); - await writeExtendedConfig({ - description: - 'Rules considered to be best practice for modern TypeScript codebases, but that do not impact program logic.', - name: 'stylistic', - ruleEntries: filterRuleEntriesTo('stylistic'), - settings: { - typeChecked: 'exclude', - }, - }); +await writeExtendedConfig({ + description: + 'A version of `strict` that only contains type-checked rules and disables of any corresponding core ESLint rules.', + name: 'strict-type-checked-only', + ruleEntries: filterRuleEntriesTo('recommended', 'strict'), + settings: { + getOptions: createGetOptionsForLevel('strict'), + typeChecked: 'include-only', + }, +}); - await writeExtendedConfig({ - description: - 'Contains all of `stylistic`, along with additional stylistic rules that require type information.', - name: 'stylistic-type-checked', - ruleEntries: filterRuleEntriesTo('stylistic'), - }); +await writeExtendedConfig({ + description: + 'Rules considered to be best practice for modern TypeScript codebases, but that do not impact program logic.', + name: 'stylistic', + ruleEntries: filterRuleEntriesTo('stylistic'), + settings: { + typeChecked: 'exclude', + }, +}); - await writeExtendedConfig({ - description: - 'A version of `stylistic` that only contains type-checked rules and disables of any corresponding core ESLint rules.', - name: 'stylistic-type-checked-only', - ruleEntries: filterRuleEntriesTo('stylistic'), - settings: { - typeChecked: 'include-only', - }, - }); +await writeExtendedConfig({ + description: + 'Contains all of `stylistic`, along with additional stylistic rules that require type information.', + name: 'stylistic-type-checked', + ruleEntries: filterRuleEntriesTo('stylistic'), +}); - await writeConfig({ - description: - 'A utility ruleset that will disable type-aware linting and all type-aware rules available in our project.', - getConfig: () => ({ - parserOptions: { - program: null, - project: false, - projectService: false, - }, - rules: allRuleEntries.reduce( - (config, entry) => - reducer(config, entry, { - baseRuleForExtensionRule: 'exclude', - forcedRuleLevel: 'off', - typeChecked: 'include-only', - }), - {}, - ), - }), - name: 'disable-type-checked', - }); -} +await writeExtendedConfig({ + description: + 'A version of `stylistic` that only contains type-checked rules and disables of any corresponding core ESLint rules.', + name: 'stylistic-type-checked-only', + ruleEntries: filterRuleEntriesTo('stylistic'), + settings: { + typeChecked: 'include-only', + }, +}); -main().catch((error: unknown) => { - console.error(error); +await writeConfig({ + description: + 'A utility ruleset that will disable type-aware linting and all type-aware rules available in our project.', + getConfig: () => ({ + parserOptions: { + program: null, + project: false, + projectService: false, + }, + rules: allRuleEntries.reduce( + (config, entry) => + reducer(config, entry, { + baseRuleForExtensionRule: 'exclude', + forcedRuleLevel: 'off', + typeChecked: 'include-only', + }), + {}, + ), + }), + name: 'disable-type-checked', }); diff --git a/tools/scripts/generate-contributors.mts b/tools/scripts/generate-contributors.mts index d051ab6c34e0..c3c08d7a9435 100644 --- a/tools/scripts/generate-contributors.mts +++ b/tools/scripts/generate-contributors.mts @@ -154,40 +154,33 @@ function writeTable(contributors: User[], perLine = 5): void { fs.writeFileSync(path.join(REPO_ROOT, 'CONTRIBUTORS.md'), lines.join('\n')); } -async function main(): Promise { - const githubContributors: Contributor[] = []; +const githubContributors: Contributor[] = []; - // fetch all of the contributor info - for await (const lastUsers of fetchUsers()) { - githubContributors.push(...lastUsers); - } - - // fetch the user info - console.log(`Fetching user information...`); - const users = await Promise.allSettled( - githubContributors - // remove ignored users and bots - .filter( - usr => usr.login && usr.type !== 'Bot' && !IGNORED_USERS.has(usr.login), - ) - // fetch the in-depth information for each user - .map(c => getData(c.url)), - ); - - writeTable( - users - .map(result => { - if (result.status === 'fulfilled') { - return result.value?.body; - } - return null; - }) - .filter((c): c is User => c?.login != null), - 5, - ); +// fetch all of the contributor info +for await (const lastUsers of fetchUsers()) { + githubContributors.push(...lastUsers); } -main().catch((error: unknown) => { - console.error(error); - process.exitCode = 1; -}); +// fetch the user info +console.log(`Fetching user information...`); +const users = await Promise.allSettled( + githubContributors + // remove ignored users and bots + .filter( + usr => usr.login && usr.type !== 'Bot' && !IGNORED_USERS.has(usr.login), + ) + // fetch the in-depth information for each user + .map(c => getData(c.url)), +); + +writeTable( + users + .map(result => { + if (result.status === 'fulfilled') { + return result.value?.body; + } + return null; + }) + .filter((c): c is User => c?.login != null), + 5, +); diff --git a/tools/scripts/generate-lib.mts b/tools/scripts/generate-lib.mts index 599313dbdeb6..817d25c2a2f8 100644 --- a/tools/scripts/generate-lib.mts +++ b/tools/scripts/generate-lib.mts @@ -123,187 +123,175 @@ function getReferences( return references; } -async function main(): Promise { - try { - rimraf.sync(OUTPUT_FOLDER); - } catch { - // ignored - } - try { - fs.mkdirSync(OUTPUT_FOLDER); - } catch { - // ignored - } +try { + rimraf.sync(OUTPUT_FOLDER); +} catch { + // ignored +} +try { + fs.mkdirSync(OUTPUT_FOLDER); +} catch { + // ignored +} - const filesWritten: string[] = [ - SHARED_CONFIG_MODULE, - TYPES_FILE, - BARREL_PATH, - ]; - - // the shared - fs.writeFileSync( - SHARED_CONFIG_MODULE, - await formatCode([ - `export const TYPE = Object.freeze(${JSON.stringify({ - eslintImplicitGlobalSetting: 'readonly', - isTypeVariable: true, - isValueVariable: false, - })});`, - `export const VALUE = Object.freeze(${JSON.stringify({ - eslintImplicitGlobalSetting: 'readonly', - isTypeVariable: false, - isValueVariable: true, - })});`, - `export const TYPE_VALUE = Object.freeze(${JSON.stringify({ - eslintImplicitGlobalSetting: 'readonly', - isTypeVariable: true, - isValueVariable: true, - })});`, - '', - ]), - ); +const filesWritten: string[] = [SHARED_CONFIG_MODULE, TYPES_FILE, BARREL_PATH]; + +// the shared +fs.writeFileSync( + SHARED_CONFIG_MODULE, + await formatCode([ + `export const TYPE = Object.freeze(${JSON.stringify({ + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + })});`, + `export const VALUE = Object.freeze(${JSON.stringify({ + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: false, + isValueVariable: true, + })});`, + `export const TYPE_VALUE = Object.freeze(${JSON.stringify({ + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, + })});`, + '', + ]), +); - for (const [libName, filename] of libMap) { - const libPath = path.join(TS_LIB_FOLDER, filename); - const { ast, scopeManager } = parseAndAnalyze( - fs.readFileSync(libPath, 'utf8'), - { - // we don't want any libs - lib: [], - sourceType: 'module', - }, - { - comment: true, - loc: true, - range: true, - }, - ) as { - // https://github.com/typescript-eslint/typescript-eslint/issues/8347 - ast: { comments: TSESTree.Comment[] } & TSESTree.Program; - } & ReturnType; - - const code = [`export const ${sanitize(libName)}: LibDefinition = {`]; - - const references = getReferences(ast); - if (references.size > 0) { - // add a newline before the export - code.unshift(''); - } +for (const [libName, filename] of libMap) { + const libPath = path.join(TS_LIB_FOLDER, filename); + const { ast, scopeManager } = parseAndAnalyze( + fs.readFileSync(libPath, 'utf8'), + { + // we don't want any libs + lib: [], + sourceType: 'module', + }, + { + comment: true, + loc: true, + range: true, + }, + ) as { + // https://github.com/typescript-eslint/typescript-eslint/issues/8347 + ast: { comments: TSESTree.Comment[] } & TSESTree.Program; + } & ReturnType; + + const code = [`export const ${sanitize(libName)}: LibDefinition = {`]; + + const references = getReferences(ast); + if (references.size > 0) { + // add a newline before the export + code.unshift(''); + } - // import and spread all of the references - const imports = ["import type { LibDefinition } from '../variable';"]; - code.push('libs: ['); - for (const reference of references) { - const name = sanitize(reference); - imports.push(`import { ${name} } from './${reference}'`); - code.push(`${name},`); - } - code.push('],'); - - const requiredBaseImports = new Set(); - - // add a declaration for each variable - const variables = getVariablesFromScope(scopeManager); - code.push('variables: ['); - for (const variable of variables) { - const importName = ((): BASE_CONFIG_EXPORT_NAMES => { - if (variable.isTypeVariable && variable.isValueVariable) { - return 'TYPE_VALUE'; - } - if (variable.isTypeVariable) { - return 'TYPE'; - } - if (variable.isValueVariable) { - return 'VALUE'; - } - // shouldn't happen - throw new Error( - "Unexpected variable that's is not a type or value variable", - ); - })(); - requiredBaseImports.add(importName); - - code.push(`['${variable.name}', ${importName}],`); - } - code.push('],'); - code.push('};'); - - if (requiredBaseImports.size > 0) { - imports.push( - `import {${[...requiredBaseImports] - .sort() - .join(',')}} from './${BASE_CONFIG_MODULE_NAME}';`, + // import and spread all of the references + const imports = ["import type { LibDefinition } from '../variable';"]; + code.push('libs: ['); + for (const reference of references) { + const name = sanitize(reference); + imports.push(`import { ${name} } from './${reference}'`); + code.push(`${name},`); + } + code.push('],'); + + const requiredBaseImports = new Set(); + + // add a declaration for each variable + const variables = getVariablesFromScope(scopeManager); + code.push('variables: ['); + for (const variable of variables) { + const importName = ((): BASE_CONFIG_EXPORT_NAMES => { + if (variable.isTypeVariable && variable.isValueVariable) { + return 'TYPE_VALUE'; + } + if (variable.isTypeVariable) { + return 'TYPE'; + } + if (variable.isValueVariable) { + return 'VALUE'; + } + // shouldn't happen + throw new Error( + "Unexpected variable that's is not a type or value variable", ); - } + })(); + requiredBaseImports.add(importName); - if (imports.length > 0) { - code.unshift(...imports, ''); - } - - const formattedCode = await formatCode(code); - const writePath = path.join(OUTPUT_FOLDER, `${libName}.ts`); - fs.writeFileSync(writePath, formattedCode); - filesWritten.push(writePath); - - console.log( - 'Wrote', - variables.length, - 'variables, and', - references.size, - 'references for', - libName, + code.push(`['${variable.name}', ${importName}],`); + } + code.push('],'); + code.push('};'); + + if (requiredBaseImports.size > 0) { + imports.push( + `import {${[...requiredBaseImports] + .sort() + .join(',')}} from './${BASE_CONFIG_MODULE_NAME}';`, ); } - // generate and write a barrel file - const barrelImports = []; // use a separate way so everything is in the same order - const barrelCode = [ - '', - `export const lib: ReadonlyMap =`, - `new Map([`, - ]; - // Call `Object.entries` during barrel construction to avoid redundantly calling - // and allocating a new array on every reference - for (const lib of libMap.keys()) { - const name = sanitize(lib); - if (name === 'lib') { - barrelImports.push(`import { lib as libBase } from './${lib}'`); - barrelCode.push(`['${lib}', libBase],`); - } else { - barrelImports.push(`import { ${name} } from './${lib}'`); - barrelCode.push(`['${lib}', ${name}],`); - } + if (imports.length > 0) { + code.unshift(...imports, ''); } - barrelCode.unshift(...barrelImports); - barrelCode.unshift('', `import type { LibDefinition } from '../variable';`); - barrelCode.push(']);'); - const formattedBarrelCode = await formatCode(barrelCode); + const formattedCode = await formatCode(code); + const writePath = path.join(OUTPUT_FOLDER, `${libName}.ts`); + fs.writeFileSync(writePath, formattedCode); + filesWritten.push(writePath); + + console.log( + 'Wrote', + variables.length, + 'variables, and', + references.size, + 'references for', + libName, + ); +} + +// generate and write a barrel file +const barrelImports = []; // use a separate way so everything is in the same order +const barrelCode = [ + '', + `export const lib: ReadonlyMap =`, + `new Map([`, +]; +// Call `Object.entries` during barrel construction to avoid redundantly calling +// and allocating a new array on every reference +for (const lib of libMap.keys()) { + const name = sanitize(lib); + if (name === 'lib') { + barrelImports.push(`import { lib as libBase } from './${lib}'`); + barrelCode.push(`['${lib}', libBase],`); + } else { + barrelImports.push(`import { ${name} } from './${lib}'`); + barrelCode.push(`['${lib}', ${name}],`); + } +} +barrelCode.unshift(...barrelImports); +barrelCode.unshift('', `import type { LibDefinition } from '../variable';`); +barrelCode.push(']);'); - fs.writeFileSync(BARREL_PATH, formattedBarrelCode); - console.log('Wrote barrel file'); +const formattedBarrelCode = await formatCode(barrelCode); - // generate a string union type for the lib names +fs.writeFileSync(BARREL_PATH, formattedBarrelCode); +console.log('Wrote barrel file'); - const libUnionCode = [ - `export type Lib = ${[...libMap.keys()].map(k => `'${k}'`).join(' | ')};`, - ]; - const formattedLibUnionCode = await formatCode(libUnionCode); +// generate a string union type for the lib names - fs.writeFileSync(TYPES_FILE, formattedLibUnionCode); - console.log('Wrote Lib union type file'); +const libUnionCode = [ + `export type Lib = ${[...libMap.keys()].map(k => `'${k}'`).join(' | ')};`, +]; +const formattedLibUnionCode = await formatCode(libUnionCode); - const lint = new FlatESLint({ - fix: true, - }); - const results = await lint.lintFiles(filesWritten); - await FlatESLint.outputFixes(results); - console.log('Autofixed lint errors'); -} +fs.writeFileSync(TYPES_FILE, formattedLibUnionCode); +console.log('Wrote Lib union type file'); -main().catch((e: unknown) => { - console.error(e); - // eslint-disable-next-line no-process-exit - process.exit(1); +const lint = new FlatESLint({ + fix: true, }); +const results = await lint.lintFiles(filesWritten); +await FlatESLint.outputFixes(results); +console.log('Autofixed lint errors'); diff --git a/tools/scripts/postinstall.mts b/tools/scripts/postinstall.mts index 5d123b1991d5..c6bfcd2f3a97 100644 --- a/tools/scripts/postinstall.mts +++ b/tools/scripts/postinstall.mts @@ -28,22 +28,20 @@ if (process.env.SKIP_POSTINSTALL) { process.exit(0); } -void (async function (): Promise { - // make sure we're running from the workspace root - const { - default: { workspaceRoot }, - } = await import('@nx/devkit'); - process.chdir(workspaceRoot); +// make sure we're running from the workspace root +const { + default: { workspaceRoot }, +} = await import('@nx/devkit'); +process.chdir(workspaceRoot); - // Install git hooks - await $`yarn husky`; +// Install git hooks +await $`yarn husky`; - if (!process.env.SKIP_POSTINSTALL_BUILD) { - // Clean any caches that may be invalid now - await $`yarn clean`; +if (!process.env.SKIP_POSTINSTALL_BUILD) { + // Clean any caches that may be invalid now + await $`yarn clean`; - // Build all the packages ready for use - await $`yarn build`; - await $`yarn nx typecheck ast-spec`; - } -})(); + // Build all the packages ready for use + await $`yarn build`; + await $`yarn nx typecheck ast-spec`; +} From 1c0e1ae8d88d210e255814ee998bb9d7eefe6ba8 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Sat, 17 May 2025 04:03:50 -0500 Subject: [PATCH 008/283] chore: update some package scripts and dependency config (#10765) --- .github/actions/prepare-build/action.yml | 4 +- .github/workflows/ci.yml | 6 +-- knip.ts | 9 ++-- nx.json | 6 ++- package.json | 36 +++++++-------- packages/ast-spec/package.json | 7 ++- packages/ast-spec/project.json | 3 +- packages/eslint-plugin-internal/package.json | 11 +++-- packages/eslint-plugin-internal/project.json | 3 +- packages/eslint-plugin/package.json | 12 ++--- packages/eslint-plugin/project.json | 3 +- packages/integration-tests/package.json | 6 +-- packages/integration-tests/project.json | 3 +- packages/parser/package.json | 7 ++- packages/parser/project.json | 3 +- .../package.json | 7 +-- .../project.json | 3 +- packages/rule-tester/package.json | 11 ++--- packages/rule-tester/project.json | 3 +- packages/scope-manager/package.json | 9 ++-- packages/scope-manager/project.json | 3 +- packages/type-utils/package.json | 7 ++- packages/type-utils/project.json | 3 +- packages/types/package.json | 31 +++---------- packages/types/project.json | 12 +++-- packages/typescript-eslint/package.json | 7 ++- packages/typescript-eslint/project.json | 3 +- packages/typescript-estree/package.json | 7 ++- packages/typescript-estree/project.json | 3 +- packages/utils/package.json | 10 ++--- packages/utils/project.json | 3 +- packages/visitor-keys/package.json | 10 ++--- packages/visitor-keys/project.json | 3 +- packages/website-eslint/package.json | 9 ++-- packages/website-eslint/project.json | 8 ++-- packages/website/package.json | 12 +++-- packages/website/project.json | 10 ++--- project.json | 16 +++++-- yarn.lock | 45 ++++++++++--------- 39 files changed, 167 insertions(+), 187 deletions(-) diff --git a/.github/actions/prepare-build/action.yml b/.github/actions/prepare-build/action.yml index e88bd2cfb93b..d191358d6503 100644 --- a/.github/actions/prepare-build/action.yml +++ b/.github/actions/prepare-build/action.yml @@ -22,7 +22,7 @@ runs: if: steps['build-cache'].outputs.cache-hit == 'true' shell: bash run: | - npx nx run types:build + yarn nx run types:build env: SKIP_AST_SPEC_REBUILD: true @@ -31,6 +31,6 @@ runs: shell: bash # Website will be built by the Netlify GitHub App run: | - npx nx run-many --target=build --parallel --exclude=website --exclude=website-eslint + yarn nx run-many --target=build --parallel --exclude=website --exclude=website-eslint env: SKIP_AST_SPEC_REBUILD: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 398c05e17baa..2ded66ac31b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -198,12 +198,12 @@ jobs: # we don't collect coverage on other node versions so they run faster - name: Run unit tests with coverage for ${{ matrix.package }} if: env.PRIMARY_NODE_VERSION == matrix.node-version && matrix.os == 'ubuntu-latest' - run: npx nx run ${{ matrix.package }}:test -- --coverage + run: yarn nx run ${{ matrix.package }}:test -- --coverage env: CI: true - name: Run unit tests for ${{ matrix.package }} if: env.PRIMARY_NODE_VERSION != matrix.node-version || matrix.os != 'ubuntu-latest' - run: npx nx test ${{ matrix.package }} + run: yarn nx test ${{ matrix.package }} env: CI: true @@ -238,7 +238,7 @@ jobs: - name: Build uses: ./.github/actions/prepare-build - name: Run unit tests for ${{ matrix.package }} - run: npx nx test ${{ matrix.package }} --coverage=false + run: yarn nx test ${{ matrix.package }} --coverage=false env: CI: true TYPESCRIPT_ESLINT_PROJECT_SERVICE: true diff --git a/knip.ts b/knip.ts index 4ab6787999d8..9f2a79146687 100644 --- a/knip.ts +++ b/knip.ts @@ -22,14 +22,17 @@ export default { workspaces: { '.': { entry: ['tools/release/changelog-renderer.js', 'tools/scripts/**/*.mts'], - ignore: ['tools/scripts/typings/typescript.d.ts', 'typings/*.d.ts'], ignoreDependencies: [ - '@nx/js', '@nx/workspace', - 'make-dir', // imported for type purposes only 'website', ], + + project: [ + 'tools/scripts/**/*.mts', + '!tools/scripts/typings/typescript.d.ts', + '!typings/*.d.ts', + ], }, 'packages/ast-spec': { ignore: [ diff --git a/nx.json b/nx.json index b48badbaad3f..167f99ebcc2a 100644 --- a/nx.json +++ b/nx.json @@ -100,6 +100,7 @@ "cache": true }, "lint": { + "executor": "@nx/eslint:lint", "dependsOn": ["eslint-plugin-internal:build", "typescript-eslint:build"], "inputs": [ "default", @@ -135,9 +136,10 @@ ], "production": [ "default", - "!{projectRoot}/**/?(*.)+(test).[jt]s?(x)?(.snap)", + "!{projectRoot}/**/?(*.)+(test).?(m|c)[jt]s?(x)?(.snap|.shot)", + "!{projectRoot}/tests", "!{projectRoot}/tsconfig.spec.json", - "!{projectRoot}/vitest.config.m[jt]s", + "!{projectRoot}/vitest.config.mts", "!{projectRoot}/src/test-setup.[jt]s" ] } diff --git a/package.json b/package.json index 5ea26cb0ba81..a3d9c5c307bd 100644 --- a/package.json +++ b/package.json @@ -22,30 +22,30 @@ }, "homepage": "https://typescript-eslint.io", "scripts": { - "build": "npx nx run-many --target=build --exclude website --exclude website-eslint", + "build": "nx run-many --target=build --exclude website --exclude website-eslint", "check-clean-workspace-after-install": "git diff --quiet --exit-code", "check-format": "prettier --check .", "check-spelling": "cspell --config=.cspell.json \"**/*.{md,mdx,ts,mts,cts,js,cjs,mjs,tsx,jsx}\" --no-progress --show-context --show-suggestions", - "clean": "npx nx run-many --target=clean", - "format": "prettier --write .", - "generate-breaking-changes": "npx nx run eslint-plugin:generate-breaking-changes", - "generate-configs": "npx nx generate-configs", - "generate-contributors": "npx nx generate-contributors", - "generate-lib": "npx nx generate-lib", - "generate-sponsors": "npx nx generate-sponsors", - "generate-website-dts": "npx nx run website:generate-website-dts", + "clean": "nx run-many --target=clean --parallel=20", + "format": "prettier --ignore-path=$PROJECT_CWD/.prettierignore --config=$PROJECT_CWD/.prettierrc.json --write $INIT_CWD", + "generate-breaking-changes": "nx run eslint-plugin:generate-breaking-changes", + "generate-configs": "nx generate-configs", + "generate-contributors": "nx generate-contributors", + "generate-lib": "nx generate-lib", + "generate-sponsors": "nx generate-sponsors", + "generate-website-dts": "nx run website:generate-website-dts", "lint-fix": "yarn lint --fix", "lint-markdown-fix": "yarn lint-markdown --fix", "lint-markdown": "markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore", - "lint-stylelint": "npx nx lint website stylelint", - "lint": "npx nx lint eslint-plugin --skip-nx-cache && npx nx run-many --target=lint --exclude eslint-plugin", + "lint-stylelint": "nx lint website stylelint", + "lint": "nx run-many --target=lint", "postinstall": "tsx tools/scripts/postinstall.mts", - "pre-commit": "yarn lint-staged", + "pre-commit": "lint-staged", "release": "tsx tools/release/release.mts", - "start": "npx nx run website:start", - "test": "npx nx run-many --target=test --exclude integration-tests --exclude website --exclude website-eslint", - "test-integration": "npx nx run integration-tests:test", - "typecheck": "npx nx run-many --target=typecheck" + "start": "nx run website:start", + "test": "nx run-many --target=test --exclude integration-tests --exclude website --exclude website-eslint", + "test-integration": "nx run integration-tests:test", + "typecheck": "nx run-many --target=typecheck" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -59,6 +59,7 @@ "@eslint/js": "^9.26.0", "@nx/devkit": "20.7.2", "@nx/eslint": "20.7.2", + "@nx/js": "20.7.2", "@nx/vite": "20.7.2", "@nx/workspace": "20.7.2", "@swc/core": "^1.4.12", @@ -70,6 +71,7 @@ "@types/yargs": "^17.0.32", "@typescript-eslint/eslint-plugin": "workspace:^", "@typescript-eslint/eslint-plugin-internal": "workspace:^", + "@typescript-eslint/parser": "workspace:^", "@typescript-eslint/scope-manager": "workspace:^", "@typescript-eslint/types": "workspace:^", "@typescript-eslint/typescript-estree": "workspace:^", @@ -94,7 +96,6 @@ "husky": "^9.1.4", "knip": "^5.41.1", "lint-staged": "^15.2.2", - "make-dir": "^4.0.0", "markdownlint-cli": "^0.44.0", "nx": "20.7.2", "prettier": "3.5.0", @@ -116,7 +117,6 @@ "eslint-plugin-eslint-plugin@^5.5.0": "patch:eslint-plugin-eslint-plugin@npm%3A5.5.1#./.yarn/patches/eslint-plugin-eslint-plugin-npm-5.5.1-4206c2506d.patch", "prettier": "3.5.0", "react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch", - "tmp": "0.2.1", "tsx": "^4.7.2", "typescript": "5.8.2" }, diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index a2c017d52f42..f2532092d1e2 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -34,10 +34,10 @@ "build": "tsc -b tsconfig.build.json && api-extractor run --local --config=$INIT_CWD/api-extractor.json", "clean": "rimraf dist/ coverage/", "clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "npx nx lint", + "format": "yarn run -T format", + "lint": "yarn run -BT nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "npx nx typecheck" + "check-types": "yarn run -BT nx typecheck" }, "funding": { "type": "opencollective", @@ -56,7 +56,6 @@ "@vitest/utils": "^3.1.3", "eslint": "*", "glob": "*", - "prettier": "^3.2.5", "rimraf": "*", "typescript": "*", "vitest": "^3.1.3" diff --git a/packages/ast-spec/project.json b/packages/ast-spec/project.json index 5e0432b40f39..d6c8c081f226 100644 --- a/packages/ast-spec/project.json +++ b/packages/ast-spec/project.json @@ -10,8 +10,7 @@ "outputs": ["{projectRoot}/dist/**/*.ts"] }, "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" }, "test": { "executor": "@nx/vite:test", diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 458bee57df6a..c2cde3c76ee8 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -14,13 +14,12 @@ "homepage": "https://typescript-eslint.io", "license": "MIT", "scripts": { - "build": "npx tsc -b tsconfig.build.json", - "clean": "npx tsc -b tsconfig.build.json --clean", - "postclean": "rimraf dist/ coverage/", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "npx nx lint", + "build": "tsc -b tsconfig.build.json", + "clean": "rimraf dist/ coverage/", + "format": "yarn run -T format", + "lint": "yarn run -BT nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "npx nx typecheck" + "check-types": "yarn run -BT nx typecheck" }, "dependencies": { "@prettier/sync": "^0.5.1", diff --git a/packages/eslint-plugin-internal/project.json b/packages/eslint-plugin-internal/project.json index e7e8fe15571b..f0bfaacd26b6 100644 --- a/packages/eslint-plugin-internal/project.json +++ b/packages/eslint-plugin-internal/project.json @@ -6,8 +6,7 @@ "sourceRoot": "packages/eslint-plugin-internal/src", "targets": { "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" }, "test": { "executor": "@nx/vite:test" diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index c27d09067eab..f198f162124c 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -51,13 +51,13 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "clean": "rimraf dist/ coverage/", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "generate:breaking-changes": "tsx tools/generate-breaking-changes.mts", - "generate:configs": "npx nx generate-configs repo", - "lint": "npx nx lint", + "format": "yarn run -T format", + "generate-breaking-changes": "tsx tools/generate-breaking-changes.mts", + "generate-configs": "yarn run -T generate-configs", + "lint": "yarn run -BT nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", "test-single": "vitest --run --config=$INIT_CWD/vitest.config.mts --no-coverage", - "check-types": "npx nx typecheck" + "check-types": "yarn run -BT nx typecheck" }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", @@ -85,7 +85,7 @@ "mdast-util-from-markdown": "^2.0.0", "mdast-util-mdx": "^3.0.0", "micromark-extension-mdxjs": "^3.0.0", - "prettier": "^3.2.5", + "prettier": "^3.5.3", "rimraf": "*", "title-case": "^4.0.0", "tsx": "*", diff --git a/packages/eslint-plugin/project.json b/packages/eslint-plugin/project.json index 3dbae67d7435..acfd65a8f79c 100644 --- a/packages/eslint-plugin/project.json +++ b/packages/eslint-plugin/project.json @@ -19,9 +19,10 @@ "executor": "@nx/vite:test" }, "generate-breaking-changes": { + "dependsOn": ["type-utils:build"], "executor": "nx:run-script", "options": { - "script": "generate:breaking-changes" + "script": "generate-breaking-changes" } } } diff --git a/packages/integration-tests/package.json b/packages/integration-tests/package.json index 602d44d36f8f..250cd92b8b07 100644 --- a/packages/integration-tests/package.json +++ b/packages/integration-tests/package.json @@ -12,10 +12,10 @@ "homepage": "https://typescript-eslint.io", "license": "MIT", "scripts": { - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "npx nx lint", + "format": "yarn run -T format", + "lint": "yarn run -BT nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "npx nx typecheck" + "check-types": "yarn run -BT nx typecheck" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", diff --git a/packages/integration-tests/project.json b/packages/integration-tests/project.json index a34197dff37d..7686e219f332 100644 --- a/packages/integration-tests/project.json +++ b/packages/integration-tests/project.json @@ -7,8 +7,7 @@ "implicitDependencies": ["typescript-eslint"], "targets": { "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" }, "test": { "executor": "@nx/vite:test" diff --git a/packages/parser/package.json b/packages/parser/package.json index ca32c3eb4d7e..c0e124b4f28d 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -41,10 +41,10 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "clean": "rimraf dist/ coverage/", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "npx nx lint", + "format": "yarn run -T format", + "lint": "yarn run -BT nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "npx nx typecheck" + "check-types": "yarn run -BT nx typecheck" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", @@ -60,7 +60,6 @@ "devDependencies": { "@vitest/coverage-v8": "^3.1.3", "glob": "*", - "prettier": "^3.2.5", "rimraf": "*", "typescript": "*", "vitest": "^3.1.3" diff --git a/packages/parser/project.json b/packages/parser/project.json index 6b9e1efe5f09..fe0a92487dde 100644 --- a/packages/parser/project.json +++ b/packages/parser/project.json @@ -6,8 +6,7 @@ "sourceRoot": "packages/parser/src", "targets": { "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" }, "test": { "executor": "@nx/vite:test" diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 513496d1e58e..f2e18a13c669 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -25,10 +25,11 @@ "license": "MIT", "scripts": { "build": "tsc -b tsconfig.build.json", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "npx nx lint", + "clean": "rimraf dist/ coverage/", + "format": "yarn run -T format", + "lint": "yarn run -BT nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "npx nx typecheck" + "check-types": "yarn run -BT nx typecheck" }, "dependencies": { "@typescript-eslint/type-utils": "8.32.1", diff --git a/packages/rule-schema-to-typescript-types/project.json b/packages/rule-schema-to-typescript-types/project.json index 283f31ed4538..954e08a4001c 100644 --- a/packages/rule-schema-to-typescript-types/project.json +++ b/packages/rule-schema-to-typescript-types/project.json @@ -6,8 +6,7 @@ "sourceRoot": "packages/rule-schema-to-typescript-types/src", "targets": { "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" } } } diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 90a565184644..1689bdd5372e 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -36,14 +36,13 @@ ], "scripts": { "build": "tsc -b tsconfig.build.json", - "clean": "tsc -b tsconfig.build.json --clean", - "postclean": "rimraf dist/ coverage/", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "npx nx lint", + "clean": "rimraf dist/ coverage/", + "format": "yarn run -T format", + "lint": "yarn run -BT nx lint", "pretest-eslint-base": "tsc -b tsconfig.build.json", "test-eslint-base": "mocha --require source-map-support/register ./tests/eslint-base/eslint-base.test.js", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "npx nx typecheck" + "check-types": "yarn run -BT nx typecheck" }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { @@ -63,10 +62,12 @@ "@types/lodash.merge": "4.6.9", "@vitest/coverage-v8": "^3.1.3", "chai": "^5.2.0", + "eslint": "*", "eslint-visitor-keys": "^4.2.0", "espree": "^10.3.0", "esprima": "^4.0.1", "mocha": "^11.0.0", + "rimraf": "*", "sinon": "^20.0.0", "source-map-support": "^0.5.21", "typescript": "*", diff --git a/packages/rule-tester/project.json b/packages/rule-tester/project.json index cbcfa8914c33..0dfef3253a40 100644 --- a/packages/rule-tester/project.json +++ b/packages/rule-tester/project.json @@ -6,8 +6,7 @@ "sourceRoot": "packages/rule-tester/src", "targets": { "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" }, "test": { "executor": "@nx/vite:test" diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 4f586adc78a2..bba61ba408a7 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -40,11 +40,11 @@ "build": "tsc -b tsconfig.build.json", "clean": "rimraf dist/ coverage/", "clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "generate-lib": "npx nx generate-lib repo", - "lint": "npx nx lint", + "format": "yarn run -T format", + "generate-lib": "yarn run -BT nx generate-lib repo", + "lint": "yarn run -BT nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "npx nx typecheck" + "check-types": "yarn run -BT nx typecheck" }, "dependencies": { "@typescript-eslint/types": "8.32.1", @@ -55,7 +55,6 @@ "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "glob": "*", - "prettier": "^3.2.5", "rimraf": "*", "typescript": "*", "vitest": "^3.1.3" diff --git a/packages/scope-manager/project.json b/packages/scope-manager/project.json index 059f34126073..ae939212a2d0 100644 --- a/packages/scope-manager/project.json +++ b/packages/scope-manager/project.json @@ -6,8 +6,7 @@ "projectType": "library", "targets": { "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" }, "test": { "executor": "@nx/vite:test" diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index d6bb070d6cfd..0505936ce0b8 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -38,10 +38,10 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "clean": "rimraf dist/ coverage/", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "npx nx lint", + "format": "yarn run -T format", + "lint": "yarn run -BT nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "npx nx typecheck" + "check-types": "yarn run -BT nx typecheck" }, "dependencies": { "@typescript-eslint/typescript-estree": "8.32.1", @@ -58,7 +58,6 @@ "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", - "prettier": "^3.2.5", "rimraf": "*", "typescript": "*", "vitest": "^3.1.3" diff --git a/packages/type-utils/project.json b/packages/type-utils/project.json index 8c91c0ace943..a1fe512b9900 100644 --- a/packages/type-utils/project.json +++ b/packages/type-utils/project.json @@ -6,8 +6,7 @@ "sourceRoot": "packages/type-utils/src", "targets": { "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" }, "test": { "executor": "@nx/vite:test" diff --git a/packages/types/package.json b/packages/types/package.json index b64cbdeb108f..aa3254dc94e5 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -39,36 +39,15 @@ "scripts": { "copy-ast-spec": "tsx ./tools/copy-ast-spec.mts", "build": "tsc -b tsconfig.build.json", - "clean": "tsc -b tsconfig.build.json --clean", - "postclean": "rimraf dist/ src/generated/ coverage/", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "generate-lib": "npx nx run scope-manager:generate-lib", - "lint": "npx nx lint", + "clean": "rimraf dist/ src/generated/ coverage/", + "format": "yarn run -T format", + "generate-lib": "yarn run -BT nx run scope-manager:generate-lib", + "lint": "yarn run -BT nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "npx nx typecheck" - }, - "nx": { - "targets": { - "copy-ast-spec": { - "dependsOn": [ - "^build" - ], - "outputs": [ - "{projectRoot}/src/generated" - ], - "cache": true - }, - "build": { - "dependsOn": [ - "^build", - "copy-ast-spec" - ] - } - } + "check-types": "yarn run -BT nx typecheck" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", - "prettier": "^3.2.5", "rimraf": "*", "tsx": "*", "typescript": "*", diff --git a/packages/types/project.json b/packages/types/project.json index da87602e0a30..e40c639f06e7 100644 --- a/packages/types/project.json +++ b/packages/types/project.json @@ -4,11 +4,17 @@ "projectType": "library", "root": "packages/types", "sourceRoot": "packages/types/src", - "implicitDependencies": ["ast-spec"], "targets": { + "copy-ast-spec": { + "dependsOn": ["ast-spec:build"], + "outputs": ["{projectRoot}/src/generated"], + "cache": true + }, + "build": { + "dependsOn": ["copy-ast-spec"] + }, "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" } } } diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 9eb271206573..98370ddace83 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -44,10 +44,10 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "clean": "rimraf dist/ coverage/", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "nx lint", + "format": "yarn run -T format", + "lint": "yarn run -BT nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "npx nx typecheck" + "check-types": "yarn run -BT nx typecheck" }, "dependencies": { "@typescript-eslint/eslint-plugin": "8.32.1", @@ -60,7 +60,6 @@ }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", - "prettier": "^3.2.5", "rimraf": "*", "typescript": "*", "vitest": "^3.1.3" diff --git a/packages/typescript-eslint/project.json b/packages/typescript-eslint/project.json index 121581ef2b13..a2f82e64ac22 100644 --- a/packages/typescript-eslint/project.json +++ b/packages/typescript-eslint/project.json @@ -6,8 +6,7 @@ "sourceRoot": "packages/typescript-eslint/src", "targets": { "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" }, "test": { "executor": "@nx/vite:test" diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 958ba78b17ae..5ebc1ff50d89 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -46,10 +46,10 @@ "scripts": { "build": "tsc -b tsconfig.build.json", "clean": "rimraf dist/ coverage/", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "npx nx lint", + "format": "yarn run -T format", + "lint": "yarn run -BT nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "npx nx typecheck" + "check-types": "yarn run -BT nx typecheck" }, "dependencies": { "@typescript-eslint/types": "8.32.1", @@ -65,7 +65,6 @@ "@types/is-glob": "^4.0.4", "@vitest/coverage-v8": "^3.1.3", "glob": "*", - "prettier": "^3.2.5", "rimraf": "*", "typescript": "*", "vitest": "^3.1.3" diff --git a/packages/typescript-estree/project.json b/packages/typescript-estree/project.json index f0c767ee7c9a..4c49900749bf 100644 --- a/packages/typescript-estree/project.json +++ b/packages/typescript-estree/project.json @@ -6,8 +6,7 @@ "sourceRoot": "packages/typescript-estree/src", "targets": { "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" }, "test": { "executor": "@nx/vite:test" diff --git a/packages/utils/package.json b/packages/utils/package.json index 59cc23f0ad5a..99d3729f7cd1 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -54,12 +54,11 @@ ], "scripts": { "build": "tsc -b tsconfig.build.json", - "clean": "tsc -b tsconfig.build.json --clean", - "postclean": "rimraf dist/ coverage/", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "npx nx lint", + "clean": "rimraf dist/ coverage/", + "format": "yarn run -T format", + "lint": "yarn run -BT nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "npx nx typecheck" + "check-types": "yarn run -BT nx typecheck" }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", @@ -73,7 +72,6 @@ }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", - "prettier": "^3.2.5", "rimraf": "*", "typescript": "*", "vitest": "^3.1.3" diff --git a/packages/utils/project.json b/packages/utils/project.json index b5a83f94b080..7fe1a2d09486 100644 --- a/packages/utils/project.json +++ b/packages/utils/project.json @@ -6,8 +6,7 @@ "sourceRoot": "packages/utils/src", "targets": { "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" }, "test": { "executor": "@nx/vite:test", diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 612ce782ef59..8c2574a19926 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -38,12 +38,11 @@ ], "scripts": { "build": "tsc -b tsconfig.build.json", - "clean": "tsc -b tsconfig.build.json --clean", - "postclean": "rimraf dist/ coverage/", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "npx nx lint", + "clean": "rimraf dist/ coverage/", + "format": "yarn run -T format", + "lint": "yarn run -BT nx lint", "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "npx nx typecheck" + "check-types": "yarn run -BT nx typecheck" }, "dependencies": { "@typescript-eslint/types": "8.32.1", @@ -51,7 +50,6 @@ }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", - "prettier": "^3.2.5", "rimraf": "*", "typescript": "*", "vitest": "^3.1.3" diff --git a/packages/visitor-keys/project.json b/packages/visitor-keys/project.json index 208a8c73ee21..62e1f7fee8d3 100644 --- a/packages/visitor-keys/project.json +++ b/packages/visitor-keys/project.json @@ -6,8 +6,7 @@ "sourceRoot": "packages/visitor-keys/src", "targets": { "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" }, "test": { "executor": "@nx/vite:test" diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index 3a85f9c3b20b..fa7d8b903898 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -28,9 +28,10 @@ }, "scripts": { "build": "tsx ./build.mts", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "npx nx lint", - "check-types": "npx nx typecheck" + "clean": "rimraf dist/", + "format": "yarn run -T format", + "lint": "yarn run -BT nx lint", + "check-types": "yarn run -BT nx typecheck" }, "devDependencies": { "@eslint/js": "*", @@ -42,7 +43,7 @@ "esbuild": "~0.25.0", "eslint": "*", "esquery": "*", - "prettier": "^3.2.5", + "rimraf": "*", "tsx": "*" } } diff --git a/packages/website-eslint/project.json b/packages/website-eslint/project.json index 52ed1e539c3e..838eec579bf4 100644 --- a/packages/website-eslint/project.json +++ b/packages/website-eslint/project.json @@ -1,12 +1,12 @@ { "name": "website-eslint", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "type": "library", - "implicitDependencies": [], + "projectType": "library", + "root": "packages/website-eslint", + "sourceRoot": "packages/website-eslint/src", "targets": { "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" } } } diff --git a/packages/website/package.json b/packages/website/package.json index 9fdb887577ce..84e9bbf241c7 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -14,15 +14,16 @@ "scripts": { "build": "docusaurus build", "clear": "docusaurus clear", - "format": "prettier --write \"./**/*.{md,mdx,ts,js,tsx,jsx}\" --ignore-path ../../.prettierignore", + "clean": "rimraf dist/ build/ .docusaurus/ && yarn run clear", + "format": "yarn run -T format", "generate-website-dts": "tsx ./tools/generate-website-dts.mts", "stylelint": "stylelint \"src/**/*.css\"", "stylelint:fix": "stylelint \"src/**/*.css\" --fix", - "lint": "npx nx lint", + "lint": "yarn run -BT nx lint", "serve": "docusaurus serve", - "start": "npx nx start", + "start": "yarn run -BT nx start", "swizzle": "docusaurus swizzle", - "check-types": "npx nx typecheck" + "check-types": "yarn run -BT nx typecheck" }, "dependencies": { "@babel/runtime": "^7.24.4", @@ -52,9 +53,6 @@ "typedoc-plugin-markdown": "^4.6.3", "typescript": "*" }, - "resolutions": { - "react": "^18.2.0" - }, "devDependencies": { "@docusaurus/module-type-aliases": "^3.2.1", "@types/mdast": "^4.0.3", diff --git a/packages/website/project.json b/packages/website/project.json index c9b3f62d96f5..8ba9d038bdf5 100644 --- a/packages/website/project.json +++ b/packages/website/project.json @@ -1,20 +1,20 @@ { "name": "website", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "type": "library", - "implicitDependencies": [], + "projectType": "library", + "root": "packages/website", + "sourceRoot": "packages/website/src", "targets": { "start": { "dependsOn": ["website-eslint:build"], "executor": "nx:run-commands", "options": { - "cwd": "packages/website", + "cwd": "{projectRoot}", "command": "docusaurus start" } }, "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] + "executor": "@nx/eslint:lint" } } } diff --git a/project.json b/project.json index 8aa79709f045..a92e8d6ab900 100644 --- a/project.json +++ b/project.json @@ -1,10 +1,16 @@ { - "$schema": "node_modules/nx/schemas/project-schema.json", + "$schema": "./node_modules/nx/schemas/project-schema.json", "name": "repo", + "projectType": "library", + "root": ".", + "sourceRoot": ".", "// These targets are used for repo level utils and checking repo files which do not belong to specific published packages": {}, "targets": { + "clean": { + "command": "rimraf dist/ coverage/ .eslintcache" + }, "typecheck": { - "command": "tsc -b ./tsconfig.repo-config-files.json", + "command": "tsc -b tsconfig.repo-config-files.json", "dependsOn": ["types:copy-ast-spec"], "outputs": ["{workspaceRoot}/dist"] }, @@ -15,13 +21,15 @@ } }, "generate-configs": { - "command": "tsx tools/scripts/generate-configs.mts" + "command": "tsx tools/scripts/generate-configs.mts", + "dependsOn": ["eslint-plugin:build"] }, "generate-contributors": { "command": "tsx tools/scripts/generate-contributors.mts" }, "generate-lib": { - "command": "tsx tools/scripts/generate-lib.mts" + "command": "tsx tools/scripts/generate-lib.mts", + "dependsOn": ["typescript-eslint:build", "eslint-plugin-internal:build"] }, "generate-sponsors": { "command": "tsx tools/scripts/generate-sponsors.mts" diff --git a/yarn.lock b/yarn.lock index eb4c70f161e8..49103bcf9de2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -547,7 +547,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.25.4, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": version: 7.27.2 resolution: "@babel/parser@npm:7.27.2" dependencies: @@ -558,6 +558,17 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.25.4": + version: 7.27.1 + resolution: "@babel/parser@npm:7.27.1" + dependencies: + "@babel/types": ^7.27.1 + bin: + parser: ./bin/babel-parser.js + checksum: 36042c744c4648a8cebf5579a0f8dc6c056648a5b017c1f1c896ce99468764dad91dfc3dd215684e0e4e648a28b62cdd2e6537b34f4a83dda01cb97a846166b0 + languageName: node + linkType: hard + "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.25.9": version: 7.25.9 resolution: "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.25.9" @@ -5500,7 +5511,6 @@ __metadata: "@vitest/utils": ^3.1.3 eslint: "*" glob: "*" - prettier: ^3.2.5 rimraf: "*" typescript: "*" vitest: ^3.1.3 @@ -5549,7 +5559,7 @@ __metadata: mdast-util-mdx: ^3.0.0 micromark-extension-mdxjs: ^3.0.0 natural-compare: ^1.4.0 - prettier: ^3.2.5 + prettier: ^3.5.3 rimraf: "*" title-case: ^4.0.0 ts-api-utils: ^2.1.0 @@ -5573,7 +5583,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.32.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.32.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: @@ -5584,7 +5594,6 @@ __metadata: "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 glob: "*" - prettier: ^3.2.5 rimraf: "*" typescript: "*" vitest: ^3.1.3 @@ -5620,12 +5629,14 @@ __metadata: "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 chai: ^5.2.0 + eslint: "*" eslint-visitor-keys: ^4.2.0 espree: ^10.3.0 esprima: ^4.0.1 json-stable-stringify-without-jsonify: ^1.0.1 lodash.merge: 4.6.2 mocha: ^11.0.0 + rimraf: "*" semver: ^7.6.0 sinon: ^20.0.0 source-map-support: ^0.5.21 @@ -5646,7 +5657,6 @@ __metadata: "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 glob: "*" - prettier: ^3.2.5 rimraf: "*" typescript: "*" vitest: ^3.1.3 @@ -5664,7 +5674,6 @@ __metadata: ajv: ^6.12.6 debug: ^4.3.4 eslint: "*" - prettier: ^3.2.5 rimraf: "*" ts-api-utils: ^2.1.0 typescript: "*" @@ -5680,7 +5689,6 @@ __metadata: resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: "@vitest/coverage-v8": ^3.1.3 - prettier: ^3.2.5 rimraf: "*" tsx: "*" typescript: "*" @@ -5700,6 +5708,7 @@ __metadata: "@eslint/js": ^9.26.0 "@nx/devkit": 20.7.2 "@nx/eslint": 20.7.2 + "@nx/js": 20.7.2 "@nx/vite": 20.7.2 "@nx/workspace": 20.7.2 "@swc/core": ^1.4.12 @@ -5711,6 +5720,7 @@ __metadata: "@types/yargs": ^17.0.32 "@typescript-eslint/eslint-plugin": "workspace:^" "@typescript-eslint/eslint-plugin-internal": "workspace:^" + "@typescript-eslint/parser": "workspace:^" "@typescript-eslint/scope-manager": "workspace:^" "@typescript-eslint/types": "workspace:^" "@typescript-eslint/typescript-estree": "workspace:^" @@ -5735,7 +5745,6 @@ __metadata: husky: ^9.1.4 knip: ^5.41.1 lint-staged: ^15.2.2 - make-dir: ^4.0.0 markdownlint-cli: ^0.44.0 nx: 20.7.2 prettier: 3.5.0 @@ -5763,7 +5772,6 @@ __metadata: glob: "*" is-glob: ^4.0.3 minimatch: ^9.0.4 - prettier: ^3.2.5 rimraf: "*" semver: ^7.6.0 ts-api-utils: ^2.1.0 @@ -5783,7 +5791,6 @@ __metadata: "@typescript-eslint/types": 8.32.1 "@typescript-eslint/typescript-estree": 8.32.1 "@vitest/coverage-v8": ^3.1.3 - prettier: ^3.2.5 rimraf: "*" typescript: "*" vitest: ^3.1.3 @@ -5800,7 +5807,6 @@ __metadata: "@typescript-eslint/types": 8.32.1 "@vitest/coverage-v8": ^3.1.3 eslint-visitor-keys: ^4.2.0 - prettier: ^3.2.5 rimraf: "*" typescript: "*" vitest: ^3.1.3 @@ -5820,7 +5826,7 @@ __metadata: esbuild: ~0.25.0 eslint: "*" esquery: "*" - prettier: ^3.2.5 + rimraf: "*" tsx: "*" languageName: unknown linkType: soft @@ -17040,7 +17046,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: @@ -18655,12 +18661,10 @@ __metadata: languageName: node linkType: hard -"tmp@npm:0.2.1": - version: 0.2.1 - resolution: "tmp@npm:0.2.1" - dependencies: - rimraf: ^3.0.0 - checksum: 8b1214654182575124498c87ca986ac53dc76ff36e8f0e0b67139a8d221eaecfdec108c0e6ec54d76f49f1f72ab9325500b246f562b926f85bcdfca8bf35df9e +"tmp@npm:~0.2.1": + version: 0.2.3 + resolution: "tmp@npm:0.2.3" + checksum: 73b5c96b6e52da7e104d9d44afb5d106bb1e16d9fa7d00dbeb9e6522e61b571fbdb165c756c62164be9a3bbe192b9b268c236d370a2a0955c7689cd2ae377b95 languageName: node linkType: hard @@ -18956,7 +18960,6 @@ __metadata: "@typescript-eslint/parser": 8.32.1 "@typescript-eslint/utils": 8.32.1 "@vitest/coverage-v8": ^3.1.3 - prettier: ^3.2.5 rimraf: "*" typescript: "*" vitest: ^3.1.3 From f9e0eb9dbe40f89c1bd39ea466bab8666b7f60b3 Mon Sep 17 00:00:00 2001 From: James Henry Date: Mon, 19 May 2025 12:40:53 +0400 Subject: [PATCH 009/283] chore: clean up nx and other config (#11226) --- .github/workflows/ci.yml | 20 +- knip.ts | 3 + nx.json | 79 +- package.json | 73 +- packages/ast-spec/package.json | 39 +- packages/ast-spec/project.json | 23 - packages/ast-spec/vitest.config.mts | 5 - packages/eslint-plugin-internal/package.json | 13 +- packages/eslint-plugin-internal/project.json | 15 - packages/eslint-plugin/package.json | 27 +- packages/eslint-plugin/project.json | 29 - packages/integration-tests/package.json | 9 +- packages/integration-tests/project.json | 16 - packages/parser/package.json | 13 +- packages/parser/project.json | 15 - .../package.json | 14 +- .../project.json | 12 - packages/rule-tester/package.json | 22 +- packages/rule-tester/project.json | 15 - .../tests/eslint-base/eslint-base.test.js | 3536 ----------------- .../fixtures/empty-program-parser.js | 29 - .../eslint-base/fixtures/enhanced-parser.js | 20 - .../eslint-base/fixtures/enhanced-parser2.js | 25 - .../eslint-base/fixtures/fixes-one-problem.js | 25 - .../tests/eslint-base/fixtures/messageId.js | 146 - .../fixtures/modify-ast-at-first.js | 37 - .../fixtures/modify-ast-at-last.js | 37 - .../tests/eslint-base/fixtures/modify-ast.js | 21 - .../tests/eslint-base/fixtures/no-eval.js | 19 - .../eslint-base/fixtures/no-invalid-args.js | 23 - .../eslint-base/fixtures/no-invalid-schema.js | 21 - .../fixtures/no-schema-violation.js | 22 - .../eslint-base/fixtures/no-test-filename | 19 - .../eslint-base/fixtures/no-test-global.js | 26 - .../eslint-base/fixtures/no-test-settings.js | 22 - .../tests/eslint-base/fixtures/no-var.js | 26 - .../tests/eslint-base/fixtures/suggestions.js | 260 -- packages/scope-manager/package.json | 14 +- packages/scope-manager/project.json | 15 - packages/type-utils/package.json | 13 +- packages/type-utils/project.json | 15 - packages/types/package.json | 35 +- packages/typescript-eslint/package.json | 13 +- packages/typescript-eslint/project.json | 15 - packages/typescript-estree/package.json | 13 +- packages/typescript-estree/project.json | 15 - packages/utils/package.json | 20 +- packages/utils/project.json | 16 - packages/utils/vitest.config.mts | 5 - packages/visitor-keys/package.json | 13 +- packages/visitor-keys/project.json | 15 - packages/website-eslint/package.json | 10 +- packages/website-eslint/project.json | 12 - packages/website/package.json | 26 +- packages/website/project.json | 20 - project.json | 38 - vitest.config.base.mts | 4 - yarn.lock | 358 +- 58 files changed, 422 insertions(+), 5019 deletions(-) delete mode 100644 packages/ast-spec/project.json delete mode 100644 packages/eslint-plugin-internal/project.json delete mode 100644 packages/eslint-plugin/project.json delete mode 100644 packages/integration-tests/project.json delete mode 100644 packages/parser/project.json delete mode 100644 packages/rule-schema-to-typescript-types/project.json delete mode 100644 packages/rule-tester/project.json delete mode 100644 packages/rule-tester/tests/eslint-base/eslint-base.test.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/empty-program-parser.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/enhanced-parser.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/enhanced-parser2.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/fixes-one-problem.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/messageId.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/modify-ast-at-first.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/modify-ast-at-last.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/modify-ast.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/no-eval.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/no-invalid-args.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/no-invalid-schema.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/no-schema-violation.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/no-test-filename delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/no-test-global.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/no-test-settings.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/no-var.js delete mode 100644 packages/rule-tester/tests/eslint-base/fixtures/suggestions.js delete mode 100644 packages/scope-manager/project.json delete mode 100644 packages/type-utils/project.json delete mode 100644 packages/typescript-eslint/project.json delete mode 100644 packages/typescript-estree/project.json delete mode 100644 packages/utils/project.json delete mode 100644 packages/visitor-keys/project.json delete mode 100644 packages/website-eslint/project.json delete mode 100644 packages/website/project.json delete mode 100644 project.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ded66ac31b3..1e4861de3cdf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,8 @@ jobs: install: name: Checkout and Install runs-on: ubuntu-latest + env: + NX_CI_EXECUTION_ENV: 'ubuntu-latest' steps: - name: Checkout uses: actions/checkout@v4 @@ -51,6 +53,8 @@ jobs: name: Build All Packages needs: [install] runs-on: ubuntu-latest + env: + NX_CI_EXECUTION_ENV: 'ubuntu-latest' steps: - name: Checkout uses: actions/checkout@v4 @@ -65,6 +69,8 @@ jobs: name: Generate Configs needs: [build] runs-on: ubuntu-latest + env: + NX_CI_EXECUTION_ENV: 'ubuntu-latest' steps: - name: Checkout uses: actions/checkout@v4 @@ -84,6 +90,8 @@ jobs: strategy: matrix: lint-task: ['check-spelling', 'check-format', 'lint-markdown'] + env: + NX_CI_EXECUTION_ENV: 'ubuntu-latest' steps: - name: Checkout uses: actions/checkout@v4 @@ -103,6 +111,8 @@ jobs: strategy: matrix: lint-task: ['lint', 'typecheck', 'knip'] + env: + NX_CI_EXECUTION_ENV: 'ubuntu-latest' steps: - name: Checkout uses: actions/checkout@v4 @@ -122,6 +132,8 @@ jobs: name: Stylelint needs: [install] runs-on: ubuntu-latest + env: + NX_CI_EXECUTION_ENV: 'ubuntu-latest' steps: - name: Checkout uses: actions/checkout@v4 @@ -137,6 +149,8 @@ jobs: name: Run integration tests on primary Node.js version needs: [build] runs-on: ubuntu-latest + env: + NX_CI_EXECUTION_ENV: 'ubuntu-latest' steps: - name: Checkout uses: actions/checkout@v4 @@ -179,8 +193,7 @@ jobs: 'visitor-keys', ] env: - # Added the - at the end to function as a separator to improve readability in the PR comment from the Nx cloud app - NX_CLOUD_ENV_NAME: 'Node ${{ matrix.node-version }} -' + NX_CI_EXECUTION_ENV: '${{ matrix.os }} - Node ${{ matrix.node-version }}' COLLECT_COVERAGE: false steps: - name: Checkout @@ -225,7 +238,8 @@ jobs: package: ['eslint-plugin', 'eslint-plugin-internal', 'typescript-estree'] env: - COLLECT_COVERAGE: false + NX_CI_EXECUTION_ENV: 'ubuntu-latest' + COLLECT_COVERAGE: false, steps: - name: Checkout uses: actions/checkout@v4 diff --git a/knip.ts b/knip.ts index 9f2a79146687..327290d9019a 100644 --- a/knip.ts +++ b/knip.ts @@ -2,6 +2,7 @@ import type { KnipConfig } from 'knip' with { 'resolution-mode': 'import' }; export default { rules: { + binaries: 'off', classMembers: 'off', duplicates: 'off', enumMembers: 'off', @@ -54,11 +55,13 @@ export default { }, }, 'packages/eslint-plugin': { + entry: ['tools/**'], ignore: [ 'tests/fixtures/**', 'typings/eslint-rules.d.ts', 'typings/typescript.d.ts', ], + ignoreDependencies: ['tsx'], // used in nx target definitions }, 'packages/eslint-plugin-internal': { ignore: ['tests/fixtures/**'], diff --git a/nx.json b/nx.json index 167f99ebcc2a..bea912313ce5 100644 --- a/nx.json +++ b/nx.json @@ -4,7 +4,7 @@ "plugins": [ { "plugin": "@nx/js/typescript", - "exclude": [".", "packages/integration-tests/fixtures/**"], + "exclude": ["packages/integration-tests/fixtures/**"], "options": { "typecheck": { "targetName": "typecheck" @@ -17,17 +17,9 @@ }, { "plugin": "@nx/vite/plugin", - "include": ["packages/*"], + "exclude": ["*"], "options": { - "buildTargetName": "vite:build", - "testTargetName": "test", - "serveTargetName": "serve", - "devTargetName": "dev", - "previewTargetName": "preview", - "serveStaticTargetName": "serve-static", - "typecheckTargetName": "vite:typecheck", - "buildDepsTargetName": "vite:build-deps", - "watchDepsTargetName": "vite:watch-deps" + "testTargetName": "test" } }, { @@ -59,64 +51,8 @@ } }, "targetDefaults": { - "build": { - "dependsOn": ["^build"], - "inputs": ["production", "^production"], - "outputs": ["{projectRoot}/dist"], - "options": { - "cwd": "{projectRoot}" - }, - "cache": true - }, "test": { - "dependsOn": ["^build"], - "outputs": ["{projectRoot}/coverage"], - "cache": true - }, - "@nx/vite:test": { - "dependsOn": ["^build"], - "inputs": [ - "default", - "^production", - "{workspaceRoot}/vitest.config.mts", - "{workspaceRoot}/vitest.config.base.mts", - "{projectRoot}/vitest.config.mts" - ], - "outputs": ["{projectRoot}/coverage"], - "cache": true, - "options": { - "config": "{projectRoot}/vitest.config.mts", - "watch": false - } - }, - "@nx/eslint:lint": { - "dependsOn": ["eslint-plugin-internal:build", "typescript-eslint:build"], - "options": { - "noEslintrc": true, - "cache": true, - "eslintConfig": "{workspaceRoot}/eslint.config.mjs" - }, - "outputs": ["{options.outputFile}"], - "cache": true - }, - "lint": { - "executor": "@nx/eslint:lint", - "dependsOn": ["eslint-plugin-internal:build", "typescript-eslint:build"], - "inputs": [ - "default", - "{workspaceRoot}/eslint.config.mjs", - { - "dependentTasksOutputFiles": "**/*.js", - "transitive": false - } - ], - "outputs": ["{options.outputFile}"], - "cache": true - }, - "typecheck": { - "dependsOn": ["types:copy-ast-spec"], - "outputs": ["{workspaceRoot}/dist"], - "cache": true + "outputs": ["{projectRoot}/coverage"] } }, "namedInputs": { @@ -131,16 +67,15 @@ }, { "runtime": "yarn -v" - }, - "{workspaceRoot}/yarn.lock" + } ], "production": [ "default", "!{projectRoot}/**/?(*.)+(test).?(m|c)[jt]s?(x)?(.snap|.shot)", "!{projectRoot}/tests", + "!{projectRoot}/tools", "!{projectRoot}/tsconfig.spec.json", - "!{projectRoot}/vitest.config.mts", - "!{projectRoot}/src/test-setup.[jt]s" + "!{projectRoot}/vitest.config.mts" ] } } diff --git a/package.json b/package.json index a3d9c5c307bd..8dde6b1ec8fb 100644 --- a/package.json +++ b/package.json @@ -22,30 +22,30 @@ }, "homepage": "https://typescript-eslint.io", "scripts": { - "build": "nx run-many --target=build --exclude website --exclude website-eslint", + "build": "nx run-many -t build --exclude website website-eslint", "check-clean-workspace-after-install": "git diff --quiet --exit-code", "check-format": "prettier --check .", "check-spelling": "cspell --config=.cspell.json \"**/*.{md,mdx,ts,mts,cts,js,cjs,mjs,tsx,jsx}\" --no-progress --show-context --show-suggestions", - "clean": "nx run-many --target=clean --parallel=20", + "clean": "nx run-many -t clean --parallel=20", "format": "prettier --ignore-path=$PROJECT_CWD/.prettierignore --config=$PROJECT_CWD/.prettierrc.json --write $INIT_CWD", "generate-breaking-changes": "nx run eslint-plugin:generate-breaking-changes", - "generate-configs": "nx generate-configs", - "generate-contributors": "nx generate-contributors", - "generate-lib": "nx generate-lib", - "generate-sponsors": "nx generate-sponsors", + "generate-configs": "tsx tools/scripts/generate-configs.mts", + "generate-contributors": "tsx tools/scripts/generate-contributors.mts", + "generate-lib": "tsx tools/scripts/generate-lib.mts", + "generate-sponsors": "tsx tools/scripts/generate-sponsors.mts", "generate-website-dts": "nx run website:generate-website-dts", "lint-fix": "yarn lint --fix", "lint-markdown-fix": "yarn lint-markdown --fix", "lint-markdown": "markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore", "lint-stylelint": "nx lint website stylelint", - "lint": "nx run-many --target=lint", + "lint": "nx run-many -t lint", "postinstall": "tsx tools/scripts/postinstall.mts", "pre-commit": "lint-staged", "release": "tsx tools/release/release.mts", "start": "nx run website:start", - "test": "nx run-many --target=test --exclude integration-tests --exclude website --exclude website-eslint", + "test": "nx run-many -t test --exclude integration-tests website website-eslint", "test-integration": "nx run integration-tests:test", - "typecheck": "nx run-many --target=typecheck" + "typecheck": "nx run-many -t typecheck" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -57,11 +57,11 @@ "@eslint/compat": "^1.2.4", "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.26.0", - "@nx/devkit": "20.7.2", - "@nx/eslint": "20.7.2", - "@nx/js": "20.7.2", - "@nx/vite": "20.7.2", - "@nx/workspace": "20.7.2", + "@nx/devkit": "21.0.3", + "@nx/eslint": "21.0.3", + "@nx/js": "21.0.3", + "@nx/vite": "21.0.3", + "@nx/workspace": "21.0.3", "@swc/core": "^1.4.12", "@types/debug": "^4.1.12", "@types/eslint-plugin-jsx-a11y": "^6.10.0", @@ -97,7 +97,7 @@ "knip": "^5.41.1", "lint-staged": "^15.2.2", "markdownlint-cli": "^0.44.0", - "nx": "20.7.2", + "nx": "21.0.3", "prettier": "3.5.0", "rimraf": "^5.0.5", "semver": "7.7.0", @@ -122,6 +122,47 @@ }, "packageManager": "yarn@3.8.2", "nx": { - "includedScripts": [] + "name": "repo", + "includedScripts": [ + "generate-configs", + "generate-contributors", + "generate-lib", + "generate-sponsors" + ], + "targets": { + "generate-configs": { + "dependsOn": [ + "eslint-plugin:build" + ] + }, + "generate-lib": { + "dependsOn": [ + "typescript-eslint:build", + "eslint-plugin-internal:build" + ] + }, + "// These targets are used for repo level utils and checking repo files which do not belong to specific published packages": {}, + "typecheck": { + "command": "tsc -b tsconfig.repo-config-files.json", + "dependsOn": [ + "types:copy-ast-spec" + ], + "outputs": [ + "{workspaceRoot}/dist" + ], + "cache": true + }, + "lint": { + "command": "eslint . --ignore-pattern=packages --cache", + "dependsOn": [ + "typescript-eslint:build", + "eslint-plugin-internal:build" + ], + "cache": false + }, + "clean": { + "command": "rimraf dist/ coverage/ .eslintcache" + } + } } } diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index f2532092d1e2..b88610c936ca 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -31,13 +31,14 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build": "tsc -b tsconfig.build.json && api-extractor run --local --config=$INIT_CWD/api-extractor.json", + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"", "format": "yarn run -T format", "lint": "yarn run -BT nx lint", - "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "yarn run -BT nx typecheck" + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" }, "funding": { "type": "opencollective", @@ -59,5 +60,37 @@ "rimraf": "*", "typescript": "*", "vitest": "^3.1.3" + }, + "nx": { + "name": "ast-spec", + "implicitDependencies": [ + "!typescript-estree" + ], + "includedScripts": [ + "clean", + "clean-fixtures" + ], + "targets": { + "build": { + "command": "tsc -b tsconfig.build.json && api-extractor run --local --config=api-extractor.json", + "options": { + "cwd": "{projectRoot}" + }, + "outputs": [ + "{projectRoot}/dist/**/*.ts" + ], + "cache": true + }, + "typecheck": { + "dependsOn": [ + "typescript-estree:build" + ] + }, + "test": { + "dependsOn": [ + "typecheck" + ] + } + } } } diff --git a/packages/ast-spec/project.json b/packages/ast-spec/project.json deleted file mode 100644 index d6c8c081f226..000000000000 --- a/packages/ast-spec/project.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "ast-spec", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "implicitDependencies": ["!typescript-estree"], - "root": "packages/ast-spec", - "sourceRoot": "packages/ast-spec/src", - "targets": { - "build": { - "outputs": ["{projectRoot}/dist/**/*.ts"] - }, - "lint": { - "executor": "@nx/eslint:lint" - }, - "test": { - "executor": "@nx/vite:test", - "dependsOn": ["typecheck"] - }, - "typecheck": { - "dependsOn": ["typescript-estree:build"] - } - } -} diff --git a/packages/ast-spec/vitest.config.mts b/packages/ast-spec/vitest.config.mts index 090170ba88af..d79590018e5b 100644 --- a/packages/ast-spec/vitest.config.mts +++ b/packages/ast-spec/vitest.config.mts @@ -19,11 +19,6 @@ const vitestConfig = mergeConfig( './tests/util/setupVitest.mts', './tests/util/custom-matchers/custom-matchers.ts', ], - - typecheck: { - enabled: true, - tsconfig: path.join(import.meta.dirname, 'tsconfig.spec.json'), - }, }, }), ); diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index c2cde3c76ee8..303842fa29ba 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -14,12 +14,13 @@ "homepage": "https://typescript-eslint.io", "license": "MIT", "scripts": { - "build": "tsc -b tsconfig.build.json", + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", "lint": "yarn run -BT nx lint", - "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "yarn run -BT nx typecheck" + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { "@prettier/sync": "^0.5.1", @@ -33,5 +34,11 @@ "@vitest/coverage-v8": "^3.1.3", "rimraf": "*", "vitest": "^3.1.3" + }, + "nx": { + "name": "eslint-plugin-internal", + "includedScripts": [ + "clean" + ] } } diff --git a/packages/eslint-plugin-internal/project.json b/packages/eslint-plugin-internal/project.json deleted file mode 100644 index f0bfaacd26b6..000000000000 --- a/packages/eslint-plugin-internal/project.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "eslint-plugin-internal", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "root": "packages/eslint-plugin-internal", - "sourceRoot": "packages/eslint-plugin-internal/src", - "targets": { - "lint": { - "executor": "@nx/eslint:lint" - }, - "test": { - "executor": "@nx/vite:test" - } - } -} diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index f198f162124c..a48904ddb6e2 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -49,15 +49,15 @@ "typescript" ], "scripts": { - "build": "tsc -b tsconfig.build.json", + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", - "generate-breaking-changes": "tsx tools/generate-breaking-changes.mts", + "generate-breaking-changes": "yarn run -BT nx generate-breaking-changes", "generate-configs": "yarn run -T generate-configs", "lint": "yarn run -BT nx lint", - "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "test-single": "vitest --run --config=$INIT_CWD/vitest.config.mts --no-coverage", - "check-types": "yarn run -BT nx typecheck" + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", @@ -101,5 +101,22 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "eslint-plugin", + "includedScripts": [ + "clean" + ], + "targets": { + "generate-breaking-changes": { + "command": "tsx tools/generate-breaking-changes.mts", + "options": { + "cwd": "{projectRoot}" + }, + "dependsOn": [ + "type-utils:build" + ] + } + } } } diff --git a/packages/eslint-plugin/project.json b/packages/eslint-plugin/project.json deleted file mode 100644 index acfd65a8f79c..000000000000 --- a/packages/eslint-plugin/project.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "eslint-plugin", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "root": "packages/eslint-plugin", - "sourceRoot": "packages/eslint-plugin/src", - "targets": { - "lint": { - "executor": "@nx/eslint:lint" - }, - "test-single": { - "executor": "@nx/vite:test", - "cache": false, - "options": { - "coverage": false - } - }, - "test": { - "executor": "@nx/vite:test" - }, - "generate-breaking-changes": { - "dependsOn": ["type-utils:build"], - "executor": "nx:run-script", - "options": { - "script": "generate-breaking-changes" - } - } - } -} diff --git a/packages/integration-tests/package.json b/packages/integration-tests/package.json index 250cd92b8b07..df5b3ff213b8 100644 --- a/packages/integration-tests/package.json +++ b/packages/integration-tests/package.json @@ -12,13 +12,18 @@ "homepage": "https://typescript-eslint.io", "license": "MIT", "scripts": { + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "format": "yarn run -T format", "lint": "yarn run -BT nx lint", - "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "yarn run -BT nx typecheck" + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", "vitest": "^3.1.3" + }, + "nx": { + "name": "integration-tests", + "includedScripts": [] } } diff --git a/packages/integration-tests/project.json b/packages/integration-tests/project.json deleted file mode 100644 index 7686e219f332..000000000000 --- a/packages/integration-tests/project.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "integration-tests", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "root": "packages/integration-tests", - "sourceRoot": "packages/integration-tests/tools", - "implicitDependencies": ["typescript-eslint"], - "targets": { - "lint": { - "executor": "@nx/eslint:lint" - }, - "test": { - "executor": "@nx/vite:test" - } - } -} diff --git a/packages/parser/package.json b/packages/parser/package.json index c0e124b4f28d..99d63e8e0084 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -39,12 +39,13 @@ "eslint" ], "scripts": { - "build": "tsc -b tsconfig.build.json", + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", "lint": "yarn run -BT nx lint", - "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "yarn run -BT nx typecheck" + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", @@ -67,5 +68,11 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "parser", + "includedScripts": [ + "clean" + ] } } diff --git a/packages/parser/project.json b/packages/parser/project.json deleted file mode 100644 index fe0a92487dde..000000000000 --- a/packages/parser/project.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "parser", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "root": "packages/parser", - "sourceRoot": "packages/parser/src", - "targets": { - "lint": { - "executor": "@nx/eslint:lint" - }, - "test": { - "executor": "@nx/vite:test" - } - } -} diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index f2e18a13c669..8e4963cb2b52 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -24,12 +24,13 @@ "homepage": "https://typescript-eslint.io", "license": "MIT", "scripts": { - "build": "tsc -b tsconfig.build.json", + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", "lint": "yarn run -BT nx lint", - "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "yarn run -BT nx typecheck" + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { "@typescript-eslint/type-utils": "8.32.1", @@ -39,11 +40,18 @@ }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", + "rimraf": "*", "typescript": "*", "vitest": "^3.1.3" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "rule-schema-to-typescript-types", + "includedScripts": [ + "clean" + ] } } diff --git a/packages/rule-schema-to-typescript-types/project.json b/packages/rule-schema-to-typescript-types/project.json deleted file mode 100644 index 954e08a4001c..000000000000 --- a/packages/rule-schema-to-typescript-types/project.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "rule-schema-to-typescript-types", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "root": "packages/rule-schema-to-typescript-types", - "sourceRoot": "packages/rule-schema-to-typescript-types/src", - "targets": { - "lint": { - "executor": "@nx/eslint:lint" - } - } -} diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 1689bdd5372e..dfee240b8094 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -35,14 +35,13 @@ "estree" ], "scripts": { - "build": "tsc -b tsconfig.build.json", + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", "lint": "yarn run -BT nx lint", - "pretest-eslint-base": "tsc -b tsconfig.build.json", - "test-eslint-base": "mocha --require source-map-support/register ./tests/eslint-base/eslint-base.test.js", - "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "yarn run -BT nx typecheck" + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { @@ -61,15 +60,8 @@ "@types/json-stable-stringify-without-jsonify": "^1.0.2", "@types/lodash.merge": "4.6.9", "@vitest/coverage-v8": "^3.1.3", - "chai": "^5.2.0", "eslint": "*", - "eslint-visitor-keys": "^4.2.0", - "espree": "^10.3.0", - "esprima": "^4.0.1", - "mocha": "^11.0.0", "rimraf": "*", - "sinon": "^20.0.0", - "source-map-support": "^0.5.21", "typescript": "*", "vitest": "^3.1.3" }, @@ -79,5 +71,11 @@ }, "publishConfig": { "access": "public" + }, + "nx": { + "name": "rule-tester", + "includedScripts": [ + "clean" + ] } } diff --git a/packages/rule-tester/project.json b/packages/rule-tester/project.json deleted file mode 100644 index 0dfef3253a40..000000000000 --- a/packages/rule-tester/project.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "rule-tester", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "root": "packages/rule-tester", - "sourceRoot": "packages/rule-tester/src", - "targets": { - "lint": { - "executor": "@nx/eslint:lint" - }, - "test": { - "executor": "@nx/vite:test" - } - } -} diff --git a/packages/rule-tester/tests/eslint-base/eslint-base.test.js b/packages/rule-tester/tests/eslint-base/eslint-base.test.js deleted file mode 100644 index e87ece634534..000000000000 --- a/packages/rule-tester/tests/eslint-base/eslint-base.test.js +++ /dev/null @@ -1,3536 +0,0 @@ -/** - * This file intentionally does not match the standards in the rest of our codebase. - * It's intended to exactly match the test in ESLint core so we can ensure we - * have compatibility. - * It's tempting to switch this to be strictly typed in TS and to use jest - but - * it's too easy to introduce subtle changes into the test by doing that. It also - * makes it much harder to merge upstream changes into this test. - * - * The only edits we have made are to update the paths for our rep - * - * Forked from https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/lib/rule-tester/rule-tester.js - * - * @noformat - */ -/* eslint-disable */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ -const sinon = require("sinon"), - EventEmitter = require("events"), - { RuleTester } = require("../../dist/RuleTester"), - assert = require("chai").assert, - nodeAssert = require("assert"), - espree = require("espree"); - -const NODE_ASSERT_STRICT_EQUAL_OPERATOR = (() => { - try { - nodeAssert.strictEqual(1, 2); - } catch (err) { - return err.operator; - } - throw new Error("unexpected successful assertion"); -})(); - -/** - * Do nothing. - * @returns {void} - */ -function noop() { - - // do nothing. -} - -//------------------------------------------------------------------------------ -// Rewire Things -//------------------------------------------------------------------------------ - -/* - * So here's the situation. Because RuleTester uses it() and describe() from - * Mocha, any failures would show up in the output of this test file. That means - * when we tested that a failure is thrown, that would also count as a failure - * in the testing for RuleTester. In order to remove those results from the - * results of this file, we need to overwrite it() and describe() just in - * RuleTester to do nothing but run code. Effectively, it() and describe() - * just become regular functions inside of index.js, not at all related to Mocha. - * That allows the results of this file to be untainted and therefore accurate. - * - * To assert that the right arguments are passed to RuleTester.describe/it, an - * event emitter is used which emits the arguments. - */ - -const ruleTesterTestEmitter = new EventEmitter(); - -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - -describe("RuleTester", () => { - - // Stub `describe()` and `it()` while this test suite. - before(() => { - RuleTester.describe = function(text, method) { - ruleTesterTestEmitter.emit("describe", text, method); - return method.call(this); - }; - RuleTester.it = function(text, method) { - ruleTesterTestEmitter.emit("it", text, method); - return method.call(this); - }; - }); - after(() => { - RuleTester.describe = null; - RuleTester.it = null; - }); - - let ruleTester; - - /** - * A helper function to verify Node.js core error messages. - * @param {string} actual The actual input - * @param {string} expected The expected input - * @returns {Function} Error callback to verify that the message is correct - * for the actual and expected input. - */ - function assertErrorMatches(actual, expected) { - const err = new nodeAssert.AssertionError({ - actual, - expected, - operator: NODE_ASSERT_STRICT_EQUAL_OPERATOR - }); - - return err.message; - } - - beforeEach(() => { - RuleTester.resetDefaultConfig(); - ruleTester = new RuleTester(); - }); - - describe("only", () => { - describe("`itOnly` accessor", () => { - describe("when `itOnly` is set", () => { - before(() => { - RuleTester.itOnly = sinon.spy(); - }); - after(() => { - RuleTester.itOnly = void 0; - }); - beforeEach(() => { - RuleTester.itOnly.resetHistory(); - ruleTester = new RuleTester(); - }); - - it("is called by exclusive tests", () => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [{ - code: "const notVar = 42;", - only: true - }], - invalid: [] - }); - - sinon.assert.calledWith(RuleTester.itOnly, "const notVar = 42;"); - }); - }); - - describe("when `it` is set and has an `only()` method", () => { - before(() => { - RuleTester.it.only = () => {}; - sinon.spy(RuleTester.it, "only"); - }); - after(() => { - RuleTester.it.only = void 0; - }); - beforeEach(() => { - RuleTester.it.only.resetHistory(); - ruleTester = new RuleTester(); - }); - - it("is called by tests with `only` set", () => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [{ - code: "const notVar = 42;", - only: true - }], - invalid: [] - }); - - sinon.assert.calledWith(RuleTester.it.only, "const notVar = 42;"); - }); - }); - - describe("when global `it` is a function that has an `only()` method", () => { - let originalGlobalItOnly; - - before(() => { - - /* - * We run tests with `--forbid-only`, so we have to override - * `it.only` to prevent the real one from being called. - */ - originalGlobalItOnly = it.only; - it.only = () => {}; - sinon.spy(it, "only"); - }); - after(() => { - it.only = originalGlobalItOnly; - }); - beforeEach(() => { - it.only.resetHistory(); - ruleTester = new RuleTester(); - }); - - it("is called by tests with `only` set", () => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [{ - code: "const notVar = 42;", - only: true - }], - invalid: [] - }); - - sinon.assert.calledWith(it.only, "const notVar = 42;"); - }); - }); - - describe("when `describe` and `it` are overridden without `itOnly`", () => { - let originalGlobalItOnly; - - before(() => { - - /* - * These tests override `describe` and `it` already, so we - * don't need to override them here. We do, however, need to - * remove `only` from the global `it` to prevent it from - * being used instead. - */ - originalGlobalItOnly = it.only; - it.only = void 0; - }); - after(() => { - it.only = originalGlobalItOnly; - }); - beforeEach(() => { - ruleTester = new RuleTester(); - }); - - it("throws an error recommending overriding `itOnly`", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [{ - code: "const notVar = 42;", - only: true - }], - invalid: [] - }); - }, "Set `RuleTester.itOnly` to use `only` with a custom test framework."); - }); - }); - - describe("when global `it` is a function that does not have an `only()` method", () => { - let originalGlobalIt; - let originalRuleTesterDescribe; - let originalRuleTesterIt; - - before(() => { - originalGlobalIt = global.it; - - // eslint-disable-next-line no-global-assign -- Temporarily override Mocha global - it = () => {}; - - /* - * These tests override `describe` and `it`, so we need to - * un-override them here so they won't interfere. - */ - originalRuleTesterDescribe = RuleTester.describe; - RuleTester.describe = void 0; - originalRuleTesterIt = RuleTester.it; - RuleTester.it = void 0; - }); - after(() => { - - // eslint-disable-next-line no-global-assign -- Restore Mocha global - it = originalGlobalIt; - RuleTester.describe = originalRuleTesterDescribe; - RuleTester.it = originalRuleTesterIt; - }); - beforeEach(() => { - ruleTester = new RuleTester(); - }); - - it("throws an error explaining that the current test framework does not support `only`", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [{ - code: "const notVar = 42;", - only: true - }], - invalid: [] - }); - }, "The current test framework does not support exclusive tests with `only`."); - }); - }); - }); - - describe("test cases", () => { - const ruleName = "no-var"; - const rule = require("./fixtures/no-var"); - - let originalRuleTesterIt; - let spyRuleTesterIt; - let originalRuleTesterItOnly; - let spyRuleTesterItOnly; - - before(() => { - originalRuleTesterIt = RuleTester.it; - spyRuleTesterIt = sinon.spy(); - RuleTester.it = spyRuleTesterIt; - originalRuleTesterItOnly = RuleTester.itOnly; - spyRuleTesterItOnly = sinon.spy(); - RuleTester.itOnly = spyRuleTesterItOnly; - }); - after(() => { - RuleTester.it = originalRuleTesterIt; - RuleTester.itOnly = originalRuleTesterItOnly; - }); - beforeEach(() => { - spyRuleTesterIt.resetHistory(); - spyRuleTesterItOnly.resetHistory(); - ruleTester = new RuleTester(); - }); - - it("isn't called for normal tests", () => { - ruleTester.run(ruleName, rule, { - valid: ["const notVar = 42;"], - invalid: [] - }); - sinon.assert.calledWith(spyRuleTesterIt, "const notVar = 42;"); - sinon.assert.notCalled(spyRuleTesterItOnly); - }); - - it("calls it or itOnly for every test case", () => { - - /* - * `RuleTester` doesn't implement test case exclusivity itself. - * Setting `only: true` just causes `RuleTester` to call - * whatever `only()` function is provided by the test framework - * instead of the regular `it()` function. - */ - - ruleTester.run(ruleName, rule, { - valid: [ - "const valid = 42;", - { - code: "const onlyValid = 42;", - only: true - } - ], - invalid: [ - { - code: "var invalid = 42;", - errors: [/^Bad var/u] - }, - { - code: "var onlyInvalid = 42;", - errors: [/^Bad var/u], - only: true - } - ] - }); - - sinon.assert.calledWith(spyRuleTesterIt, "const valid = 42;"); - sinon.assert.calledWith(spyRuleTesterItOnly, "const onlyValid = 42;"); - sinon.assert.calledWith(spyRuleTesterIt, "var invalid = 42;"); - sinon.assert.calledWith(spyRuleTesterItOnly, "var onlyInvalid = 42;"); - }); - }); - - describe("static helper wrapper", () => { - it("adds `only` to string test cases", () => { - const test = RuleTester.only("const valid = 42;"); - - assert.deepStrictEqual(test, { - code: "const valid = 42;", - only: true - }); - }); - - it("adds `only` to object test cases", () => { - const test = RuleTester.only({ code: "const valid = 42;" }); - - assert.deepStrictEqual(test, { - code: "const valid = 42;", - only: true - }); - }); - }); - }); - - it("should not throw an error when everything passes", () => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - "Eval(foo)" - ], - invalid: [ - { code: "eval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression" }] } - ] - }); - }); - - it("should throw an error when valid code is invalid", () => { - - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - "eval(foo)" - ], - invalid: [ - { code: "eval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression" }] } - ] - }); - }, /Should have no errors but had 1/u); - }); - - it("should throw an error when valid code is invalid", () => { - - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - { code: "eval(foo)" } - ], - invalid: [ - { code: "eval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression" }] } - ] - }); - }, /Should have no errors but had 1/u); - }); - - it("should throw an error if invalid code is valid", () => { - - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - "Eval(foo)" - ], - invalid: [ - { code: "Eval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression" }] } - ] - }); - }, /Should have 1 error but had 0/u); - }); - - it("should throw an error when the error message is wrong", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - - // Only the invalid test matters here - valid: [ - "bar = baz;" - ], - invalid: [ - { code: "var foo = bar;", errors: [{ message: "Bad error message." }] } - ] - }); - }, assertErrorMatches("Bad var.", "Bad error message.")); - }); - - it("should throw an error when the error message regex does not match", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [], - invalid: [ - { code: "var foo = bar;", errors: [{ message: /Bad error message/u }] } - ] - }); - }, /Expected 'Bad var.' to match \/Bad error message\//u); - }); - - it("should throw an error when the error is not a supported type", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - - // Only the invalid test matters here - valid: [ - "bar = baz;" - ], - invalid: [ - { code: "var foo = bar;", errors: [42] } - ] - }); - }, /Error should be a string, object, or RegExp/u); - }); - - it("should throw an error when any of the errors is not a supported type", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - - // Only the invalid test matters here - valid: [ - "bar = baz;" - ], - invalid: [ - { code: "var foo = bar; var baz = quux", errors: [{ message: "Bad var.", type: "VariableDeclaration" }, null] } - ] - }); - }, /Error should be a string, object, or RegExp/u); - }); - - it("should throw an error when the error is a string and it does not match error message", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - - // Only the invalid test matters here - valid: [ - "bar = baz;" - ], - invalid: [ - { code: "var foo = bar;", errors: ["Bad error message."] } - ] - }); - }, assertErrorMatches("Bad var.", "Bad error message.")); - }); - - it("should throw an error when the error is a string and it does not match error message", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - - valid: [ - ], - invalid: [ - { code: "var foo = bar;", errors: [/Bad error message/u] } - ] - }); - }, /Expected 'Bad var.' to match \/Bad error message\//u); - }); - - it("should not throw an error when the error is a string and it matches error message", () => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - - // Only the invalid test matters here - valid: [ - "bar = baz;" - ], - invalid: [ - { code: "var foo = bar;", output: " foo = bar;", errors: ["Bad var."] } - ] - }); - }); - - it("should not throw an error when the error is a regex and it matches error message", () => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [], - invalid: [ - { code: "var foo = bar;", output: " foo = bar;", errors: [/^Bad var/u] } - ] - }); - }); - - it("should not throw an error when the error is a string and the suggestion fixer is failing", () => { - ruleTester.run("no-var", require("./fixtures/suggestions").withFailingFixer, { - valid: [], - invalid: [ - { code: "foo", errors: ["some message"] } - ] - }); - }); - - it("throws an error when the error is a string and the suggestion fixer provides a fix", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/suggestions").basic, { - valid: [], - invalid: [ - { code: "foo", errors: ["Avoid using identifiers named 'foo'."] } - ] - }); - }, "Error at index 0 has suggestions. Please convert the test error into an object and specify 'suggestions' property on it to test suggestions."); - }); - - it("should throw an error when the error is an object with an unknown property name", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [ - "bar = baz;" - ], - invalid: [ - { code: "var foo = bar;", errors: [{ Message: "Bad var." }] } - ] - }); - }, /Invalid error property name 'Message'/u); - }); - - it("should throw an error when any of the errors is an object with an unknown property name", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [ - "bar = baz;" - ], - invalid: [ - { - code: "var foo = bar; var baz = quux", - errors: [ - { message: "Bad var.", type: "VariableDeclaration" }, - { message: "Bad var.", typo: "VariableDeclaration" } - ] - } - ] - }); - }, /Invalid error property name 'typo'/u); - }); - - it("should not throw an error when the error is a regex in an object and it matches error message", () => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [], - invalid: [ - { code: "var foo = bar;", output: " foo = bar;", errors: [{ message: /^Bad var/u }] } - ] - }); - }); - - it("should throw an error when the expected output doesn't match", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [ - "bar = baz;" - ], - invalid: [ - { code: "var foo = bar;", output: "foo = bar", errors: [{ message: "Bad var.", type: "VariableDeclaration" }] } - ] - }); - }, /Output is incorrect/u); - }); - - it("should use strict equality to compare output", () => { - const replaceProgramWith5Rule = { - meta: { - fixable: "code" - }, - - create: context => ({ - Program(node) { - context.report({ node, message: "bad", fix: fixer => fixer.replaceText(node, "5") }); - } - }) - }; - - // Should not throw. - ruleTester.run("foo", replaceProgramWith5Rule, { - valid: [], - invalid: [ - { code: "var foo = bar;", output: "5", errors: 1 } - ] - }); - - assert.throws(() => { - ruleTester.run("foo", replaceProgramWith5Rule, { - valid: [], - invalid: [ - { code: "var foo = bar;", output: 5, errors: 1 } - ] - }); - }, /Output is incorrect/u); - }); - - it("should throw an error when the expected output doesn't match and errors is just a number", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [ - "bar = baz;" - ], - invalid: [ - { code: "var foo = bar;", output: "foo = bar", errors: 1 } - ] - }); - }, /Output is incorrect/u); - }); - - it("should not throw an error when the expected output is null and no errors produce output", () => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - "bar = baz;" - ], - invalid: [ - { code: "eval(x)", errors: 1, output: null }, - { code: "eval(x); eval(y);", errors: 2, output: null } - ] - }); - }); - - it("should throw an error when the expected output is null and problems produce output", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [ - "bar = baz;" - ], - invalid: [ - { code: "var foo = bar;", output: null, errors: 1 } - ] - }); - }, /Expected no autofixes to be suggested/u); - - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [ - "bar = baz;" - ], - invalid: [ - { - code: "var foo = bar; var qux = boop;", - output: null, - errors: 2 - } - ] - }); - }, /Expected no autofixes to be suggested/u); - }); - - it("should throw an error when the expected output is null and only some problems produce output", () => { - assert.throws(() => { - ruleTester.run("fixes-one-problem", require("./fixtures/fixes-one-problem"), { - valid: [], - invalid: [ - { code: "foo", output: null, errors: 2 } - ] - }); - }, /Expected no autofixes to be suggested/u); - }); - - it("should throw an error when the expected output is not null and the output does not differ from the code", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-eval"), { - valid: [], - invalid: [ - { code: "eval('')", output: "eval('')", errors: 1 } - ] - }); - }, "Test property 'output' matches 'code'. If no autofix is expected, then omit the 'output' property or set it to null."); - }); - - it("should throw an error when the expected output isn't specified and problems produce output", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [ - "bar = baz;" - ], - invalid: [ - { code: "var foo = bar;", errors: 1 } - ] - }); - }, "The rule fixed the code. Please add 'output' property."); - }); - - it("should throw an error if invalid code specifies wrong type", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - "Eval(foo)" - ], - invalid: [ - { code: "eval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression2" }] } - ] - }); - }, /Error type should be CallExpression2, found CallExpression/u); - }); - - it("should throw an error if invalid code specifies wrong line", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - "Eval(foo)" - ], - invalid: [ - { code: "eval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression", line: 5 }] } - ] - }); - }, /Error line should be 5/u); - }); - - it("should not skip line assertion if line is a falsy value", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - "Eval(foo)" - ], - invalid: [ - { code: "\neval(foo)", errors: [{ message: "eval sucks.", type: "CallExpression", line: 0 }] } - ] - }); - }, /Error line should be 0/u); - }); - - it("should throw an error if invalid code specifies wrong column", () => { - const wrongColumn = 10, - expectedErrorMessage = "Error column should be 1"; - - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: ["Eval(foo)"], - invalid: [{ - code: "eval(foo)", - errors: [{ - message: "eval sucks.", - column: wrongColumn - }] - }] - }); - }, expectedErrorMessage); - }); - - it("should throw error for empty error array", () => { - assert.throws(() => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [] - }] - }); - }, /Invalid cases must have at least one error/u); - }); - - it("should throw error for errors : 0", () => { - assert.throws(() => { - ruleTester.run( - "suggestions-messageIds", - require("./fixtures/suggestions") - .withMessageIds, - { - valid: [], - invalid: [ - { - code: "var foo;", - errors: 0 - } - ] - } - ); - }, /Invalid cases must have 'error' value greater than 0/u); - }); - - it("should not skip column assertion if column is a falsy value", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: ["Eval(foo)"], - invalid: [{ - code: "var foo; eval(foo)", - errors: [{ message: "eval sucks.", column: 0 }] - }] - }); - }, /Error column should be 0/u); - }); - - it("should throw an error if invalid code specifies wrong endLine", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [ - "bar = baz;" - ], - invalid: [ - { code: "var foo = bar;", output: "foo = bar", errors: [{ message: "Bad var.", type: "VariableDeclaration", endLine: 10 }] } - ] - }); - }, "Error endLine should be 10"); - }); - - it("should throw an error if invalid code specifies wrong endColumn", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [ - "bar = baz;" - ], - invalid: [ - { code: "var foo = bar;", output: "foo = bar", errors: [{ message: "Bad var.", type: "VariableDeclaration", endColumn: 10 }] } - ] - }); - }, "Error endColumn should be 10"); - }); - - it("should throw an error if invalid code has the wrong number of errors", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - "Eval(foo)" - ], - invalid: [ - { - code: "eval(foo)", - errors: [ - { message: "eval sucks.", type: "CallExpression" }, - { message: "eval sucks.", type: "CallExpression" } - ] - } - ] - }); - }, /Should have 2 errors but had 1/u); - }); - - it("should throw an error if invalid code does not have errors", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - "Eval(foo)" - ], - invalid: [ - { code: "eval(foo)" } - ] - }); - }, /Did not specify errors for an invalid test of no-eval/u); - }); - - it("should throw an error if invalid code has the wrong explicit number of errors", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - "Eval(foo)" - ], - invalid: [ - { code: "eval(foo)", errors: 2 } - ] - }); - }, /Should have 2 errors but had 1/u); - }); - - it("should throw an error if there's a parsing error in a valid test", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - "1eval('foo')" - ], - invalid: [ - { code: "eval('foo')", errors: [{}] } - ] - }); - }, /fatal parsing error/iu); - }); - - it("should throw an error if there's a parsing error in an invalid test", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - "noeval('foo')" - ], - invalid: [ - { code: "1eval('foo')", errors: [{}] } - ] - }); - }, /fatal parsing error/iu); - }); - - it("should throw an error if there's a parsing error in an invalid test and errors is just a number", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - "noeval('foo')" - ], - invalid: [ - { code: "1eval('foo')", errors: 1 } - ] - }); - }, /fatal parsing error/iu); - }); - - // https://github.com/eslint/eslint/issues/4779 - it("should throw an error if there's a parsing error and output doesn't match", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [], - invalid: [ - { code: "obvious parser error", output: "string that doesnt match", errors: [{}] } - ] - }); - }, /fatal parsing error/iu); - }); - - it("should throw an error if an error object has no properties", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: ["Eval(foo)"], - invalid: [{ - code: "eval(foo)", - errors: [{}] - }] - }); - }, "Test error must specify either a 'messageId' or 'message'."); - }); - - it("should throw an error if an error has a property besides message or messageId", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: ["Eval(foo)"], - invalid: [{ - code: "eval(foo)", - errors: [{ line: 1 }] - }] - }); - }, "Test error must specify either a 'messageId' or 'message'."); - }); - - it("should pass-through the globals config of valid tests to the to rule", () => { - ruleTester.run("no-test-global", require("./fixtures/no-test-global"), { - valid: [ - "var test = 'foo'", - { - code: "var test2 = 'bar'", - globals: { test: true } - } - ], - invalid: [{ code: "bar", errors: 1 }] - }); - }); - - it("should pass-through the globals config of invalid tests to the to rule", () => { - ruleTester.run("no-test-global", require("./fixtures/no-test-global"), { - valid: ["var test = 'foo'"], - invalid: [ - { - code: "var test = 'foo'; var foo = 'bar'", - errors: 1 - }, - { - code: "var test = 'foo'", - globals: { foo: true }, - errors: [{ message: "Global variable foo should not be used." }] - } - ] - }); - }); - - it("should pass-through the settings config to rules", () => { - ruleTester.run("no-test-settings", require("./fixtures/no-test-settings"), { - valid: [ - { - code: "var test = 'bar'", settings: { test: 1 } - } - ], - invalid: [ - { - code: "var test = 'bar'", settings: { "no-test": 22 }, errors: 1 - } - ] - }); - }); - - it("should pass-through the filename to the rule", () => { - (function() { - ruleTester.run("", require("./fixtures/no-test-filename"), { - valid: [ - { - code: "var foo = 'bar'", - filename: "somefile.js" - } - ], - invalid: [ - { - code: "var foo = 'bar'", - errors: [ - { message: "Filename test was not defined." } - ] - } - ] - }); - }()); - }); - - it("should pass-through the options to the rule", () => { - ruleTester.run("no-invalid-args", require("./fixtures/no-invalid-args"), { - valid: [ - { - code: "var foo = 'bar'", - options: [false] - } - ], - invalid: [ - { - code: "var foo = 'bar'", - options: [true], - errors: [{ message: "Invalid args" }] - } - ] - }); - }); - - it("should throw an error if the options are an object", () => { - assert.throws(() => { - ruleTester.run("no-invalid-args", require("./fixtures/no-invalid-args"), { - valid: [ - { - code: "foo", - options: { ok: true } - } - ], - invalid: [] - }); - }, /options must be an array/u); - }); - - it("should throw an error if the options are a number", () => { - assert.throws(() => { - ruleTester.run("no-invalid-args", require("./fixtures/no-invalid-args"), { - valid: [ - { - code: "foo", - options: 0 - } - ], - invalid: [] - }); - }, /options must be an array/u); - }); - - it("should pass-through the parser to the rule", () => { - const spy = sinon.spy(ruleTester.linter, "verify"); - - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - { - code: "Eval(foo)" - } - ], - invalid: [ - { - code: "eval(foo)", - parser: require.resolve("esprima"), - errors: [{ message: "eval sucks.", line: 1 }] - } - ] - }); - assert.strictEqual(spy.args[1][1].parser, require.resolve("esprima")); - }); - - // skipping because it's not something our parser cares about - it.skip("should pass normalized ecmaVersion to the rule", () => { - const reportEcmaVersionRule = { - meta: { - messages: { - ecmaVersionMessage: "context.parserOptions.ecmaVersion is {{type}} {{ecmaVersion}}." - } - }, - create: context => ({ - Program(node) { - const { ecmaVersion } = context.parserOptions; - - context.report({ - node, - messageId: "ecmaVersionMessage", - data: { type: typeof ecmaVersion, ecmaVersion } - }); - } - }) - }; - - const notEspree = require.resolve("./fixtures/empty-program-parser"); - - ruleTester.run("report-ecma-version", reportEcmaVersionRule, { - valid: [], - invalid: [ - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "undefined", ecmaVersion: "undefined" } }] - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "undefined", ecmaVersion: "undefined" } }], - parserOptions: {} - }, - { - code: "
", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "undefined", ecmaVersion: "undefined" } }], - parserOptions: { ecmaFeatures: { jsx: true } } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "undefined", ecmaVersion: "undefined" } }], - parser: require.resolve("espree") - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: "6" } }], - parserOptions: { ecmaVersion: 6 } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: "6" } }], - parserOptions: { ecmaVersion: 2015 } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "undefined", ecmaVersion: "undefined" } }], - env: { browser: true } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "undefined", ecmaVersion: "undefined" } }], - env: { es6: false } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: "6" } }], - env: { es6: true } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: "8" } }], - env: { es6: false, es2017: true } - }, - { - code: "let x", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: "6" } }], - env: { es6: "truthy" } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: "8" } }], - env: { es2017: true } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: "11" } }], - env: { es2020: true } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: "12" } }], - env: { es2021: true } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: String(espree.latestEcmaVersion) } }], - parserOptions: { ecmaVersion: "latest" } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: String(espree.latestEcmaVersion) } }], - parser: require.resolve("espree"), - parserOptions: { ecmaVersion: "latest" } - }, - { - code: "
", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: String(espree.latestEcmaVersion) } }], - parserOptions: { ecmaVersion: "latest", ecmaFeatures: { jsx: true } } - }, - { - code: "import 'foo'", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: String(espree.latestEcmaVersion) } }], - parserOptions: { ecmaVersion: "latest", sourceType: "module" } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: String(espree.latestEcmaVersion) } }], - parserOptions: { ecmaVersion: "latest" }, - env: { es6: true } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: String(espree.latestEcmaVersion) } }], - parserOptions: { ecmaVersion: "latest" }, - env: { es2020: true } - }, - - // Non-Espree parsers normalize ecmaVersion if it's not "latest" - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "undefined", ecmaVersion: "undefined" } }], - parser: notEspree - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "undefined", ecmaVersion: "undefined" } }], - parser: notEspree, - parserOptions: {} - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: "5" } }], - parser: notEspree, - parserOptions: { ecmaVersion: 5 } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: "6" } }], - parser: notEspree, - parserOptions: { ecmaVersion: 6 } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: 6 } }], - parser: notEspree, - parserOptions: { ecmaVersion: 2015 } - }, - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "string", ecmaVersion: "latest" } }], - parser: notEspree, - parserOptions: { ecmaVersion: "latest" } - } - ] - }); - - [{ parserOptions: { ecmaVersion: 6 } }, { env: { es6: true } }].forEach(options => { - new RuleTester(options).run("report-ecma-version", reportEcmaVersionRule, { - valid: [], - invalid: [ - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: "6" } }] - }, - { - code: "", - parserOptions: {}, - errors: [{ messageId: "ecmaVersionMessage", data: { type: "number", ecmaVersion: "6" } }] - } - ] - }); - }); - - new RuleTester({ parser: notEspree }).run("report-ecma-version", reportEcmaVersionRule, { - valid: [], - invalid: [ - { - code: "", - errors: [{ messageId: "ecmaVersionMessage", data: { type: "undefined", ecmaVersion: "undefined" } }] - }, - { - code: "", - parserOptions: { ecmaVersion: "latest" }, - errors: [{ messageId: "ecmaVersionMessage", data: { type: "string", ecmaVersion: "latest" } }] - } - ] - }); - }); - - it("should pass-through services from parseForESLint to the rule", () => { - const enhancedParserPath = require.resolve("./fixtures/enhanced-parser"); - const disallowHiRule = { - create: context => ({ - Literal(node) { - const disallowed = context.parserServices.test.getMessage(); // returns "Hi!" - - if (node.value === disallowed) { - context.report({ node, message: `Don't use '${disallowed}'` }); - } - } - }) - }; - - ruleTester.run("no-hi", disallowHiRule, { - valid: [ - { - code: "'Hello!'", - parser: enhancedParserPath - } - ], - invalid: [ - { - code: "'Hi!'", - parser: enhancedParserPath, - errors: [{ message: "Don't use 'Hi!'" }] - } - ] - }); - }); - - it("should prevent invalid options schemas", () => { - assert.throws(() => { - ruleTester.run("no-invalid-schema", require("./fixtures/no-invalid-schema"), { - valid: [ - "var answer = 6 * 7;", - { code: "var answer = 6 * 7;", options: [] } - ], - invalid: [ - { code: "var answer = 6 * 7;", options: ["bar"], errors: [{ message: "Expected nothing." }] } - ] - }); - }, "Schema for rule no-invalid-schema is invalid:,\titems: should be object\n\titems[0].enum: should NOT have fewer than 1 items\n\titems: should match some schema in anyOf"); - - }); - - it("should prevent schema violations in options", () => { - assert.throws(() => { - ruleTester.run("no-schema-violation", require("./fixtures/no-schema-violation"), { - valid: [ - "var answer = 6 * 7;", - { code: "var answer = 6 * 7;", options: ["foo"] } - ], - invalid: [ - { code: "var answer = 6 * 7;", options: ["bar"], errors: [{ message: "Expected foo." }] } - ] - }); - }, /Value "bar" should be equal to one of the allowed values./u); - - }); - - it("should disallow invalid defaults in rules", () => { - const ruleWithInvalidDefaults = { - meta: { - schema: [ - { - oneOf: [ - { enum: ["foo"] }, - { - type: "object", - properties: { - foo: { - enum: ["foo", "bar"], - default: "foo" - } - }, - additionalProperties: false - } - ] - } - ] - }, - create: () => ({}) - }; - - assert.throws(() => { - ruleTester.run("invalid-defaults", ruleWithInvalidDefaults, { - valid: [ - { - code: "foo", - options: [{}] - } - ], - invalid: [] - }); - }, /Schema for rule invalid-defaults is invalid: default is ignored for: data1\.foo/u); - }); - - it("throw an error when an unknown config option is included", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - { code: "Eval(foo)", foo: "bar" } - ], - invalid: [] - }); - }, /ESLint configuration in rule-tester is invalid./u); - }); - - it("throw an error when an invalid config value is included", () => { - assert.throws(() => { - ruleTester.run("no-eval", require("./fixtures/no-eval"), { - valid: [ - { code: "Eval(foo)", env: ["es6"] } - ], - invalid: [] - }); - }, /Property "env" is the wrong type./u); - }); - - it("should pass-through the tester config to the rule", () => { - ruleTester = new RuleTester({ - globals: { test: true } - }); - - ruleTester.run("no-test-global", require("./fixtures/no-test-global"), { - valid: [ - "var test = 'foo'", - "var test2 = test" - ], - invalid: [{ code: "bar", errors: 1, globals: { foo: true } }] - }); - }); - - it("should correctly set the globals configuration", () => { - const config = { globals: { test: true } }; - - RuleTester.setDefaultConfig(config); - assert( - RuleTester.getDefaultConfig().globals.test, - "The default config object is incorrect" - ); - }); - - it("should correctly reset the global configuration", () => { - const config = { globals: { test: true } }; - - RuleTester.setDefaultConfig(config); - RuleTester.resetDefaultConfig(); - assert.deepStrictEqual( - RuleTester.getDefaultConfig(), - { parser: require.resolve('@typescript-eslint/parser'), rules: {} }, - "The default configuration has not reset correctly" - ); - }); - - it("should enforce the global configuration to be an object", () => { - - /** - * Set the default config for the rules tester - * @param {Object} config configuration object - * @returns {Function} Function to be executed - * @private - */ - function setConfig(config) { - return function() { - RuleTester.setDefaultConfig(config); - }; - } - assert.throw(setConfig()); - assert.throw(setConfig(1)); - assert.throw(setConfig(3.14)); - assert.throw(setConfig("foo")); - assert.throw(setConfig(null)); - assert.throw(setConfig(true)); - }); - - it("should pass-through the globals config to the tester then to the to rule", () => { - const config = { globals: { test: true } }; - - RuleTester.setDefaultConfig(config); - ruleTester = new RuleTester(); - - ruleTester.run("no-test-global", require("./fixtures/no-test-global"), { - valid: [ - "var test = 'foo'", - "var test2 = test" - ], - invalid: [{ code: "bar", errors: 1, globals: { foo: true } }] - }); - }); - - it("should throw an error if AST was modified", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/modify-ast"), { - valid: [ - "var foo = 0;" - ], - invalid: [] - }); - }, "Rule should not modify AST."); - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/modify-ast"), { - valid: [], - invalid: [ - { code: "var bar = 0;", errors: ["error"] } - ] - }); - }, "Rule should not modify AST."); - }); - - it("should throw an error if AST was modified (at Program)", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/modify-ast-at-first"), { - valid: [ - "var foo = 0;" - ], - invalid: [] - }); - }, "Rule should not modify AST."); - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/modify-ast-at-first"), { - valid: [], - invalid: [ - { code: "var bar = 0;", errors: ["error"] } - ] - }); - }, "Rule should not modify AST."); - }); - - it("should throw an error if AST was modified (at Program:exit)", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/modify-ast-at-last"), { - valid: [ - "var foo = 0;" - ], - invalid: [] - }); - }, "Rule should not modify AST."); - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/modify-ast-at-last"), { - valid: [], - invalid: [ - { code: "var bar = 0;", errors: ["error"] } - ] - }); - }, "Rule should not modify AST."); - }); - - it("should throw an error if rule uses start and end properties on nodes, tokens or comments", () => { - const usesStartEndRule = { - create(context) { - return { - CallExpression(node) { - noop(node.arguments[1].start); - }, - "BinaryExpression[operator='+']"(node) { - noop(node.end); - }, - "UnaryExpression[operator='-']"(node) { - noop(context.sourceCode.getFirstToken(node).start); - }, - ConditionalExpression(node) { - noop(context.sourceCode.getFirstToken(node).end); - }, - BlockStatement(node) { - noop(context.sourceCode.getCommentsInside(node)[0].start); - }, - ObjectExpression(node) { - noop(context.sourceCode.getCommentsInside(node)[0].end); - }, - Decorator(node) { - noop(node.start); - } - }; - } - }; - - assert.throws(() => { - ruleTester.run("uses-start-end", usesStartEndRule, { - valid: ["foo(a, b)"], - invalid: [] - }); - }, "Use node.range[0] instead of node.start"); - assert.throws(() => { - ruleTester.run("uses-start-end", usesStartEndRule, { - valid: [], - invalid: [{ code: "var a = b * (c + d) / e;", errors: 1 }] - }); - }, "Use node.range[1] instead of node.end"); - assert.throws(() => { - ruleTester.run("uses-start-end", usesStartEndRule, { - valid: [], - invalid: [{ code: "var a = -b * c;", errors: 1 }] - }); - }, "Use token.range[0] instead of token.start"); - assert.throws(() => { - ruleTester.run("uses-start-end", usesStartEndRule, { - valid: ["var a = b ? c : d;"], - invalid: [] - }); - }, "Use token.range[1] instead of token.end"); - assert.throws(() => { - ruleTester.run("uses-start-end", usesStartEndRule, { - valid: ["function f() { /* comment */ }"], - invalid: [] - }); - }, "Use token.range[0] instead of token.start"); - assert.throws(() => { - ruleTester.run("uses-start-end", usesStartEndRule, { - valid: [], - invalid: [{ code: "var x = //\n {\n //comment\n //\n}", errors: 1 }] - }); - }, "Use token.range[1] instead of token.end"); - - const enhancedParserPath = require.resolve("./fixtures/enhanced-parser"); - - assert.throws(() => { - ruleTester.run("uses-start-end", usesStartEndRule, { - valid: [{ code: "foo(a, b)", parser: enhancedParserPath }], - invalid: [] - }); - }, "Use node.range[0] instead of node.start"); - assert.throws(() => { - ruleTester.run("uses-start-end", usesStartEndRule, { - valid: [], - invalid: [{ code: "var a = b * (c + d) / e;", parser: enhancedParserPath, errors: 1 }] - }); - }, "Use node.range[1] instead of node.end"); - assert.throws(() => { - ruleTester.run("uses-start-end", usesStartEndRule, { - valid: [], - invalid: [{ code: "var a = -b * c;", parser: enhancedParserPath, errors: 1 }] - }); - }, "Use token.range[0] instead of token.start"); - assert.throws(() => { - ruleTester.run("uses-start-end", usesStartEndRule, { - valid: [{ code: "var a = b ? c : d;", parser: enhancedParserPath }], - invalid: [] - }); - }, "Use token.range[1] instead of token.end"); - assert.throws(() => { - ruleTester.run("uses-start-end", usesStartEndRule, { - valid: [{ code: "function f() { /* comment */ }", parser: enhancedParserPath }], - invalid: [] - }); - }, "Use token.range[0] instead of token.start"); - assert.throws(() => { - ruleTester.run("uses-start-end", usesStartEndRule, { - valid: [], - invalid: [{ code: "var x = //\n {\n //comment\n //\n}", parser: enhancedParserPath, errors: 1 }] - }); - }, "Use token.range[1] instead of token.end"); - - assert.throws(() => { - ruleTester.run("uses-start-end", usesStartEndRule, { - valid: [{ code: "@foo class A {}", parser: require.resolve("./fixtures/enhanced-parser2") }], - invalid: [] - }); - }, "Use node.range[0] instead of node.start"); - }); - - it("should throw an error if no test scenarios given", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/modify-ast-at-last")); - }, "Test Scenarios for rule foo : Could not find test scenario object"); - }); - - it("should throw an error if no acceptable test scenario object is given", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/modify-ast-at-last"), []); - }, "Test Scenarios for rule foo is invalid:\nCould not find any valid test scenarios\nCould not find any invalid test scenarios"); - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/modify-ast-at-last"), ""); - }, "Test Scenarios for rule foo : Could not find test scenario object"); - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/modify-ast-at-last"), 2); - }, "Test Scenarios for rule foo : Could not find test scenario object"); - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/modify-ast-at-last"), {}); - }, "Test Scenarios for rule foo is invalid:\nCould not find any valid test scenarios\nCould not find any invalid test scenarios"); - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/modify-ast-at-last"), { - valid: [] - }); - }, "Test Scenarios for rule foo is invalid:\nCould not find any invalid test scenarios"); - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/modify-ast-at-last"), { - invalid: [] - }); - }, "Test Scenarios for rule foo is invalid:\nCould not find any valid test scenarios"); - }); - - // Nominal message/messageId use cases - it("should assert match if message provided in both test and result.", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/messageId").withMessageOnly, { - valid: [], - invalid: [{ code: "foo", errors: [{ message: "something" }] }] - }); - }, /Avoid using variables named/u); - - ruleTester.run("foo", require("./fixtures/messageId").withMessageOnly, { - valid: [], - invalid: [{ code: "foo", errors: [{ message: "Avoid using variables named 'foo'." }] }] - }); - }); - - it("should assert match between messageId if provided in both test and result.", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/messageId").withMetaWithData, { - valid: [], - invalid: [{ code: "foo", errors: [{ messageId: "unused" }] }] - }); - }, "messageId 'avoidFoo' does not match expected messageId 'unused'."); - - ruleTester.run("foo", require("./fixtures/messageId").withMetaWithData, { - valid: [], - invalid: [{ code: "foo", errors: [{ messageId: "avoidFoo" }] }] - }); - }); - it("should assert match between resulting message output if messageId and data provided in both test and result", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/messageId").withMetaWithData, { - valid: [], - invalid: [{ code: "foo", errors: [{ messageId: "avoidFoo", data: { name: "notFoo" } }] }] - }); - }, "Hydrated message \"Avoid using variables named 'notFoo'.\" does not match \"Avoid using variables named 'foo'.\""); - }); - - it("should throw if the message has a single unsubstituted placeholder when data is not specified", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/messageId").withMissingData, { - valid: [], - invalid: [{ code: "foo", errors: [{ messageId: "avoidFoo" }] }] - }); - }, "The reported message has an unsubstituted placeholder 'name'. Please provide the missing value via the 'data' property in the context.report() call."); - }); - - it("should throw if the message has a single unsubstituted placeholders when data is specified", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/messageId").withMissingData, { - valid: [], - invalid: [{ code: "foo", errors: [{ messageId: "avoidFoo", data: { name: "name" } }] }] - }); - }, "Hydrated message \"Avoid using variables named 'name'.\" does not match \"Avoid using variables named '{{ name }}'."); - }); - - it("should throw if the message has multiple unsubstituted placeholders when data is not specified", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/messageId").withMultipleMissingDataProperties, { - valid: [], - invalid: [{ code: "foo", errors: [{ messageId: "avoidFoo" }] }] - }); - }, "The reported message has unsubstituted placeholders: 'type', 'name'. Please provide the missing values via the 'data' property in the context.report() call."); - }); - - it("should not throw if the data in the message contains placeholders not present in the raw message", () => { - ruleTester.run("foo", require("./fixtures/messageId").withPlaceholdersInData, { - valid: [], - invalid: [{ code: "foo", errors: [{ messageId: "avoidFoo" }] }] - }); - }); - - it("should throw if the data in the message contains the same placeholder and data is not specified", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/messageId").withSamePlaceholdersInData, { - valid: [], - invalid: [{ code: "foo", errors: [{ messageId: "avoidFoo" }] }] - }); - }, "The reported message has an unsubstituted placeholder 'name'. Please provide the missing value via the 'data' property in the context.report() call."); - }); - - it("should not throw if the data in the message contains the same placeholder and data is specified", () => { - ruleTester.run("foo", require("./fixtures/messageId").withSamePlaceholdersInData, { - valid: [], - invalid: [{ code: "foo", errors: [{ messageId: "avoidFoo", data: { name: "{{ name }}" } }] }] - }); - }); - - it("should not throw an error for specifying non-string data values", () => { - ruleTester.run("foo", require("./fixtures/messageId").withNonStringData, { - valid: [], - invalid: [{ code: "0", errors: [{ messageId: "avoid", data: { value: 0 } }] }] - }); - }); - - // messageId/message misconfiguration cases - it("should throw if user tests for both message and messageId", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/messageId").withMetaWithData, { - valid: [], - invalid: [{ code: "foo", errors: [{ message: "something", messageId: "avoidFoo" }] }] - }); - }, "Error should not specify both 'message' and a 'messageId'."); - }); - it("should throw if user tests for messageId but the rule doesn't use the messageId meta syntax.", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/messageId").withMessageOnly, { - valid: [], - invalid: [{ code: "foo", errors: [{ messageId: "avoidFoo" }] }] - }); - }, "Error can not use 'messageId' if rule under test doesn't define 'meta.messages'"); - }); - it("should throw if user tests for messageId not listed in the rule's meta syntax.", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/messageId").withMetaWithData, { - valid: [], - invalid: [{ code: "foo", errors: [{ messageId: "useFoo" }] }] - }); - }, /Invalid messageId 'useFoo'/u); - }); - it("should throw if data provided without messageId.", () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/messageId").withMetaWithData, { - valid: [], - invalid: [{ code: "foo", errors: [{ data: "something" }] }] - }); - }, "Test error must specify either a 'messageId' or 'message'."); - }); - - describe("suggestions", () => { - it("should throw if suggestions are available but not specified", () => { - assert.throw(() => { - ruleTester.run("suggestions-basic", require("./fixtures/suggestions").basic, { - valid: [ - "var boo;" - ], - invalid: [{ - code: "var foo;", - errors: [{ message: "Avoid using identifiers named 'foo'." }] - }] - }); - }, "Error at index 0 has suggestions. Please specify 'suggestions' property on the test error object."); - }); - - it("should pass with valid suggestions (tested using desc)", () => { - ruleTester.run("suggestions-basic", require("./fixtures/suggestions").basic, { - valid: [ - "var boo;" - ], - invalid: [{ - code: "var foo;", - errors: [{ - message: "Avoid using identifiers named 'foo'.", - suggestions: [{ - desc: "Rename identifier 'foo' to 'bar'", - output: "var bar;" - }] - }] - }] - }); - }); - - it("should pass with suggestions on multiple lines", () => { - ruleTester.run("suggestions-basic", require("./fixtures/suggestions").basic, { - valid: [], - invalid: [ - { - code: "function foo() {\n var foo = 1;\n}", - errors: [{ - message: "Avoid using identifiers named 'foo'.", - suggestions: [{ - desc: "Rename identifier 'foo' to 'bar'", - output: "function bar() {\n var foo = 1;\n}" - }] - }, { - message: "Avoid using identifiers named 'foo'.", - suggestions: [{ - desc: "Rename identifier 'foo' to 'bar'", - output: "function foo() {\n var bar = 1;\n}" - }] - }] - } - ] - }); - }); - - it("should pass with valid suggestions (tested using messageIds)", () => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - message: "Avoid using identifiers named 'foo'.", - suggestions: [{ - messageId: "renameFoo", - output: "var bar;" - }, { - messageId: "renameFoo", - output: "var baz;" - }] - }] - }] - }); - }); - - it("should pass with valid suggestions (one tested using messageIds, the other using desc)", () => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - message: "Avoid using identifiers named 'foo'.", - suggestions: [{ - messageId: "renameFoo", - output: "var bar;" - }, { - desc: "Rename identifier 'foo' to 'baz'", - output: "var baz;" - }] - }] - }] - }); - }); - - it("should fail with valid suggestions when testing using both desc and messageIds for the same suggestion", () => { - assert.throw(() => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{ - desc: "Rename identifier 'foo' to 'bar'", - messageId: "renameFoo", - output: "var bar;" - }, { - desc: "Rename identifier 'foo' to 'baz'", - messageId: "renameFoo", - output: "var baz;" - }] - }] - }] - }); - }, "Error Suggestion at index 0: Test should not specify both 'desc' and 'messageId'."); - }); - - it("should pass with valid suggestions (tested using only desc on a rule that utilizes meta.messages)", () => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{ - desc: "Rename identifier 'foo' to 'bar'", - output: "var bar;" - }, { - desc: "Rename identifier 'foo' to 'baz'", - output: "var baz;" - }] - }] - }] - }); - }); - - it("should pass with valid suggestions (tested using messageIds and data)", () => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{ - messageId: "renameFoo", - data: { newName: "bar" }, - output: "var bar;" - }, { - messageId: "renameFoo", - data: { newName: "baz" }, - output: "var baz;" - }] - }] - }] - }); - }); - - it("should fail with a single missing data placeholder when data is not specified", () => { - assert.throws(() => { - ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMissingPlaceholderData, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{ - messageId: "renameFoo", - output: "var bar;" - }] - }] - }] - }); - }, "The message of the suggestion has an unsubstituted placeholder 'newName'. Please provide the missing value via the 'data' property for the suggestion in the context.report() call."); - }); - - it("should fail with a single missing data placeholder when data is specified", () => { - assert.throws(() => { - ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMissingPlaceholderData, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{ - messageId: "renameFoo", - data: { other: "name" }, - output: "var bar;" - }] - }] - }] - }); - }, "The message of the suggestion has an unsubstituted placeholder 'newName'. Please provide the missing value via the 'data' property for the suggestion in the context.report() call."); - }); - - it("should fail with multiple missing data placeholders when data is not specified", () => { - assert.throws(() => { - ruleTester.run("suggestions-messageIds", require("../../fixtures/testers/rule-tester/suggestions").withMultipleMissingPlaceholderDataProperties, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{ - messageId: "rename", - output: "var bar;" - }] - }] - }] - }); - }, "The message of the suggestion has unsubstituted placeholders: 'currentName', 'newName'. Please provide the missing values via the 'data' property for the suggestion in the context.report() call."); - }); - - - it("should fail when tested using empty suggestion test objects even if the array length is correct", () => { - assert.throw(() => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{}, {}] - }] - }] - }); - }, "Error Suggestion at index 0: Test must specify either 'messageId' or 'desc'"); - }); - - it("should fail when tested using non-empty suggestion test objects without an output property", () => { - assert.throw(() => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{ messageId: "renameFoo" }, {}] - }] - }] - }); - }, 'Error Suggestion at index 0: The "output" property is required.'); - }); - - it("should support explicitly expecting no suggestions", () => { - [void 0, null, false, []].forEach(suggestions => { - ruleTester.run("suggestions-basic", require("./fixtures/no-eval"), { - valid: [], - invalid: [{ - code: "eval('var foo');", - errors: [{ - message: "eval sucks.", - suggestions - }] - }] - }); - }); - }); - - it("should fail when expecting no suggestions and there are suggestions", () => { - [void 0, null, false, []].forEach(suggestions => { - assert.throws(() => { - ruleTester.run("suggestions-basic", require("./fixtures/suggestions").basic, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - message: "Avoid using identifiers named 'foo'.", - suggestions - }] - }] - }); - }, "Error should have no suggestions on error with message: \"Avoid using identifiers named 'foo'.\""); - }); - }); - - it("should fail when testing for suggestions that don't exist", () => { - assert.throws(() => { - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - suggestions: [{ - message: "Bad var.", - messageId: "this-does-not-exist" - }] - }] - }] - }); - }, 'Error should have suggestions on error with message: "Bad var."'); - }); - - it("should support specifying only the amount of suggestions", () => { - ruleTester.run("suggestions-basic", require("./fixtures/suggestions").basic, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - message: "Avoid using identifiers named 'foo'.", - suggestions: 1 - }] - }] - }); - }); - - it("should fail when there are a different number of suggestions", () => { - assert.throws(() => { - ruleTester.run("suggestions-basic", require("./fixtures/suggestions").basic, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - message: "Avoid using identifiers named 'foo'.", - suggestions: 2 - }] - }] - }); - }, "Error should have 2 suggestions. Instead found 1 suggestions"); - }); - - it("should fail when there are a different number of suggestions for arrays", () => { - assert.throws(() => { - ruleTester.run("suggestions-basic", require("./fixtures/suggestions").basic, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - message: "Avoid using identifiers named 'foo'.", - suggestions: [{ - desc: "Rename identifier 'foo' to 'bar'", - output: "var bar;" - }, { - desc: "Rename identifier 'foo' to 'baz'", - output: "var baz;" - }] - }] - }] - }); - }, "Error should have 2 suggestions. Instead found 1 suggestions"); - }); - - it("should fail when the suggestion property is neither a number nor an array", () => { - assert.throws(() => { - ruleTester.run("suggestions-basic", require("./fixtures/suggestions").basic, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - message: "Avoid using identifiers named 'foo'.", - suggestions: "1" - }] - }] - }); - }, "Test error object property 'suggestions' should be an array or a number"); - }); - - it("should throw if suggestion fix made a syntax error.", () => { - assert.throw(() => { - ruleTester.run( - "foo", - { - meta: { hasSuggestions: true }, - create(context) { - return { - Identifier(node) { - context.report({ - node, - message: "make a syntax error", - suggest: [ - { - desc: "make a syntax error", - fix(fixer) { - return fixer.replaceText(node, "one two"); - } - } - ] - }); - } - }; - } - }, - { - valid: [""], - invalid: [{ - code: "one()", - errors: [{ - message: "make a syntax error", - suggestions: [{ - desc: "make a syntax error", - output: "one two()" - }] - }] - }] - } - ); - }, /A fatal parsing error occurred in suggestion fix\.\nError: .+\nSuggestion output:\n.+/u); - }); - - it("should throw if the suggestion description doesn't match", () => { - assert.throws(() => { - ruleTester.run("suggestions-basic", require("./fixtures/suggestions").basic, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - suggestions: [{ - desc: "not right", - output: "var baz;" - }] - }] - }] - }); - }, "Error Suggestion at index 0 : desc should be \"not right\" but got \"Rename identifier 'foo' to 'bar'\" instead."); - }); - - it("should pass when different suggestion matchers use desc and messageId", () => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{ - desc: "Rename identifier 'foo' to 'bar'", - output: "var bar;" - }, { - messageId: "renameFoo", - output: "var baz;" - }] - }] - }] - }); - }); - - it("should throw if the suggestion messageId doesn't match", () => { - assert.throws(() => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{ - messageId: "unused", - output: "var bar;" - }, { - messageId: "renameFoo", - output: "var baz;" - }] - }] - }] - }); - }, "Error Suggestion at index 0: messageId should be 'unused' but got 'renameFoo' instead."); - }); - - it("should throw if test specifies messageId for a rule that doesn't have meta.messages", () => { - assert.throws(() => { - ruleTester.run("suggestions-basic", require("./fixtures/suggestions").basic, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - message: "Avoid using identifiers named 'foo'.", - suggestions: [{ - messageId: "renameFoo", - output: "var bar;" - }] - }] - }] - }); - }, "Error Suggestion at index 0: Test can not use 'messageId' if rule under test doesn't define 'meta.messages'."); - }); - - it("should throw if test specifies messageId that doesn't exist in the rule's meta.messages", () => { - assert.throws(() => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{ - messageId: "renameFoo", - output: "var bar;" - }, { - messageId: "removeFoo", - output: "var baz;" - }] - }] - }] - }); - }, "Error Suggestion at index 1: Test has invalid messageId 'removeFoo', the rule under test allows only one of ['avoidFoo', 'unused', 'renameFoo']."); - }); - - it("should throw if hydrated desc doesn't match (wrong data value)", () => { - assert.throws(() => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{ - messageId: "renameFoo", - data: { newName: "car" }, - output: "var bar;" - }, { - messageId: "renameFoo", - data: { newName: "baz" }, - output: "var baz;" - }] - }] - }] - }); - }, "Error Suggestion at index 0: Hydrated test desc \"Rename identifier 'foo' to 'car'\" does not match received desc \"Rename identifier 'foo' to 'bar'\"."); - }); - - it("should throw if hydrated desc doesn't match (wrong data key)", () => { - assert.throws(() => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{ - messageId: "renameFoo", - data: { newName: "bar" }, - output: "var bar;" - }, { - messageId: "renameFoo", - data: { name: "baz" }, - output: "var baz;" - }] - }] - }] - }); - }, "Error Suggestion at index 1: Hydrated test desc \"Rename identifier 'foo' to '{{ newName }}'\" does not match received desc \"Rename identifier 'foo' to 'baz'\"."); - }); - - it("should throw if test specifies both desc and data", () => { - assert.throws(() => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{ - desc: "Rename identifier 'foo' to 'bar'", - messageId: "renameFoo", - data: { newName: "bar" }, - output: "var bar;" - }, { - messageId: "renameFoo", - data: { newName: "baz" }, - output: "var baz;" - }] - }] - }] - }); - }, "Error Suggestion at index 0: Test should not specify both 'desc' and 'data'."); - }); - - it("should throw if test uses data but doesn't specify messageId", () => { - assert.throws(() => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - messageId: "avoidFoo", - suggestions: [{ - messageId: "renameFoo", - data: { newName: "bar" }, - output: "var bar;" - }, { - data: { newName: "baz" }, - output: "var baz;" - }] - }] - }] - }); - }, "Error Suggestion at index 1: Test must specify 'messageId' if 'data' is used."); - }); - - it("should throw if the resulting suggestion output doesn't match", () => { - assert.throws(() => { - ruleTester.run("suggestions-basic", require("./fixtures/suggestions").basic, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - message: "Avoid using identifiers named 'foo'.", - suggestions: [{ - desc: "Rename identifier 'foo' to 'bar'", - output: "var baz;" - }] - }] - }] - }); - }, "Expected the applied suggestion fix to match the test suggestion output"); - }); - - it("should throw if the resulting suggestion output is the same as the original source code", () => { - assert.throws(() => { - ruleTester.run("suggestions-basic", require("./fixtures/suggestions").withFixerWithoutChanges, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - message: "Avoid using identifiers named 'foo'.", - suggestions: [{ - desc: "Rename identifier 'foo' to 'bar'", - output: "var foo;" - }] - }] - }] - }); - }, "The output of a suggestion should differ from the original source code for suggestion at index: 0 on error with message: \"Avoid using identifiers named 'foo'.\""); - }); - - it("should fail when specified suggestion isn't an object", () => { - assert.throws(() => { - ruleTester.run("suggestions-basic", require("./fixtures/suggestions").basic, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - message: "Avoid using identifiers named 'foo'.", - suggestions: [null] - }] - }] - }); - }, "Test suggestion in 'suggestions' array must be an object."); - - assert.throws(() => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - message: "avoidFoo", - suggestions: [ - { - messageId: "renameFoo", - output: "var bar;" - }, - "Rename identifier 'foo' to 'baz'" - ] - }] - }] - }); - }, "Test suggestion in 'suggestions' array must be an object."); - }); - - it("should fail when the suggestion is an object with an unknown property name", () => { - assert.throws(() => { - ruleTester.run("suggestions-basic", require("./fixtures/suggestions").basic, { - valid: [ - "var boo;" - ], - invalid: [{ - code: "var foo;", - errors: [{ - message: "avoidFoo", - suggestions: [{ - message: "Rename identifier 'foo' to 'bar'" - }] - }] - }] - }); - }, /Invalid suggestion property name 'message'/u); - }); - - it("should fail when any of the suggestions is an object with an unknown property name", () => { - assert.throws(() => { - ruleTester.run("suggestions-messageIds", require("./fixtures/suggestions").withMessageIds, { - valid: [], - invalid: [{ - code: "var foo;", - errors: [{ - suggestions: [{ - messageId: "renameFoo", - output: "var bar;" - }, { - messageId: "renameFoo", - outpt: "var baz;" - }] - }] - }] - }); - }, /Invalid suggestion property name 'outpt'/u); - }); - - it("should fail if a rule produces two suggestions with the same description", () => { - assert.throws(() => { - ruleTester.run("suggestions-with-duplicate-descriptions", require("../../fixtures/testers/rule-tester/suggestions").withDuplicateDescriptions, { - valid: [], - invalid: [ - { code: "var foo = bar;", errors: 1 } - ] - }); - }, "Suggestion message 'Rename 'foo' to 'bar'' reported from suggestion 1 was previously reported by suggestion 0. Suggestion messages should be unique within an error."); - }); - - it("should fail if a rule produces two suggestions with the same messageId without data", () => { - assert.throws(() => { - ruleTester.run("suggestions-with-duplicate-messageids-no-data", require("../../fixtures/testers/rule-tester/suggestions").withDuplicateMessageIdsNoData, { - valid: [], - invalid: [ - { code: "var foo = bar;", errors: 1 } - ] - }); - }, "Suggestion message 'Rename identifier' reported from suggestion 1 was previously reported by suggestion 0. Suggestion messages should be unique within an error."); - }); - - it("should fail if a rule produces two suggestions with the same messageId with data", () => { - assert.throws(() => { - ruleTester.run("suggestions-with-duplicate-messageids-with-data", require("../../fixtures/testers/rule-tester/suggestions").withDuplicateMessageIdsWithData, { - valid: [], - invalid: [ - { code: "var foo = bar;", errors: 1 } - ] - }); - }, "Suggestion message 'Rename identifier 'foo' to 'bar'' reported from suggestion 1 was previously reported by suggestion 0. Suggestion messages should be unique within an error."); - }); - - it("should throw an error if a rule that doesn't have `meta.hasSuggestions` enabled produces suggestions", () => { - assert.throws(() => { - ruleTester.run("suggestions-missing-hasSuggestions-property", require("./fixtures/suggestions").withoutHasSuggestionsProperty, { - valid: [], - invalid: [ - { code: "var foo = bar;", output: "5", errors: 1 } - ] - }); - }, "Rules with suggestions must set the `meta.hasSuggestions` property to `true`."); - }); - }); - - describe("deprecations", () => { - let processStub; - const ruleWithNoSchema = { - meta: { - type: "suggestion" - }, - create(context) { - return { - Program(node) { - context.report({ node, message: "bad" }); - } - }; - } - }; - const ruleWithNoMeta = { - create(context) { - return { - Program(node) { - context.report({ node, message: "bad" }); - } - }; - } - }; - - beforeEach(() => { - processStub = sinon.stub(process, "emitWarning"); - }); - - afterEach(() => { - processStub.restore(); - }); - - it("should log a deprecation warning when using the legacy function-style API for rule", () => { - - /** - * Legacy-format rule (a function instead of an object with `create` method). - * @param {RuleContext} context The ESLint rule context object. - * @returns {Object} Listeners. - */ - function functionStyleRule(context) { - return { - Program(node) { - context.report({ node, message: "bad" }); - } - }; - } - - ruleTester.run("function-style-rule", functionStyleRule, { - valid: [], - invalid: [ - { code: "var foo = bar;", errors: 1 } - ] - }); - - assert.strictEqual(processStub.callCount, 1, "calls `process.emitWarning()` once"); - assert.deepStrictEqual( - processStub.getCall(0).args, - [ - "\"function-style-rule\" rule is using the deprecated function-style format and will stop working in ESLint v9. Please use object-style format: https://eslint.org/docs/latest/extend/custom-rules", - "DeprecationWarning" - ] - ); - }); - - it("should log a deprecation warning when meta is not defined for the rule", () => { - ruleTester.run("rule-with-no-meta-1", ruleWithNoMeta, { - valid: [], - invalid: [ - { code: "var foo = bar;", options: [{ foo: true }], errors: 1 } - ] - }); - - assert.strictEqual(processStub.callCount, 1, "calls `process.emitWarning()` once"); - assert.deepStrictEqual( - processStub.getCall(0).args, - [ - "\"rule-with-no-meta-1\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/latest/extend/custom-rules#options-schemas", - "DeprecationWarning" - ] - ); - }); - - it("should log a deprecation warning when schema is not defined for the rule", () => { - ruleTester.run("rule-with-no-schema-1", ruleWithNoSchema, { - valid: [], - invalid: [ - { code: "var foo = bar;", options: [{ foo: true }], errors: 1 } - ] - }); - - assert.strictEqual(processStub.callCount, 1, "calls `process.emitWarning()` once"); - assert.deepStrictEqual( - processStub.getCall(0).args, - [ - "\"rule-with-no-schema-1\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/latest/extend/custom-rules#options-schemas", - "DeprecationWarning" - ] - ); - }); - - it("should log a deprecation warning when schema is `undefined`", () => { - const ruleWithUndefinedSchema = { - meta: { - type: "problem", - // eslint-disable-next-line no-undefined -- intentionally added for test case - schema: undefined - }, - create(context) { - return { - Program(node) { - context.report({ node, message: "bad" }); - } - }; - } - }; - - ruleTester.run("rule-with-undefined-schema", ruleWithUndefinedSchema, { - valid: [], - invalid: [ - { code: "var foo = bar;", options: [{ foo: true }], errors: 1 } - ] - }); - - assert.strictEqual(processStub.callCount, 1, "calls `process.emitWarning()` once"); - assert.deepStrictEqual( - processStub.getCall(0).args, - [ - "\"rule-with-undefined-schema\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/latest/extend/custom-rules#options-schemas", - "DeprecationWarning" - ] - ); - }); - - it("should log a deprecation warning when schema is `null`", () => { - const ruleWithNullSchema = { - meta: { - type: "problem", - schema: null - }, - create(context) { - return { - Program(node) { - context.report({ node, message: "bad" }); - } - }; - } - }; - - ruleTester.run("rule-with-null-schema", ruleWithNullSchema, { - valid: [], - invalid: [ - { code: "var foo = bar;", options: [{ foo: true }], errors: 1 } - ] - }); - - assert.strictEqual(processStub.callCount, 1, "calls `process.emitWarning()` once"); - assert.deepStrictEqual( - processStub.getCall(0).args, - [ - "\"rule-with-null-schema\" rule has options but is missing the \"meta.schema\" property and will stop working in ESLint v9. Please add a schema: https://eslint.org/docs/latest/extend/custom-rules#options-schemas", - "DeprecationWarning" - ] - ); - }); - - it("should not log a deprecation warning when schema is an empty array", () => { - const ruleWithEmptySchema = { - meta: { - type: "suggestion", - schema: [] - }, - create(context) { - return { - Program(node) { - context.report({ node, message: "bad" }); - } - }; - } - }; - - ruleTester.run("rule-with-no-options", ruleWithEmptySchema, { - valid: [], - invalid: [{ code: "var foo = bar;", errors: 1 }] - }); - - assert.strictEqual(processStub.callCount, 0, "never calls `process.emitWarning()`"); - }); - - it("When the rule is an object-style rule, the legacy rule API warning is not emitted", () => { - ruleTester.run("rule-with-no-schema-2", ruleWithNoSchema, { - valid: [], - invalid: [ - { code: "var foo = bar;", errors: 1 } - ] - }); - - assert.strictEqual(processStub.callCount, 0, "never calls `process.emitWarning()`"); - }); - - it("When the rule has meta.schema and there are test cases with options, the missing schema warning is not emitted", () => { - const ruleWithSchema = { - meta: { - type: "suggestion", - schema: [{ - type: "boolean" - }] - }, - create(context) { - return { - Program(node) { - context.report({ node, message: "bad" }); - } - }; - } - }; - - ruleTester.run("rule-with-schema", ruleWithSchema, { - valid: [], - invalid: [ - { code: "var foo = bar;", options: [true], errors: 1 } - ] - }); - - assert.strictEqual(processStub.callCount, 0, "never calls `process.emitWarning()`"); - }); - - it("When the rule does not have meta, but there are no test cases with options, the missing schema warning is not emitted", () => { - ruleTester.run("rule-with-no-meta-2", ruleWithNoMeta, { - valid: [], - invalid: [ - { code: "var foo = bar;", errors: 1 } - ] - }); - - assert.strictEqual(processStub.callCount, 0, "never calls `process.emitWarning()`"); - }); - - it("When the rule has meta without meta.schema, but there are no test cases with options, the missing schema warning is not emitted", () => { - ruleTester.run("rule-with-no-schema-3", ruleWithNoSchema, { - valid: [], - invalid: [ - { code: "var foo = bar;", errors: 1 } - ] - }); - - assert.strictEqual(processStub.callCount, 0, "never calls `process.emitWarning()`"); - }); - it("When the rule has meta without meta.schema, and some test cases have options property but it's an empty array, the missing schema warning is not emitted", () => { - ruleTester.run("rule-with-no-schema-4", ruleWithNoSchema, { - valid: [], - invalid: [ - { code: "var foo = bar;", options: [], errors: 1 } - ] - }); - - assert.strictEqual(processStub.callCount, 0, "never calls `process.emitWarning()`"); - }); - }); - - /** - * Asserts that a particular value will be emitted from an EventEmitter. - * @param {EventEmitter} emitter The emitter that should emit a value - * @param {string} emitType The type of emission to listen for - * @param {any} expectedValue The value that should be emitted - * @returns {Promise} A Promise that fulfills if the value is emitted, and rejects if something else is emitted. - * The Promise will be indefinitely pending if no value is emitted. - */ - function assertEmitted(emitter, emitType, expectedValue) { - return new Promise((resolve, reject) => { - emitter.once(emitType, emittedValue => { - if (emittedValue === expectedValue) { - resolve(); - } else { - reject(new Error(`Expected ${expectedValue} to be emitted but ${emittedValue} was emitted instead.`)); - } - }); - }); - } - - describe("naming test cases", () => { - - it("should use the first argument as the name of the test suite", () => { - const assertion = assertEmitted(ruleTesterTestEmitter, "describe", "this-is-a-rule-name"); - - ruleTester.run("this-is-a-rule-name", require("./fixtures/no-var"), { - valid: [], - invalid: [] - }); - - return assertion; - }); - - it("should use the test code as the name of the tests for valid code (string form)", () => { - const assertion = assertEmitted(ruleTesterTestEmitter, "it", "valid(code);"); - - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: [ - "valid(code);" - ], - invalid: [] - }); - - return assertion; - }); - - it("should use the test code as the name of the tests for valid code (object form)", () => { - const assertion = assertEmitted(ruleTesterTestEmitter, "it", "valid(code);"); - - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: [ - { - code: "valid(code);" - } - ], - invalid: [] - }); - - return assertion; - }); - - it("should use the test code as the name of the tests for invalid code", () => { - const assertion = assertEmitted(ruleTesterTestEmitter, "it", "var x = invalid(code);"); - - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: [], - invalid: [ - { - code: "var x = invalid(code);", - output: " x = invalid(code);", - errors: 1 - } - ] - }); - - return assertion; - }); - - // https://github.com/eslint/eslint/issues/8142 - it("should use the empty string as the name of the test if the test case is an empty string", () => { - const assertion = assertEmitted(ruleTesterTestEmitter, "it", ""); - - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: [ - { - code: "" - } - ], - invalid: [] - }); - - return assertion; - }); - - it('should use the "name" property if set to a non-empty string', () => { - const assertion = assertEmitted(ruleTesterTestEmitter, "it", "my test"); - - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: [], - invalid: [ - { - name: "my test", - code: "var x = invalid(code);", - output: " x = invalid(code);", - errors: 1 - } - ] - }); - - return assertion; - }); - - it('should use the "name" property if set to a non-empty string for valid cases too', () => { - const assertion = assertEmitted(ruleTesterTestEmitter, "it", "my test"); - - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: [ - { - name: "my test", - code: "valid(code);" - } - ], - invalid: [] - }); - - return assertion; - }); - - - it('should use the test code as the name if the "name" property is set to an empty string', () => { - const assertion = assertEmitted(ruleTesterTestEmitter, "it", "var x = invalid(code);"); - - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: [], - invalid: [ - { - name: "", - code: "var x = invalid(code);", - output: " x = invalid(code);", - errors: 1 - } - ] - }); - - return assertion; - }); - - it('should throw if "name" property is not a string', () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: [{ code: "foo", name: 123 }], - invalid: [{ code: "foo" }] - - }); - }, /Optional test case property 'name' must be a string/u); - - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: ["foo"], - invalid: [{ code: "foo", name: 123 }] - }); - }, /Optional test case property 'name' must be a string/u); - }); - - it('should throw if "code" property is not a string', () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: [{ code: 123 }], - invalid: [{ code: "foo" }] - - }); - }, /Test case must specify a string value for 'code'/u); - - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: [123], - invalid: [{ code: "foo" }] - - }); - }, /Test case must specify a string value for 'code'/u); - - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: ["foo"], - invalid: [{ code: 123 }] - }); - }, /Test case must specify a string value for 'code'/u); - }); - - it('should throw if "code" property is missing', () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: [{ }], - invalid: [{ code: "foo" }] - - }); - }, /Test case must specify a string value for 'code'/u); - - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: ["foo"], - invalid: [{ }] - }); - }, /Test case must specify a string value for 'code'/u); - }); - }); - - // https://github.com/eslint/eslint/issues/11615 - it("should fail the case if autofix made a syntax error.", () => { - assert.throw(() => { - ruleTester.run( - "foo", - { - meta: { - fixable: "code" - }, - create(context) { - return { - Identifier(node) { - context.report({ - node, - message: "make a syntax error", - fix(fixer) { - return fixer.replaceText(node, "one two"); - } - }); - } - }; - } - }, - { - valid: ["one()"], - invalid: [] - } - ); - }, /A fatal parsing error occurred in autofix.\nError: .+\nAutofix output:\n.+/u); - }); - - describe("type checking", () => { - it('should throw if "only" property is not a boolean', () => { - - // "only" has to be falsy as itOnly is not mocked for all test cases - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: [{ code: "foo", only: "" }], - invalid: [] - }); - }, /Optional test case property 'only' must be a boolean/u); - - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: [], - invalid: [{ code: "foo", only: 0, errors: 1 }] - }); - }, /Optional test case property 'only' must be a boolean/u); - }); - - it('should throw if "filename" property is not a string', () => { - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: [{ code: "foo", filename: false }], - invalid: [] - - }); - }, /Optional test case property 'filename' must be a string/u); - - assert.throws(() => { - ruleTester.run("foo", require("./fixtures/no-var"), { - valid: ["foo"], - invalid: [{ code: "foo", errors: 1, filename: 0 }] - }); - }, /Optional test case property 'filename' must be a string/u); - }); - }); - - describe("sanitize test cases", () => { - let originalRuleTesterIt; - let spyRuleTesterIt; - - before(() => { - originalRuleTesterIt = RuleTester.it; - spyRuleTesterIt = sinon.spy(); - RuleTester.it = spyRuleTesterIt; - }); - after(() => { - RuleTester.it = originalRuleTesterIt; - }); - beforeEach(() => { - spyRuleTesterIt.resetHistory(); - ruleTester = new RuleTester(); - }); - it("should present newline when using back-tick as new line", () => { - const code = ` - var foo = bar;`; - - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [], - invalid: [ - { - code, - errors: [/^Bad var/u] - } - ] - }); - sinon.assert.calledWith(spyRuleTesterIt, code); - }); - it("should present \\u0000 as a string", () => { - const code = "\u0000"; - - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [], - invalid: [ - { - code, - errors: [/^Bad var/u] - } - ] - }); - sinon.assert.calledWith(spyRuleTesterIt, "\\u0000"); - }); - it("should present the pipe character correctly", () => { - const code = "var foo = bar || baz;"; - - ruleTester.run("no-var", require("./fixtures/no-var"), { - valid: [], - invalid: [ - { - code, - errors: [/^Bad var/u] - } - ] - }); - sinon.assert.calledWith(spyRuleTesterIt, code); - }); - - }); - - describe("SourceCode#getComments()", () => { - const useGetCommentsRule = { - create: context => ({ - Program(node) { - const sourceCode = context.getSourceCode(); - - sourceCode.getComments(node); - } - }) - }; - - it("should throw if called from a valid test case", () => { - assert.throws(() => { - ruleTester.run("use-get-comments", useGetCommentsRule, { - valid: [""], - invalid: [] - }); - }, /`SourceCode#getComments\(\)` is deprecated/u); - }); - - it("should throw if called from an invalid test case", () => { - assert.throws(() => { - ruleTester.run("use-get-comments", useGetCommentsRule, { - valid: [], - invalid: [{ - code: "", - errors: [{}] - }] - }); - }, /`SourceCode#getComments\(\)` is deprecated/u); - }); - }); - - describe("Subclassing", () => { - - it("should allow subclasses to set the describe/it/itOnly statics and should correctly use those values", () => { - const assertionDescribe = assertEmitted(ruleTesterTestEmitter, "custom describe", "this-is-a-rule-name"); - const assertionIt = assertEmitted(ruleTesterTestEmitter, "custom it", "valid(code);"); - const assertionItOnly = assertEmitted(ruleTesterTestEmitter, "custom itOnly", "validOnly(code);"); - - /** - * Subclass for testing - */ - class RuleTesterSubclass extends RuleTester { } - RuleTesterSubclass.describe = function(text, method) { - ruleTesterTestEmitter.emit("custom describe", text, method); - return method.call(this); - }; - RuleTesterSubclass.it = function(text, method) { - ruleTesterTestEmitter.emit("custom it", text, method); - return method.call(this); - }; - RuleTesterSubclass.itOnly = function(text, method) { - ruleTesterTestEmitter.emit("custom itOnly", text, method); - return method.call(this); - }; - - const ruleTesterSubclass = new RuleTesterSubclass(); - - ruleTesterSubclass.run("this-is-a-rule-name", require("./fixtures/no-var"), { - valid: [ - "valid(code);", - { - code: "validOnly(code);", - only: true - } - ], - invalid: [] - }); - - return Promise.all([ - assertionDescribe, - assertionIt, - assertionItOnly - ]); - }); - - }); - - describe("duplicate test cases", () => { - describe("valid test cases", () => { - it("throws with duplicate string test cases", () => { - assert.throws(() => { - ruleTester.run("foo", { - meta: {}, - create() { - return {}; - } - }, { - valid: ["foo", "foo"], - invalid: [] - }); - }, "detected duplicate test case"); - }); - - it("throws with duplicate object test cases", () => { - assert.throws(() => { - ruleTester.run("foo", { - meta: {}, - create() { - return {}; - } - }, { - valid: [{ code: "foo" }, { code: "foo" }], - invalid: [] - }); - }, "detected duplicate test case"); - }); - - it("throws with string and object test cases", () => { - assert.throws(() => { - ruleTester.run("foo", { - meta: {}, - create() { - return {}; - } - }, { - valid: ["foo", { code: "foo" }], - invalid: [] - }); - }, "detected duplicate test case"); - }); - - it("ignores the name property", () => { - assert.throws(() => { - ruleTester.run("foo", { - meta: {}, - create() { - return {}; - } - }, { - valid: [{ code: "foo" }, { name: "bar", code: "foo" }], - invalid: [] - }); - }, "detected duplicate test case"); - }); - - it("does not ignore top level test case properties nested in other test case properties", () => { - ruleTester.run("foo", { - meta: { schema: [{ type: "object" }] }, - create() { - return {}; - } - }, { - valid: [{ options: [{ name: "foo" }], name: "foo", code: "same" }, { options: [{ name: "bar" }], name: "bar", code: "same" }], - invalid: [] - }); - }); - - it("does not throw an error for defining the same test case in different run calls", () => { - const rule = { - meta: {}, - create() { - return {}; - } - }; - - ruleTester.run("foo", rule, { - valid: ["foo"], - invalid: [] - }); - - ruleTester.run("foo", rule, { - valid: ["foo"], - invalid: [] - }); - }); - }); - - describe("invalid test cases", () => { - it("throws with duplicate object test cases", () => { - assert.throws(() => { - ruleTester.run("foo", { - meta: {}, - create(context) { - return { - VariableDeclaration(node) { - context.report(node, "foo bar"); - } - }; - } - }, { - valid: ["foo"], - invalid: [ - { code: "const x = 123;", errors: [{ message: "foo bar" }] }, - { code: "const x = 123;", errors: [{ message: "foo bar" }] } - ] - }); - }, "detected duplicate test case"); - }); - - it("throws with duplicate object test cases when options is a primitive", () => { - assert.throws(() => { - ruleTester.run("foo", { - meta: { schema: false }, - create(context) { - return { - VariableDeclaration(node) { - context.report(node, "foo bar"); - } - }; - } - }, { - valid: ["foo"], - invalid: [ - { code: "const x = 123;", errors: [{ message: "foo bar" }], options: ["abc"] }, - { code: "const x = 123;", errors: [{ message: "foo bar" }], options: ["abc"] } - ] - }); - }, "detected duplicate test case"); - }); - - it("throws with duplicate object test cases when options is a nested serializable object", () => { - assert.throws(() => { - ruleTester.run("foo", { - meta: { schema: false }, - create(context) { - return { - VariableDeclaration(node) { - context.report(node, "foo bar"); - } - }; - } - }, { - valid: ["foo"], - invalid: [ - { code: "const x = 123;", errors: [{ message: "foo bar" }], options: [{ foo: [{ a: true, b: [1, 2, 3] }] }] }, - { code: "const x = 123;", errors: [{ message: "foo bar" }], options: [{ foo: [{ a: true, b: [1, 2, 3] }] }] } - ] - }); - }, "detected duplicate test case"); - }); - - it("throws with duplicate object test cases even when property order differs", () => { - assert.throws(() => { - ruleTester.run("foo", { - meta: {}, - create(context) { - return { - VariableDeclaration(node) { - context.report(node, "foo bar"); - } - }; - } - }, { - valid: ["foo"], - invalid: [ - { code: "const x = 123;", errors: [{ message: "foo bar" }] }, - { errors: [{ message: "foo bar" }], code: "const x = 123;" } - ] - }); - }, "detected duplicate test case"); - }); - - it("ignores duplicate test case when non-serializable property present (settings)", () => { - ruleTester.run("foo", { - meta: {}, - create(context) { - return { - VariableDeclaration(node) { - context.report(node, "foo bar"); - } - }; - } - }, { - valid: ["foo"], - invalid: [ - { code: "const x = 123;", errors: [{ message: "foo bar" }], settings: { foo: /abc/u } }, - { code: "const x = 123;", errors: [{ message: "foo bar" }], settings: { foo: /abc/u } } - ] - }); - }); - - it("ignores duplicate test case when non-serializable property present (languageOptions.parserOptions)", () => { - ruleTester.run("foo", { - meta: {}, - create(context) { - return { - VariableDeclaration(node) { - context.report(node, "foo bar"); - } - }; - } - }, { - valid: ["foo"], - invalid: [ - { code: "const x = 123;", errors: [{ message: "foo bar" }], languageOptions: { parserOptions: { foo: /abc/u } } }, - { code: "const x = 123;", errors: [{ message: "foo bar" }], languageOptions: { parserOptions: { foo: /abc/u } } } - ] - }); - }); - - it("ignores duplicate test case when non-serializable property present (plugins)", () => { - ruleTester.run("foo", { - meta: {}, - create(context) { - return { - VariableDeclaration(node) { - context.report(node, "foo bar"); - } - }; - } - }, { - valid: ["foo"], - invalid: [ - { code: "const x = 123;", errors: [{ message: "foo bar" }], plugins: { foo: /abc/u } }, - { code: "const x = 123;", errors: [{ message: "foo bar" }], plugins: { foo: /abc/u } } - ] - }); - }); - - it("ignores duplicate test case when non-serializable property present (options)", () => { - ruleTester.run("foo", { - meta: { schema: false }, - create(context) { - return { - VariableDeclaration(node) { - context.report(node, "foo bar"); - } - }; - } - }, { - valid: ["foo"], - invalid: [ - { code: "const x = 123;", errors: [{ message: "foo bar" }], options: [{ foo: /abc/u }] }, - { code: "const x = 123;", errors: [{ message: "foo bar" }], options: [{ foo: /abc/u }] } - ] - }); - }); - - it("detects duplicate test cases even if the error matchers differ", () => { - assert.throws(() => { - ruleTester.run("foo", { - meta: { schema: false }, - create(context) { - return { - VariableDeclaration(node) { - context.report(node, "foo bar"); - } - }; - } - }, { - valid: [], - invalid: [ - { code: "const x = 123;", errors: [{ message: "foo bar" }] }, - { code: "const x = 123;", errors: 1 } - ] - }); - }, "detected duplicate test case"); - }); - - it("detects duplicate test cases even if the presence of the output property differs", () => { - assert.throws(() => { - ruleTester.run("foo", { - meta: { schema: false }, - create(context) { - return { - VariableDeclaration(node) { - context.report(node, "foo bar"); - } - }; - } - }, { - valid: [], - invalid: [ - { code: "const x = 123;", errors: 1 }, - { code: "const x = 123;", errors: 1, output: null } - ] - }); - }, "detected duplicate test case"); - }); - }); - }); - -}); diff --git a/packages/rule-tester/tests/eslint-base/fixtures/empty-program-parser.js b/packages/rule-tester/tests/eslint-base/fixtures/empty-program-parser.js deleted file mode 100644 index 06a87c90dcde..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/empty-program-parser.js +++ /dev/null @@ -1,29 +0,0 @@ -// Forked from https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/parsers/empty-program-parser.js - -"use strict"; - -exports.parse = function (text, parserOptions) { - return { - "type": "Program", - "start": 0, - "end": 0, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 0 - } - }, - "range": [ - 0, - 0 - ], - "body": [], - "sourceType": "script", - "comments": [], - "tokens": [] - }; -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/enhanced-parser.js b/packages/rule-tester/tests/eslint-base/fixtures/enhanced-parser.js deleted file mode 100644 index 9aef71554d3d..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/enhanced-parser.js +++ /dev/null @@ -1,20 +0,0 @@ -// Forked from https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/parsers/enhanced-parser.js - -var espree = require("espree"); - -exports.parseForESLint = function(code, options) { - return { - ast: espree.parse(code, options), - services: { - test: { - getMessage() { - return "Hi!"; - } - } - } - }; -}; - -exports.parse = function() { - throw new Error("Use parseForESLint() instead."); -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/enhanced-parser2.js b/packages/rule-tester/tests/eslint-base/fixtures/enhanced-parser2.js deleted file mode 100644 index bd91282a38c6..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/enhanced-parser2.js +++ /dev/null @@ -1,25 +0,0 @@ -// Forked from https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/parsers/enhanced-parser2.js - -"use strict"; - -const assert = require("assert"); -const vk = require("eslint-visitor-keys"); -const KEYS = vk.unionWith({ - ClassDeclaration: ["experimentalDecorators"], - ClassExpression: ["experimentalDecorators"] -}) - -exports.parseForESLint = (code, options) => { - assert(code === "@foo class A {}"); - assert(options.eslintVisitorKeys === true); - assert(options.eslintScopeManager === true); - - return { - ast: { type: "Program", start: 0, end: 15, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 15 } }, comments: [], tokens: [{ type: "Punctuator", value: "@", start: 0, end: 1, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 1 } }, range: [0, 1] }, { type: "Identifier", value: "foo", start: 1, end: 4, loc: { start: { line: 1, column: 1 }, end: { line: 1, column: 4 } }, range: [1, 4] }, { type: "Keyword", value: "class", start: 5, end: 10, loc: { start: { line: 1, column: 5 }, end: { line: 1, column: 10 } }, range: [5, 10] }, { type: "Identifier", value: "A", start: 11, end: 12, loc: { start: { line: 1, column: 11 }, end: { line: 1, column: 12 } }, range: [11, 12] }, { type: "Punctuator", value: "{", start: 13, end: 14, loc: { start: { line: 1, column: 13 }, end: { line: 1, column: 14 } }, range: [13, 14] }, { type: "Punctuator", value: "}", start: 14, end: 15, loc: { start: { line: 1, column: 14 }, end: { line: 1, column: 15 } }, range: [14, 15] }], range: [5, 15], sourceType: "module", body: [{ type: "ClassDeclaration", start: 5, end: 15, loc: { start: { line: 1, column: 5 }, end: { line: 1, column: 15 } }, experimentalDecorators: [{ type: "Decorator", start: 0, end: 4, loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 4 } }, expression: { type: "Identifier", start: 1, end: 4, loc: { start: { line: 1, column: 1 }, end: { line: 1, column: 4 }, identifierName: "foo" }, name: "foo", range: [1, 4], _babelType: "Identifier" }, range: [0, 4], _babelType: "Decorator" }], id: { type: "Identifier", start: 11, end: 12, loc: { start: { line: 1, column: 11 }, end: { line: 1, column: 12 }, identifierName: "A" }, name: "A", range: [11, 12], _babelType: "Identifier" }, superClass: null, body: { type: "ClassBody", start: 13, end: 15, loc: { start: { line: 1, column: 13 }, end: { line: 1, column: 15 } }, body: [], range: [13, 15], _babelType: "ClassBody" }, range: [5, 15], _babelType: "ClassDeclaration" }] }, - visitorKeys: KEYS - }; -}; - -exports.parse = function () { - throw new Error("Use parseForESLint() instead."); -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/fixes-one-problem.js b/packages/rule-tester/tests/eslint-base/fixtures/fixes-one-problem.js deleted file mode 100644 index adde04196c95..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/fixes-one-problem.js +++ /dev/null @@ -1,25 +0,0 @@ -// Forked from https://github.com/eslint/eslint/tree/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/testers/rule-tester/fixes-one-problem.js - -"use strict"; - -module.exports = { - meta: { - fixable: "code" - }, - create(context) { - return { - Program(node) { - context.report({ - node, - message: "No programs allowed." - }); - - context.report({ - node, - message: "Seriously, no programs allowed.", - fix: fixer => fixer.remove(node) - }); - } - } - } -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/messageId.js b/packages/rule-tester/tests/eslint-base/fixtures/messageId.js deleted file mode 100644 index 3813b878edc6..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/messageId.js +++ /dev/null @@ -1,146 +0,0 @@ -// Forked from https://github.com/eslint/eslint/tree/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/testers/rule-tester/messageId.js - -"use strict"; - -module.exports.withMetaWithData = { - meta: { - messages: { - avoidFoo: "Avoid using variables named '{{ name }}'.", - unused: "An unused key" - } - }, - create(context) { - return { - Identifier(node) { - if (node.name === "foo") { - context.report({ - node, - messageId: "avoidFoo", - data: { - name: "foo" - } - }); - } - } - }; - } -}; - -module.exports.withMessageOnly = { - create(context) { - return { - Identifier(node) { - if (node.name === "foo") { - context.report({ node, message: "Avoid using variables named 'foo'."}); - } - } - }; - } -}; - -module.exports.withMissingData = { - meta: { - messages: { - avoidFoo: "Avoid using variables named '{{ name }}'.", - unused: "An unused key" - } - }, - create(context) { - return { - Identifier(node) { - if (node.name === "foo") { - context.report({ - node, - messageId: "avoidFoo", - }); - } - } - }; - } -}; - -module.exports.withMultipleMissingDataProperties = { - meta: { - messages: { - avoidFoo: "Avoid using {{ type }} named '{{ name }}'.", - unused: "An unused key" - } - }, - create(context) { - return { - Identifier(node) { - if (node.name === "foo") { - context.report({ - node, - messageId: "avoidFoo", - }); - } - } - }; - } -}; - -module.exports.withPlaceholdersInData = { - meta: { - messages: { - avoidFoo: "Avoid using variables named '{{ name }}'.", - unused: "An unused key" - } - }, - create(context) { - return { - Identifier(node) { - if (node.name === "foo") { - context.report({ - node, - messageId: "avoidFoo", - data: { name: '{{ placeholder }}' }, - }); - } - } - }; - } -}; - -module.exports.withSamePlaceholdersInData = { - meta: { - messages: { - avoidFoo: "Avoid using variables named '{{ name }}'.", - unused: "An unused key" - } - }, - create(context) { - return { - Identifier(node) { - if (node.name === "foo") { - context.report({ - node, - messageId: "avoidFoo", - data: { name: '{{ name }}' }, - }); - } - } - }; - } -}; - -module.exports.withNonStringData = { - meta: { - messages: { - avoid: "Avoid using the value '{{ value }}'.", - } - }, - create(context) { - return { - Literal(node) { - if (node.value === 0) { - context.report({ - node, - messageId: "avoid", - data: { value: 0 }, - }); - } - } - }; - } -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/modify-ast-at-first.js b/packages/rule-tester/tests/eslint-base/fixtures/modify-ast-at-first.js deleted file mode 100644 index 53ddcd28847e..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/modify-ast-at-first.js +++ /dev/null @@ -1,37 +0,0 @@ -// Forked from https://github.com/eslint/eslint/tree/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/testers/rule-tester/modify-ast-at-first.js - -"use strict"; - -module.exports = { - meta: { - type: "problem", - schema: [] - }, - create(context) { - return { - "Program": function(node) { - node.body.push({ - "type": "Identifier", - "name": "modified", - "range": [0, 8], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }); - }, - - "Identifier": function(node) { - if (node.name === "bar") { - context.report({message: "error", node: node}); - } - } - }; - }, -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/modify-ast-at-last.js b/packages/rule-tester/tests/eslint-base/fixtures/modify-ast-at-last.js deleted file mode 100644 index 9fda56d02609..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/modify-ast-at-last.js +++ /dev/null @@ -1,37 +0,0 @@ -// Forked from https://github.com/eslint/eslint/tree/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/testers/rule-tester/modify-ast-at-last.js - -"use strict"; - -module.exports = { - meta: { - type: "problem", - schema: [] - }, - create(context) { - return { - "Program:exit": function(node) { - node.body.push({ - "type": "Identifier", - "name": "modified", - "range": [0, 8], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - } - } - }); - }, - - "Identifier": function(node) { - if (node.name === "bar") { - context.report({message: "error", node: node}); - } - } - }; - }, -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/modify-ast.js b/packages/rule-tester/tests/eslint-base/fixtures/modify-ast.js deleted file mode 100644 index 3b8a879920aa..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/modify-ast.js +++ /dev/null @@ -1,21 +0,0 @@ -// Forked from https://github.com/eslint/eslint/tree/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/testers/rule-tester/modify-ast.js - -"use strict"; - -module.exports = { - meta: { - type: "problem", - schema: [] - }, - create(context) { - return { - "Identifier": function(node) { - node.name += "!"; - - if (node.name === "bar!") { - context.report({message: "error", node: node}); - } - } - }; - }, -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/no-eval.js b/packages/rule-tester/tests/eslint-base/fixtures/no-eval.js deleted file mode 100644 index a7cba23f6128..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/no-eval.js +++ /dev/null @@ -1,19 +0,0 @@ -// Forked from https://github.com/eslint/eslint/tree/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/testers/rule-tester/no-eval.js - -"use strict"; - -module.exports = { - meta: { - type: "problem", - schema: [], - }, - create(context) { - return { - CallExpression: function (node) { - if (node.callee.name === "eval") { - context.report(node, "eval sucks."); - } - }, - }; - }, -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/no-invalid-args.js b/packages/rule-tester/tests/eslint-base/fixtures/no-invalid-args.js deleted file mode 100644 index 7f9a1683aa07..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/no-invalid-args.js +++ /dev/null @@ -1,23 +0,0 @@ -// Forked from https://github.com/eslint/eslint/tree/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/testers/rule-tester/no-invalid-args.js - -"use strict"; - -module.exports = { - meta: { - type: "problem", - schema: [{ - type: "boolean" - }] - }, - create(context) { - var config = context.options[0]; - - return { - "Program": function(node) { - if (config === true) { - context.report(node, "Invalid args"); - } - } - }; - } -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/no-invalid-schema.js b/packages/rule-tester/tests/eslint-base/fixtures/no-invalid-schema.js deleted file mode 100644 index fd691f11a961..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/no-invalid-schema.js +++ /dev/null @@ -1,21 +0,0 @@ -// Forked from https://github.com/eslint/eslint/tree/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/testers/rule-tester/no-invalid-schema.js - -"use strict"; - -module.exports = { - meta: { - type: "problem", - schema: [{ - "enum": [] - }] - }, - create(context) { - return { - "Program": function(node) { - if (config) { - context.report(node, "Expected nothing."); - } - } - }; - }, -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/no-schema-violation.js b/packages/rule-tester/tests/eslint-base/fixtures/no-schema-violation.js deleted file mode 100644 index 1e12913c2287..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/no-schema-violation.js +++ /dev/null @@ -1,22 +0,0 @@ -// Forked from https://github.com/eslint/eslint/tree/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/testers/rule-tester/no-schema-violation.js - -"use strict"; - -module.exports = { - meta: { - type: "problem", - schema: [{ - "enum": ["foo"] - }] - }, - create(context) { - const config = context.options[0]; - return { - "Program": function(node) { - if (config && config !== "foo") { - context.report(node, "Expected foo."); - } - } - }; - }, -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/no-test-filename b/packages/rule-tester/tests/eslint-base/fixtures/no-test-filename deleted file mode 100644 index 795bd0ac7af3..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/no-test-filename +++ /dev/null @@ -1,19 +0,0 @@ -// Forked from https://github.com/eslint/eslint/tree/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/testers/rule-tester/no-test-filename - -"use strict"; - -module.exports = { - meta: { - type: "problem", - schema: [] - }, - create(context) { - return { - "Program": function(node) { - if (context.getFilename() === '') { - context.report(node, "Filename test was not defined."); - } - } - }; - } -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/no-test-global.js b/packages/rule-tester/tests/eslint-base/fixtures/no-test-global.js deleted file mode 100644 index 94834189376a..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/no-test-global.js +++ /dev/null @@ -1,26 +0,0 @@ -// Forked from https://github.com/eslint/eslint/tree/1665c029acb92bf8812267f1647ad1a7054cbcb4/tests/fixtures/testers/rule-tester/no-test-global.js - -"use strict"; - -module.exports = { - meta: { - type: "problem", - schema: [], - }, - create(context) { - return { - "Program": function(node) { - var globals = context.getScope().variables.map(function (variable) { - return variable.name; - }); - - if (globals.indexOf("test") === -1) { - context.report(node, "Global variable test was not defined."); - } - if (globals.indexOf("foo") !== -1) { - context.report(node, "Global variable foo should not be used."); - } - } - }; - }, -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/no-test-settings.js b/packages/rule-tester/tests/eslint-base/fixtures/no-test-settings.js deleted file mode 100644 index 291b81b105f5..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/no-test-settings.js +++ /dev/null @@ -1,22 +0,0 @@ -// Forked from https://github.com/eslint/eslint/tree/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/testers/rule-tester/no-test-settings.js - -"use strict"; - -module.exports = { - meta: { - type: "problem", - schema: [], - }, - create(context) { - return { - Program: function (node) { - if (!context.settings || !context.settings.test) { - context.report( - node, - "Global settings test was not defined." - ); - } - }, - }; - }, -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/no-var.js b/packages/rule-tester/tests/eslint-base/fixtures/no-var.js deleted file mode 100644 index 58530de4e1d0..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/no-var.js +++ /dev/null @@ -1,26 +0,0 @@ -// Forked from https://github.com/eslint/eslint/tree/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/testers/rule-tester/no-var.js - -"use strict"; - -module.exports = { - meta: { - fixable: "code", - schema: [] - }, - create(context) { - return { - "VariableDeclaration": function(node) { - if (node.kind === "var") { - context.report({ - node: node, - loc: sourceCode.getFirstToken(node).loc, - message: "Bad var.", - fix: function(fixer) { - return fixer.remove(context.sourceCode.getFirstToken(node)); - } - }) - } - } - }; - } -}; diff --git a/packages/rule-tester/tests/eslint-base/fixtures/suggestions.js b/packages/rule-tester/tests/eslint-base/fixtures/suggestions.js deleted file mode 100644 index 6310d0a2104a..000000000000 --- a/packages/rule-tester/tests/eslint-base/fixtures/suggestions.js +++ /dev/null @@ -1,260 +0,0 @@ -// Forked from https://github.com/eslint/eslint/tree/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/tests/fixtures/testers/rule-tester/suggestions.js - -"use strict"; - -module.exports.basic = { - meta: { hasSuggestions: true }, - create(context) { - return { - Identifier(node) { - if (node.name === "foo") { - context.report({ - node, - message: "Avoid using identifiers named 'foo'.", - suggest: [{ - desc: "Rename identifier 'foo' to 'bar'", - fix: fixer => fixer.replaceText(node, 'bar') - }] - }); - } - } - }; - } -}; - -module.exports.withMessageIds = { - meta: { - messages: { - avoidFoo: "Avoid using identifiers named '{{ name }}'.", - unused: "An unused key", - renameFoo: "Rename identifier 'foo' to '{{ newName }}'" - }, - hasSuggestions: true - }, - create(context) { - return { - Identifier(node) { - if (node.name === "foo") { - context.report({ - node, - messageId: "avoidFoo", - data: { - name: "foo" - }, - suggest: [{ - messageId: "renameFoo", - data: { - newName: "bar" - }, - fix: fixer => fixer.replaceText(node, "bar") - }, { - messageId: "renameFoo", - data: { - newName: "baz" - }, - fix: fixer => fixer.replaceText(node, "baz") - }] - }); - } - } - }; - } -}; - -module.exports.withDuplicateDescriptions = { - meta: { - hasSuggestions: true - }, - create(context) { - return { - Identifier(node) { - if (node.name === "foo") { - context.report({ - node, - message: "Avoid using identifiers name 'foo'.", - suggest: [{ - desc: "Rename 'foo' to 'bar'", - fix: fixer => fixer.replaceText(node, "bar") - }, { - desc: "Rename 'foo' to 'bar'", - fix: fixer => fixer.replaceText(node, "baz") - }] - }); - } - } - }; - } -}; - -module.exports.withDuplicateMessageIdsNoData = { - meta: { - messages: { - avoidFoo: "Avoid using identifiers named '{{ name }}'.", - renameFoo: "Rename identifier" - }, - hasSuggestions: true - }, - create(context) { - return { - Identifier(node) { - if (node.name === "foo") { - context.report({ - node, - messageId: "avoidFoo", - data: { - name: "foo" - }, - suggest: [{ - messageId: "renameFoo", - fix: fixer => fixer.replaceText(node, "bar") - }, { - messageId: "renameFoo", - fix: fixer => fixer.replaceText(node, "baz") - }] - }); - } - } - }; - } -}; - -module.exports.withDuplicateMessageIdsWithData = { - meta: { - messages: { - avoidFoo: "Avoid using identifiers named foo.", - renameFoo: "Rename identifier 'foo' to '{{ newName }}'" - }, - hasSuggestions: true - }, - create(context) { - return { - Identifier(node) { - if (node.name === "foo") { - context.report({ - node, - messageId: "avoidFoo", - suggest: [{ - messageId: "renameFoo", - data: { - newName: "bar" - }, - fix: fixer => fixer.replaceText(node, "bar") - }, { - messageId: "renameFoo", - data: { - newName: "bar" - }, - fix: fixer => fixer.replaceText(node, "baz") - }] - }); - } - } - }; - } -}; - -module.exports.withoutHasSuggestionsProperty = { - create(context) { - return { - Identifier(node) { - context.report({ - node, - message: "some message", - suggest: [{ desc: "some suggestion", fix: fixer => fixer.replaceText(node, 'bar') }] - }); - } - }; - } -}; - -module.exports.withFixerWithoutChanges = { - meta: { hasSuggestions: true }, - create(context) { - return { - Identifier(node) { - if (node.name === "foo") { - context.report({ - node, - message: "Avoid using identifiers named 'foo'.", - suggest: [{ - desc: "Rename identifier 'foo' to 'bar'", - fix: fixer => fixer.replaceText(node, 'foo') - }] - }); - } - } - }; - } -}; - -module.exports.withFailingFixer = { - create(context) { - return { - Identifier(node) { - context.report({ - node, - message: "some message", - suggest: [{ desc: "some suggestion", fix: fixer => null }] - }); - } - }; - } -}; - -module.exports.withMissingPlaceholderData = { - meta: { - messages: { - avoidFoo: "Avoid using identifiers named '{{ name }}'.", - renameFoo: "Rename identifier 'foo' to '{{ newName }}'" - }, - hasSuggestions: true - }, - create(context) { - return { - Identifier(node) { - if (node.name === "foo") { - context.report({ - node, - messageId: "avoidFoo", - data: { - name: "foo" - }, - suggest: [{ - messageId: "renameFoo", - fix: fixer => fixer.replaceText(node, "bar") - }] - }); - } - } - }; - } -}; - -module.exports.withMultipleMissingPlaceholderDataProperties = { - meta: { - messages: { - avoidFoo: "Avoid using identifiers named '{{ name }}'.", - rename: "Rename identifier '{{ currentName }}' to '{{ newName }}'" - }, - hasSuggestions: true - }, - create(context) { - return { - Identifier(node) { - if (node.name === "foo") { - context.report({ - node, - messageId: "avoidFoo", - data: { - name: "foo" - }, - suggest: [{ - messageId: "rename", - fix: fixer => fixer.replaceText(node, "bar") - }] - }); - } - } - }; - } -}; diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index bba61ba408a7..1587be1bcc59 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -37,14 +37,15 @@ "estree" ], "scripts": { - "build": "tsc -b tsconfig.build.json", + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"", "format": "yarn run -T format", "generate-lib": "yarn run -BT nx generate-lib repo", "lint": "yarn run -BT nx lint", - "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "yarn run -BT nx typecheck" + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { "@typescript-eslint/types": "8.32.1", @@ -62,5 +63,12 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "scope-manager", + "includedScripts": [ + "clean", + "clean-fixtures" + ] } } diff --git a/packages/scope-manager/project.json b/packages/scope-manager/project.json deleted file mode 100644 index ae939212a2d0..000000000000 --- a/packages/scope-manager/project.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "scope-manager", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "root": "packages/scope-manager", - "sourceRoot": "packages/scope-manager/src", - "projectType": "library", - "targets": { - "lint": { - "executor": "@nx/eslint:lint" - }, - "test": { - "executor": "@nx/vite:test" - } - } -} diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 0505936ce0b8..89bf9a6af9dc 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -36,12 +36,13 @@ "estree" ], "scripts": { - "build": "tsc -b tsconfig.build.json", + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", "lint": "yarn run -BT nx lint", - "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "yarn run -BT nx typecheck" + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { "@typescript-eslint/typescript-estree": "8.32.1", @@ -65,5 +66,11 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "type-utils", + "includedScripts": [ + "clean" + ] } } diff --git a/packages/type-utils/project.json b/packages/type-utils/project.json deleted file mode 100644 index a1fe512b9900..000000000000 --- a/packages/type-utils/project.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "type-utils", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "root": "packages/type-utils", - "sourceRoot": "packages/type-utils/src", - "targets": { - "lint": { - "executor": "@nx/eslint:lint" - }, - "test": { - "executor": "@nx/vite:test" - } - } -} diff --git a/packages/types/package.json b/packages/types/package.json index aa3254dc94e5..1a121bc52240 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -37,14 +37,15 @@ "estree" ], "scripts": { - "copy-ast-spec": "tsx ./tools/copy-ast-spec.mts", - "build": "tsc -b tsconfig.build.json", + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", "clean": "rimraf dist/ src/generated/ coverage/", + "copy-ast-spec": "tsx ./tools/copy-ast-spec.mts", "format": "yarn run -T format", "generate-lib": "yarn run -BT nx run scope-manager:generate-lib", "lint": "yarn run -BT nx lint", - "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "yarn run -BT nx typecheck" + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", @@ -56,5 +57,31 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "types", + "includedScripts": [ + "clean" + ], + "targets": { + "build": { + "dependsOn": [ + "copy-ast-spec" + ] + }, + "copy-ast-spec": { + "command": "tsx ./tools/copy-ast-spec.mts", + "options": { + "cwd": "{projectRoot}" + }, + "dependsOn": [ + "ast-spec:build" + ], + "outputs": [ + "{projectRoot}/src/generated" + ], + "cache": true + } + } } } diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 98370ddace83..b8c33d720f62 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -42,12 +42,13 @@ "eslint-plugin" ], "scripts": { - "build": "tsc -b tsconfig.build.json", + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", "lint": "yarn run -BT nx lint", - "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "yarn run -BT nx typecheck" + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { "@typescript-eslint/eslint-plugin": "8.32.1", @@ -67,5 +68,11 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "typescript-eslint", + "includedScripts": [ + "clean" + ] } } diff --git a/packages/typescript-eslint/project.json b/packages/typescript-eslint/project.json deleted file mode 100644 index a2f82e64ac22..000000000000 --- a/packages/typescript-eslint/project.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "typescript-eslint", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "root": "packages/typescript-eslint", - "sourceRoot": "packages/typescript-eslint/src", - "targets": { - "lint": { - "executor": "@nx/eslint:lint" - }, - "test": { - "executor": "@nx/vite:test" - } - } -} diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 5ebc1ff50d89..cfd6091e8d62 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -44,12 +44,13 @@ "syntax" ], "scripts": { - "build": "tsc -b tsconfig.build.json", + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", "lint": "yarn run -BT nx lint", - "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "yarn run -BT nx typecheck" + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { "@typescript-eslint/types": "8.32.1", @@ -75,5 +76,11 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "typescript-estree", + "includedScripts": [ + "clean" + ] } } diff --git a/packages/typescript-estree/project.json b/packages/typescript-estree/project.json deleted file mode 100644 index 4c49900749bf..000000000000 --- a/packages/typescript-estree/project.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "typescript-estree", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "root": "packages/typescript-estree", - "sourceRoot": "packages/typescript-estree/src", - "targets": { - "lint": { - "executor": "@nx/eslint:lint" - }, - "test": { - "executor": "@nx/vite:test" - } - } -} diff --git a/packages/utils/package.json b/packages/utils/package.json index 99d3729f7cd1..e9c39408029e 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -53,12 +53,13 @@ "estree" ], "scripts": { - "build": "tsc -b tsconfig.build.json", + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", "lint": "yarn run -BT nx lint", - "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "yarn run -BT nx typecheck" + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", @@ -79,5 +80,18 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "utils", + "includedScripts": [ + "clean" + ], + "targets": { + "test": { + "dependsOn": [ + "^build" + ] + } + } } } diff --git a/packages/utils/project.json b/packages/utils/project.json deleted file mode 100644 index 7fe1a2d09486..000000000000 --- a/packages/utils/project.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "utils", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "root": "packages/utils", - "sourceRoot": "packages/utils/src", - "targets": { - "lint": { - "executor": "@nx/eslint:lint" - }, - "test": { - "executor": "@nx/vite:test", - "dependsOn": ["^build", "typecheck"] - } - } -} diff --git a/packages/utils/vitest.config.mts b/packages/utils/vitest.config.mts index b29fd6f44121..ddc038f86b56 100644 --- a/packages/utils/vitest.config.mts +++ b/packages/utils/vitest.config.mts @@ -14,11 +14,6 @@ const vitestConfig = mergeConfig( dir: path.join(import.meta.dirname, 'tests'), name: packageJson.name.replace('@typescript-eslint/', ''), root: import.meta.dirname, - - typecheck: { - enabled: true, - tsconfig: path.join(import.meta.dirname, 'tsconfig.spec.json'), - }, }, }), ); diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 8c2574a19926..21ff63442c23 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -37,12 +37,13 @@ "estree" ], "scripts": { - "build": "tsc -b tsconfig.build.json", + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", "lint": "yarn run -BT nx lint", - "test": "vitest --run --config=$INIT_CWD/vitest.config.mts", - "check-types": "yarn run -BT nx typecheck" + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { "@typescript-eslint/types": "8.32.1", @@ -57,5 +58,11 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "visitor-keys", + "includedScripts": [ + "clean" + ] } } diff --git a/packages/visitor-keys/project.json b/packages/visitor-keys/project.json deleted file mode 100644 index 62e1f7fee8d3..000000000000 --- a/packages/visitor-keys/project.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "visitor-keys", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "root": "packages/visitor-keys", - "sourceRoot": "packages/visitor-keys/src", - "targets": { - "lint": { - "executor": "@nx/eslint:lint" - }, - "test": { - "executor": "@nx/vite:test" - } - } -} diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index fa7d8b903898..2f9ac9855ab4 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -27,11 +27,12 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "scripts": { + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "tsx ./build.mts", "clean": "rimraf dist/", "format": "yarn run -T format", "lint": "yarn run -BT nx lint", - "check-types": "yarn run -BT nx typecheck" + "typecheck": "yarn run -BT nx typecheck" }, "devDependencies": { "@eslint/js": "*", @@ -45,5 +46,12 @@ "esquery": "*", "rimraf": "*", "tsx": "*" + }, + "nx": { + "name": "website-eslint", + "includedScripts": [ + "clean", + "build" + ] } } diff --git a/packages/website-eslint/project.json b/packages/website-eslint/project.json deleted file mode 100644 index 838eec579bf4..000000000000 --- a/packages/website-eslint/project.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "website-eslint", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "root": "packages/website-eslint", - "sourceRoot": "packages/website-eslint/src", - "targets": { - "lint": { - "executor": "@nx/eslint:lint" - } - } -} diff --git a/packages/website/package.json b/packages/website/package.json index 84e9bbf241c7..eb0fd1bafcce 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -12,6 +12,7 @@ "homepage": "https://typescript-eslint.io", "license": "MIT", "scripts": { + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "docusaurus build", "clear": "docusaurus clear", "clean": "rimraf dist/ build/ .docusaurus/ && yarn run clear", @@ -23,7 +24,7 @@ "serve": "docusaurus serve", "start": "yarn run -BT nx start", "swizzle": "docusaurus swizzle", - "check-types": "yarn run -BT nx typecheck" + "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { "@babel/runtime": "^7.24.4", @@ -93,5 +94,28 @@ "last 1 firefox version", "last 1 safari version" ] + }, + "nx": { + "name": "website", + "includedScripts": [ + "clean", + "build" + ], + "targets": { + "build": { + "dependsOn": [ + "^build" + ] + }, + "start": { + "command": "docusaurus start", + "options": { + "cwd": "{projectRoot}" + }, + "dependsOn": [ + "^build" + ] + } + } } } diff --git a/packages/website/project.json b/packages/website/project.json deleted file mode 100644 index 8ba9d038bdf5..000000000000 --- a/packages/website/project.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "website", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "root": "packages/website", - "sourceRoot": "packages/website/src", - "targets": { - "start": { - "dependsOn": ["website-eslint:build"], - "executor": "nx:run-commands", - "options": { - "cwd": "{projectRoot}", - "command": "docusaurus start" - } - }, - "lint": { - "executor": "@nx/eslint:lint" - } - } -} diff --git a/project.json b/project.json deleted file mode 100644 index a92e8d6ab900..000000000000 --- a/project.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$schema": "./node_modules/nx/schemas/project-schema.json", - "name": "repo", - "projectType": "library", - "root": ".", - "sourceRoot": ".", - "// These targets are used for repo level utils and checking repo files which do not belong to specific published packages": {}, - "targets": { - "clean": { - "command": "rimraf dist/ coverage/ .eslintcache" - }, - "typecheck": { - "command": "tsc -b tsconfig.repo-config-files.json", - "dependsOn": ["types:copy-ast-spec"], - "outputs": ["{workspaceRoot}/dist"] - }, - "lint": { - "executor": "@nx/eslint:lint", - "options": { - "lintFilePatterns": ["{workspaceRoot}/!packages"] - } - }, - "generate-configs": { - "command": "tsx tools/scripts/generate-configs.mts", - "dependsOn": ["eslint-plugin:build"] - }, - "generate-contributors": { - "command": "tsx tools/scripts/generate-contributors.mts" - }, - "generate-lib": { - "command": "tsx tools/scripts/generate-lib.mts", - "dependsOn": ["typescript-eslint:build", "eslint-plugin-internal:build"] - }, - "generate-sponsors": { - "command": "tsx tools/scripts/generate-sponsors.mts" - } - } -} diff --git a/vitest.config.base.mts b/vitest.config.base.mts index caa16009e093..75ac38dbf958 100644 --- a/vitest.config.base.mts +++ b/vitest.config.base.mts @@ -25,10 +25,6 @@ export const vitestBaseConfig = { testTimeout: 10_000, - typecheck: { - include: ['**/*.test-d.?(c|m)ts?(x)'], - }, - watch: false, }, } as const satisfies ViteUserConfig; diff --git a/yarn.lock b/yarn.lock index 49103bcf9de2..0f5ac77592d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3872,9 +3872,9 @@ __metadata: languageName: node linkType: hard -"@nx/devkit@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/devkit@npm:20.7.2" +"@nx/devkit@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/devkit@npm:21.0.3" dependencies: ejs: ^3.1.7 enquirer: ~2.3.6 @@ -3885,17 +3885,17 @@ __metadata: tslib: ^2.3.0 yargs-parser: 21.1.1 peerDependencies: - nx: ">= 19 <= 21" - checksum: 178299551b1859deccb2ba3c561e064681f6b929eb4d50f2281e6790dc7abe6e9fb17917980fd66a2c769b3575fb0a3c906a414b7e5b86755f3265f7c574be22 + nx: 21.0.3 + checksum: a742dce7d5103b585d0cb13fc2cf11fb41ad5b031b5bb2ff6c7a6f0c837a287123866a0809d411974e4f03a41b057b14b46c8b226231755563267f6a46d3c611 languageName: node linkType: hard -"@nx/eslint@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/eslint@npm:20.7.2" +"@nx/eslint@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/eslint@npm:21.0.3" dependencies: - "@nx/devkit": 20.7.2 - "@nx/js": 20.7.2 + "@nx/devkit": 21.0.3 + "@nx/js": 21.0.3 semver: ^7.5.3 tslib: ^2.3.0 typescript: ~5.7.2 @@ -3905,13 +3905,13 @@ __metadata: peerDependenciesMeta: "@zkochan/js-yaml": optional: true - checksum: 5a926f39bd51fa356d9a3bdc37f99057103de54f0a727afa1f891589fa7f1f0df4272e644fb174877f7fe43a559368a5e1cbf200630d2a89587a5869ba88accd + checksum: 1520df77239618e9a3d4475b426d2c851a1ac649672ee1ecadad6c6654eeacaa69c8876f47fac8308e2b019153cc28556f4fc01a03489f63a7441290607e70a1 languageName: node linkType: hard -"@nx/js@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/js@npm:20.7.2" +"@nx/js@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/js@npm:21.0.3" dependencies: "@babel/core": ^7.23.2 "@babel/plugin-proposal-decorators": ^7.22.7 @@ -3920,8 +3920,8 @@ __metadata: "@babel/preset-env": ^7.23.2 "@babel/preset-typescript": ^7.22.5 "@babel/runtime": ^7.22.6 - "@nx/devkit": 20.7.2 - "@nx/workspace": 20.7.2 + "@nx/devkit": 21.0.3 + "@nx/workspace": 21.0.3 "@zkochan/js-yaml": 0.0.7 babel-plugin-const-enum: ^1.0.1 babel-plugin-macros: ^3.1.0 @@ -3947,112 +3947,112 @@ __metadata: peerDependenciesMeta: verdaccio: optional: true - checksum: 05253f77916d8f524c3cef7295f1e44e1aa99514ebbffea06bff832b9055fccc9aa35a1b2ee477803513c829985c8891bbf305d14993c1a1579d74fc4a5be798 + checksum: 97af3d23ef58484011ba7e0667656c4ab15e38935176d29310c926ba42d3b78aa50724ae293c15e2f565a9752bcbee3b4007197e778d43a33329d8bd38773bb7 languageName: node linkType: hard -"@nx/nx-darwin-arm64@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/nx-darwin-arm64@npm:20.7.2" +"@nx/nx-darwin-arm64@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/nx-darwin-arm64@npm:21.0.3" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@nx/nx-darwin-x64@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/nx-darwin-x64@npm:20.7.2" +"@nx/nx-darwin-x64@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/nx-darwin-x64@npm:21.0.3" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@nx/nx-freebsd-x64@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/nx-freebsd-x64@npm:20.7.2" +"@nx/nx-freebsd-x64@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/nx-freebsd-x64@npm:21.0.3" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@nx/nx-linux-arm-gnueabihf@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/nx-linux-arm-gnueabihf@npm:20.7.2" +"@nx/nx-linux-arm-gnueabihf@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/nx-linux-arm-gnueabihf@npm:21.0.3" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@nx/nx-linux-arm64-gnu@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/nx-linux-arm64-gnu@npm:20.7.2" +"@nx/nx-linux-arm64-gnu@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/nx-linux-arm64-gnu@npm:21.0.3" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@nx/nx-linux-arm64-musl@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/nx-linux-arm64-musl@npm:20.7.2" +"@nx/nx-linux-arm64-musl@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/nx-linux-arm64-musl@npm:21.0.3" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@nx/nx-linux-x64-gnu@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/nx-linux-x64-gnu@npm:20.7.2" +"@nx/nx-linux-x64-gnu@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/nx-linux-x64-gnu@npm:21.0.3" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@nx/nx-linux-x64-musl@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/nx-linux-x64-musl@npm:20.7.2" +"@nx/nx-linux-x64-musl@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/nx-linux-x64-musl@npm:21.0.3" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@nx/nx-win32-arm64-msvc@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/nx-win32-arm64-msvc@npm:20.7.2" +"@nx/nx-win32-arm64-msvc@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/nx-win32-arm64-msvc@npm:21.0.3" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@nx/nx-win32-x64-msvc@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/nx-win32-x64-msvc@npm:20.7.2" +"@nx/nx-win32-x64-msvc@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/nx-win32-x64-msvc@npm:21.0.3" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@nx/vite@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/vite@npm:20.7.2" +"@nx/vite@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/vite@npm:21.0.3" dependencies: - "@nx/devkit": 20.7.2 - "@nx/js": 20.7.2 + "@nx/devkit": 21.0.3 + "@nx/js": 21.0.3 "@phenomnomnominal/tsquery": ~5.0.1 "@swc/helpers": ~0.5.0 enquirer: ~2.3.6 - minimatch: 9.0.3 + picomatch: 4.0.2 semver: ^7.6.3 tsconfig-paths: ^4.1.2 peerDependencies: vite: ^5.0.0 || ^6.0.0 vitest: ^1.3.1 || ^2.0.0 || ^3.0.0 - checksum: 978cc4e8039177ad78bbf305df733c437ea5c74530f6b1efa173e8dce2ca2d781c5ab824ad11ed78a1d6da7959f02a0b8ce0ff42c405a451867247acae595548 + checksum: 4195276b94cfd310650d5fd68172e00a025b2df75424f1e930923a8703178bc8c1887d3d3854cd4cad2b5b15d70ed4331b9f2aadfba1d172f2d33bc49f098e36 languageName: node linkType: hard -"@nx/workspace@npm:20.7.2": - version: 20.7.2 - resolution: "@nx/workspace@npm:20.7.2" +"@nx/workspace@npm:21.0.3": + version: 21.0.3 + resolution: "@nx/workspace@npm:21.0.3" dependencies: - "@nx/devkit": 20.7.2 + "@nx/devkit": 21.0.3 "@zkochan/js-yaml": 0.0.7 chalk: ^4.1.0 enquirer: ~2.3.6 - nx: 20.7.2 + nx: 21.0.3 picomatch: 4.0.2 tslib: ^2.3.0 yargs-parser: 21.1.1 - checksum: aeecc9dbbb864d64b3745a8ddb88ef5677b473b21cc8c308e3fbc7e2f064636fba75005df204b6306a4cbf22a733b82304e77655269a76ff8a445a962c369dc2 + checksum: 20c4051faa3a61c28acd8578b04afb4e991da23b382ff8e70aa907d88ea2f553e4b39759a21da893fdf36814ce809a1dce97fc95683576cfb37bf7278f38efc9 languageName: node linkType: hard @@ -4584,35 +4584,6 @@ __metadata: languageName: node linkType: hard -"@sinonjs/commons@npm:^3.0.1": - version: 3.0.1 - resolution: "@sinonjs/commons@npm:3.0.1" - dependencies: - type-detect: 4.0.8 - checksum: a7c3e7cc612352f4004873747d9d8b2d4d90b13a6d483f685598c945a70e734e255f1ca5dc49702515533c403b32725defff148177453b3f3915bcb60e9d4601 - languageName: node - linkType: hard - -"@sinonjs/fake-timers@npm:^13.0.5": - version: 13.0.5 - resolution: "@sinonjs/fake-timers@npm:13.0.5" - dependencies: - "@sinonjs/commons": ^3.0.1 - checksum: b1c6ba87fadb7666d3aa126c9e8b4ac32b2d9e84c9e5fd074aa24cab3c8342fd655459de014b08e603be1e6c24c9f9716d76d6d2a36c50f59bb0091be61601dd - languageName: node - linkType: hard - -"@sinonjs/samsam@npm:^8.0.1": - version: 8.0.2 - resolution: "@sinonjs/samsam@npm:8.0.2" - dependencies: - "@sinonjs/commons": ^3.0.1 - lodash.get: ^4.4.2 - type-detect: ^4.1.0 - checksum: 7dc24a388ea108e513c88edaaacf98cf4ebcbda8c715551b02954ce50db0e26d6071d98ba9594e737da7fe750079a2af94633d7d46ff1481cb940383b441f29b - languageName: node - linkType: hard - "@slorber/remark-comment@npm:^1.0.0": version: 1.0.0 resolution: "@slorber/remark-comment@npm:1.0.0" @@ -5612,6 +5583,7 @@ __metadata: "@vitest/coverage-v8": ^3.1.3 natural-compare: ^1.4.0 prettier: ^3.2.5 + rimraf: "*" typescript: "*" vitest: ^3.1.3 languageName: unknown @@ -5628,18 +5600,11 @@ __metadata: "@typescript-eslint/utils": 8.32.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 - chai: ^5.2.0 eslint: "*" - eslint-visitor-keys: ^4.2.0 - espree: ^10.3.0 - esprima: ^4.0.1 json-stable-stringify-without-jsonify: ^1.0.1 lodash.merge: 4.6.2 - mocha: ^11.0.0 rimraf: "*" semver: ^7.6.0 - sinon: ^20.0.0 - source-map-support: ^0.5.21 typescript: "*" vitest: ^3.1.3 peerDependencies: @@ -5706,11 +5671,11 @@ __metadata: "@eslint/compat": ^1.2.4 "@eslint/eslintrc": ^3.2.0 "@eslint/js": ^9.26.0 - "@nx/devkit": 20.7.2 - "@nx/eslint": 20.7.2 - "@nx/js": 20.7.2 - "@nx/vite": 20.7.2 - "@nx/workspace": 20.7.2 + "@nx/devkit": 21.0.3 + "@nx/eslint": 21.0.3 + "@nx/js": 21.0.3 + "@nx/vite": 21.0.3 + "@nx/workspace": 21.0.3 "@swc/core": ^1.4.12 "@types/debug": ^4.1.12 "@types/eslint-plugin-jsx-a11y": ^6.10.0 @@ -5746,7 +5711,7 @@ __metadata: knip: ^5.41.1 lint-staged: ^15.2.2 markdownlint-cli: ^0.44.0 - nx: 20.7.2 + nx: 21.0.3 prettier: 3.5.0 rimraf: ^5.0.5 semver: 7.7.0 @@ -7039,13 +7004,6 @@ __metadata: languageName: node linkType: hard -"browser-stdout@npm:^1.3.1": - version: 1.3.1 - resolution: "browser-stdout@npm:1.3.1" - checksum: b717b19b25952dd6af483e368f9bcd6b14b87740c3d226c2977a65e84666ffd67000bddea7d911f111a9b6ddc822b234de42d52ab6507bce4119a4cc003ef7b3 - languageName: node - linkType: hard - "browserslist@npm:^4.0.0, browserslist@npm:^4.18.1, browserslist@npm:^4.23.0, browserslist@npm:^4.24.0, browserslist@npm:^4.24.4": version: 4.24.5 resolution: "browserslist@npm:4.24.5" @@ -7233,7 +7191,7 @@ __metadata: languageName: node linkType: hard -"camelcase@npm:^6.0.0, camelcase@npm:^6.2.0": +"camelcase@npm:^6.2.0": version: 6.3.0 resolution: "camelcase@npm:6.3.0" checksum: 8c96818a9076434998511251dcb2761a94817ea17dbdc37f47ac080bd088fc62c7369429a19e2178b993497132c8cbcf5cc1f44ba963e76782ba469c0474938d @@ -7402,15 +7360,6 @@ __metadata: languageName: node linkType: hard -"chokidar@npm:^4.0.1": - version: 4.0.3 - resolution: "chokidar@npm:4.0.3" - dependencies: - readdirp: ^4.0.1 - checksum: a8765e452bbafd04f3f2fad79f04222dd65f43161488bb6014a41099e6ca18d166af613d59a90771908c1c823efa3f46ba36b86ac50b701c20c1b9908c5fe36e - languageName: node - linkType: hard - "chownr@npm:^2.0.0": version: 2.0.0 resolution: "chownr@npm:2.0.0" @@ -8508,13 +8457,6 @@ __metadata: languageName: node linkType: hard -"decamelize@npm:^4.0.0": - version: 4.0.0 - resolution: "decamelize@npm:4.0.0" - checksum: b7d09b82652c39eead4d6678bb578e3bebd848add894b76d0f6b395bc45b2d692fb88d977e7cfb93c4ed6c119b05a1347cef261174916c2e75c0a8ca57da1809 - languageName: node - linkType: hard - "decode-named-character-reference@npm:^1.0.0": version: 1.0.2 resolution: "decode-named-character-reference@npm:1.0.2" @@ -8729,20 +8671,6 @@ __metadata: languageName: node linkType: hard -"diff@npm:^5.2.0": - version: 5.2.0 - resolution: "diff@npm:5.2.0" - checksum: 12b63ca9c36c72bafa3effa77121f0581b4015df18bc16bac1f8e263597735649f1a173c26f7eba17fb4162b073fee61788abe49610e6c70a2641fe1895443fd - languageName: node - linkType: hard - -"diff@npm:^7.0.0": - version: 7.0.0 - resolution: "diff@npm:7.0.0" - checksum: 5db0d339476b18dfbc8a08a7504fbcc74789eec626c8d20cf2cdd1871f1448962888128f4447c8f50a1e41a80decfe5e8489c375843b8cf1d42b7c2b611da4e1 - languageName: node - linkType: hard - "dir-glob@npm:^3.0.1": version: 3.0.1 resolution: "dir-glob@npm:3.0.1" @@ -10868,7 +10796,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^10.3.7, glob@npm:^10.4.1, glob@npm:^10.4.5, glob@npm:~10.4.5": +"glob@npm:^10.3.7, glob@npm:^10.4.1, glob@npm:~10.4.5": version: 10.4.5 resolution: "glob@npm:10.4.5" dependencies: @@ -12153,13 +12081,6 @@ __metadata: languageName: node linkType: hard -"is-plain-obj@npm:^2.1.0": - version: 2.1.0 - resolution: "is-plain-obj@npm:2.1.0" - checksum: cec9100678b0a9fe0248a81743041ed990c2d4c99f893d935545cfbc42876cbe86d207f3b895700c690ad2fa520e568c44afc1605044b535a7820c1d40e38daa - languageName: node - linkType: hard - "is-plain-obj@npm:^3.0.0": version: 3.0.0 resolution: "is-plain-obj@npm:3.0.0" @@ -13009,13 +12930,6 @@ __metadata: languageName: node linkType: hard -"lodash.get@npm:^4.4.2": - version: 4.4.2 - resolution: "lodash.get@npm:4.4.2" - checksum: e403047ddb03181c9d0e92df9556570e2b67e0f0a930fcbbbd779370972368f5568e914f913e93f3b08f6d492abc71e14d4e9b7a18916c31fa04bd2306efe545 - languageName: node - linkType: hard - "lodash.memoize@npm:^4.1.2": version: 4.1.2 resolution: "lodash.memoize@npm:4.1.2" @@ -13058,7 +12972,7 @@ __metadata: languageName: node linkType: hard -"log-symbols@npm:^4.0.0, log-symbols@npm:^4.1.0": +"log-symbols@npm:^4.0.0": version: 4.1.0 resolution: "log-symbols@npm:4.1.0" dependencies: @@ -14374,7 +14288,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^5.0.1, minimatch@npm:^5.1.6": +"minimatch@npm:^5.0.1": version: 5.1.6 resolution: "minimatch@npm:5.1.6" dependencies: @@ -14517,37 +14431,6 @@ __metadata: languageName: node linkType: hard -"mocha@npm:^11.0.0": - version: 11.2.2 - resolution: "mocha@npm:11.2.2" - dependencies: - browser-stdout: ^1.3.1 - chokidar: ^4.0.1 - debug: ^4.3.5 - diff: ^5.2.0 - escape-string-regexp: ^4.0.0 - find-up: ^5.0.0 - glob: ^10.4.5 - he: ^1.2.0 - js-yaml: ^4.1.0 - log-symbols: ^4.1.0 - minimatch: ^5.1.6 - ms: ^2.1.3 - picocolors: ^1.1.1 - serialize-javascript: ^6.0.2 - strip-json-comments: ^3.1.1 - supports-color: ^8.1.1 - workerpool: ^6.5.1 - yargs: ^17.7.2 - yargs-parser: ^21.1.1 - yargs-unparser: ^2.0.0 - bin: - _mocha: bin/_mocha - mocha: bin/mocha.js - checksum: ac012ac2413e1705077a30e9b7d0172095ccc027fea54da0d84688754b42c2bca32dc24aaff2502ea869f53901d2b970b5a0697cf32b19433f350f89196d6e47 - languageName: node - linkType: hard - "monaco-editor@npm:~0.52.0": version: 0.52.0 resolution: "monaco-editor@npm:0.52.0" @@ -14819,21 +14702,21 @@ __metadata: languageName: node linkType: hard -"nx@npm:20.7.2": - version: 20.7.2 - resolution: "nx@npm:20.7.2" +"nx@npm:21.0.3": + version: 21.0.3 + resolution: "nx@npm:21.0.3" dependencies: "@napi-rs/wasm-runtime": 0.2.4 - "@nx/nx-darwin-arm64": 20.7.2 - "@nx/nx-darwin-x64": 20.7.2 - "@nx/nx-freebsd-x64": 20.7.2 - "@nx/nx-linux-arm-gnueabihf": 20.7.2 - "@nx/nx-linux-arm64-gnu": 20.7.2 - "@nx/nx-linux-arm64-musl": 20.7.2 - "@nx/nx-linux-x64-gnu": 20.7.2 - "@nx/nx-linux-x64-musl": 20.7.2 - "@nx/nx-win32-arm64-msvc": 20.7.2 - "@nx/nx-win32-x64-msvc": 20.7.2 + "@nx/nx-darwin-arm64": 21.0.3 + "@nx/nx-darwin-x64": 21.0.3 + "@nx/nx-freebsd-x64": 21.0.3 + "@nx/nx-linux-arm-gnueabihf": 21.0.3 + "@nx/nx-linux-arm64-gnu": 21.0.3 + "@nx/nx-linux-arm64-musl": 21.0.3 + "@nx/nx-linux-x64-gnu": 21.0.3 + "@nx/nx-linux-x64-musl": 21.0.3 + "@nx/nx-win32-arm64-msvc": 21.0.3 + "@nx/nx-win32-x64-msvc": 21.0.3 "@yarnpkg/lockfile": ^1.1.0 "@yarnpkg/parsers": 3.0.2 "@zkochan/js-yaml": 0.0.7 @@ -14862,6 +14745,7 @@ __metadata: string-width: ^4.2.3 tar-stream: ~2.2.0 tmp: ~0.2.1 + tree-kill: ^1.2.2 tsconfig-paths: ^4.1.2 tslib: ^2.3.0 yaml: ^2.6.0 @@ -14899,7 +14783,7 @@ __metadata: bin: nx: bin/nx.js nx-cloud: bin/nx-cloud.js - checksum: e566448aa98de9fc5fd32fb20251062e4c628f97cd63dd194375fd7597ebcae2dc9ff31632499914e7dcd89a8d20abbd015745aeaecb90cbf290aa428227ce3e + checksum: 9b3ae238d5df6265bff3430e4e0680762fc3236fb2cd3aed4d3177f64f12586fa19aa8dc4f60f9f5674fb035c46dcf6e0dcad3744d717e84f4a70775aaa10d1b languageName: node linkType: hard @@ -16530,13 +16414,6 @@ __metadata: languageName: node linkType: hard -"readdirp@npm:^4.0.1": - version: 4.1.2 - resolution: "readdirp@npm:4.1.2" - checksum: 3242ee125422cb7c0e12d51452e993f507e6ed3d8c490bc8bf3366c5cdd09167562224e429b13e9cb2b98d4b8b2b11dc100d3c73883aa92d657ade5a21ded004 - languageName: node - linkType: hard - "readdirp@npm:~3.6.0": version: 3.6.0 resolution: "readdirp@npm:3.6.0" @@ -17698,19 +17575,6 @@ __metadata: languageName: node linkType: hard -"sinon@npm:^20.0.0": - version: 20.0.0 - resolution: "sinon@npm:20.0.0" - dependencies: - "@sinonjs/commons": ^3.0.1 - "@sinonjs/fake-timers": ^13.0.5 - "@sinonjs/samsam": ^8.0.1 - diff: ^7.0.0 - supports-color: ^7.2.0 - checksum: c6dcd3bc60aa360fede157fbed30c3984eb222990ff28f3014a5e31834cec74e5203c0575332a99c3f7976425167f70e0777507c0c58867473ad0a0c4c1a759c - languageName: node - linkType: hard - "sirv@npm:^2.0.3": version: 2.0.4 resolution: "sirv@npm:2.0.4" @@ -17884,7 +17748,7 @@ __metadata: languageName: node linkType: hard -"source-map-support@npm:^0.5.21, source-map-support@npm:~0.5.20": +"source-map-support@npm:~0.5.20": version: 0.5.21 resolution: "source-map-support@npm:0.5.21" dependencies: @@ -18385,7 +18249,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^7.0.0, supports-color@npm:^7.1.0, supports-color@npm:^7.2.0": +"supports-color@npm:^7.0.0, supports-color@npm:^7.1.0": version: 7.2.0 resolution: "supports-color@npm:7.2.0" dependencies: @@ -18394,7 +18258,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^8.0.0, supports-color@npm:^8.1.1, supports-color@npm:~8.1.1": +"supports-color@npm:^8.0.0, supports-color@npm:~8.1.1": version: 8.1.1 resolution: "supports-color@npm:8.1.1" dependencies: @@ -18707,6 +18571,15 @@ __metadata: languageName: node linkType: hard +"tree-kill@npm:^1.2.2": + version: 1.2.2 + resolution: "tree-kill@npm:1.2.2" + bin: + tree-kill: cli.js + checksum: 49117f5f410d19c84b0464d29afb9642c863bc5ba40fcb9a245d474c6d5cc64d1b177a6e6713129eb346b40aebb9d4631d967517f9fbe8251c35b21b13cd96c7 + languageName: node + linkType: hard + "trim-lines@npm:^3.0.0": version: 3.0.1 resolution: "trim-lines@npm:3.0.1" @@ -18792,20 +18665,6 @@ __metadata: languageName: node linkType: hard -"type-detect@npm:4.0.8": - version: 4.0.8 - resolution: "type-detect@npm:4.0.8" - checksum: 62b5628bff67c0eb0b66afa371bd73e230399a8d2ad30d852716efcc4656a7516904570cd8631a49a3ce57c10225adf5d0cbdcb47f6b0255fe6557c453925a15 - languageName: node - linkType: hard - -"type-detect@npm:^4.1.0": - version: 4.1.0 - resolution: "type-detect@npm:4.1.0" - checksum: 3b32f873cd02bc7001b00a61502b7ddc4b49278aabe68d652f732e1b5d768c072de0bc734b427abf59d0520a5f19a2e07309ab921ef02018fa1cb4af155cdb37 - languageName: node - linkType: hard - "type-fest@npm:^0.16.0": version: 0.16.0 resolution: "type-fest@npm:0.16.0" @@ -20124,13 +19983,6 @@ __metadata: languageName: node linkType: hard -"workerpool@npm:^6.5.1": - version: 6.5.1 - resolution: "workerpool@npm:6.5.1" - checksum: f86d13f9139c3a57c5a5867e81905cd84134b499849405dec2ffe5b1acd30dabaa1809f6f6ee603a7c65e1e4325f21509db6b8398eaf202c8b8f5809e26a2e16 - languageName: node - linkType: hard - "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0": version: 7.0.0 resolution: "wrap-ansi@npm:7.0.0" @@ -20285,19 +20137,7 @@ __metadata: languageName: node linkType: hard -"yargs-unparser@npm:^2.0.0": - version: 2.0.0 - resolution: "yargs-unparser@npm:2.0.0" - dependencies: - camelcase: ^6.0.0 - decamelize: ^4.0.0 - flat: ^5.0.2 - is-plain-obj: ^2.1.0 - checksum: 68f9a542c6927c3768c2f16c28f71b19008710abd6b8f8efbac6dcce26bbb68ab6503bed1d5994bdbc2df9a5c87c161110c1dfe04c6a3fe5c6ad1b0e15d9a8a3 - languageName: node - linkType: hard - -"yargs@npm:17.7.2, yargs@npm:^17.6.2, yargs@npm:^17.7.2": +"yargs@npm:17.7.2, yargs@npm:^17.6.2": version: 17.7.2 resolution: "yargs@npm:17.7.2" dependencies: From 387eeb54bb0fb9054d92058a9b5418e310940ad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Mon, 19 May 2025 08:53:05 -0400 Subject: [PATCH 010/283] docs(eslint-plugin): [typedef] deprecate the rule (#11202) docs(eslint-plugin) [typedef] deprecate the rule --- packages/eslint-plugin/docs/rules/typedef.mdx | 21 +++++++++++-------- .../eslint-plugin/src/configs/eslintrc/all.ts | 1 - .../eslint-plugin/src/configs/flat/all.ts | 1 - packages/eslint-plugin/src/rules/typedef.ts | 4 ++++ 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/typedef.mdx b/packages/eslint-plugin/docs/rules/typedef.mdx index 8af5c045244a..827936d63329 100644 --- a/packages/eslint-plugin/docs/rules/typedef.mdx +++ b/packages/eslint-plugin/docs/rules/typedef.mdx @@ -9,6 +9,18 @@ import TabItem from '@theme/TabItem'; > > See **https://typescript-eslint.io/rules/typedef** for documentation. +:::caution + +This is an old, deprecated rule. +It will be removed in a future major version of typescript-eslint. + +Requiring type annotations unnecessarily can be cumbersome to maintain and generally reduces code readability. +TypeScript is often better at inferring types than easily written type annotations would allow. + +**Instead of enabling `typedef`, it is generally recommended to use the `--noImplicitAny` and `--strictPropertyInitialization` compiler options to enforce type annotations only when useful.** + +::: + TypeScript cannot always infer types for all places in code. Some locations require type annotations for their types to be inferred. @@ -30,15 +42,6 @@ class ContainsText { > To enforce type definitions existing on call signatures, use [`explicit-function-return-type`](./explicit-function-return-type.mdx), or [`explicit-module-boundary-types`](./explicit-module-boundary-types.mdx). -:::caution - -Requiring type annotations unnecessarily can be cumbersome to maintain and generally reduces code readability. -TypeScript is often better at inferring types than easily written type annotations would allow. - -**Instead of enabling `typedef`, it is generally recommended to use the `--noImplicitAny` and `--strictPropertyInitialization` compiler options to enforce type annotations only when useful.** - -::: - ## Options For example, with the following configuration: diff --git a/packages/eslint-plugin/src/configs/eslintrc/all.ts b/packages/eslint-plugin/src/configs/eslintrc/all.ts index 3d25e79e33db..2764e4f92a74 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/all.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/all.ts @@ -156,7 +156,6 @@ export = { '@typescript-eslint/strict-boolean-expressions': 'error', '@typescript-eslint/switch-exhaustiveness-check': 'error', '@typescript-eslint/triple-slash-reference': 'error', - '@typescript-eslint/typedef': 'error', '@typescript-eslint/unbound-method': 'error', '@typescript-eslint/unified-signatures': 'error', '@typescript-eslint/use-unknown-in-catch-callback-variable': 'error', diff --git a/packages/eslint-plugin/src/configs/flat/all.ts b/packages/eslint-plugin/src/configs/flat/all.ts index dc40d391e4fd..37f6b8647ddc 100644 --- a/packages/eslint-plugin/src/configs/flat/all.ts +++ b/packages/eslint-plugin/src/configs/flat/all.ts @@ -170,7 +170,6 @@ export default ( '@typescript-eslint/strict-boolean-expressions': 'error', '@typescript-eslint/switch-exhaustiveness-check': 'error', '@typescript-eslint/triple-slash-reference': 'error', - '@typescript-eslint/typedef': 'error', '@typescript-eslint/unbound-method': 'error', '@typescript-eslint/unified-signatures': 'error', '@typescript-eslint/use-unknown-in-catch-callback-variable': 'error', diff --git a/packages/eslint-plugin/src/rules/typedef.ts b/packages/eslint-plugin/src/rules/typedef.ts index c46ec9ff1e76..a952ef44fd24 100644 --- a/packages/eslint-plugin/src/rules/typedef.ts +++ b/packages/eslint-plugin/src/rules/typedef.ts @@ -23,6 +23,10 @@ export default createRule({ name: 'typedef', meta: { type: 'suggestion', + deprecated: { + deprecatedSince: '8.33.0', + message: 'This is an old rule that is no longer recommended for use.', + }, docs: { description: 'Require type annotations in certain places', }, From 9335077904aaa4a8ddcd3b446b5c28dd4e8079bf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 08:53:28 -0400 Subject: [PATCH 011/283] chore(deps): update dependency knip to v5.55.1 (#11209) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 493 ++++++++++++++++++++++-------------------------------- 1 file changed, 201 insertions(+), 292 deletions(-) diff --git a/yarn.lock b/yarn.lock index 0f5ac77592d6..83d544efa9b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -505,7 +505,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-string-parser@npm:^7.25.9, @babel/helper-string-parser@npm:^7.27.1": +"@babel/helper-string-parser@npm:^7.27.1": version: 7.27.1 resolution: "@babel/helper-string-parser@npm:7.27.1" checksum: 0a8464adc4b39b138aedcb443b09f4005d86207d7126e5e079177e05c3116107d856ec08282b365e9a79a9872f40f4092a6127f8d74c8a01c1ef789dacfc25d6 @@ -1576,17 +1576,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.3, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0, @babel/types@npm:^7.4.4": - version: 7.26.0 - resolution: "@babel/types@npm:7.26.0" - dependencies: - "@babel/helper-string-parser": ^7.25.9 - "@babel/helper-validator-identifier": ^7.25.9 - checksum: a3dd37dabac693018872da96edb8c1843a605c1bfacde6c3f504fba79b972426a6f24df70aa646356c0c1b19bdd2c722c623c684a996c002381071680602280d - languageName: node - linkType: hard - -"@babel/types@npm:^7.25.4, @babel/types@npm:^7.27.1": +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.3, @babel/types@npm:^7.25.4, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0, @babel/types@npm:^7.27.1, @babel/types@npm:^7.4.4": version: 7.27.1 resolution: "@babel/types@npm:7.27.1" dependencies: @@ -2856,31 +2846,31 @@ __metadata: languageName: node linkType: hard -"@emnapi/core@npm:^1.1.0": - version: 1.2.0 - resolution: "@emnapi/core@npm:1.2.0" +"@emnapi/core@npm:^1.1.0, @emnapi/core@npm:^1.4.0": + version: 1.4.3 + resolution: "@emnapi/core@npm:1.4.3" dependencies: - "@emnapi/wasi-threads": 1.0.1 + "@emnapi/wasi-threads": 1.0.2 tslib: ^2.4.0 - checksum: b3b61bd01de93346f05803151eee9dc308262065034d835db95a46842ea75867c43745c227577f19fa0542fcb3883a752477eb012bf9e4b72f540f4e23f63cbe + checksum: 1c757d380b3cecec637a2eccfb31b770b995060f695d1e15b29a86e2038909a24152947ef6e4b6586759e6716148ff17f40e51367d1b79c9a3e1b6812537bdf4 languageName: node linkType: hard -"@emnapi/runtime@npm:^1.1.0": - version: 1.2.0 - resolution: "@emnapi/runtime@npm:1.2.0" +"@emnapi/runtime@npm:^1.1.0, @emnapi/runtime@npm:^1.4.0": + version: 1.4.3 + resolution: "@emnapi/runtime@npm:1.4.3" dependencies: tslib: ^2.4.0 - checksum: c9f5814f65a7851eda3fae96320b7ebfaf3b7e0db4e1ac2d77b55f5c0785e56b459a029413dbfc0abb1b23f059b850169888f92833150a28cdf24b9a53e535c5 + checksum: ff2074809638ed878e476ece370c6eae7e6257bf029a581bb7a290488d8f2a08c420a65988c7f03bfc6bb689218f0cd995d2f935bd182150b357fc2341142f4f languageName: node linkType: hard -"@emnapi/wasi-threads@npm:1.0.1": - version: 1.0.1 - resolution: "@emnapi/wasi-threads@npm:1.0.1" +"@emnapi/wasi-threads@npm:1.0.2": + version: 1.0.2 + resolution: "@emnapi/wasi-threads@npm:1.0.2" dependencies: tslib: ^2.4.0 - checksum: e154880440ff9bfe67b417f30134f0ff6fee28913dbf4a22de2e67dda5bf5b51055647c5d1565281df17ef5dfcc89256546bdf9b8ccfd07e07566617e7ce1498 + checksum: c289cd3d0e26f11de23429a4abc7f99927917c0871d5a22637cbb75170f2b58d3a42e80d76dea89d054e529f79e35cdc953324819a7f990305d0db2897fa5fab languageName: node linkType: hard @@ -2902,13 +2892,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/aix-ppc64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/aix-ppc64@npm:0.25.3" - conditions: os=aix & cpu=ppc64 - languageName: node - linkType: hard - "@esbuild/aix-ppc64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/aix-ppc64@npm:0.25.4" @@ -2923,13 +2906,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/android-arm64@npm:0.25.3" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/android-arm64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/android-arm64@npm:0.25.4" @@ -2944,13 +2920,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/android-arm@npm:0.25.3" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - "@esbuild/android-arm@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/android-arm@npm:0.25.4" @@ -2965,13 +2934,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-x64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/android-x64@npm:0.25.3" - conditions: os=android & cpu=x64 - languageName: node - linkType: hard - "@esbuild/android-x64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/android-x64@npm:0.25.4" @@ -2986,13 +2948,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/darwin-arm64@npm:0.25.3" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/darwin-arm64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/darwin-arm64@npm:0.25.4" @@ -3007,13 +2962,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/darwin-x64@npm:0.25.3" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - "@esbuild/darwin-x64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/darwin-x64@npm:0.25.4" @@ -3028,13 +2976,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/freebsd-arm64@npm:0.25.3" - conditions: os=freebsd & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/freebsd-arm64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/freebsd-arm64@npm:0.25.4" @@ -3049,13 +2990,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/freebsd-x64@npm:0.25.3" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/freebsd-x64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/freebsd-x64@npm:0.25.4" @@ -3070,13 +3004,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/linux-arm64@npm:0.25.3" - conditions: os=linux & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/linux-arm64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/linux-arm64@npm:0.25.4" @@ -3091,13 +3018,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/linux-arm@npm:0.25.3" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - "@esbuild/linux-arm@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/linux-arm@npm:0.25.4" @@ -3112,13 +3032,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/linux-ia32@npm:0.25.3" - conditions: os=linux & cpu=ia32 - languageName: node - linkType: hard - "@esbuild/linux-ia32@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/linux-ia32@npm:0.25.4" @@ -3133,13 +3046,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/linux-loong64@npm:0.25.3" - conditions: os=linux & cpu=loong64 - languageName: node - linkType: hard - "@esbuild/linux-loong64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/linux-loong64@npm:0.25.4" @@ -3154,13 +3060,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/linux-mips64el@npm:0.25.3" - conditions: os=linux & cpu=mips64el - languageName: node - linkType: hard - "@esbuild/linux-mips64el@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/linux-mips64el@npm:0.25.4" @@ -3175,13 +3074,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/linux-ppc64@npm:0.25.3" - conditions: os=linux & cpu=ppc64 - languageName: node - linkType: hard - "@esbuild/linux-ppc64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/linux-ppc64@npm:0.25.4" @@ -3196,13 +3088,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/linux-riscv64@npm:0.25.3" - conditions: os=linux & cpu=riscv64 - languageName: node - linkType: hard - "@esbuild/linux-riscv64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/linux-riscv64@npm:0.25.4" @@ -3217,13 +3102,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/linux-s390x@npm:0.25.3" - conditions: os=linux & cpu=s390x - languageName: node - linkType: hard - "@esbuild/linux-s390x@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/linux-s390x@npm:0.25.4" @@ -3238,13 +3116,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/linux-x64@npm:0.25.3" - conditions: os=linux & cpu=x64 - languageName: node - linkType: hard - "@esbuild/linux-x64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/linux-x64@npm:0.25.4" @@ -3252,13 +3123,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/netbsd-arm64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/netbsd-arm64@npm:0.25.3" - conditions: os=netbsd & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/netbsd-arm64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/netbsd-arm64@npm:0.25.4" @@ -3273,13 +3137,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/netbsd-x64@npm:0.25.3" - conditions: os=netbsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/netbsd-x64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/netbsd-x64@npm:0.25.4" @@ -3287,13 +3144,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/openbsd-arm64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/openbsd-arm64@npm:0.25.3" - conditions: os=openbsd & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/openbsd-arm64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/openbsd-arm64@npm:0.25.4" @@ -3308,13 +3158,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/openbsd-x64@npm:0.25.3" - conditions: os=openbsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/openbsd-x64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/openbsd-x64@npm:0.25.4" @@ -3329,13 +3172,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/sunos-x64@npm:0.25.3" - conditions: os=sunos & cpu=x64 - languageName: node - linkType: hard - "@esbuild/sunos-x64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/sunos-x64@npm:0.25.4" @@ -3350,13 +3186,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/win32-arm64@npm:0.25.3" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/win32-arm64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/win32-arm64@npm:0.25.4" @@ -3371,13 +3200,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/win32-ia32@npm:0.25.3" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - "@esbuild/win32-ia32@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/win32-ia32@npm:0.25.4" @@ -3392,13 +3214,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.25.3": - version: 0.25.3 - resolution: "@esbuild/win32-x64@npm:0.25.3" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@esbuild/win32-x64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/win32-x64@npm:0.25.4" @@ -3827,6 +3642,17 @@ __metadata: languageName: node linkType: hard +"@napi-rs/wasm-runtime@npm:^0.2.9": + version: 0.2.9 + resolution: "@napi-rs/wasm-runtime@npm:0.2.9" + dependencies: + "@emnapi/core": ^1.4.0 + "@emnapi/runtime": ^1.4.0 + "@tybys/wasm-util": ^0.9.0 + checksum: bffa375d960ebe5f0e98583f46a14bf4aaa086c2cce45582229b36eb0f5987d9dae1c184ebc218df504ffdd92a7169f73ac60697e6e2a2fc064277e3150a3764 + languageName: node + linkType: hard + "@nicolo-ribaudo/eslint-scope-5-internals@npm:5.1.1-v1": version: 5.1.1-v1 resolution: "@nicolo-ribaudo/eslint-scope-5-internals@npm:5.1.1-v1" @@ -4162,6 +3988,99 @@ __metadata: languageName: node linkType: hard +"@oxc-resolver/binding-darwin-arm64@npm:9.0.2": + version: 9.0.2 + resolution: "@oxc-resolver/binding-darwin-arm64@npm:9.0.2" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-darwin-x64@npm:9.0.2": + version: 9.0.2 + resolution: "@oxc-resolver/binding-darwin-x64@npm:9.0.2" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-freebsd-x64@npm:9.0.2": + version: 9.0.2 + resolution: "@oxc-resolver/binding-freebsd-x64@npm:9.0.2" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-arm-gnueabihf@npm:9.0.2": + version: 9.0.2 + resolution: "@oxc-resolver/binding-linux-arm-gnueabihf@npm:9.0.2" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-arm64-gnu@npm:9.0.2": + version: 9.0.2 + resolution: "@oxc-resolver/binding-linux-arm64-gnu@npm:9.0.2" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-arm64-musl@npm:9.0.2": + version: 9.0.2 + resolution: "@oxc-resolver/binding-linux-arm64-musl@npm:9.0.2" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-riscv64-gnu@npm:9.0.2": + version: 9.0.2 + resolution: "@oxc-resolver/binding-linux-riscv64-gnu@npm:9.0.2" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-s390x-gnu@npm:9.0.2": + version: 9.0.2 + resolution: "@oxc-resolver/binding-linux-s390x-gnu@npm:9.0.2" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-x64-gnu@npm:9.0.2": + version: 9.0.2 + resolution: "@oxc-resolver/binding-linux-x64-gnu@npm:9.0.2" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-x64-musl@npm:9.0.2": + version: 9.0.2 + resolution: "@oxc-resolver/binding-linux-x64-musl@npm:9.0.2" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@oxc-resolver/binding-wasm32-wasi@npm:9.0.2": + version: 9.0.2 + resolution: "@oxc-resolver/binding-wasm32-wasi@npm:9.0.2" + dependencies: + "@napi-rs/wasm-runtime": ^0.2.9 + conditions: cpu=wasm32 + languageName: node + linkType: hard + +"@oxc-resolver/binding-win32-arm64-msvc@npm:9.0.2": + version: 9.0.2 + resolution: "@oxc-resolver/binding-win32-arm64-msvc@npm:9.0.2" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-win32-x64-msvc@npm:9.0.2": + version: 9.0.2 + resolution: "@oxc-resolver/binding-win32-x64-msvc@npm:9.0.2" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@phenomnomnominal/tsquery@npm:~5.0.1": version: 5.0.1 resolution: "@phenomnomnominal/tsquery@npm:5.0.1" @@ -8960,7 +8879,7 @@ __metadata: languageName: node linkType: hard -"enhanced-resolve@npm:^5.17.1, enhanced-resolve@npm:^5.18.1": +"enhanced-resolve@npm:^5.17.1": version: 5.18.1 resolution: "enhanced-resolve@npm:5.18.1" dependencies: @@ -9172,7 +9091,7 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.25.0": +"esbuild@npm:^0.25.0, esbuild@npm:~0.25.0": version: 0.25.4 resolution: "esbuild@npm:0.25.4" dependencies: @@ -9338,92 +9257,6 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:~0.25.0": - version: 0.25.3 - resolution: "esbuild@npm:0.25.3" - dependencies: - "@esbuild/aix-ppc64": 0.25.3 - "@esbuild/android-arm": 0.25.3 - "@esbuild/android-arm64": 0.25.3 - "@esbuild/android-x64": 0.25.3 - "@esbuild/darwin-arm64": 0.25.3 - "@esbuild/darwin-x64": 0.25.3 - "@esbuild/freebsd-arm64": 0.25.3 - "@esbuild/freebsd-x64": 0.25.3 - "@esbuild/linux-arm": 0.25.3 - "@esbuild/linux-arm64": 0.25.3 - "@esbuild/linux-ia32": 0.25.3 - "@esbuild/linux-loong64": 0.25.3 - "@esbuild/linux-mips64el": 0.25.3 - "@esbuild/linux-ppc64": 0.25.3 - "@esbuild/linux-riscv64": 0.25.3 - "@esbuild/linux-s390x": 0.25.3 - "@esbuild/linux-x64": 0.25.3 - "@esbuild/netbsd-arm64": 0.25.3 - "@esbuild/netbsd-x64": 0.25.3 - "@esbuild/openbsd-arm64": 0.25.3 - "@esbuild/openbsd-x64": 0.25.3 - "@esbuild/sunos-x64": 0.25.3 - "@esbuild/win32-arm64": 0.25.3 - "@esbuild/win32-ia32": 0.25.3 - "@esbuild/win32-x64": 0.25.3 - dependenciesMeta: - "@esbuild/aix-ppc64": - optional: true - "@esbuild/android-arm": - optional: true - "@esbuild/android-arm64": - optional: true - "@esbuild/android-x64": - optional: true - "@esbuild/darwin-arm64": - optional: true - "@esbuild/darwin-x64": - optional: true - "@esbuild/freebsd-arm64": - optional: true - "@esbuild/freebsd-x64": - optional: true - "@esbuild/linux-arm": - optional: true - "@esbuild/linux-arm64": - optional: true - "@esbuild/linux-ia32": - optional: true - "@esbuild/linux-loong64": - optional: true - "@esbuild/linux-mips64el": - optional: true - "@esbuild/linux-ppc64": - optional: true - "@esbuild/linux-riscv64": - optional: true - "@esbuild/linux-s390x": - optional: true - "@esbuild/linux-x64": - optional: true - "@esbuild/netbsd-arm64": - optional: true - "@esbuild/netbsd-x64": - optional: true - "@esbuild/openbsd-arm64": - optional: true - "@esbuild/openbsd-x64": - optional: true - "@esbuild/sunos-x64": - optional: true - "@esbuild/win32-arm64": - optional: true - "@esbuild/win32-ia32": - optional: true - "@esbuild/win32-x64": - optional: true - bin: - esbuild: bin/esbuild - checksum: 1f9af51aa1d7d1f57e7294823d19ed69b0f6da413b7b0e8123abcebd1bb4011ef19961e2e6679c07301fcd00a85c4d102160fc40a91c25ceeaf594932509d84d - languageName: node - linkType: hard - "escalade@npm:^3.1.1, escalade@npm:^3.2.0": version: 3.2.0 resolution: "escalade@npm:3.2.0" @@ -10198,6 +10031,15 @@ __metadata: languageName: node linkType: hard +"fd-package-json@npm:^1.2.0": + version: 1.2.0 + resolution: "fd-package-json@npm:1.2.0" + dependencies: + walk-up-path: ^3.0.1 + checksum: 043a9b5bbec41d2e452b6c81943b235f0f89358acb1f0fbcfa7ecba80df53434f8e1d663d964c919447fbd0c6f8f8e7dc477fd31a1dd1d7217bfaeeae14fcbb0 + languageName: node + linkType: hard + "fdir@npm:^6.4.4": version: 6.4.4 resolution: "fdir@npm:6.4.4" @@ -10499,6 +10341,17 @@ __metadata: languageName: node linkType: hard +"formatly@npm:^0.2.3": + version: 0.2.3 + resolution: "formatly@npm:0.2.3" + dependencies: + fd-package-json: ^1.2.0 + bin: + formatly: bin/index.mjs + checksum: 8cab7108c6e46f088b737dc0a6ad4c8eafcce9b87934179d018da1ebe0746e1a28ec6b3caab34c54832f9ec08097d97ed6e907eefdaab6eb70bbeba9d3799e5e + languageName: node + linkType: hard + "forwarded@npm:0.2.0": version: 0.2.0 resolution: "forwarded@npm:0.2.0" @@ -12705,15 +12558,16 @@ __metadata: linkType: hard "knip@npm:^5.41.1": - version: 5.53.0 - resolution: "knip@npm:5.53.0" + version: 5.56.0 + resolution: "knip@npm:5.56.0" dependencies: "@nodelib/fs.walk": ^1.2.3 - enhanced-resolve: ^5.18.1 fast-glob: ^3.3.3 + formatly: ^0.2.3 jiti: ^2.4.2 js-yaml: ^4.1.0 minimist: ^1.2.8 + oxc-resolver: ^9.0.2 picocolors: ^1.1.0 picomatch: ^4.0.1 smol-toml: ^1.3.1 @@ -12726,7 +12580,7 @@ __metadata: bin: knip: bin/knip.js knip-bun: bin/knip-bun.js - checksum: f963a3c72f96dfb01e1913f089af48ce97ec0c5d7900508d0e60f9a9733fdc227aab7264483c3168e022bac9ff1ed4426dbcc2090bfe16c784c822dedb75d56f + checksum: 8de4800915cd502d213ba2a8301c8f445955fed95915281b1ceb688f59c0062737171448c114d7147236f0f134c13b1a1f676e293896ace7ebf20bdeb143dc0c languageName: node linkType: hard @@ -14988,6 +14842,54 @@ __metadata: languageName: node linkType: hard +"oxc-resolver@npm:^9.0.2": + version: 9.0.2 + resolution: "oxc-resolver@npm:9.0.2" + dependencies: + "@oxc-resolver/binding-darwin-arm64": 9.0.2 + "@oxc-resolver/binding-darwin-x64": 9.0.2 + "@oxc-resolver/binding-freebsd-x64": 9.0.2 + "@oxc-resolver/binding-linux-arm-gnueabihf": 9.0.2 + "@oxc-resolver/binding-linux-arm64-gnu": 9.0.2 + "@oxc-resolver/binding-linux-arm64-musl": 9.0.2 + "@oxc-resolver/binding-linux-riscv64-gnu": 9.0.2 + "@oxc-resolver/binding-linux-s390x-gnu": 9.0.2 + "@oxc-resolver/binding-linux-x64-gnu": 9.0.2 + "@oxc-resolver/binding-linux-x64-musl": 9.0.2 + "@oxc-resolver/binding-wasm32-wasi": 9.0.2 + "@oxc-resolver/binding-win32-arm64-msvc": 9.0.2 + "@oxc-resolver/binding-win32-x64-msvc": 9.0.2 + dependenciesMeta: + "@oxc-resolver/binding-darwin-arm64": + optional: true + "@oxc-resolver/binding-darwin-x64": + optional: true + "@oxc-resolver/binding-freebsd-x64": + optional: true + "@oxc-resolver/binding-linux-arm-gnueabihf": + optional: true + "@oxc-resolver/binding-linux-arm64-gnu": + optional: true + "@oxc-resolver/binding-linux-arm64-musl": + optional: true + "@oxc-resolver/binding-linux-riscv64-gnu": + optional: true + "@oxc-resolver/binding-linux-s390x-gnu": + optional: true + "@oxc-resolver/binding-linux-x64-gnu": + optional: true + "@oxc-resolver/binding-linux-x64-musl": + optional: true + "@oxc-resolver/binding-wasm32-wasi": + optional: true + "@oxc-resolver/binding-win32-arm64-msvc": + optional: true + "@oxc-resolver/binding-win32-x64-msvc": + optional: true + checksum: d51312a12a64f214b0139d3865cc0ac6f47ae678403595ae656fd7fac8613b4a6629c4fba86c6fa56bd0af98ad75567265ddcad7f7d2240f527c75d77dea1969 + languageName: node + linkType: hard + "p-cancelable@npm:^3.0.0": version: 3.0.0 resolution: "p-cancelable@npm:3.0.0" @@ -19358,6 +19260,13 @@ __metadata: languageName: node linkType: hard +"walk-up-path@npm:^3.0.1": + version: 3.0.1 + resolution: "walk-up-path@npm:3.0.1" + checksum: 9ffca02fe30fb65f6db531260582988c5e766f4c739cf86a6109380a7f791236b5d0b92b1dce37a6f73e22dca6bc9d93bf3700413e16251b2bd6bbd1ca2be316 + languageName: node + linkType: hard + "watchpack@npm:^2.4.1": version: 2.4.1 resolution: "watchpack@npm:2.4.1" From 4ad8a0713376e5b88c56997312861a2c8cb049ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Wed, 21 May 2025 07:42:11 -0400 Subject: [PATCH 012/283] feat: create standalone project-service, tsconfig-utils packages (#11182) * feat: create standalone project-service, tsconfig-utils packages * fix: add missing dependency on tsconfig-utils * chore: correct for Knip reports * lint fixes * lint fixes * lint fixes * Docs and lockfile updates * nit: 'programs', not 'projects' * Updated y(a)ml files too * chore: correct tsconfig-utils type-utils config entries * chore: correct license year * tests: corrected * Lint fixes * Lint fixes * Apply suggestions from code review Co-authored-by: Brad Zacher * filename fix * an inline disable * Remove project.json files, and instead add package.json nx entries * Align scripts * Remove unnecessary deps --------- Co-authored-by: Brad Zacher --- .../ISSUE_TEMPLATE/06-bug-report-other.yaml | 2 + .../ISSUE_TEMPLATE/07-enhancement-other.yaml | 2 + .github/workflows/ci.yml | 2 + .github/workflows/semantic-pr-titles.yml | 2 + docs/packages/Project_Service.mdx | 39 ++ docs/packages/TSConfig_Utils.mdx | 17 + packages/project-service/LICENSE | 21 + packages/project-service/README.md | 12 + packages/project-service/package.json | 63 +++ .../src}/createProjectService.ts | 119 ++++-- .../src/getParsedConfigFileFromTSServer.ts | 22 + packages/project-service/src/index.ts | 1 + .../tests/createProjectService.test.ts | 277 +++++++++++++ .../getParsedConfigFileFromTSServer.test.ts | 61 +++ packages/project-service/tsconfig.build.json | 20 + packages/project-service/tsconfig.json | 22 + packages/project-service/tsconfig.spec.json | 18 + packages/project-service/tsconfig.tools.json | 10 + packages/project-service/vitest.config.mts | 22 + packages/tsconfig-utils/LICENSE | 21 + packages/tsconfig-utils/README.md | 12 + packages/tsconfig-utils/package.json | 60 +++ .../tsconfig-utils/src/compilerOptions.ts | 13 + .../src}/getParsedConfigFile.ts | 4 +- packages/tsconfig-utils/src/index.ts | 2 + .../tests/lib/getParsedConfigFile.test.ts | 2 +- packages/tsconfig-utils/tsconfig.build.json | 14 + packages/tsconfig-utils/tsconfig.json | 13 + packages/tsconfig-utils/tsconfig.spec.json | 26 ++ packages/tsconfig-utils/vitest.config.mts | 26 ++ packages/typescript-estree/package.json | 2 + .../src/create-program/shared.ts | 14 +- .../src/create-program/useProvidedPrograms.ts | 2 +- .../src/parseSettings/createParseSettings.ts | 33 +- .../src/parseSettings/index.ts | 4 +- .../typescript-estree/src/parser-options.ts | 2 - .../src/useProgramFromProjectService.ts | 53 +-- .../tests/lib/createParseSettings.test.ts | 4 +- .../tests/lib/createProjectService.test.ts | 379 ------------------ .../lib/useProgramFromProjectService.test.ts | 11 +- ...validateDefaultProjectForFilesGlob.test.ts | 2 +- .../typescript-estree/tsconfig.build.json | 6 + packages/typescript-estree/tsconfig.json | 6 + packages/website-eslint/build.mts | 1 + packages/website/docusaurus.config.mts | 48 ++- packages/website/sidebars/sidebar.base.js | 2 + tsconfig.json | 2 + yarn.lock | 20 + 48 files changed, 1018 insertions(+), 498 deletions(-) create mode 100644 docs/packages/Project_Service.mdx create mode 100644 docs/packages/TSConfig_Utils.mdx create mode 100644 packages/project-service/LICENSE create mode 100644 packages/project-service/README.md create mode 100644 packages/project-service/package.json rename packages/{typescript-estree/src/create-program => project-service/src}/createProjectService.ts (62%) create mode 100644 packages/project-service/src/getParsedConfigFileFromTSServer.ts create mode 100644 packages/project-service/src/index.ts create mode 100644 packages/project-service/tests/createProjectService.test.ts create mode 100644 packages/project-service/tests/getParsedConfigFileFromTSServer.test.ts create mode 100644 packages/project-service/tsconfig.build.json create mode 100644 packages/project-service/tsconfig.json create mode 100644 packages/project-service/tsconfig.spec.json create mode 100644 packages/project-service/tsconfig.tools.json create mode 100644 packages/project-service/vitest.config.mts create mode 100644 packages/tsconfig-utils/LICENSE create mode 100644 packages/tsconfig-utils/README.md create mode 100644 packages/tsconfig-utils/package.json create mode 100644 packages/tsconfig-utils/src/compilerOptions.ts rename packages/{typescript-estree/src/create-program => tsconfig-utils/src}/getParsedConfigFile.ts (94%) create mode 100644 packages/tsconfig-utils/src/index.ts rename packages/{typescript-estree => tsconfig-utils}/tests/lib/getParsedConfigFile.test.ts (97%) create mode 100644 packages/tsconfig-utils/tsconfig.build.json create mode 100644 packages/tsconfig-utils/tsconfig.json create mode 100644 packages/tsconfig-utils/tsconfig.spec.json create mode 100644 packages/tsconfig-utils/vitest.config.mts delete mode 100644 packages/typescript-estree/tests/lib/createProjectService.test.ts diff --git a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml index 59b8783d1e75..69fc7d6ef7d7 100644 --- a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml +++ b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml @@ -40,8 +40,10 @@ body: - ast-spec - eslint-plugin - parser + - project-service - rule-tester - scope-manager + - tsconfig-utils - type-utils - types - typescript-eslint diff --git a/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml b/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml index 604ce5468161..7250ea66e0f3 100644 --- a/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml +++ b/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml @@ -26,8 +26,10 @@ body: - ast-spec - eslint-plugin - parser + - project-service - rule-tester - scope-manager + - tsconfig-utils - type-utils - types - typescript-eslint diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e4861de3cdf..a31e268f5a16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -184,8 +184,10 @@ jobs: 'eslint-plugin', 'eslint-plugin-internal', 'parser', + 'project-service', 'rule-tester', 'scope-manager', + 'tsconfig-utils', 'type-utils', 'typescript-eslint', 'typescript-estree', diff --git a/.github/workflows/semantic-pr-titles.yml b/.github/workflows/semantic-pr-titles.yml index 3a3c4a2c3164..b206297b3896 100644 --- a/.github/workflows/semantic-pr-titles.yml +++ b/.github/workflows/semantic-pr-titles.yml @@ -30,8 +30,10 @@ jobs: eslint-plugin eslint-plugin-internal parser + project-service rule-tester scope-manager + tsconfig-utils type-utils types typescript-eslint diff --git a/docs/packages/Project_Service.mdx b/docs/packages/Project_Service.mdx new file mode 100644 index 000000000000..7f841f3560b1 --- /dev/null +++ b/docs/packages/Project_Service.mdx @@ -0,0 +1,39 @@ +--- +id: project-service +sidebar_label: project-service +toc_max_heading_level: 3 +--- + +import GeneratedDocs from './project-service/generated/index.md'; + +# `@typescript-eslint/project-service` + + + +> Standalone TypeScript project service wrapper for linting ✨ + +The typescript-eslint Project Service is a wrapper around TypeScript's "project service" APIs. +These APIs are what editors such as VS Code use to programmatically "open" files and generate TypeScript programs for type information. + +:::note +See [Announcing typescript-eslint v8 > Project Service](/blog/announcing-typescript-eslint-v8#project-service) for more details on how lint users interact with the Project Service. +::: + +```ts +import { createProjectService } from '@typescript-eslint/project-service'; + +const filePathAbsolute = '/path/to/your/project/index.ts'; +const { service } = createProjectService(); + +service.openClientFile(filePathAbsolute); + +const scriptInfo = service.getScriptInfo(filePathAbsolute)!; +const program = service + .getDefaultProjectForFile(scriptInfo.fileName, true)! + .getLanguageService(true) + .getProgram()!; +``` + +The following documentation is auto-generated from source code. + + diff --git a/docs/packages/TSConfig_Utils.mdx b/docs/packages/TSConfig_Utils.mdx new file mode 100644 index 000000000000..1ce3361c7fa4 --- /dev/null +++ b/docs/packages/TSConfig_Utils.mdx @@ -0,0 +1,17 @@ +--- +id: tsconfig-utils +sidebar_label: tsconfig-utils +toc_max_heading_level: 3 +--- + +import GeneratedDocs from './tsconfig-utils/generated/index.md'; + +# `@typescript-eslint/tsconfig-utils` + + + +> Utilities for collecting TSConfigs for linting scenarios ✨ + +The following documentation is auto-generated from source code. + + diff --git a/packages/project-service/LICENSE b/packages/project-service/LICENSE new file mode 100644 index 000000000000..310a18f8a6cb --- /dev/null +++ b/packages/project-service/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/project-service/README.md b/packages/project-service/README.md new file mode 100644 index 000000000000..cf1a671681d6 --- /dev/null +++ b/packages/project-service/README.md @@ -0,0 +1,12 @@ +# `@typescript-eslint/project-service` + +> Standalone TypeScript project service wrapper for linting. + +[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/project-service.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/project-service) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/project-service.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/project-service) + +A standalone export of the "Project Service" that powers typed linting for typescript-eslint. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/packages/project-service/package.json b/packages/project-service/package.json new file mode 100644 index 000000000000..6b84af53ee34 --- /dev/null +++ b/packages/project-service/package.json @@ -0,0 +1,63 @@ +{ + "name": "@typescript-eslint/project-service", + "version": "8.32.1", + "description": "Standalone TypeScript project service wrapper for linting.", + "files": [ + "dist", + "!*.tsbuildinfo", + "package.json", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "types": "./dist/index.d.ts", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/project-service" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io", + "license": "MIT", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "scripts": { + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", + "clean": "rimraf dist/ coverage/", + "format": "yarn run -T format", + "lint": "yarn run -BT nx lint", + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" + }, + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.32.1", + "@typescript-eslint/types": "^8.32.1", + "debug": "^4.3.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "project-service", + "includedScripts": [ + "clean" + ] + } +} diff --git a/packages/typescript-estree/src/create-program/createProjectService.ts b/packages/project-service/src/createProjectService.ts similarity index 62% rename from packages/typescript-estree/src/create-program/createProjectService.ts rename to packages/project-service/src/createProjectService.ts index 26b2c5421612..ecf075ef7c5f 100644 --- a/packages/typescript-estree/src/create-program/createProjectService.ts +++ b/packages/project-service/src/createProjectService.ts @@ -1,57 +1,104 @@ -/* eslint-disable @typescript-eslint/no-empty-function -- for TypeScript APIs*/ +import type { ProjectServiceOptions } from '@typescript-eslint/types'; import type * as ts from 'typescript/lib/tsserverlibrary'; import debug from 'debug'; -import type { ProjectServiceOptions } from '../parser-options'; - -import { getParsedConfigFile } from './getParsedConfigFile'; -import { validateDefaultProjectForFilesGlob } from './validateDefaultProjectForFilesGlob'; +import { getParsedConfigFileFromTSServer } from './getParsedConfigFileFromTSServer.js'; const DEFAULT_PROJECT_MATCHED_FILES_THRESHOLD = 8; -const log = debug( - 'typescript-eslint:typescript-estree:create-program:createProjectService', -); -const logTsserverErr = debug( - 'typescript-eslint:typescript-estree:tsserver:err', -); +const log = debug('typescript-eslint:project-service:createProjectService'); +const logTsserverErr = debug('typescript-eslint:project-service:tsserver:err'); const logTsserverInfo = debug( - 'typescript-eslint:typescript-estree:tsserver:info', + 'typescript-eslint:project-service:tsserver:info', ); const logTsserverPerf = debug( - 'typescript-eslint:typescript-estree:tsserver:perf', + 'typescript-eslint:project-service:tsserver:perf', ); const logTsserverEvent = debug( - 'typescript-eslint:typescript-estree:tsserver:event', + 'typescript-eslint:project-service:tsserver:event', ); +// For TypeScript APIs that expect a function to be passed in +// eslint-disable-next-line @typescript-eslint/no-empty-function const doNothing = (): void => {}; const createStubFileWatcher = (): ts.FileWatcher => ({ close: doNothing, }); +/** + * Shortcut type to refer to TypeScript's server ProjectService. + */ export type TypeScriptProjectService = ts.server.ProjectService; -export interface ProjectServiceSettings { +/** + * A created Project Service instance, as well as metadata on its creation. + */ +export interface ProjectServiceAndMetadata { + /** + * Files allowed to be loaded from the default project, if any were specified. + */ allowDefaultProject: string[] | undefined; + + /** + * The performance.now() timestamp of the last reload of the project service. + */ lastReloadTimestamp: number; + + /** + * The maximum number of files that can be matched by the default project. + */ maximumDefaultProjectFileMatchCount: number; + + /** + * The created TypeScript Project Service instance. + */ service: TypeScriptProjectService; } -export function createProjectService( - optionsRaw: boolean | ProjectServiceOptions | undefined, - jsDocParsingMode: ts.JSDocParsingMode | undefined, - tsconfigRootDir: string | undefined, -): ProjectServiceSettings { - const optionsRawObject = typeof optionsRaw === 'object' ? optionsRaw : {}; +/** + * Settings to create a new Project Service instance with {@link createProjectService}. + */ +export interface CreateProjectServiceSettings { + /** + * Granular options to configure the project service. + */ + options?: ProjectServiceOptions; + + /** + * How aggressively (and slowly) to parse JSDoc comments. + */ + jsDocParsingMode?: ts.JSDocParsingMode; + + /** + * Root directory for the tsconfig.json file, if not the current directory. + */ + tsconfigRootDir?: string; +} + +/** + * Creates a new Project Service instance, as well as metadata on its creation. + * @param settings Settings to create a new Project Service instance. + * @returns A new Project Service instance, as well as metadata on its creation. + * @example + * ```ts + * import { createProjectService } from '@typescript-eslint/project-service'; + * + * const { service } = createProjectService(); + * + * service.openClientFile('index.ts'); + * ``` + */ +export function createProjectService({ + jsDocParsingMode, + options: optionsRaw = {}, + tsconfigRootDir, +}: CreateProjectServiceSettings = {}): ProjectServiceAndMetadata { const options = { defaultProject: 'tsconfig.json', - ...optionsRawObject, + ...optionsRaw, }; - validateDefaultProjectForFilesGlob(options.allowDefaultProject); // We import this lazily to avoid its cost for users who don't use the service // TODO: Once we drop support for TS<5.3 we can import from "typescript" directly @@ -119,7 +166,7 @@ export function createProjectService( startGroup: doNothing, }; - log('Creating project service with: %o', options); + log('Creating Project Service with: %o', options); const service = new tsserver.server.ProjectService({ cancellationToken: { isCancellationRequested: (): boolean => false }, @@ -143,26 +190,18 @@ export function createProjectService( }); log('Enabling default project: %s', options.defaultProject); - let configFile: ts.ParsedCommandLine | undefined; - try { - configFile = getParsedConfigFile( - tsserver, - options.defaultProject, - tsconfigRootDir, - ); - } catch (error) { - if (optionsRawObject.defaultProject) { - throw new Error( - `Could not read project service default project '${options.defaultProject}': ${(error as Error).message}`, - ); - } - } + const configFile = getParsedConfigFileFromTSServer( + tsserver, + options.defaultProject, + !!optionsRaw.defaultProject, + tsconfigRootDir, + ); if (configFile) { service.setCompilerOptionsForInferredProjects( // NOTE: The inferred projects API is not intended for source files when a tsconfig - // exists. There is no API that generates an InferredProjectCompilerOptions suggesting + // exists. There is no API that generates an InferredProjectCompilerOptions suggesting // it is meant for hard coded options passed in. Hard asserting as a work around. // See https://github.com/microsoft/TypeScript/blob/27bcd4cb5a98bce46c9cdd749752703ead021a4b/src/server/protocol.ts#L1904 configFile.options as ts.server.protocol.InferredProjectCompilerOptions, @@ -178,3 +217,5 @@ export function createProjectService( service, }; } + +export { type ProjectServiceOptions } from '@typescript-eslint/types'; diff --git a/packages/project-service/src/getParsedConfigFileFromTSServer.ts b/packages/project-service/src/getParsedConfigFileFromTSServer.ts new file mode 100644 index 000000000000..c2e2f83612c4 --- /dev/null +++ b/packages/project-service/src/getParsedConfigFileFromTSServer.ts @@ -0,0 +1,22 @@ +import type * as ts from 'typescript/lib/tsserverlibrary'; + +import { getParsedConfigFile } from '@typescript-eslint/tsconfig-utils'; + +export function getParsedConfigFileFromTSServer( + tsserver: typeof ts, + defaultProject: string, + throwOnFailure: boolean, + tsconfigRootDir?: string, +): ts.ParsedCommandLine | undefined { + try { + return getParsedConfigFile(tsserver, defaultProject, tsconfigRootDir); + } catch (error) { + if (throwOnFailure) { + throw new Error( + `Could not read Project Service default project '${defaultProject}': ${(error as Error).message}`, + ); + } + } + + return undefined; +} diff --git a/packages/project-service/src/index.ts b/packages/project-service/src/index.ts new file mode 100644 index 000000000000..943c04088b69 --- /dev/null +++ b/packages/project-service/src/index.ts @@ -0,0 +1 @@ +export * from './createProjectService'; diff --git a/packages/project-service/tests/createProjectService.test.ts b/packages/project-service/tests/createProjectService.test.ts new file mode 100644 index 000000000000..32fd4e971d85 --- /dev/null +++ b/packages/project-service/tests/createProjectService.test.ts @@ -0,0 +1,277 @@ +import debug from 'debug'; +import * as ts from 'typescript'; + +import { createProjectService } from '../src/createProjectService.js'; + +const mockGetParsedConfigFileFromTSServer = vi.fn(); + +vi.mock('../src/getParsedConfigFileFromTSServer.js', () => ({ + get getParsedConfigFileFromTSServer() { + return mockGetParsedConfigFileFromTSServer; + }, +})); + +const mockSetCompilerOptionsForInferredProjects = vi.fn(); +const mockSetHostConfiguration = vi.fn(); + +vi.mock(import('../src/createProjectService.js'), async importOriginal => { + const actual = await importOriginal(); + + return { + ...actual, + createProjectService: vi + .fn(actual.createProjectService) + .mockImplementation((...args) => { + const projectServiceSettings = actual.createProjectService(...args); + const service = + projectServiceSettings.service as typeof projectServiceSettings.service & { + eventHandler: ts.server.ProjectServiceEventHandler | undefined; + }; + + if (service.eventHandler) { + service.eventHandler({ + eventName: ts.server.ProjectLoadingStartEvent, + } as ts.server.ProjectLoadingStartEvent); + } + + return projectServiceSettings; + }), + }; +}); + +describe(createProjectService, () => { + const processStderrWriteSpy = vi + .spyOn(process.stderr, 'write') + .mockImplementation(() => true); + + beforeEach(() => { + // eslint-disable-next-line @typescript-eslint/no-require-imports + const { ProjectService } = require('typescript/lib/tsserverlibrary').server; + + ProjectService.prototype.setCompilerOptionsForInferredProjects = + mockSetCompilerOptionsForInferredProjects; + ProjectService.prototype.setHostConfiguration = mockSetHostConfiguration; + }); + + afterEach(() => { + debug.disable(); + vi.clearAllMocks(); + }); + + describe('defaultProject', () => { + it('sets allowDefaultProject when options.allowDefaultProject is defined', () => { + const allowDefaultProject = ['./*.js']; + + const settings = createProjectService({ + options: { allowDefaultProject }, + }); + + expect(settings.allowDefaultProject).toBe(allowDefaultProject); + }); + + it('does not set allowDefaultProject when options.allowDefaultProject is not defined', () => { + const settings = createProjectService(); + + assert.isUndefined(settings.allowDefaultProject); + }); + + it('uses the default project compiler options when options.defaultProject is set', () => { + const compilerOptions: ts.CompilerOptions = { strict: true }; + mockGetParsedConfigFileFromTSServer.mockReturnValueOnce({ + errors: [], + fileNames: [], + options: compilerOptions, + }); + + const defaultProject = 'tsconfig.eslint.json'; + + createProjectService({ + options: { + allowDefaultProject: ['file.js'], + defaultProject, + }, + }); + + expect(mockSetCompilerOptionsForInferredProjects).toHaveBeenCalledWith( + compilerOptions, + ); + + expect(mockGetParsedConfigFileFromTSServer).toHaveBeenCalledWith( + expect.any(Object), + defaultProject, + true, + undefined, + ); + }); + }); + + it('uses tsconfigRootDir as getParsedConfigFile projectDirectory when provided', async () => { + const compilerOptions: ts.CompilerOptions = { strict: true }; + const tsconfigRootDir = 'path/to/repo'; + mockGetParsedConfigFileFromTSServer.mockReturnValueOnce({ + errors: [], + fileNames: [], + options: compilerOptions, + }); + + const { service } = createProjectService({ + options: { allowDefaultProject: ['file.js'] }, + tsconfigRootDir, + }); + + expect(service.setCompilerOptionsForInferredProjects).toHaveBeenCalledWith( + compilerOptions, + ); + + expect(mockGetParsedConfigFileFromTSServer).toHaveBeenCalledWith( + (await import('typescript/lib/tsserverlibrary.js')).default, + 'tsconfig.json', + false, + tsconfigRootDir, + ); + }); + + it('uses the default projects error debugger for error messages when enabled', () => { + debug.enable('typescript-eslint:project-service:tsserver:err'); + const { service } = createProjectService(); + + service.logger.msg('foo', ts.server.Msg.Err); + + const newLocal = service.logger.loggingEnabled(); + expect(newLocal).toBe(true); + expect(processStderrWriteSpy).toHaveBeenCalledWith( + expect.stringMatching( + /^.*typescript-eslint:project-service:tsserver:err foo\n$/, + ), + ); + }); + + it('does not use the default projects error debugger for error messages when disabled', () => { + const { service } = createProjectService(); + + service.logger.msg('foo', ts.server.Msg.Err); + + expect(service.logger.loggingEnabled()).toBe(false); + expect(processStderrWriteSpy).not.toHaveBeenCalled(); + }); + + it('uses the default projects info debugger for info messages when enabled', () => { + debug.enable('typescript-eslint:project-service:tsserver:info'); + + const { service } = createProjectService(); + + service.logger.info('foo'); + + expect(service.logger.loggingEnabled()).toBe(true); + expect(processStderrWriteSpy).toHaveBeenCalledWith( + expect.stringMatching( + /^.*typescript-eslint:project-service:tsserver:info foo\n$/, + ), + ); + }); + + it('does not use the default projects info debugger for info messages when disabled', () => { + const { service } = createProjectService(); + + service.logger.info('foo'); + + expect(service.logger.loggingEnabled()).toBe(false); + expect(processStderrWriteSpy).not.toHaveBeenCalled(); + }); + + it('uses the default projects perf debugger for perf messages when enabled', () => { + debug.enable('typescript-eslint:project-service:tsserver:perf'); + const { service } = createProjectService(); + + service.logger.perftrc('foo'); + + expect(service.logger.loggingEnabled()).toBe(true); + expect(processStderrWriteSpy).toHaveBeenCalledWith( + expect.stringMatching( + /^.*typescript-eslint:project-service:tsserver:perf foo\n$/, + ), + ); + }); + + it('does not use the default projects perf debugger for perf messages when disabled', () => { + const { service } = createProjectService(); + + service.logger.perftrc('foo'); + + expect(service.logger.loggingEnabled()).toBe(false); + expect(processStderrWriteSpy).not.toHaveBeenCalled(); + }); + + it('enables all log levels for the default projects logger', () => { + const { service } = createProjectService(); + + expect(service.logger.hasLevel(ts.server.LogLevel.terse)).toBe(true); + expect(service.logger.hasLevel(ts.server.LogLevel.normal)).toBe(true); + expect(service.logger.hasLevel(ts.server.LogLevel.requestTime)).toBe(true); + expect(service.logger.hasLevel(ts.server.LogLevel.verbose)).toBe(true); + }); + + it('does not return a log filename with the default projects logger', () => { + const { service } = createProjectService(); + + assert.isUndefined(service.logger.getLogFileName()); + }); + + it('uses the default projects event debugger for event handling when enabled', () => { + debug.enable('typescript-eslint:project-service:tsserver:event'); + + createProjectService(); + + expect(processStderrWriteSpy).toHaveBeenCalledWith( + expect.stringMatching( + /^.*typescript-eslint:project-service:tsserver:event { eventName: 'projectLoadingStart' }\n$/, + ), + ); + }); + + it('does not use the default projects event debugger for event handling when disabled', () => { + createProjectService(); + + expect(processStderrWriteSpy).not.toHaveBeenCalled(); + }); + + it('provides a stub require to the host system when loadTypeScriptPlugins is falsy', () => { + const { service } = createProjectService({}); + + const required = service.host.require?.('', ''); + + expect(required).toStrictEqual({ + error: { + message: + 'TypeScript plugins are not required when using parserOptions.projectService.', + }, + module: undefined, + }); + }); + + it('does not provide a require to the host system when loadTypeScriptPlugins is truthy', async () => { + const { service } = createProjectService({ + options: { loadTypeScriptPlugins: true }, + }); + + expect(service.host.require).toBe( + ( + await vi.importActual>>( + 'typescript/lib/tsserverlibrary.js', + ) + ).sys.require, + ); + }); + + it('sets a host configuration', () => { + createProjectService({ + options: { allowDefaultProject: ['file.js'] }, + }); + + expect(mockSetHostConfiguration).toHaveBeenCalledWith({ + preferences: { + includePackageJsonAutoImports: 'off', + }, + }); + }); +}); diff --git a/packages/project-service/tests/getParsedConfigFileFromTSServer.test.ts b/packages/project-service/tests/getParsedConfigFileFromTSServer.test.ts new file mode 100644 index 000000000000..f6f868bd0096 --- /dev/null +++ b/packages/project-service/tests/getParsedConfigFileFromTSServer.test.ts @@ -0,0 +1,61 @@ +import type * as ts from 'typescript/lib/tsserverlibrary'; + +import { getParsedConfigFileFromTSServer } from '../src/getParsedConfigFileFromTSServer'; + +const mockGetParsedConfigFile = vi.fn(); + +vi.mock('@typescript-eslint/tsconfig-utils', () => ({ + get getParsedConfigFile() { + return mockGetParsedConfigFile; + }, +})); + +const mockConfigFile = { + fileNames: [], +}; + +const mockTSServer = {} as unknown as typeof ts; +const mockTSConfigRootDir = '/mock/tsconfig/root/dir'; + +describe(getParsedConfigFileFromTSServer, () => { + it('returns the parsed config file when getParsedConfigFile succeeds', () => { + mockGetParsedConfigFile.mockReturnValueOnce(mockConfigFile); + + const actual = getParsedConfigFileFromTSServer( + mockTSServer, + 'tsconfig.json', + false, + mockTSConfigRootDir, + ); + + expect(actual).toBe(mockConfigFile); + }); + + it('returns undefined when getParsedConfigFile fails and throwOnFailure is false', () => { + mockGetParsedConfigFile.mockImplementationOnce(() => { + throw new Error('Oh no!'); + }); + + const actual = getParsedConfigFileFromTSServer( + mockTSServer, + 'tsconfig.json', + false, + ); + + expect(actual).toBeUndefined(); + }); + + it('throws the error when getParsedConfigFile fails and throwOnFailure is true', () => { + mockGetParsedConfigFile.mockImplementationOnce(() => { + throw new Error('Oh no!'); + }); + + expect(() => + getParsedConfigFileFromTSServer(mockTSServer, 'tsconfig.json', true), + ).toThrow( + new Error( + `Could not read Project Service default project 'tsconfig.json': Oh no!`, + ), + ); + }); +}); diff --git a/packages/project-service/tsconfig.build.json b/packages/project-service/tsconfig.build.json new file mode 100644 index 000000000000..d9cc02f3ba7c --- /dev/null +++ b/packages/project-service/tsconfig.build.json @@ -0,0 +1,20 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "baseUrl": ".", + "rootDir": "src", + "outDir": "dist", + "tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo", + "emitDeclarationOnly": false, + "types": ["node"] + }, + "include": ["src/**/*.ts"], + "references": [ + { + "path": "../tsconfig-utils/tsconfig.build.json" + }, + { + "path": "../types/tsconfig.build.json" + } + ] +} diff --git a/packages/project-service/tsconfig.json b/packages/project-service/tsconfig.json new file mode 100644 index 000000000000..7d8d748caa17 --- /dev/null +++ b/packages/project-service/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../tsconfig.base.json", + "files": [], + "include": [], + "references": [ + { + "path": "../tsconfig-utils" + }, + { + "path": "../types" + }, + { + "path": "./tsconfig.build.json" + }, + { + "path": "./tsconfig.tools.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/packages/project-service/tsconfig.spec.json b/packages/project-service/tsconfig.spec.json new file mode 100644 index 000000000000..872d3c655b27 --- /dev/null +++ b/packages/project-service/tsconfig.spec.json @@ -0,0 +1,18 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc/packages/types/vitest", + "resolveJsonModule": true, + "types": ["vitest/globals", "vitest/importMeta"] + }, + "include": ["vitest.config.mts", "package.json", "tests"], + "exclude": ["**/fixtures/**"], + "references": [ + { + "path": "./tsconfig.build.json" + }, + { + "path": "../../tsconfig.spec.json" + } + ] +} diff --git a/packages/project-service/tsconfig.tools.json b/packages/project-service/tsconfig.tools.json new file mode 100644 index 000000000000..cf7f584666a9 --- /dev/null +++ b/packages/project-service/tsconfig.tools.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc/packages/types/tools", + "module": "NodeNext", + "types": ["node"] + }, + "include": ["tools"], + "references": [] +} diff --git a/packages/project-service/vitest.config.mts b/packages/project-service/vitest.config.mts new file mode 100644 index 000000000000..136e4f77b392 --- /dev/null +++ b/packages/project-service/vitest.config.mts @@ -0,0 +1,22 @@ +import * as path from 'node:path'; +import { defineConfig, mergeConfig } from 'vitest/config'; + +import { vitestBaseConfig } from '../../vitest.config.base.mjs'; +import packageJson from './package.json' with { type: 'json' }; + +const vitestConfig = mergeConfig( + vitestBaseConfig, + + defineConfig({ + root: import.meta.dirname, + + test: { + dir: path.join(import.meta.dirname, 'tests'), + name: packageJson.name.replace('@typescript-eslint/', ''), + passWithNoTests: true, + root: import.meta.dirname, + }, + }), +); + +export default vitestConfig; diff --git a/packages/tsconfig-utils/LICENSE b/packages/tsconfig-utils/LICENSE new file mode 100644 index 000000000000..310a18f8a6cb --- /dev/null +++ b/packages/tsconfig-utils/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/tsconfig-utils/README.md b/packages/tsconfig-utils/README.md new file mode 100644 index 000000000000..075c3fbb7315 --- /dev/null +++ b/packages/tsconfig-utils/README.md @@ -0,0 +1,12 @@ +# `@typescript-eslint/tsconfig-utils` + +> Utilities for collecting TSConfigs for linting scenarios. + +[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/tsconfig-utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/tsconfig-utils) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/tsconfig-utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/tsconfig-utils) + +The utilities in this package are separated from `@typescript-eslint/utils` so that they do not have a dependency on `eslint` or `@typescript-eslint/typescript-estree`. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json new file mode 100644 index 000000000000..d430af46082a --- /dev/null +++ b/packages/tsconfig-utils/package.json @@ -0,0 +1,60 @@ +{ + "name": "@typescript-eslint/tsconfig-utils", + "version": "8.32.1", + "description": "Utilities for collecting TSConfigs for linting scenarios.", + "files": [ + "dist", + "!*.tsbuildinfo", + "package.json", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/tsconfig-utils" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io", + "license": "MIT", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "scripts": { + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "yarn run -BT nx build", + "clean": "rimraf dist/ coverage/", + "format": "yarn run -T format", + "lint": "yarn run -BT nx lint", + "test": "yarn run -BT nx test", + "typecheck": "yarn run -BT nx typecheck" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "tsconfig-utils", + "includedScripts": [ + "clean" + ] + } +} diff --git a/packages/tsconfig-utils/src/compilerOptions.ts b/packages/tsconfig-utils/src/compilerOptions.ts new file mode 100644 index 000000000000..1183ce149911 --- /dev/null +++ b/packages/tsconfig-utils/src/compilerOptions.ts @@ -0,0 +1,13 @@ +import type * as ts from 'typescript'; + +/** + * Compiler options required to avoid critical functionality issues + */ +export const CORE_COMPILER_OPTIONS = { + // Required to avoid parse from causing emit to occur + noEmit: true, + + // Flags required to make no-unused-vars work + noUnusedLocals: true, + noUnusedParameters: true, +} satisfies ts.CompilerOptions; diff --git a/packages/typescript-estree/src/create-program/getParsedConfigFile.ts b/packages/tsconfig-utils/src/getParsedConfigFile.ts similarity index 94% rename from packages/typescript-estree/src/create-program/getParsedConfigFile.ts rename to packages/tsconfig-utils/src/getParsedConfigFile.ts index 6efebadf48d2..a6dafe5b1daa 100644 --- a/packages/typescript-estree/src/create-program/getParsedConfigFile.ts +++ b/packages/tsconfig-utils/src/getParsedConfigFile.ts @@ -3,10 +3,10 @@ import type * as ts from 'typescript/lib/tsserverlibrary'; import * as fs from 'node:fs'; import * as path from 'node:path'; -import { CORE_COMPILER_OPTIONS } from './shared'; +import { CORE_COMPILER_OPTIONS } from './compilerOptions'; /** - * Utility offered by parser to help consumers parse a config file. + * Parses a TSConfig file using the same logic as tsserver. * * @param configFile the path to the tsconfig.json file, relative to `projectDirectory` * @param projectDirectory the project directory to use as the CWD, defaults to `process.cwd()` diff --git a/packages/tsconfig-utils/src/index.ts b/packages/tsconfig-utils/src/index.ts new file mode 100644 index 000000000000..3213fc4e40a1 --- /dev/null +++ b/packages/tsconfig-utils/src/index.ts @@ -0,0 +1,2 @@ +export * from './compilerOptions'; +export * from './getParsedConfigFile'; diff --git a/packages/typescript-estree/tests/lib/getParsedConfigFile.test.ts b/packages/tsconfig-utils/tests/lib/getParsedConfigFile.test.ts similarity index 97% rename from packages/typescript-estree/tests/lib/getParsedConfigFile.test.ts rename to packages/tsconfig-utils/tests/lib/getParsedConfigFile.test.ts index aa013abef444..d26919b52b5c 100644 --- a/packages/typescript-estree/tests/lib/getParsedConfigFile.test.ts +++ b/packages/tsconfig-utils/tests/lib/getParsedConfigFile.test.ts @@ -1,7 +1,7 @@ import path from 'node:path'; import * as ts from 'typescript'; -import { getParsedConfigFile } from '../../src/create-program/getParsedConfigFile'; +import { getParsedConfigFile } from '../../src/getParsedConfigFile'; const mockGetParsedCommandLineOfConfigFile = vi.fn(); diff --git a/packages/tsconfig-utils/tsconfig.build.json b/packages/tsconfig-utils/tsconfig.build.json new file mode 100644 index 000000000000..2250b25126e4 --- /dev/null +++ b/packages/tsconfig-utils/tsconfig.build.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "baseUrl": ".", + "rootDir": "src", + "outDir": "dist", + "tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo", + "emitDeclarationOnly": false, + "types": ["node"] + }, + "include": ["src/**/*.ts", "typings"], + "exclude": ["vitest.config.mts", "src/**/*.spec.ts", "src/**/*.test.ts"], + "references": [] +} diff --git a/packages/tsconfig-utils/tsconfig.json b/packages/tsconfig-utils/tsconfig.json new file mode 100644 index 000000000000..d4d0929e1955 --- /dev/null +++ b/packages/tsconfig-utils/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.build.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/packages/tsconfig-utils/tsconfig.spec.json b/packages/tsconfig-utils/tsconfig.spec.json new file mode 100644 index 000000000000..21fcf7e24f3f --- /dev/null +++ b/packages/tsconfig-utils/tsconfig.spec.json @@ -0,0 +1,26 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc/packages/tsconfig-utils", + "module": "NodeNext", + "resolveJsonModule": true, + "types": ["node", "vitest/globals", "vitest/importMeta"] + }, + "include": [ + "vitest.config.mts", + "package.json", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.d.ts", + "tests" + ], + "exclude": ["**/fixtures/**"], + "references": [ + { + "path": "./tsconfig.build.json" + }, + { + "path": "../../tsconfig.spec.json" + } + ] +} diff --git a/packages/tsconfig-utils/vitest.config.mts b/packages/tsconfig-utils/vitest.config.mts new file mode 100644 index 000000000000..9cadb9dea2bb --- /dev/null +++ b/packages/tsconfig-utils/vitest.config.mts @@ -0,0 +1,26 @@ +import * as path from 'node:path'; +import { defineProject, mergeConfig } from 'vitest/config'; + +import { vitestBaseConfig } from '../../vitest.config.base.mjs'; +import packageJson from './package.json' with { type: 'json' }; + +const vitestConfig = mergeConfig( + vitestBaseConfig, + + defineProject({ + root: import.meta.dirname, + + test: { + diff: { + maxDepth: 1, + }, + + dir: path.join(import.meta.dirname, 'tests'), + name: packageJson.name.replace('@typescript-eslint/', ''), + root: import.meta.dirname, + testTimeout: 10_000, + }, + }), +); + +export default vitestConfig; diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index cfd6091e8d62..41b687506a4f 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -53,6 +53,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { + "@typescript-eslint/project-service": "8.32.1", + "@typescript-eslint/tsconfig-utils": "8.32.1", "@typescript-eslint/types": "8.32.1", "@typescript-eslint/visitor-keys": "8.32.1", "debug": "^4.3.4", diff --git a/packages/typescript-estree/src/create-program/shared.ts b/packages/typescript-estree/src/create-program/shared.ts index 07a67cbb9b38..088e5ce1c7dd 100644 --- a/packages/typescript-estree/src/create-program/shared.ts +++ b/packages/typescript-estree/src/create-program/shared.ts @@ -1,5 +1,6 @@ import type { Program } from 'typescript'; +import { CORE_COMPILER_OPTIONS } from '@typescript-eslint/tsconfig-utils'; import path from 'node:path'; import * as ts from 'typescript'; @@ -15,19 +16,6 @@ export interface ASTAndDefiniteProgram { } export type ASTAndProgram = ASTAndDefiniteProgram | ASTAndNoProgram; -/** - * Compiler options required to avoid critical functionality issues - */ -export const CORE_COMPILER_OPTIONS: ts.CompilerOptions = { - noEmit: true, // required to avoid parse from causing emit to occur - - /** - * Flags required to make no-unused-vars work - */ - noUnusedLocals: true, - noUnusedParameters: true, -}; - /** * Default compiler options for program generation */ diff --git a/packages/typescript-estree/src/create-program/useProvidedPrograms.ts b/packages/typescript-estree/src/create-program/useProvidedPrograms.ts index f84767ea19c7..b8e958ed34f2 100644 --- a/packages/typescript-estree/src/create-program/useProvidedPrograms.ts +++ b/packages/typescript-estree/src/create-program/useProvidedPrograms.ts @@ -1,3 +1,4 @@ +import { getParsedConfigFile } from '@typescript-eslint/tsconfig-utils'; import debug from 'debug'; import * as path from 'node:path'; import * as ts from 'typescript'; @@ -5,7 +6,6 @@ import * as ts from 'typescript'; import type { ParseSettings } from '../parseSettings'; import type { ASTAndDefiniteProgram } from './shared'; -import { getParsedConfigFile } from './getParsedConfigFile'; import { getAstFromProgram } from './shared'; const log = debug( diff --git a/packages/typescript-estree/src/parseSettings/createParseSettings.ts b/packages/typescript-estree/src/parseSettings/createParseSettings.ts index 6a1c42008c6b..678b771ac3a5 100644 --- a/packages/typescript-estree/src/parseSettings/createParseSettings.ts +++ b/packages/typescript-estree/src/parseSettings/createParseSettings.ts @@ -1,13 +1,19 @@ +import type { + CreateProjectServiceSettings, + ProjectServiceAndMetadata, +} from '@typescript-eslint/project-service'; +import type { ProjectServiceOptions } from '@typescript-eslint/types'; + +import { createProjectService } from '@typescript-eslint/project-service'; import debug from 'debug'; import path from 'node:path'; import * as ts from 'typescript'; -import type { ProjectServiceSettings } from '../create-program/createProjectService'; import type { TSESTreeOptions } from '../parser-options'; import type { MutableParseSettings } from './index'; -import { createProjectService } from '../create-program/createProjectService'; import { ensureAbsolutePath } from '../create-program/shared'; +import { validateDefaultProjectForFilesGlob } from '../create-program/validateDefaultProjectForFilesGlob'; import { isSourceFile } from '../source-files'; import { DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS, @@ -23,7 +29,7 @@ const log = debug( ); let TSCONFIG_MATCH_CACHE: ExpiringCache | null; -let TSSERVER_PROJECT_SERVICE: ProjectServiceSettings | null = null; +let TSSERVER_PROJECT_SERVICE: ProjectServiceAndMetadata | null = null; // NOTE - we intentionally use "unnecessary" `?.` here because in TS<5.3 this enum doesn't exist // This object exists so we can centralize these for tracking and so we don't proliferate these across the file @@ -112,11 +118,10 @@ export function createParseSettings( (tsestreeOptions.project && tsestreeOptions.projectService !== false && process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true') - ? (TSSERVER_PROJECT_SERVICE ??= createProjectService( - tsestreeOptions.projectService, + ? populateProjectService(tsestreeOptions.projectService, { jsDocParsingMode, tsconfigRootDir, - )) + }) : undefined, setExternalModuleIndicator: tsestreeOptions.sourceType === 'module' || @@ -223,3 +228,19 @@ function enforceCodeString(code: unknown): string { function getFileName(jsx?: boolean): string { return jsx ? 'estree.tsx' : 'estree.ts'; } + +function populateProjectService( + optionsRaw: ProjectServiceOptions | true | undefined, + settings: CreateProjectServiceSettings, +) { + const options = typeof optionsRaw === 'object' ? optionsRaw : {}; + + validateDefaultProjectForFilesGlob(options.allowDefaultProject); + + TSSERVER_PROJECT_SERVICE ??= createProjectService({ + options, + ...settings, + }); + + return TSSERVER_PROJECT_SERVICE; +} diff --git a/packages/typescript-estree/src/parseSettings/index.ts b/packages/typescript-estree/src/parseSettings/index.ts index 1ea208210e0a..f4d771a8a4bb 100644 --- a/packages/typescript-estree/src/parseSettings/index.ts +++ b/packages/typescript-estree/src/parseSettings/index.ts @@ -1,6 +1,6 @@ +import type { ProjectServiceAndMetadata } from '@typescript-eslint/project-service'; import type * as ts from 'typescript'; -import type { ProjectServiceSettings } from '../create-program/createProjectService'; import type { CanonicalPath } from '../create-program/shared'; import type { TSESTree } from '../ts-estree'; import type { CacheLike } from './ExpiringCache'; @@ -120,7 +120,7 @@ export interface MutableParseSettings { /** * TypeScript server to power program creation. */ - projectService: ProjectServiceSettings | undefined; + projectService: ProjectServiceAndMetadata | undefined; /** * Whether to add the `range` property to AST nodes. diff --git a/packages/typescript-estree/src/parser-options.ts b/packages/typescript-estree/src/parser-options.ts index d3f8c8649fc5..a1841a828d48 100644 --- a/packages/typescript-estree/src/parser-options.ts +++ b/packages/typescript-estree/src/parser-options.ts @@ -9,8 +9,6 @@ import type * as ts from 'typescript'; import type { TSESTree, TSESTreeToTSNode, TSNode, TSToken } from './ts-estree'; -export type { ProjectServiceOptions } from '@typescript-eslint/types'; - ////////////////////////////////////////////////////////// // MAKE SURE THIS IS KEPT IN SYNC WITH THE WEBSITE DOCS // ////////////////////////////////////////////////////////// diff --git a/packages/typescript-estree/src/useProgramFromProjectService.ts b/packages/typescript-estree/src/useProgramFromProjectService.ts index cf98e5523921..9a046ee2c907 100644 --- a/packages/typescript-estree/src/useProgramFromProjectService.ts +++ b/packages/typescript-estree/src/useProgramFromProjectService.ts @@ -1,10 +1,11 @@ +import type { ProjectServiceAndMetadata as ProjectServiceAndMetadata } from '@typescript-eslint/project-service'; + import debug from 'debug'; import { minimatch } from 'minimatch'; import path from 'node:path'; import util from 'node:util'; import * as ts from 'typescript'; -import type { ProjectServiceSettings } from './create-program/createProjectService'; import type { ASTAndDefiniteProgram, ASTAndNoProgram, @@ -55,7 +56,7 @@ function openClientFileFromProjectService( isDefaultProjectAllowed: boolean, filePathAbsolute: string, parseSettings: Readonly, - serviceSettings: ProjectServiceSettings, + serviceAndSettings: ProjectServiceAndMetadata, ): ts.server.OpenConfiguredProjectResult { const opened = openClientFileAndMaybeReload(); @@ -107,7 +108,7 @@ function openClientFileFromProjectService( defaultProjectMatchedFiles.add(filePathAbsolute); if ( defaultProjectMatchedFiles.size > - serviceSettings.maximumDefaultProjectFileMatchCount + serviceAndSettings.maximumDefaultProjectFileMatchCount ) { const filePrintLimit = 20; const filesToPrint = [...defaultProjectMatchedFiles].slice( @@ -118,7 +119,7 @@ function openClientFileFromProjectService( defaultProjectMatchedFiles.size - filesToPrint.length; throw new Error( - `Too many files (>${serviceSettings.maximumDefaultProjectFileMatchCount}) have matched the default project.${DEFAULT_PROJECT_FILES_ERROR_EXPLANATION} + `Too many files (>${serviceAndSettings.maximumDefaultProjectFileMatchCount}) have matched the default project.${DEFAULT_PROJECT_FILES_ERROR_EXPLANATION} Matching files: ${filesToPrint.map(file => `- ${file}`).join('\n')} ${truncatedFileCount ? `...and ${truncatedFileCount} more files\n` : ''} @@ -131,7 +132,7 @@ If you absolutely need more files included, set parserOptions.projectService.max return opened; function openClientFile(): ts.server.OpenConfiguredProjectResult { - return serviceSettings.service.openClientFile( + return serviceAndSettings.service.openClientFile( filePathAbsolute, parseSettings.codeFullText, /* scriptKind */ undefined, @@ -152,13 +153,13 @@ If you absolutely need more files included, set parserOptions.projectService.max !opened.configFileName && !parseSettings.singleRun && !isDefaultProjectAllowed && - performance.now() - serviceSettings.lastReloadTimestamp > + performance.now() - serviceAndSettings.lastReloadTimestamp > RELOAD_THROTTLE_MS ) { log('No config file found; reloading project service and retrying.'); - serviceSettings.service.reloadProjects(); + serviceAndSettings.service.reloadProjects(); opened = openClientFile(); - serviceSettings.lastReloadTimestamp = performance.now(); + serviceAndSettings.lastReloadTimestamp = performance.now(); } return opened; @@ -192,13 +193,13 @@ function createNoProgramWithProjectService( function retrieveASTAndProgramFor( filePathAbsolute: string, parseSettings: Readonly, - serviceSettings: ProjectServiceSettings, + serviceAndSettings: ProjectServiceAndMetadata, ): ASTAndDefiniteProgram | undefined { log('Retrieving script info and then program for: %s', filePathAbsolute); - const scriptInfo = serviceSettings.service.getScriptInfo(filePathAbsolute); + const scriptInfo = serviceAndSettings.service.getScriptInfo(filePathAbsolute); /* eslint-disable @typescript-eslint/no-non-null-assertion */ - const program = serviceSettings.service + const program = serviceAndSettings.service .getDefaultProjectForFile(scriptInfo!.fileName, true)! .getLanguageService(/*ensureSynchronized*/ true) .getProgram(); @@ -215,38 +216,41 @@ function retrieveASTAndProgramFor( } export function useProgramFromProjectService( - settings: ProjectServiceSettings, + serviceAndSettings: ProjectServiceAndMetadata, parseSettings: Readonly, hasFullTypeInformation: boolean, defaultProjectMatchedFiles: Set, ): ASTAndProgram | undefined; export function useProgramFromProjectService( - settings: ProjectServiceSettings, + serviceAndSettings: ProjectServiceAndMetadata, parseSettings: Readonly, hasFullTypeInformation: true, defaultProjectMatchedFiles: Set, ): ASTAndDefiniteProgram | undefined; export function useProgramFromProjectService( - settings: ProjectServiceSettings, + serviceAndSettings: ProjectServiceAndMetadata, parseSettings: Readonly, hasFullTypeInformation: false, defaultProjectMatchedFiles: Set, ): ASTAndNoProgram | undefined; export function useProgramFromProjectService( - serviceSettings: ProjectServiceSettings, + serviceAndSettings: ProjectServiceAndMetadata, parseSettings: Readonly, hasFullTypeInformation: boolean, defaultProjectMatchedFiles: Set, ): ASTAndProgram | undefined { // NOTE: triggers a full project reload when changes are detected updateExtraFileExtensions( - serviceSettings.service, + serviceAndSettings.service, parseSettings.extraFileExtensions, ); // We don't canonicalize the filename because it caused a performance regression. // See https://github.com/typescript-eslint/typescript-eslint/issues/8519 - const filePathAbsolute = absolutify(parseSettings.filePath, serviceSettings); + const filePathAbsolute = absolutify( + parseSettings.filePath, + serviceAndSettings, + ); log( 'Opening project service file for: %s at absolute path %s', parseSettings.filePath, @@ -259,7 +263,7 @@ export function useProgramFromProjectService( ); const isDefaultProjectAllowed = filePathMatchedBy( filePathRelative, - serviceSettings.allowDefaultProject, + serviceAndSettings.allowDefaultProject, ); // Type-aware linting is disabled for this file. @@ -268,7 +272,7 @@ export function useProgramFromProjectService( return createNoProgramWithProjectService( filePathAbsolute, parseSettings, - serviceSettings.service, + serviceAndSettings.service, ); } @@ -284,7 +288,7 @@ export function useProgramFromProjectService( isDefaultProjectAllowed, filePathAbsolute, parseSettings, - serviceSettings, + serviceAndSettings, ); log('Opened project service file: %o', opened); @@ -292,17 +296,20 @@ export function useProgramFromProjectService( return retrieveASTAndProgramFor( filePathAbsolute, parseSettings, - serviceSettings, + serviceAndSettings, ); } function absolutify( filePath: string, - serviceSettings: ProjectServiceSettings, + serviceAndSettings: ProjectServiceAndMetadata, ): string { return path.isAbsolute(filePath) ? filePath - : path.join(serviceSettings.service.host.getCurrentDirectory(), filePath); + : path.join( + serviceAndSettings.service.host.getCurrentDirectory(), + filePath, + ); } function filePathMatchedBy( diff --git a/packages/typescript-estree/tests/lib/createParseSettings.test.ts b/packages/typescript-estree/tests/lib/createParseSettings.test.ts index 846210391076..ccb210fd8dbd 100644 --- a/packages/typescript-estree/tests/lib/createParseSettings.test.ts +++ b/packages/typescript-estree/tests/lib/createParseSettings.test.ts @@ -2,8 +2,8 @@ import { createParseSettings } from '../../src/parseSettings/createParseSettings const projectService = { service: true }; -vi.mock('../../src/create-program/createProjectService.js', () => ({ - createProjectService: (): typeof projectService => projectService, +vi.mock('@typescript-eslint/project-service', () => ({ + createProjectService: () => projectService, })); describe(createParseSettings, () => { diff --git a/packages/typescript-estree/tests/lib/createProjectService.test.ts b/packages/typescript-estree/tests/lib/createProjectService.test.ts deleted file mode 100644 index af67dd38a024..000000000000 --- a/packages/typescript-estree/tests/lib/createProjectService.test.ts +++ /dev/null @@ -1,379 +0,0 @@ -import debug from 'debug'; -import * as ts from 'typescript'; - -import { createProjectService } from '../../src/create-program/createProjectService.js'; -import { getParsedConfigFile } from '../../src/create-program/getParsedConfigFile.js'; - -const mockGetParsedConfigFile = vi.mocked(getParsedConfigFile); - -vi.mock( - import('../../src/create-program/getParsedConfigFile.js'), - async importOriginal => { - const actual = await importOriginal(); - - return { - ...actual, - getParsedConfigFile: vi.fn(actual.getParsedConfigFile), - }; - }, -); - -vi.mock( - import('../../src/create-program/createProjectService.js'), - async importOriginal => { - const actual = await importOriginal(); - - vi.spyOn( - ts.server.ProjectService.prototype, - 'setCompilerOptionsForInferredProjects', - ); - - vi.spyOn(ts.server.ProjectService.prototype, 'setHostConfiguration'); - - return { - ...actual, - createProjectService: vi - .fn(actual.createProjectService) - .mockImplementation((...args) => { - const projectServiceSettings = actual.createProjectService(...args); - const service = - projectServiceSettings.service as typeof projectServiceSettings.service & { - eventHandler: ts.server.ProjectServiceEventHandler | undefined; - }; - - if (service.eventHandler) { - service.eventHandler({ - eventName: ts.server.ProjectLoadingStartEvent, - } as ts.server.ProjectLoadingStartEvent); - } - - return projectServiceSettings; - }), - }; - }, -); - -describe(createProjectService, () => { - const processStderrWriteSpy = vi - .spyOn(process.stderr, 'write') - .mockImplementation(() => true); - - beforeEach(() => { - mockGetParsedConfigFile.mockReturnValue({ - errors: [], - fileNames: [], - options: {}, - }); - }); - - afterEach(() => { - vi.clearAllMocks(); - }); - - afterAll(() => { - vi.restoreAllMocks(); - }); - - it('sets allowDefaultProject when options.allowDefaultProject is defined', () => { - const allowDefaultProject = ['./*.js']; - const settings = createProjectService( - { allowDefaultProject }, - undefined, - undefined, - ); - - expect(settings.allowDefaultProject).toBe(allowDefaultProject); - }); - - it('does not set allowDefaultProject when options.allowDefaultProject is not defined', () => { - const settings = createProjectService(undefined, undefined, undefined); - - assert.isUndefined(settings.allowDefaultProject); - }); - - it('does not throw an error when options.defaultProject is not provided and getParsedConfigFile throws a diagnostic error', () => { - mockGetParsedConfigFile.mockImplementation(() => { - throw new Error('tsconfig.json(1,1): error TS1234: Oh no!'); - }); - - expect(() => - createProjectService( - { - allowDefaultProject: ['file.js'], - }, - undefined, - undefined, - ), - ).not.toThrow(); - }); - - it('throws an error with a relative path when options.defaultProject is set to a relative path and getParsedConfigFile throws a diagnostic error', () => { - mockGetParsedConfigFile.mockImplementation(() => { - throw new Error('./tsconfig.eslint.json(1,1): error TS1234: Oh no!'); - }); - - expect(() => - createProjectService( - { - allowDefaultProject: ['file.js'], - defaultProject: './tsconfig.eslint.json', - }, - undefined, - undefined, - ), - ).toThrow( - /Could not read project service default project '\.\/tsconfig.eslint.json': .+ error TS1234: Oh no!/, - ); - }); - - it('throws an error with a local path when options.defaultProject is set to a local path and getParsedConfigFile throws a diagnostic error', () => { - mockGetParsedConfigFile.mockImplementation(() => { - throw new Error('./tsconfig.eslint.json(1,1): error TS1234: Oh no!'); - }); - - expect(() => - createProjectService( - { - allowDefaultProject: ['file.js'], - defaultProject: 'tsconfig.eslint.json', - }, - undefined, - undefined, - ), - ).toThrow( - /Could not read project service default project 'tsconfig.eslint.json': .+ error TS1234: Oh no!/, - ); - }); - - it('throws an error when options.defaultProject is set and getParsedConfigFile throws an environment error', () => { - mockGetParsedConfigFile.mockImplementation(() => { - throw new Error( - '`getParsedConfigFile` is only supported in a Node-like environment.', - ); - }); - - expect(() => - createProjectService( - { - allowDefaultProject: ['file.js'], - defaultProject: 'tsconfig.json', - }, - undefined, - undefined, - ), - ).toThrow( - "Could not read project service default project 'tsconfig.json': `getParsedConfigFile` is only supported in a Node-like environment.", - ); - }); - - it('uses the default project compiler options when options.defaultProject is set and getParsedConfigFile succeeds', async () => { - const compilerOptions: ts.CompilerOptions = { strict: true }; - mockGetParsedConfigFile.mockReturnValueOnce({ - errors: [], - fileNames: [], - options: compilerOptions, - }); - - const defaultProject = 'tsconfig.eslint.json'; - - const { service } = createProjectService( - { - allowDefaultProject: ['file.js'], - defaultProject, - }, - undefined, - undefined, - ); - - expect( - service.setCompilerOptionsForInferredProjects, - ).toHaveBeenCalledExactlyOnceWith(compilerOptions); - - expect(mockGetParsedConfigFile).toHaveBeenCalledExactlyOnceWith( - (await import('typescript/lib/tsserverlibrary.js')).default, - defaultProject, - undefined, - ); - }); - - it('uses tsconfigRootDir as getParsedConfigFile projectDirectory when provided', async () => { - const compilerOptions: ts.CompilerOptions = { strict: true }; - const tsconfigRootDir = 'path/to/repo'; - mockGetParsedConfigFile.mockReturnValueOnce({ - errors: [], - fileNames: [], - options: compilerOptions, - }); - - const { service } = createProjectService( - { - allowDefaultProject: ['file.js'], - }, - undefined, - tsconfigRootDir, - ); - - expect( - service.setCompilerOptionsForInferredProjects, - ).toHaveBeenCalledExactlyOnceWith(compilerOptions); - - expect(mockGetParsedConfigFile).toHaveBeenCalledExactlyOnceWith( - (await import('typescript/lib/tsserverlibrary.js')).default, - 'tsconfig.json', - tsconfigRootDir, - ); - }); - - it('uses the default projects error debugger for error messages when enabled', () => { - const { service } = createProjectService(undefined, undefined, undefined); - debug.enable('typescript-eslint:typescript-estree:tsserver:err'); - const enabled = service.logger.loggingEnabled(); - service.logger.msg('foo', ts.server.Msg.Err); - debug.disable(); - - expect(enabled).toBe(true); - expect(processStderrWriteSpy).toHaveBeenCalledExactlyOnceWith( - expect.stringMatching( - /^.*typescript-eslint:typescript-estree:tsserver:err foo\n$/, - ), - ); - }); - - it('does not use the default projects error debugger for error messages when disabled', () => { - const { service } = createProjectService(undefined, undefined, undefined); - const enabled = service.logger.loggingEnabled(); - service.logger.msg('foo', ts.server.Msg.Err); - - expect(enabled).toBe(false); - expect(processStderrWriteSpy).not.toHaveBeenCalled(); - }); - - it('uses the default projects info debugger for info messages when enabled', () => { - const { service } = createProjectService(undefined, undefined, undefined); - debug.enable('typescript-eslint:typescript-estree:tsserver:info'); - const enabled = service.logger.loggingEnabled(); - service.logger.info('foo'); - debug.disable(); - - expect(enabled).toBe(true); - expect(processStderrWriteSpy).toHaveBeenCalledExactlyOnceWith( - expect.stringMatching( - /^.*typescript-eslint:typescript-estree:tsserver:info foo\n$/, - ), - ); - }); - - it('does not use the default projects info debugger for info messages when disabled', () => { - const { service } = createProjectService(undefined, undefined, undefined); - const enabled = service.logger.loggingEnabled(); - service.logger.info('foo'); - - expect(enabled).toBe(false); - expect(processStderrWriteSpy).not.toHaveBeenCalled(); - }); - - it('uses the default projects perf debugger for perf messages when enabled', () => { - const { service } = createProjectService(undefined, undefined, undefined); - debug.enable('typescript-eslint:typescript-estree:tsserver:perf'); - const enabled = service.logger.loggingEnabled(); - service.logger.perftrc('foo'); - debug.disable(); - - expect(enabled).toBe(true); - expect(processStderrWriteSpy).toHaveBeenCalledExactlyOnceWith( - expect.stringMatching( - /^.*typescript-eslint:typescript-estree:tsserver:perf foo\n$/, - ), - ); - }); - - it('does not use the default projects perf debugger for perf messages when disabled', () => { - const { service } = createProjectService(undefined, undefined, undefined); - const enabled = service.logger.loggingEnabled(); - service.logger.perftrc('foo'); - - expect(enabled).toBe(false); - expect(processStderrWriteSpy).not.toHaveBeenCalled(); - }); - - it('enables all log levels for the default projects logger', () => { - const { service } = createProjectService(undefined, undefined, undefined); - - expect(service.logger.hasLevel(ts.server.LogLevel.terse)).toBe(true); - expect(service.logger.hasLevel(ts.server.LogLevel.normal)).toBe(true); - expect(service.logger.hasLevel(ts.server.LogLevel.requestTime)).toBe(true); - expect(service.logger.hasLevel(ts.server.LogLevel.verbose)).toBe(true); - }); - - it('does not return a log filename with the default projects logger', () => { - const { service } = createProjectService(undefined, undefined, undefined); - - assert.isUndefined(service.logger.getLogFileName()); - }); - - it('uses the default projects event debugger for event handling when enabled', () => { - debug.enable('typescript-eslint:typescript-estree:tsserver:event'); - createProjectService(undefined, undefined, undefined); - debug.disable(); - - expect(processStderrWriteSpy).toHaveBeenCalledExactlyOnceWith( - expect.stringMatching( - /^.*typescript-eslint:typescript-estree:tsserver:event { eventName: 'projectLoadingStart' }\n$/, - ), - ); - }); - - it('does not use the default projects event debugger for event handling when disabled', () => { - createProjectService(undefined, undefined, undefined); - - expect(processStderrWriteSpy).not.toHaveBeenCalled(); - }); - - it('provides a stub require to the host system when loadTypeScriptPlugins is falsy', () => { - const { service } = createProjectService({}, undefined, undefined); - - const required = service.host.require?.('', ''); - - expect(required).toStrictEqual({ - error: { - message: - 'TypeScript plugins are not required when using parserOptions.projectService.', - }, - module: undefined, - }); - }); - - it('does not provide a require to the host system when loadTypeScriptPlugins is truthy', async () => { - const { service } = createProjectService( - { - loadTypeScriptPlugins: true, - }, - undefined, - undefined, - ); - - expect(service.host.require).toBe( - ( - await vi.importActual>>( - 'typescript/lib/tsserverlibrary.js', - ) - ).sys.require, - ); - }); - - it('sets a host configuration', () => { - const { service } = createProjectService( - { - allowDefaultProject: ['file.js'], - }, - undefined, - undefined, - ); - - expect(service.setHostConfiguration).toHaveBeenCalledExactlyOnceWith({ - preferences: { - includePackageJsonAutoImports: 'off', - }, - }); - }); -}); diff --git a/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts b/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts index c156392d3693..e07add99d30e 100644 --- a/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts +++ b/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts @@ -1,10 +1,11 @@ +import type { + ProjectServiceAndMetadata, + TypeScriptProjectService, +} from '@typescript-eslint/project-service'; + import path from 'node:path'; import * as ts from 'typescript'; -import type { - ProjectServiceSettings, - TypeScriptProjectService, -} from '../../src/create-program/createProjectService'; import type { ParseSettings } from '../../src/parseSettings'; import { useProgramFromProjectService } from '../../src/useProgramFromProjectService'; @@ -65,7 +66,7 @@ const mockParseSettings = { } as ParseSettings; const createProjectServiceSettings = < - T extends Partial, + T extends Partial, >( settings: T, ) => ({ diff --git a/packages/typescript-estree/tests/lib/validateDefaultProjectForFilesGlob.test.ts b/packages/typescript-estree/tests/lib/validateDefaultProjectForFilesGlob.test.ts index 9eccb60f8cc1..043724755b7b 100644 --- a/packages/typescript-estree/tests/lib/validateDefaultProjectForFilesGlob.test.ts +++ b/packages/typescript-estree/tests/lib/validateDefaultProjectForFilesGlob.test.ts @@ -1,4 +1,4 @@ -import { validateDefaultProjectForFilesGlob } from '../../src/create-program/validateDefaultProjectForFilesGlob'; +import { validateDefaultProjectForFilesGlob } from '../../src/create-program/validateDefaultProjectForFilesGlob.js'; describe(validateDefaultProjectForFilesGlob, () => { it('does not throw when options.allowDefaultProject is an empty array', () => { diff --git a/packages/typescript-estree/tsconfig.build.json b/packages/typescript-estree/tsconfig.build.json index e935e6c4e028..53a73a2cf5ec 100644 --- a/packages/typescript-estree/tsconfig.build.json +++ b/packages/typescript-estree/tsconfig.build.json @@ -2,6 +2,12 @@ "extends": "../../tsconfig.build.json", "compilerOptions": {}, "references": [ + { + "path": "../project-service/tsconfig.build.json" + }, + { + "path": "../tsconfig-utils/tsconfig.build.json" + }, { "path": "../visitor-keys/tsconfig.build.json" }, diff --git a/packages/typescript-estree/tsconfig.json b/packages/typescript-estree/tsconfig.json index 7b899170369f..77cec8e6ba10 100644 --- a/packages/typescript-estree/tsconfig.json +++ b/packages/typescript-estree/tsconfig.json @@ -3,6 +3,12 @@ "files": [], "include": [], "references": [ + { + "path": "../project-service" + }, + { + "path": "../tsconfig-utils" + }, { "path": "../visitor-keys" }, diff --git a/packages/website-eslint/build.mts b/packages/website-eslint/build.mts index 6a98bbb0556f..ccb6606e34d8 100644 --- a/packages/website-eslint/build.mts +++ b/packages/website-eslint/build.mts @@ -93,6 +93,7 @@ async function buildPackage(name: string, file: string): Promise { setup(build): void { build.onLoad( makeFilter([ + '/getParsedConfigFile.ts', '/ts-eslint/ESLint.ts', '/ts-eslint/RuleTester.ts', '/ts-eslint/CLIEngine.ts', diff --git a/packages/website/docusaurus.config.mts b/packages/website/docusaurus.config.mts index 3d66c81baa90..3fb7fe565efa 100644 --- a/packages/website/docusaurus.config.mts +++ b/packages/website/docusaurus.config.mts @@ -368,28 +368,32 @@ const config: Config = { onBrokenMarkdownLinks: 'throw', organizationName: 'typescript-eslint', plugins: [ - ...['ast-spec', 'type-utils'].map(packageName => [ - 'docusaurus-plugin-typedoc', - { - entryPoints: [`../${packageName}/src/index.ts`], - enumMembersFormat: 'table', - exclude: '**/*.d.ts', - excludeExternals: true, - groupOrder: ['Functions', 'Variables', '*'], - hidePageTitle: true, - id: `typedoc-generated-${packageName}`, - indexFormat: 'table', - out: `../../docs/packages/${packageName}/generated`, - outputFileStrategy: 'modules', - parametersFormat: 'table', - plugin: [require.resolve('./tools/typedoc-plugin-no-inherit-fork.mjs')], - propertiesFormat: 'table', - readme: 'none', - tsconfig: `../${packageName}/tsconfig.json`, - typeDeclarationFormat: 'table', - useCodeBlocks: true, - }, - ]), + ...['ast-spec', 'project-service', 'tsconfig-utils', 'type-utils'].map( + packageName => [ + 'docusaurus-plugin-typedoc', + { + entryPoints: [`../${packageName}/src/index.ts`], + enumMembersFormat: 'table', + exclude: '**/*.d.ts', + excludeExternals: true, + groupOrder: ['Functions', 'Variables', '*'], + hidePageTitle: true, + id: `typedoc-generated-${packageName}`, + indexFormat: 'table', + out: `../../docs/packages/${packageName}/generated`, + outputFileStrategy: 'modules', + parametersFormat: 'table', + plugin: [ + require.resolve('./tools/typedoc-plugin-no-inherit-fork.mjs'), + ], + propertiesFormat: 'table', + readme: 'none', + tsconfig: `../${packageName}/tsconfig.json`, + typeDeclarationFormat: 'table', + useCodeBlocks: true, + }, + ], + ), require.resolve('./webpack.plugin'), ['@docusaurus/plugin-content-docs', pluginContentDocsOptions], ['@docusaurus/plugin-pwa', pluginPwaOptions], diff --git a/packages/website/sidebars/sidebar.base.js b/packages/website/sidebars/sidebar.base.js index b0d55ed91ffb..689a5bb14202 100644 --- a/packages/website/sidebars/sidebar.base.js +++ b/packages/website/sidebars/sidebar.base.js @@ -103,8 +103,10 @@ module.exports = { 'packages/eslint-plugin', 'packages/eslint-plugin-tslint', 'packages/parser', + 'packages/project-service', 'packages/rule-tester', 'packages/scope-manager', + 'packages/tsconfig-utils', { collapsible: false, items: ['packages/type-utils/type-or-value-specifier'], diff --git a/tsconfig.json b/tsconfig.json index 5a3d4d28b9e8..ef9f265fd580 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,6 +11,7 @@ { "path": "./packages/eslint-plugin-internal" }, { "path": "./packages/integration-tests" }, { "path": "./packages/parser" }, + { "path": "./packages/project-service" }, { "path": "./packages/rule-schema-to-typescript-types" }, { "path": "./packages/rule-tester" }, { "path": "./packages/scope-manager" }, @@ -22,6 +23,7 @@ { "path": "./packages/visitor-keys" }, { "path": "./packages/website" }, { "path": "./packages/website-eslint" }, + { "path": "./packages/tsconfig-utils" }, { "path": "./tsconfig.repo-config-files.json" } ] } diff --git a/yarn.lock b/yarn.lock index 83d544efa9b7..09f7355bb869 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5493,6 +5493,16 @@ __metadata: languageName: unknown linkType: soft +"@typescript-eslint/project-service@8.32.1, @typescript-eslint/project-service@workspace:packages/project-service": + version: 0.0.0-use.local + resolution: "@typescript-eslint/project-service@workspace:packages/project-service" + dependencies: + "@typescript-eslint/tsconfig-utils": ^8.32.1 + "@typescript-eslint/types": ^8.32.1 + debug: ^4.3.4 + languageName: unknown + linkType: soft + "@typescript-eslint/rule-schema-to-typescript-types@8.32.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" @@ -5547,6 +5557,14 @@ __metadata: languageName: unknown linkType: soft +"@typescript-eslint/tsconfig-utils@8.32.1, @typescript-eslint/tsconfig-utils@^8.32.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": + version: 0.0.0-use.local + resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" + peerDependencies: + typescript: ">=4.8.4 <5.9.0" + languageName: unknown + linkType: soft + "@typescript-eslint/type-utils@8.32.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" @@ -5648,6 +5666,8 @@ __metadata: resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 + "@typescript-eslint/project-service": 8.32.1 + "@typescript-eslint/tsconfig-utils": 8.32.1 "@typescript-eslint/types": 8.32.1 "@typescript-eslint/visitor-keys": 8.32.1 "@vitest/coverage-v8": ^3.1.3 From a8f8b81ea9523f0c4ac1dfe9c7114731acf513a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Ossa?= Date: Mon, 26 May 2025 11:00:55 -0300 Subject: [PATCH 013/283] docs: fix misleading `return-await` options and config group (#11227) * docs: fix RulesTable `actualRecommended` The `getActualRecommended` function was returning 'recommended' when `docs.recommended` property was an object. This led to an incorrect value for rule return-await. * docs: fixed `return-await` misleading default options Closes: #11102 --- .../insertions/insertNewRuleReferences.ts | 10 +++++--- .../src/components/RulesTable/index.tsx | 24 +++++-------------- .../theme/MDXComponents/RuleAttributes.tsx | 23 +++++++++++------- 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/packages/website/plugins/generated-rule-docs/insertions/insertNewRuleReferences.ts b/packages/website/plugins/generated-rule-docs/insertions/insertNewRuleReferences.ts index 5c934e2f025e..89230d62a2fb 100644 --- a/packages/website/plugins/generated-rule-docs/insertions/insertNewRuleReferences.ts +++ b/packages/website/plugins/generated-rule-docs/insertions/insertNewRuleReferences.ts @@ -190,9 +190,13 @@ function getRuleDefaultOptions(page: RuleDocsPage): string { return typeof recommended === 'object' ? [ - `const defaultOptionsRecommended: Options = ${defaults};`, - '', - '// These options are merged on top of the recommended defaults', + ...(recommended.recommended + ? [ + `const defaultOptionsRecommended: Options = ${defaults};`, + '', + '// These options are merged on top of the recommended defaults', + ] + : []), `const defaultOptionsStrict: Options = ${JSON.stringify(recommended.strict)};`, ].join('\n') : `const defaultOptions: Options = ${defaults};`; diff --git a/packages/website/src/components/RulesTable/index.tsx b/packages/website/src/components/RulesTable/index.tsx index 1825fefcb02d..6f25e27e951d 100644 --- a/packages/website/src/components/RulesTable/index.tsx +++ b/packages/website/src/components/RulesTable/index.tsx @@ -10,6 +10,7 @@ import React, { useMemo } from 'react'; import type { HistorySelector } from '../../hooks/useHistorySelector'; import { useHistorySelector } from '../../hooks/useHistorySelector'; +import { getRecommendationWithEmoji } from '../../theme/MDXComponents/RuleAttributes'; import { CONFIG_EMOJI, DEPRECATED_RULE_EMOJI, @@ -35,9 +36,9 @@ function interpolateCode( function getActualRecommended({ docs, -}: RulesMeta[number]): RuleRecommendation | undefined { +}: RulesMeta[number]): ['', ''] | [string, RuleRecommendation] { const recommended = docs.recommended; - return typeof recommended === 'object' ? 'recommended' : recommended; + return recommended ? getRecommendationWithEmoji(recommended) : ['', '']; } function RuleRow({ @@ -50,7 +51,7 @@ function RuleRow({ } const { deprecated, fixable, hasSuggestions } = rule; const { extendsBaseRule, requiresTypeChecking } = rule.docs; - const actualRecommended = getActualRecommended(rule); + const [emoji, actualRecommended] = getActualRecommended(rule); return (
diff --git a/packages/website/src/components/RulesTable/styles.module.css b/packages/website/src/components/RulesTable/styles.module.css index 3ffcec037609..606453e07ac6 100644 --- a/packages/website/src/components/RulesTable/styles.module.css +++ b/packages/website/src/components/RulesTable/styles.module.css @@ -145,3 +145,9 @@ text-align: center; cursor: default; } + +.ruleNameWrapper { + display: inline-flex; + align-items: center; + gap: 0.5rem; +} diff --git a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx index 0465e126aaad..ec1aa2d1d7d0 100644 --- a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx +++ b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx @@ -155,6 +155,18 @@ export function RuleAttributes({ name }: { name: string }): React.ReactNode { }); } + if (rule.docs.frozen) { + features.push({ + children: ( + <> + This rule is currently frozen{' '} + and is not accepting feature requests. + + ), + emoji: '❄️', + }); + } + return (
{features.map(feature => ( From d8ca5ef54aa7fa4d14004dd1084eac9546b1f71e Mon Sep 17 00:00:00 2001 From: Victor Genaev Date: Mon, 8 Sep 2025 16:25:42 +0200 Subject: [PATCH 182/283] fix(eslint-plugin): [no-deprecated] should report deprecated exports and reexports (#11359) * fix(eslint-plugin): add support of exports/reexports to no-deprecated rule * Disable an introduced lint complaint --------- Co-authored-by: Josh Goldberg --- .../eslint-plugin/src/rules/no-deprecated.ts | 37 ++++++-- .../tests/fixtures/deprecated.ts | 5 ++ .../tests/rules/no-deprecated.test.ts | 84 +++++++++++++++++++ packages/typescript-eslint/src/index.ts | 1 + 4 files changed, 122 insertions(+), 5 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-deprecated.ts b/packages/eslint-plugin/src/rules/no-deprecated.ts index 880708a866c3..71b333488b55 100644 --- a/packages/eslint-plugin/src/rules/no-deprecated.ts +++ b/packages/eslint-plugin/src/rules/no-deprecated.ts @@ -162,17 +162,17 @@ export default createRule({ } } - function isInsideExportOrImport(node: TSESTree.Node): boolean { + function isInsideImport(node: TSESTree.Node): boolean { let current = node; while (true) { switch (current.type) { - case AST_NODE_TYPES.ExportAllDeclaration: - case AST_NODE_TYPES.ExportNamedDeclaration: case AST_NODE_TYPES.ImportDeclaration: return true; case AST_NODE_TYPES.ArrowFunctionExpression: + case AST_NODE_TYPES.ExportAllDeclaration: + case AST_NODE_TYPES.ExportNamedDeclaration: case AST_NODE_TYPES.BlockStatement: case AST_NODE_TYPES.ClassDeclaration: case AST_NODE_TYPES.TSInterfaceDeclaration: @@ -366,11 +366,12 @@ export default createRule({ } function checkIdentifier(node: IdentifierLike): void { - if (isDeclaration(node) || isInsideExportOrImport(node)) { + if (isDeclaration(node) || isInsideImport(node)) { return; } const reason = getDeprecationReason(node); + if (reason == null) { return; } @@ -440,7 +441,33 @@ export default createRule({ } return { - Identifier: checkIdentifier, + Identifier(node): void { + const { parent } = node; + + if ( + parent.type === AST_NODE_TYPES.ExportNamedDeclaration || + parent.type === AST_NODE_TYPES.ExportAllDeclaration + ) { + return; + } + + if (parent.type === AST_NODE_TYPES.ExportSpecifier) { + // only deal with the alias (exported) side, not the local binding + if (parent.exported !== node) { + return; + } + + const symbol = services.getSymbolAtLocation(node); + const aliasDeprecation = getJsDocDeprecation(symbol); + + if (aliasDeprecation != null) { + return; + } + } + + // whether it's a plain identifier or the exported alias + checkIdentifier(node); + }, JSXIdentifier(node): void { if (node.parent.type !== AST_NODE_TYPES.JSXClosingElement) { checkIdentifier(node); diff --git a/packages/eslint-plugin/tests/fixtures/deprecated.ts b/packages/eslint-plugin/tests/fixtures/deprecated.ts index 2302eabd3f54..b8dc49fcf16d 100644 --- a/packages/eslint-plugin/tests/fixtures/deprecated.ts +++ b/packages/eslint-plugin/tests/fixtures/deprecated.ts @@ -36,6 +36,11 @@ export { ClassWithDeprecatedConstructor as ReexportedClassWithDeprecatedConstructor, }; +/** @deprecated Reason */ +export type T = { a: string }; + +export type U = { b: string }; + /** @deprecated */ export default { foo: 1, diff --git a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts index 6231f9404944..e5a0937f4264 100644 --- a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts +++ b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts @@ -222,6 +222,12 @@ ruleTester.run('no-deprecated', rule, { default as ts, } from 'typescript'; `, + ` + export { deprecatedFunction as 'bur' } from './deprecated'; + `, + ` + export { 'deprecatedFunction' } from './deprecated'; + `, ` namespace A { /** @deprecated */ @@ -329,6 +335,12 @@ ruleTester.run('no-deprecated', rule, { } ; `, + ` + export { + /** @deprecated */ + foo, + }; + `, { code: ` /** @deprecated */ @@ -3274,5 +3286,77 @@ exists('/foo'); }, ], }, + { + code: ` + import { deprecatedFunction } from './deprecated'; + + export { deprecatedFunction }; + `, + errors: [ + { + column: 18, + endColumn: 36, + endLine: 4, + line: 4, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + export { deprecatedFunction } from './deprecated'; + `, + errors: [ + { + column: 18, + endColumn: 36, + endLine: 2, + line: 2, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + export type { T, U } from './deprecated'; + `, + errors: [ + { + column: 23, + endColumn: 24, + endLine: 2, + line: 2, + messageId: 'deprecatedWithReason', + }, + ], + }, + { + code: ` + export { default as foo } from './deprecated'; + `, + errors: [ + { + column: 29, + endColumn: 32, + endLine: 2, + line: 2, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + export { deprecatedFunction as bar } from './deprecated'; + `, + errors: [ + { + column: 40, + endColumn: 43, + endLine: 2, + line: 2, + messageId: 'deprecated', + }, + ], + }, ], }); diff --git a/packages/typescript-eslint/src/index.ts b/packages/typescript-eslint/src/index.ts index 02197940789a..c369d3605d2c 100644 --- a/packages/typescript-eslint/src/index.ts +++ b/packages/typescript-eslint/src/index.ts @@ -223,6 +223,7 @@ export default { }; export { + // eslint-disable-next-line @typescript-eslint/no-deprecated config, type ConfigWithExtends, type InfiniteDepthConfigWithExtends, From bd8ed8d7c5c94c02e26274393d3f691e10939a77 Mon Sep 17 00:00:00 2001 From: mdm317 Date: Mon, 8 Sep 2025 23:27:02 +0900 Subject: [PATCH 183/283] fix(eslint-plugin): [prefer-return-this-type] don't report an error when returning a union type that includes a classType (#11432) * fix: Add logic when returning a union type. * test: add test * Math.random() --------- Co-authored-by: Josh Goldberg --- .../src/rules/prefer-return-this-type.ts | 9 ++++ .../rules/prefer-return-this-type.test.ts | 49 +++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts index 7d7b14044cfb..ef5733fd47ff 100644 --- a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts +++ b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts @@ -1,6 +1,7 @@ import type { TSESTree } from '@typescript-eslint/utils'; import { AST_NODE_TYPES } from '@typescript-eslint/utils'; +import { isUnionType } from 'ts-api-utils'; import * as ts from 'typescript'; import { createRule, forEachReturnStatement, getParserServices } from '../util'; @@ -116,6 +117,14 @@ export default createRule({ return; } + if ( + isUnionType(type) && + type.types.some(typePart => typePart === classType) + ) { + hasReturnClassType = true; + return true; + } + return; }); diff --git a/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts b/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts index 5b372350059f..d0ed5d1a9c9b 100644 --- a/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts @@ -98,6 +98,19 @@ class Foo { ` class Foo { f?: string; +} + `, + ` +declare const valueUnion: BaseUnion | string; + +class BaseUnion { + f(): BaseUnion | string { + if (Math.random()) { + return this; + } + + return valueUnion; + } } `, ], @@ -395,6 +408,42 @@ class Animal { console.log("I'm moving!"); return this; } +} + `, + }, + { + code: ` +declare const valueUnion: number | string; + +class BaseUnion { + f(): BaseUnion | string { + if (Math.random()) { + return this; + } + + return valueUnion; + } +} + `, + errors: [ + { + column: 8, + endColumn: 17, + line: 5, + messageId: 'useThisType', + }, + ], + output: ` +declare const valueUnion: number | string; + +class BaseUnion { + f(): this | string { + if (Math.random()) { + return this; + } + + return valueUnion; + } } `, }, From 4f44a6e19b10a5166631a1f11eb3c96ec861fae0 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 8 Sep 2025 08:30:57 -0600 Subject: [PATCH 184/283] feat(typescript-estree): disallow empty type parameter/argument lists (#11563) * disallow empty type parameter/argument list * whoops, other case * make error range neat --- .../snapshots/1-TSESTree-Error.shot | 5 ++- .../snapshots/3-Alignment-Error.shot | 2 +- .../fixture.ts | 1 + .../snapshots/1-Babel-Error.shot | 3 ++ .../snapshots/1-TSESTree-Error.shot | 7 +++++ .../snapshots/2-Alignment-Error.shot | 3 ++ .../snapshots/2-Babel-Error.shot | 8 +++++ .../snapshots/3-Alignment-Error.shot | 4 +++ .../snapshots/1-TSESTree-Error.shot | 5 ++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 5 ++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 5 ++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 5 ++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 5 ++- .../snapshots/3-Alignment-Error.shot | 2 +- .../fixture.ts | 3 ++ .../snapshots/1-Babel-Error.shot | 3 ++ .../snapshots/1-TSESTree-Error.shot | 9 ++++++ .../snapshots/2-Alignment-Error.shot | 3 ++ .../snapshots/2-Babel-Error.shot | 10 ++++++ .../snapshots/3-Alignment-Error.shot | 4 +++ .../snapshots/1-TSESTree-Error.shot | 7 ++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 7 ++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 6 +++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 7 ++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 8 ++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 7 ++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 8 ++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 8 ++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 7 ++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../fixtures-with-differences-errors.shot | 15 --------- .../eslint-plugin/src/rules/array-type.ts | 2 +- .../tests/rules/array-type.test.ts | 31 ------------------- .../rules/method-signature-style.test.ts | 12 +++---- .../no-unnecessary-type-arguments.test.ts | 7 ++--- packages/typescript-estree/src/convert.ts | 19 +++++++++--- 48 files changed, 178 insertions(+), 91 deletions(-) create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/1-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/2-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/3-Alignment-Error.shot diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/1-TSESTree-Error.shot index 697d82b45d5b..1d0cd5a24a14 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-extends-type-param > TSESTree - Error`] -NO ERROR +TSError +> 1 | class C extends D<> {} + | ^^ Type argument list cannot be empty. + 2 | diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/3-Alignment-Error.shot index 5797ee061aed..773b51b14128 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-extends-type-param > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/fixture.ts new file mode 100644 index 000000000000..14098aa86e59 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/fixture.ts @@ -0,0 +1 @@ +class C< /* empty */ > {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/1-Babel-Error.shot new file mode 100644 index 000000000000..a14c3c54cac7 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/1-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration _error_ missing-type-param Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (1:7)]`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..25404a5d9562 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-type-param-with-comment > TSESTree - Error`] +TSError +> 1 | class C< /* empty */ > {} + | ^^^^^^^^^^^^^^^ Type parameter list cannot be empty. + 2 | diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/2-Alignment-Error.shot new file mode 100644 index 000000000000..49567ea7a7b5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/2-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration _error_ missing-type-param Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..d50c7992d392 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-type-param-with-comment > Babel - Error`] +BabelError +> 1 | class C< /* empty */ > {} + | ^ Type parameter list cannot be empty. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..0d5857532795 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-type-param-with-comment > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot index 656005eda876..241ee319116c 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-type-param > TSESTree - Error`] -NO ERROR +TSError +> 1 | class C<> {} + | ^^ Type parameter list cannot be empty. + 2 | diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot index 1a694a67920e..9d29521b804d 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-type-param > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot index febea1b1603a..0e4268f529cf 100644 --- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > missing-type-param > TSESTree - Error`] -NO ERROR +TSError +> 1 | function foo<>() {} + | ^^ Type parameter list cannot be empty. + 2 | diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot index 190ac10d0bdd..046a008ac8ee 100644 --- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > missing-type-param > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot index 86e87930550c..1ce9f3a6510a 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > missing-type-param > TSESTree - Error`] -NO ERROR +TSError +> 1 | declare function foo<>(): void; + | ^^ Type parameter list cannot be empty. + 2 | diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot index 2bda9d5029bb..19cdf1fa465f 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > missing-type-param > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot index 894a7a320645..906a02b805dc 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-type-param > TSESTree - Error`] -NO ERROR +TSError +> 1 | interface F<> {} + | ^^ Type parameter list cannot be empty. + 2 | diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot index 79866f6f1284..59f909d1ef4f 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-type-param > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/1-TSESTree-Error.shot index aa1e2269c016..c09a3a767483 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > missing-type-parameter > TSESTree - Error`] -NO ERROR +TSError +> 1 | type T<> = 1; + | ^^ Type parameter list cannot be empty. + 2 | diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/3-Alignment-Error.shot index a4210c2854d7..513e0d5efdee 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > missing-type-parameter > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/fixture.ts new file mode 100644 index 000000000000..1b6ae87f6359 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +foo< /* empty */ >(); diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-Babel-Error.shot new file mode 100644 index 000000000000..4992c1bda8ba --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-call-expression Babel - Error 1`] = `[SyntaxError: Unexpected token (3:4)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..33b566c2ad26 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-call-expression-with-comment > TSESTree - Error`] +TSError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | foo< /* empty */ >(); + | ^^^^^^^^^^^^^^^ Type argument list cannot be empty. + 4 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Alignment-Error.shot new file mode 100644 index 000000000000..c7ddaf4d3507 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-call-expression Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..8ea146fad19d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-call-expression-with-comment > Babel - Error`] +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | foo< /* empty */ >(); + | ^ Unexpected token (3:17) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..6e7b21bf1776 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-call-expression-with-comment > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-TSESTree-Error.shot index fa76bcceec4c..2bc9a5f6b7c7 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-call-expression > TSESTree - Error`] -NO ERROR +TSError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | foo<>(); + | ^^ Type argument list cannot be empty. + 4 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/3-Alignment-Error.shot index 6cd8bffbdf9b..e42614b0c09e 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-call-expression > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-TSESTree-Error.shot index 04397c1ad1f6..398387294483 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-new-expression > TSESTree - Error`] -NO ERROR +TSError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | new Foo<>() + | ^^ Type argument list cannot be empty. + 4 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/3-Alignment-Error.shot index d2b55f055473..704d3be4ffe4 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-new-expression > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-TSESTree-Error.shot index e49d52208b33..ca475faf4bcb 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments > TSESTree - Error`] -NO ERROR +TSError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | const foo: Foo<> + | ^^ Type argument list cannot be empty. diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/3-Alignment-Error.shot index 85b0b7246e10..7e8871022446 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot index f77a6fda39cf..4f12d12b51de 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-arrow-function > TSESTree - Error`] -NO ERROR +TSError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | function f1<>() {} + | ^^ Type parameter list cannot be empty. + 4 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/3-Alignment-Error.shot index ff94d062b9d7..84a2d786eff3 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-arrow-function > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-TSESTree-Error.shot index 2546fb018409..b9c00c6592d0 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-constructor > TSESTree - Error`] -NO ERROR +TSError + 2 | + 3 | class foo { +> 4 | constructor<>() {} + | ^^ Type parameter list cannot be empty. + 5 | } + 6 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/3-Alignment-Error.shot index 958c1dec19b5..99acc7c21d77 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-constructor > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot index 40cee72976cb..fa912f209747 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-expression > TSESTree - Error`] -NO ERROR +TSError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | const foo = function<>() {} + | ^^ Type parameter list cannot be empty. + 4 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/3-Alignment-Error.shot index defbf77fcf62..1b64cd4e9668 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-expression > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-TSESTree-Error.shot index 3f66104ff937..bcc1d1c1ea7d 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-method-signature > TSESTree - Error`] -NO ERROR +TSError + 2 | + 3 | interface foo { +> 4 | test<>(); + | ^^ Type parameter list cannot be empty. + 5 | } + 6 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/3-Alignment-Error.shot index 78a1922357aa..42b81315e508 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-method-signature > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-TSESTree-Error.shot index 6cdb099d73e4..ceec3f99b420 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-method > TSESTree - Error`] -NO ERROR +TSError + 2 | + 3 | class foo { +> 4 | test<>() {} + | ^^ Type parameter list cannot be empty. + 5 | } + 6 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/3-Alignment-Error.shot index 5c8dfc4b3d35..d6d8837d6520 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-method > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot index c1b25cba23a7..5bf4050773dc 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters > TSESTree - Error`] -NO ERROR +TSError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | function f1<>() {} + | ^^ Type parameter list cannot be empty. + 4 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot index 4fd1ec55af88..a525062b1e95 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters > Error Alignment`] -Babel errored but TSESTree didn't +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 04b14e7a3730..303daa8ed915 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -4,15 +4,9 @@ exports[`AST Fixtures > List fixtures with Error differences`] { "Babel errored but TSESTree didn't": [ "declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/fixture.ts", - "declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/fixture.ts", - "declaration/ClassDeclaration/fixtures/_error_/missing-type-param/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/_error_/assertion/fixture.ts", - "declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/fixture.ts", - "declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/fixture.ts", "declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/fixture.ts", - "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/fixture.ts", - "declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/fixture.ts", "declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/fixture.ts", "declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/fixture.ts", "declaration/VariableDeclaration/fixtures/_error_/const-id-no-init/fixture.ts", @@ -30,15 +24,6 @@ exports[`AST Fixtures > List fixtures with Error differences`] "legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/import-type-error/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts", diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts index 2375138d17fc..f53b61ce5bbe 100644 --- a/packages/eslint-plugin/src/rules/array-type.ts +++ b/packages/eslint-plugin/src/rules/array-type.ts @@ -242,7 +242,7 @@ export default createRule({ ? 'errorStringArraySimpleReadonly' : 'errorStringArraySimple'; - if (!typeParams || typeParams.length === 0) { + if (!typeParams) { // Create an 'any' array context.report({ node, diff --git a/packages/eslint-plugin/tests/rules/array-type.test.ts b/packages/eslint-plugin/tests/rules/array-type.test.ts index 0293bb97763b..65714e2928ea 100644 --- a/packages/eslint-plugin/tests/rules/array-type.test.ts +++ b/packages/eslint-plugin/tests/rules/array-type.test.ts @@ -1648,19 +1648,6 @@ function fooFunction(foo: ArrayClass[]) { options: [{ default: 'array' }], output: 'let x: any[];', }, - { - code: 'let x: Array<>;', - errors: [ - { - column: 8, - data: { className: 'Array', readonlyPrefix: '', type: 'any' }, - line: 1, - messageId: 'errorStringArray', - }, - ], - options: [{ default: 'array' }], - output: 'let x: any[];', - }, { code: 'let x: Array;', errors: [ @@ -1674,18 +1661,6 @@ function fooFunction(foo: ArrayClass[]) { options: [{ default: 'array-simple' }], output: 'let x: any[];', }, - { - code: 'let x: Array<>;', - errors: [ - { - column: 8, - line: 1, - messageId: 'errorStringArraySimple', - }, - ], - options: [{ default: 'array-simple' }], - output: 'let x: any[];', - }, { code: 'let x: Array = [1] as number[];', errors: [ @@ -2125,7 +2100,6 @@ type BrokenArray = { 'let yy: number[][] = [[4, 5], [6]];', 'let yy: Array> = [[4, 5], [6]];', ); - testOutput('array', 'let a: Array<>[] = [];', 'let a: any[][] = [];'); testOutput('array', 'let a: Array = [];', 'let a: any[][] = [];'); testOutput( 'array', @@ -2133,11 +2107,6 @@ type BrokenArray = { 'let a: any[][][] = [];', ); - testOutput( - 'generic', - 'let a: Array<>[] = [];', - 'let a: Array> = [];', - ); testOutput( 'generic', 'let a: Array = [];', diff --git a/packages/eslint-plugin/tests/rules/method-signature-style.test.ts b/packages/eslint-plugin/tests/rules/method-signature-style.test.ts index 2e60818a6064..9a7ab2b345c2 100644 --- a/packages/eslint-plugin/tests/rules/method-signature-style.test.ts +++ b/packages/eslint-plugin/tests/rules/method-signature-style.test.ts @@ -28,7 +28,7 @@ interface Test { `, ` interface Test { - 'f!': (/* b */ x: any /* c */) => void; + 'f!': (/* b */ x: any /* c */) => void; } `, ` @@ -82,7 +82,7 @@ interface Test { { code: ` interface Test { - 'f!'(/* b */ x: any /* c */): void; + 'f!'(/* b */ x: any /* c */): void; } `, options: ['method'], @@ -190,13 +190,13 @@ interface Test { { code: ` interface Test { - 'f!'(/* b */ x: any /* c */): void; + 'f!'(/* b */ x: any /* c */): void; } `, errors: [{ messageId: 'errorMethod' }], output: ` interface Test { - 'f!': (/* b */ x: any /* c */) => void; + 'f!': (/* b */ x: any /* c */) => void; } `, }, @@ -295,14 +295,14 @@ interface Test { { code: ` interface Test { - 'f!': (/* b */ x: any /* c */) => void; + 'f!': (/* b */ x: any /* c */) => void; } `, errors: [{ messageId: 'errorProperty' }], options: ['method'], output: ` interface Test { - 'f!'(/* b */ x: any /* c */): void; + 'f!'(/* b */ x: any /* c */): void; } `, }, diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts index 18e74325d7b6..9c2ab4fe84e8 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts @@ -16,12 +16,11 @@ const ruleTester = new RuleTester({ ruleTester.run('no-unnecessary-type-arguments', rule, { valid: [ - 'f<>();', + 'f();', 'f();', - 'expect().toBe<>();', - 'class Foo extends Bar<> {}', + 'class Foo extends Bar {}', 'class Foo extends Bar {}', - 'class Foo implements Bar<> {}', + 'class Foo implements Bar {}', 'class Foo implements Bar {}', ` function f() {} diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 150c0ee950ea..0ffc735c3a14 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -401,10 +401,12 @@ export class Converter { } } - #throwError(node: number | ts.Node, message: string): asserts node is never { + #throwError(node: number | ts.Node | TSESTree.Range, message: string): never { let start; let end; - if (typeof node === 'number') { + if (Array.isArray(node)) { + [start, end] = node; + } else if (typeof node === 'number') { start = end = node; } else { start = node.getStart(this.ast); @@ -415,7 +417,7 @@ export class Converter { } #throwUnlessAllowInvalidAST( - node: number | ts.Node, + node: number | ts.Node | TSESTree.Range, message: string, ): asserts node is never { if (!this.options.allowInvalidAST) { @@ -691,10 +693,15 @@ export class Converter { node: TSESTreeToTSNode, ): TSESTree.TSTypeParameterInstantiation { const greaterThanToken = findNextToken(typeArguments, this.ast, this.ast)!; + const range: TSESTree.Range = [typeArguments.pos - 1, greaterThanToken.end]; + + if (typeArguments.length === 0) { + this.#throwError(range, 'Type argument list cannot be empty.'); + } return this.createNode(node, { type: AST_NODE_TYPES.TSTypeParameterInstantiation, - range: [typeArguments.pos - 1, greaterThanToken.end], + range, params: typeArguments.map(typeArgument => this.convertChild(typeArgument), ), @@ -715,6 +722,10 @@ export class Converter { greaterThanToken.end, ]; + if (typeParameters.length === 0) { + this.#throwError(range, 'Type parameter list cannot be empty.'); + } + return { type: AST_NODE_TYPES.TSTypeParameterDeclaration, loc: getLocFor(range, this.ast), From ef9173c56fa488737bff9ab463338ea65cb83373 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 8 Sep 2025 17:04:12 +0000 Subject: [PATCH 185/283] chore(release): publish 8.43.0 --- CHANGELOG.md | 33 +++++++ packages/ast-spec/CHANGELOG.md | 12 +++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 30 ++++++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 12 +++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 12 +++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 12 +++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 12 +++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 12 +++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 17 ++++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 12 +++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 294 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1001310182fb..3565665f1cb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,36 @@ +## 8.43.0 (2025-09-08) + +### 🚀 Features + +- **typescript-estree:** disallow empty type parameter/argument lists ([#11563](https://github.com/typescript-eslint/typescript-eslint/pull/11563)) + +### 🩹 Fixes + +- **eslint-plugin:** [no-non-null-assertion] do not suggest optional chain on LHS of assignment ([#11489](https://github.com/typescript-eslint/typescript-eslint/pull/11489)) +- **eslint-plugin:** [no-unnecessary-type-conversion] only report ~~ on integer literal types ([#11517](https://github.com/typescript-eslint/typescript-eslint/pull/11517)) +- **eslint-plugin:** [consistent-type-exports] fix declaration shadowing ([#11457](https://github.com/typescript-eslint/typescript-eslint/pull/11457)) +- **eslint-plugin:** [no-floating-promises] allowForKnownSafeCalls now supports function names ([#11423](https://github.com/typescript-eslint/typescript-eslint/pull/11423), [#11430](https://github.com/typescript-eslint/typescript-eslint/pull/11430)) +- **eslint-plugin:** [no-deprecated] should report deprecated exports and reexports ([#11359](https://github.com/typescript-eslint/typescript-eslint/pull/11359)) +- **eslint-plugin:** [prefer-return-this-type] don't report an error when returning a union type that includes a classType ([#11432](https://github.com/typescript-eslint/typescript-eslint/pull/11432)) +- **rule-tester:** normalize paths before checking if they escape cwd ([#11525](https://github.com/typescript-eslint/typescript-eslint/pull/11525)) +- **scope-manager:** exclude Program from DefinitionBase node types ([#11469](https://github.com/typescript-eslint/typescript-eslint/pull/11469)) +- **type-utils:** add union type support to TypeOrValueSpecifier ([#11526](https://github.com/typescript-eslint/typescript-eslint/pull/11526)) +- **typescript-estree:** match filenames starting with a period when using glob in allowDefaultProject / ([#11537](https://github.com/typescript-eslint/typescript-eslint/pull/11537)) + +### ❤️ Thank You + +- Dima @dbarabashh +- Kirk Waiblinger @kirkwaiblinger +- mdm317 +- Nicolas Le Cam +- tao +- Victor Genaev @mainframev +- Yukihiro Hasegawa @y-hsgw +- 민감자(Minji Kim) @mouse0429 +- 송재욱 + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 49423544d22b..7ed7bba831d0 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.43.0 (2025-09-08) + +### 🚀 Features + +- **typescript-estree:** disallow empty type parameter/argument lists ([#11563](https://github.com/typescript-eslint/typescript-eslint/pull/11563)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) This was a version bump only for ast-spec to align it with other projects, there were no code changes. diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 3fa74192b434..dc67c399e45d 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.42.0", + "version": "8.43.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 6553f6fdfe46..ce4b358cad1b 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,33 @@ +## 8.43.0 (2025-09-08) + +### 🚀 Features + +- **typescript-estree:** disallow empty type parameter/argument lists ([#11563](https://github.com/typescript-eslint/typescript-eslint/pull/11563)) + +### 🩹 Fixes + +- **eslint-plugin:** [prefer-return-this-type] don't report an error when returning a union type that includes a classType ([#11432](https://github.com/typescript-eslint/typescript-eslint/pull/11432)) +- **eslint-plugin:** [no-deprecated] should report deprecated exports and reexports ([#11359](https://github.com/typescript-eslint/typescript-eslint/pull/11359)) +- **eslint-plugin:** [no-floating-promises] allowForKnownSafeCalls now supports function names ([#11423](https://github.com/typescript-eslint/typescript-eslint/pull/11423), [#11430](https://github.com/typescript-eslint/typescript-eslint/pull/11430)) +- **eslint-plugin:** [consistent-type-exports] fix declaration shadowing ([#11457](https://github.com/typescript-eslint/typescript-eslint/pull/11457)) +- **eslint-plugin:** [no-unnecessary-type-conversion] only report ~~ on integer literal types ([#11517](https://github.com/typescript-eslint/typescript-eslint/pull/11517)) +- **scope-manager:** exclude Program from DefinitionBase node types ([#11469](https://github.com/typescript-eslint/typescript-eslint/pull/11469)) +- **eslint-plugin:** [no-non-null-assertion] do not suggest optional chain on LHS of assignment ([#11489](https://github.com/typescript-eslint/typescript-eslint/pull/11489)) +- **type-utils:** add union type support to TypeOrValueSpecifier ([#11526](https://github.com/typescript-eslint/typescript-eslint/pull/11526)) + +### ❤️ Thank You + +- Dima @dbarabashh +- Kirk Waiblinger @kirkwaiblinger +- mdm317 +- tao +- Victor Genaev @mainframev +- Yukihiro Hasegawa @y-hsgw +- 민감자(Minji Kim) @mouse0429 +- 송재욱 + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) ### 🩹 Fixes diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 283b912e44ce..e86d12562509 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.42.0", + "version": "8.43.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.42.0", - "@typescript-eslint/type-utils": "8.42.0", - "@typescript-eslint/utils": "8.42.0", - "@typescript-eslint/visitor-keys": "8.42.0", + "@typescript-eslint/scope-manager": "8.43.0", + "@typescript-eslint/type-utils": "8.43.0", + "@typescript-eslint/utils": "8.43.0", + "@typescript-eslint/visitor-keys": "8.43.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.42.0", - "@typescript-eslint/rule-tester": "8.42.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.43.0", + "@typescript-eslint/rule-tester": "8.43.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.42.0", + "@typescript-eslint/parser": "^8.43.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index f0699726e8d7..80efaa535cbf 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.43.0 (2025-09-08) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 25b9494e7bb5..b152070d6d7d 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.42.0", + "version": "8.43.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.42.0", - "@typescript-eslint/types": "8.42.0", - "@typescript-eslint/typescript-estree": "8.42.0", - "@typescript-eslint/visitor-keys": "8.42.0", + "@typescript-eslint/scope-manager": "8.43.0", + "@typescript-eslint/types": "8.43.0", + "@typescript-eslint/typescript-estree": "8.43.0", + "@typescript-eslint/visitor-keys": "8.43.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 874fb6a1cb4f..1f306a50c759 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.43.0 (2025-09-08) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 213c332c8818..97b05cd5eed0 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.42.0", + "version": "8.43.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.42.0", - "@typescript-eslint/types": "^8.42.0", + "@typescript-eslint/tsconfig-utils": "^8.43.0", + "@typescript-eslint/types": "^8.43.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 5f273061627d..070d93a9ffa4 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.43.0 (2025-09-08) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index d9a9c1a9d62d..202c5811ec11 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.42.0", + "version": "8.43.0", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.42.0", - "@typescript-eslint/utils": "8.42.0", + "@typescript-eslint/type-utils": "8.43.0", + "@typescript-eslint/utils": "8.43.0", "natural-compare": "^1.4.0", "prettier": "3.6.2" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 3382f5b61dc8..d3d95f8f405a 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.43.0 (2025-09-08) + +### 🩹 Fixes + +- **rule-tester:** normalize paths before checking if they escape cwd ([#11525](https://github.com/typescript-eslint/typescript-eslint/pull/11525)) + +### ❤️ Thank You + +- Dima @dbarabashh + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 3e8f7d2e624e..1f93b49b727a 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.42.0", + "version": "8.43.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.42.0", - "@typescript-eslint/typescript-estree": "8.42.0", - "@typescript-eslint/utils": "8.42.0", + "@typescript-eslint/parser": "8.43.0", + "@typescript-eslint/typescript-estree": "8.43.0", + "@typescript-eslint/utils": "8.43.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 6f66a69047d6..b2fc59f25ead 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.43.0 (2025-09-08) + +### 🩹 Fixes + +- **scope-manager:** exclude Program from DefinitionBase node types ([#11469](https://github.com/typescript-eslint/typescript-eslint/pull/11469)) + +### ❤️ Thank You + +- Dima @dbarabashh + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 4bddb0326989..e3416d621b3c 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.42.0", + "version": "8.43.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.42.0", - "@typescript-eslint/visitor-keys": "8.42.0" + "@typescript-eslint/types": "8.43.0", + "@typescript-eslint/visitor-keys": "8.43.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.42.0", + "@typescript-eslint/typescript-estree": "8.43.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 6702a80306ee..91bede7256f5 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.43.0 (2025-09-08) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 581a2ac87076..fc5f1f667245 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.42.0", + "version": "8.43.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index cc2def818109..f76b267d9ee7 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.43.0 (2025-09-08) + +### 🩹 Fixes + +- **type-utils:** add union type support to TypeOrValueSpecifier ([#11526](https://github.com/typescript-eslint/typescript-eslint/pull/11526)) + +### ❤️ Thank You + +- Yukihiro Hasegawa @y-hsgw + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 6b5a34063b08..7f95c6572b5d 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.42.0", + "version": "8.43.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.42.0", - "@typescript-eslint/typescript-estree": "8.42.0", - "@typescript-eslint/utils": "8.42.0", + "@typescript-eslint/types": "8.43.0", + "@typescript-eslint/typescript-estree": "8.43.0", + "@typescript-eslint/utils": "8.43.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.42.0", + "@typescript-eslint/parser": "8.43.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index c23735280c72..25d996362475 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.43.0 (2025-09-08) + +### 🩹 Fixes + +- **scope-manager:** exclude Program from DefinitionBase node types ([#11469](https://github.com/typescript-eslint/typescript-eslint/pull/11469)) + +### ❤️ Thank You + +- Dima @dbarabashh + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 6f791504315b..890b838e2549 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.42.0", + "version": "8.43.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index fbc52575d507..1ffe823277da 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.43.0 (2025-09-08) + +### 🩹 Fixes + +- **eslint-plugin:** [no-deprecated] should report deprecated exports and reexports ([#11359](https://github.com/typescript-eslint/typescript-eslint/pull/11359)) + +### ❤️ Thank You + +- Victor Genaev @mainframev + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) ### 🚀 Features diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index f4d605563c98..b7ec11091d60 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.42.0", + "version": "8.43.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.42.0", - "@typescript-eslint/parser": "8.42.0", - "@typescript-eslint/typescript-estree": "8.42.0", - "@typescript-eslint/utils": "8.42.0" + "@typescript-eslint/eslint-plugin": "8.43.0", + "@typescript-eslint/parser": "8.43.0", + "@typescript-eslint/typescript-estree": "8.43.0", + "@typescript-eslint/utils": "8.43.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index c11a9eed239e..e0d097bc0f88 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,20 @@ +## 8.43.0 (2025-09-08) + +### 🚀 Features + +- **typescript-estree:** disallow empty type parameter/argument lists ([#11563](https://github.com/typescript-eslint/typescript-eslint/pull/11563)) + +### 🩹 Fixes + +- **typescript-estree:** match filenames starting with a period when using glob in allowDefaultProject / ([#11537](https://github.com/typescript-eslint/typescript-eslint/pull/11537)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger +- Nicolas Le Cam + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) This was a version bump only for typescript-estree to align it with other projects, there were no code changes. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index ff47e8b02713..283697eb4486 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.42.0", + "version": "8.43.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.42.0", - "@typescript-eslint/tsconfig-utils": "8.42.0", - "@typescript-eslint/types": "8.42.0", - "@typescript-eslint/visitor-keys": "8.42.0", + "@typescript-eslint/project-service": "8.43.0", + "@typescript-eslint/tsconfig-utils": "8.43.0", + "@typescript-eslint/types": "8.43.0", + "@typescript-eslint/visitor-keys": "8.43.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index c6af51658d4b..e6029c9e5864 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.43.0 (2025-09-08) + +### 🩹 Fixes + +- **scope-manager:** exclude Program from DefinitionBase node types ([#11469](https://github.com/typescript-eslint/typescript-eslint/pull/11469)) + +### ❤️ Thank You + +- Dima @dbarabashh + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index 3e8d5744d499..37c4c66a1aff 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.42.0", + "version": "8.43.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.42.0", - "@typescript-eslint/types": "8.42.0", - "@typescript-eslint/typescript-estree": "8.42.0" + "@typescript-eslint/scope-manager": "8.43.0", + "@typescript-eslint/types": "8.43.0", + "@typescript-eslint/typescript-estree": "8.43.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index f18689f963b1..34e4a4bbe64c 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.43.0 (2025-09-08) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.42.0 (2025-09-02) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 04e6678f79d6..69ad03182abe 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.42.0", + "version": "8.43.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.42.0", + "@typescript-eslint/types": "8.43.0", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 16472e11fb10..f041745c50c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5830,19 +5830,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.42.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.43.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.42.0 - "@typescript-eslint/rule-tester": 8.42.0 - "@typescript-eslint/scope-manager": 8.42.0 - "@typescript-eslint/type-utils": 8.42.0 - "@typescript-eslint/utils": 8.42.0 - "@typescript-eslint/visitor-keys": 8.42.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.43.0 + "@typescript-eslint/rule-tester": 8.43.0 + "@typescript-eslint/scope-manager": 8.43.0 + "@typescript-eslint/type-utils": 8.43.0 + "@typescript-eslint/utils": 8.43.0 + "@typescript-eslint/visitor-keys": 8.43.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5865,7 +5865,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.42.0 + "@typescript-eslint/parser": ^8.43.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -5881,14 +5881,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.42.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.43.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.42.0 - "@typescript-eslint/types": 8.42.0 - "@typescript-eslint/typescript-estree": 8.42.0 - "@typescript-eslint/visitor-keys": 8.42.0 + "@typescript-eslint/scope-manager": 8.43.0 + "@typescript-eslint/types": 8.43.0 + "@typescript-eslint/typescript-estree": 8.43.0 + "@typescript-eslint/visitor-keys": 8.43.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -5902,12 +5902,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.42.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.43.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.42.0 - "@typescript-eslint/types": ^8.42.0 + "@typescript-eslint/tsconfig-utils": ^8.43.0 + "@typescript-eslint/types": ^8.43.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -5918,12 +5918,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.42.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.43.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.42.0 - "@typescript-eslint/utils": 8.42.0 + "@typescript-eslint/type-utils": 8.43.0 + "@typescript-eslint/utils": 8.43.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -5934,15 +5934,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.42.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.43.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.42.0 - "@typescript-eslint/typescript-estree": 8.42.0 - "@typescript-eslint/utils": 8.42.0 + "@typescript-eslint/parser": 8.43.0 + "@typescript-eslint/typescript-estree": 8.43.0 + "@typescript-eslint/utils": 8.43.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5957,13 +5957,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.42.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.43.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.42.0 - "@typescript-eslint/typescript-estree": 8.42.0 - "@typescript-eslint/visitor-keys": 8.42.0 + "@typescript-eslint/types": 8.43.0 + "@typescript-eslint/typescript-estree": 8.43.0 + "@typescript-eslint/visitor-keys": 8.43.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -5974,7 +5974,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.42.0, @typescript-eslint/tsconfig-utils@^8.42.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.43.0, @typescript-eslint/tsconfig-utils@^8.43.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -5987,14 +5987,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.42.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.43.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.42.0 - "@typescript-eslint/types": 8.42.0 - "@typescript-eslint/typescript-estree": 8.42.0 - "@typescript-eslint/utils": 8.42.0 + "@typescript-eslint/parser": 8.43.0 + "@typescript-eslint/types": 8.43.0 + "@typescript-eslint/typescript-estree": 8.43.0 + "@typescript-eslint/utils": 8.43.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6009,7 +6009,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.42.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.42.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.43.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.43.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6082,15 +6082,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.42.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.43.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.42.0 - "@typescript-eslint/tsconfig-utils": 8.42.0 - "@typescript-eslint/types": 8.42.0 - "@typescript-eslint/visitor-keys": 8.42.0 + "@typescript-eslint/project-service": 8.43.0 + "@typescript-eslint/tsconfig-utils": 8.43.0 + "@typescript-eslint/types": 8.43.0 + "@typescript-eslint/visitor-keys": 8.43.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6108,14 +6108,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.42.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.43.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.42.0 - "@typescript-eslint/types": 8.42.0 - "@typescript-eslint/typescript-estree": 8.42.0 + "@typescript-eslint/scope-manager": 8.43.0 + "@typescript-eslint/types": 8.43.0 + "@typescript-eslint/typescript-estree": 8.43.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6127,11 +6127,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.42.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.43.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.42.0 + "@typescript-eslint/types": 8.43.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19359,10 +19359,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.42.0 - "@typescript-eslint/parser": 8.42.0 - "@typescript-eslint/typescript-estree": 8.42.0 - "@typescript-eslint/utils": 8.42.0 + "@typescript-eslint/eslint-plugin": 8.43.0 + "@typescript-eslint/parser": 8.43.0 + "@typescript-eslint/typescript-estree": 8.43.0 + "@typescript-eslint/utils": 8.43.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From 70c948c777a22db4731c22d0a55fba3ef9de302d Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Tue, 9 Sep 2025 12:32:50 -0600 Subject: [PATCH 186/283] chore: update vitest eslint plugin (#11585) --- eslint.config.mjs | 1 + package.json | 2 +- yarn.lock | 13 +++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 6f0bc78c5100..391214cb6184 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -380,6 +380,7 @@ export default defineConfig( '@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/no-unsafe-return': 'off', + 'vitest/hoisted-apis-on-top': 'error', 'vitest/no-alias-methods': 'error', 'vitest/no-disabled-tests': 'error', 'vitest/no-focused-tests': 'error', diff --git a/package.json b/package.json index 3edb1ac900d0..7ab91774e311 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "@typescript-eslint/typescript-estree": "workspace:^", "@typescript-eslint/utils": "workspace:^", "@vitest/coverage-v8": "^3.1.3", - "@vitest/eslint-plugin": "^1.1.44", + "@vitest/eslint-plugin": "^1.3.9", "console-fail-test": "^0.5.0", "cross-fetch": "^4.0.0", "cspell": "^9.0.0", diff --git a/yarn.lock b/yarn.lock index f041745c50c5..c3dd9862ecef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5957,7 +5957,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.43.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.43.0, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: @@ -6049,7 +6049,7 @@ __metadata: "@typescript-eslint/typescript-estree": "workspace:^" "@typescript-eslint/utils": "workspace:^" "@vitest/coverage-v8": ^3.1.3 - "@vitest/eslint-plugin": ^1.1.44 + "@vitest/eslint-plugin": ^1.3.9 console-fail-test: ^0.5.0 cross-fetch: ^4.0.0 cspell: ^9.0.0 @@ -6206,10 +6206,11 @@ __metadata: languageName: node linkType: hard -"@vitest/eslint-plugin@npm:^1.1.44": - version: 1.3.4 - resolution: "@vitest/eslint-plugin@npm:1.3.4" +"@vitest/eslint-plugin@npm:^1.3.9": + version: 1.3.9 + resolution: "@vitest/eslint-plugin@npm:1.3.9" dependencies: + "@typescript-eslint/scope-manager": ^8.41.0 "@typescript-eslint/utils": ^8.24.1 peerDependencies: eslint: ">= 8.57.0" @@ -6220,7 +6221,7 @@ __metadata: optional: true vitest: optional: true - checksum: 9cd8afc3a27ee247e3ebe9455f7c9df334824115459d640f38086121fd67142ee0523d9b30e55ce8dda7504d9c5cabaf80f351238fc64f33fc53ef92a59bba68 + checksum: 8d54a2026715c5966f9ff285b11ed3aad4873870ea9d3bc9a3d87b69cbf1725fdade2ddae489c20662f436c0de48019d79b5346391c642ecb3335470e9034448 languageName: node linkType: hard From 95c7287988696d16bd79b2f15c1d4d81f29cffc1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Sep 2025 07:22:02 -0400 Subject: [PATCH 187/283] fix(deps): update dependency @eslint-community/eslint-utils to v4.8.0 (#11589) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c3dd9862ecef..cc92c87e2ec5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3680,13 +3680,13 @@ __metadata: linkType: hard "@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0, @eslint-community/eslint-utils@npm:^4.5.1, @eslint-community/eslint-utils@npm:^4.7.0": - version: 4.7.0 - resolution: "@eslint-community/eslint-utils@npm:4.7.0" + version: 4.9.0 + resolution: "@eslint-community/eslint-utils@npm:4.9.0" dependencies: eslint-visitor-keys: ^3.4.3 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - checksum: b177e3b75c0b8d0e5d71f1c532edb7e40b31313db61f0c879f9bf19c3abb2783c6c372b5deb2396dab4432f2946b9972122ac682e77010376c029dfd0149c681 + checksum: ae9b98eea006d1354368804b0116b8b45017a4e47b486d1b9cfa048a8ed3dc69b9b074eb2b2acb14034e6897c24048fd42b6a6816d9dc8bb9daad79db7d478d2 languageName: node linkType: hard From 42527dfe3ca7e0e10b306849251db57b92e3e545 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Fri, 12 Sep 2025 16:12:07 -0600 Subject: [PATCH 188/283] chore: remove unnecessary nullThrows() (#11580) --- .../rules/prefer-string-starts-ends-with.ts | 17 ++++++----- .../src/util/explicitReturnTypeUtils.ts | 29 +++++-------------- 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts index ee946a4f85a0..39125b9dc891 100644 --- a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts +++ b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts @@ -1,4 +1,8 @@ -import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { + NodeWithParent, + TSESLint, + TSESTree, +} from '@typescript-eslint/utils'; import { RegExpParser } from '@eslint-community/regexpp'; import { AST_NODE_TYPES } from '@typescript-eslint/utils'; @@ -376,13 +380,10 @@ export default createRule({ yield fixer.removeRange([callNode.range[1], node.range[1]]); } - function getParent(node: TSESTree.Node): TSESTree.Node { - return nullThrows( - node.parent?.type === AST_NODE_TYPES.ChainExpression - ? node.parent.parent - : node.parent, - NullThrowsReasons.MissingParent, - ); + function getParent(node: NodeWithParent): TSESTree.Node { + return node.parent.type === AST_NODE_TYPES.ChainExpression + ? node.parent.parent + : node.parent; } return { diff --git a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts index 0e3b98ef7657..b9aeb65dbede 100644 --- a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts +++ b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts @@ -1,10 +1,6 @@ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; -import { - AST_NODE_TYPES, - ASTUtils, - ESLintUtils, -} from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, ASTUtils } from '@typescript-eslint/utils'; import { isConstructor, isSetter, isTypeAssertion } from './astUtils'; import { getFunctionHeadLoc } from './getFunctionHeadLoc'; @@ -210,19 +206,14 @@ export function isTypedFunctionExpression( node: FunctionExpression, options: Options, ): boolean { - const parent = ESLintUtils.nullThrows( - node.parent, - ESLintUtils.NullThrowsReasons.MissingParent, - ); - if (!options.allowTypedFunctionExpressions) { return false; } return ( - isTypedParent(parent, node) || - isPropertyOfObjectWithType(parent) || - isConstructorArgument(parent) + isTypedParent(node.parent, node) || + isPropertyOfObjectWithType(node.parent) || + isConstructorArgument(node.parent) ); } @@ -238,16 +229,12 @@ export function isValidFunctionExpressionReturnType( return true; } - const parent = ESLintUtils.nullThrows( - node.parent, - ESLintUtils.NullThrowsReasons.MissingParent, - ); if ( options.allowExpressions && - parent.type !== AST_NODE_TYPES.VariableDeclarator && - parent.type !== AST_NODE_TYPES.MethodDefinition && - parent.type !== AST_NODE_TYPES.ExportDefaultDeclaration && - parent.type !== AST_NODE_TYPES.PropertyDefinition + node.parent.type !== AST_NODE_TYPES.VariableDeclarator && + node.parent.type !== AST_NODE_TYPES.MethodDefinition && + node.parent.type !== AST_NODE_TYPES.ExportDefaultDeclaration && + node.parent.type !== AST_NODE_TYPES.PropertyDefinition ) { return true; } From c58ac3572e13a6d525a5e3704f729884b7f875d9 Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Mon, 15 Sep 2025 08:06:14 -0400 Subject: [PATCH 189/283] docs(utils): grammar (#11471) * fix: grammar * update * Update packages/utils/src/ts-eslint/eslint/FlatESLint.ts --------- Co-authored-by: Joshua Chen --- packages/utils/src/ts-eslint/Rule.ts | 2 +- packages/utils/src/ts-eslint/eslint/FlatESLint.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 49e461b89934..1a4920a3e79e 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -138,7 +138,7 @@ export interface RuleMetaData< /** * Specifies default options for the rule. If present, any user-provided options in their config will be merged on top of them recursively. * This merging will be applied directly to `context.options`. - * If you want backwards-compatible support for earlier ESLint version; consider using the top-level `defaultOptions` instead. + * If you want backwards-compatible support for earlier ESLint version, consider using the top-level `defaultOptions` instead. * * since ESLint 9.15.0 */ diff --git a/packages/utils/src/ts-eslint/eslint/FlatESLint.ts b/packages/utils/src/ts-eslint/eslint/FlatESLint.ts index 1861200f51b4..db140a033163 100644 --- a/packages/utils/src/ts-eslint/eslint/FlatESLint.ts +++ b/packages/utils/src/ts-eslint/eslint/FlatESLint.ts @@ -49,9 +49,13 @@ export namespace FlatESLint { */ ignorePatterns?: string[] | null; /** - * The path to a configuration file, overrides all configurations used with this instance. + * The path to a configuration file. Overrides all configurations used with this instance. * The options.overrideConfig option is applied after this option is applied. - * Searches for default config file when falsy; doesn't do any config file lookup when `true`; considered to be a config filename when a string. + * + * - When falsy, searches for default config file. + * - When `true`, does not do any config file lookup. + * - When a string, considered to be a config file name. + * * @default false */ overrideConfigFile?: boolean | string; From 85d8dea3e1ed04c6c885d8c6cc6c3caeeaca0ec6 Mon Sep 17 00:00:00 2001 From: Ronen Amiel Date: Mon, 15 Sep 2025 15:13:46 +0300 Subject: [PATCH 190/283] feat(eslint-plugin): [await-thenable] report invalid (non-promise) values passed to promise aggregator methods (#11267) * initial implementation * add promise.any * add missing test * wip * refactor, fix edge cases * add nested array test-case * missing coverage * Update packages/eslint-plugin/src/rules/await-thenable.ts Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> * use checker.isArrayLikeType for checking types that extend an array * code review comments * special case array literals * add ts-expect-error above tests with a type error * update lines missing code coverage --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .../eslint-plugin/src/rules/await-thenable.ts | 128 +++- .../src/util/isPromiseAggregatorMethod.ts | 41 ++ .../tests/rules/await-thenable.test.ts | 651 ++++++++++++++++++ 3 files changed, 819 insertions(+), 1 deletion(-) create mode 100644 packages/eslint-plugin/src/util/isPromiseAggregatorMethod.ts diff --git a/packages/eslint-plugin/src/rules/await-thenable.ts b/packages/eslint-plugin/src/rules/await-thenable.ts index 2ba4efbd0b06..8c84eacc8788 100644 --- a/packages/eslint-plugin/src/rules/await-thenable.ts +++ b/packages/eslint-plugin/src/rules/await-thenable.ts @@ -1,10 +1,13 @@ -import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint } from '@typescript-eslint/utils'; +import type * as ts from 'typescript'; +import { TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'ts-api-utils'; import { Awaitable, createRule, + getConstrainedTypeAtLocation, getFixOrSuggest, getParserServices, isAwaitKeyword, @@ -14,12 +17,14 @@ import { NullThrowsReasons, } from '../util'; import { getForStatementHeadLoc } from '../util/getForStatementHeadLoc'; +import { isPromiseAggregatorMethod } from '../util/isPromiseAggregatorMethod'; export type MessageId = | 'await' | 'awaitUsingOfNonAsyncDisposable' | 'convertToOrdinaryFor' | 'forAwaitOfNonAsyncIterable' + | 'invalidPromiseAggregatorInput' | 'removeAwait'; export default createRule<[], MessageId>({ @@ -39,6 +44,8 @@ export default createRule<[], MessageId>({ convertToOrdinaryFor: 'Convert to an ordinary `for...of` loop.', forAwaitOfNonAsyncIterable: 'Unexpected `for await...of` of a value that is not async iterable.', + invalidPromiseAggregatorInput: + 'Unexpected iterable of non-Promise (non-"Thenable") values passed to promise aggregator.', removeAwait: 'Remove unnecessary `await`.', }, schema: [], @@ -84,6 +91,53 @@ export default createRule<[], MessageId>({ } }, + CallExpression(node: TSESTree.CallExpression): void { + if (!isPromiseAggregatorMethod(context, services, node)) { + return; + } + + const argument = node.arguments.at(0); + + if (argument == null) { + return; + } + + if (argument.type === TSESTree.AST_NODE_TYPES.ArrayExpression) { + for (const element of argument.elements) { + if (element == null) { + continue; + } + + const type = getConstrainedTypeAtLocation(services, element); + const tsNode = services.esTreeNodeToTSNodeMap.get(element); + + if (containsNonAwaitableType(type, tsNode, checker)) { + context.report({ + node: element, + messageId: 'invalidPromiseAggregatorInput', + }); + } + } + + return; + } + + const type = getConstrainedTypeAtLocation(services, argument); + + if ( + isInvalidPromiseAggregatorInput( + checker, + services.esTreeNodeToTSNodeMap.get(argument), + type, + ) + ) { + context.report({ + node: argument, + messageId: 'invalidPromiseAggregatorInput', + }); + } + }, + 'ForOfStatement[await=true]'(node: TSESTree.ForOfStatement): void { const type = services.getTypeAtLocation(node.right); if (isTypeAnyType(type)) { @@ -176,3 +230,75 @@ export default createRule<[], MessageId>({ }; }, }); + +function isInvalidPromiseAggregatorInput( + checker: ts.TypeChecker, + node: ts.Node, + type: ts.Type, +): boolean { + // non array/tuple/iterable types already show up as a type error + if (!isIterable(type, checker)) { + return false; + } + + for (const part of tsutils.unionConstituents(type)) { + const valueTypes = getValueTypesOfArrayLike(part, checker); + + if (valueTypes != null) { + for (const typeArgument of valueTypes) { + if (containsNonAwaitableType(typeArgument, node, checker)) { + return true; + } + } + } + } + + return false; +} + +function getValueTypesOfArrayLike( + type: ts.Type, + checker: ts.TypeChecker, +): readonly ts.Type[] | null { + if (checker.isTupleType(type)) { + return checker.getTypeArguments(type); + } + + if (checker.isArrayLikeType(type)) { + return [ + nullThrows( + type.getNumberIndexType(), + 'number index type should exist on an array-like', + ), + ]; + } + + // `Iterable<...>` + if (tsutils.isTypeReference(type)) { + return checker.getTypeArguments(type).slice(0, 1); + } + + return null; +} + +function containsNonAwaitableType( + type: ts.Type, + node: ts.Node, + checker: ts.TypeChecker, +): boolean { + return tsutils + .unionConstituents(type) + .some( + typeArgumentPart => + needsToBeAwaited(checker, node, typeArgumentPart) === Awaitable.Never, + ); +} + +function isIterable(type: ts.Type, checker: ts.TypeChecker): boolean { + return tsutils + .unionConstituents(type) + .every( + part => + !!tsutils.getWellKnownSymbolPropertyOfType(part, 'iterator', checker), + ); +} diff --git a/packages/eslint-plugin/src/util/isPromiseAggregatorMethod.ts b/packages/eslint-plugin/src/util/isPromiseAggregatorMethod.ts new file mode 100644 index 000000000000..e5f9e67617d6 --- /dev/null +++ b/packages/eslint-plugin/src/util/isPromiseAggregatorMethod.ts @@ -0,0 +1,41 @@ +import type { + ParserServicesWithTypeInformation, + TSESTree, +} from '@typescript-eslint/utils'; +import type { RuleContext } from '@typescript-eslint/utils/ts-eslint'; + +import { + getConstrainedTypeAtLocation, + isPromiseConstructorLike, +} from '@typescript-eslint/type-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + +import { getStaticMemberAccessValue } from './misc'; + +const PROMISE_CONSTRUCTOR_ARRAY_METHODS = new Set([ + 'all', + 'allSettled', + 'race', + 'any', +]); + +export function isPromiseAggregatorMethod( + context: RuleContext, + services: ParserServicesWithTypeInformation, + node: TSESTree.CallExpression, +): boolean { + if (node.callee.type !== AST_NODE_TYPES.MemberExpression) { + return false; + } + + const staticAccessValue = getStaticMemberAccessValue(node.callee, context); + + if (!PROMISE_CONSTRUCTOR_ARRAY_METHODS.has(staticAccessValue)) { + return false; + } + + return isPromiseConstructorLike( + services.program, + getConstrainedTypeAtLocation(services, node.callee.object), + ); +} diff --git a/packages/eslint-plugin/tests/rules/await-thenable.test.ts b/packages/eslint-plugin/tests/rules/await-thenable.test.ts index e64f0a5f1f3c..f1729d908bdb 100644 --- a/packages/eslint-plugin/tests/rules/await-thenable.test.ts +++ b/packages/eslint-plugin/tests/rules/await-thenable.test.ts @@ -339,6 +339,353 @@ class C { } `, }, + + { + code: ` +// @ts-expect-error +Promise.all(); + `, + }, + { + code: ` +Promise.all([,]); + `, + }, + { + code: ` +declare const x: unknown; + +// @ts-expect-error +Promise.all(x); + `, + }, + { + code: ` +declare const x: any; +Promise.all(x); + `, + }, + + { + code: ` +declare const x: Array>; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Array> | Array>; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Array | Promise>; +Promise.all(x); + `, + }, + { + code: ` +function f(x: Array>) { + Promise.all(x); +} + `, + }, + { + code: ` +function f>(x: Array) { + Promise.all(x); +} + `, + }, + { + code: ` +declare const x: Array; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Array; +Promise.all(x); + `, + }, + { + code: ` +declare const x: number | Array>; + +// @ts-expect-error +Promise.all(x); + `, + }, + + { + code: ` +declare const x: [Promise, Promise]; +Promise.all(x); + `, + }, + { + code: ` +declare const x: [Promise] | [Promise]; +Promise.all(x); + `, + }, + { + code: ` +declare const x: [Promise | Promise]; +Promise.all(x); + `, + }, + { + code: ` +function f(x: [Promise]) { + Promise.all(x); +} + `, + }, + { + code: ` +function f>(x: [T]) { + Promise.all(x); +} + `, + }, + { + code: ` +declare const x: [unknown, any]; +Promise.all(x); + `, + }, + { + code: ` +declare const x: number | [Promise]; + +// @ts-expect-error +Promise.all(x); + `, + }, + + { + code: ` +declare const x: Iterable>; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Iterable> | Iterable>; + +// @ts-expect-error +Promise.all(x); + `, + }, + { + code: ` +declare const x: Iterable>; +Promise.all(x); + `, + }, + { + code: ` +function f(x: Iterable>) { + Promise.all(x); +} + `, + }, + { + code: ` +function f>(x: Iterable) { + Promise.all(x); +} + `, + }, + { + code: ` +declare const x: Iterable; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Iterable; +Promise.all(x); + `, + }, + { + code: ` +declare const x: number | Iterable>; + +// @ts-expect-error +Promise.all(x); + `, + }, + { + code: ` +declare const x: Iterable, number>; +Promise.all(x); + `, + }, + + { + code: ` +declare const x: Iterable> | Array>; +Promise.all(x); + `, + }, + { + code: ` +declare const x: + | Iterable> + | [Promise, Promise]; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Array> | [Promise, Promise]; +Promise.all(x); + `, + }, + + { + code: ` +// @ts-expect-error +Promise.all(1); + `, + }, + { + code: ` +declare const x: Promise; + +// @ts-expect-error +Promise.all(x); + `, + }, + { + code: ` +interface MyArray extends Array {} +declare const x: MyArray>; + +Promise.all(x); + `, + }, + { + code: ` +function* x() { + yield Promise.resolve(1); + yield Promise.resolve(2); + yield Promise.resolve(3); +} + +Promise.all(x()); + `, + }, + { + code: ` +function* x() { + yield 1 as unknown; +} + +Promise.all(x()); + `, + }, + { + code: ` +function* x() { + yield 1 as any; +} + +Promise.all(x()); + `, + }, + { + code: ` +declare const x: Generator>; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Generator; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Generator; +Promise.all(x); + `, + }, + { + code: ` +declare const x: ReadonlyArray>; +Promise.all(x); + `, + }, + { + code: ` +declare const x: ReadonlyArray; +Promise.all(x); + `, + }, + { + code: ` +declare const x: ReadonlyArray; +Promise.all(x); + `, + }, + { + code: ` +Promise.all([Promise.resolve(1), Promise.resolve(2), Promise.resolve(3)]); + `, + }, + { + code: ` +declare const _unknown_: unknown; + +Promise.all([ + _unknown_, + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), +]); + `, + }, + { + code: ` +declare const _any_: any; + +Promise.all([ + _any_, + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), +]); + `, + }, + { + code: ` +declare const _promise_: Promise; + +Promise.all([ + _promise_, + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), +]); + `, + }, + { + code: ` +Promise.all([ + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), + ...[Promise.resolve(4), Promise.resolve(5), Promise.resolve(6)], +]); + `, + }, ], invalid: [ @@ -786,5 +1133,309 @@ class C { }, ], }, + + { + code: ` +declare const x: Array; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Array | Array>; +Promise.race(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Array | Array; +Promise.allSettled(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Array>; +Promise.any(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + + { + code: ` +declare const x: [number]; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: [number] | [Promise]; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: [number | Promise]; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: [Promise, number]; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + + { + code: ` +declare const x: Iterable; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Iterable | Iterable>; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Iterable>; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + + { + code: ` +declare const x: Iterable | Array>; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Iterable> | [string, Promise]; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Array | [Promise, Promise]; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Array>>; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +interface MyArray extends Array {} +declare const x: MyArray, null>; + +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +function* x() { + yield 1; + yield 2; + yield 3; +} + +Promise.all(x()); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +function* x() { + yield 1 as number; +} + +Promise.all(x()); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +function* x() { + yield 1 as number | Promise; +} + +Promise.all(x()); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Generator; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: ReadonlyArray; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: ReadonlyArray>; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +Promise.all([Promise.resolve(1), 2, Promise.resolve(3)]); + `, + errors: [ + { + column: 34, + endColumn: 35, + line: 2, + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +Promise.all([1, 2, Promise.resolve(3)]); + `, + errors: [ + { + column: 14, + endColumn: 15, + line: 2, + messageId: 'invalidPromiseAggregatorInput', + }, + { + column: 17, + endColumn: 18, + line: 2, + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +Promise.all([...[1, 2, 3]]); + `, + errors: [ + { + column: 14, + endColumn: 26, + line: 2, + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, ], }); From a704bdbaa6498f380a7356a24bd0124b8404f314 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 11:37:49 -0400 Subject: [PATCH 191/283] chore(deps): update dependency stylelint to v16.24.0 (#11601) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index cc92c87e2ec5..3fd5198cbab3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10435,7 +10435,7 @@ __metadata: languageName: node linkType: hard -"file-entry-cache@npm:^10.1.3": +"file-entry-cache@npm:^10.1.4": version: 10.1.4 resolution: "file-entry-cache@npm:10.1.4" dependencies: @@ -18775,8 +18775,8 @@ __metadata: linkType: hard "stylelint@npm:^16.3.1": - version: 16.23.1 - resolution: "stylelint@npm:16.23.1" + version: 16.24.0 + resolution: "stylelint@npm:16.24.0" dependencies: "@csstools/css-parser-algorithms": ^3.0.5 "@csstools/css-tokenizer": ^3.0.4 @@ -18791,7 +18791,7 @@ __metadata: debug: ^4.4.1 fast-glob: ^3.3.3 fastest-levenshtein: ^1.0.16 - file-entry-cache: ^10.1.3 + file-entry-cache: ^10.1.4 global-modules: ^2.0.0 globby: ^11.1.0 globjoin: ^0.1.4 @@ -18818,7 +18818,7 @@ __metadata: write-file-atomic: ^5.0.1 bin: stylelint: bin/stylelint.mjs - checksum: e86bd662f3fa6b77c4fa6c72a8ba9fa0dcf46937dedd86a9fbc0e1193f55c4f26d4ae595990fa1e288d96f112859158094fa8566681ce6282e2bab33ec60c676 + checksum: b9a2926b4f1635c050d13c266cd017a3f7994b4b76aa22532b896ec600143a37d17d6d629c0a27b50a97ee0c62c2fad8b5796c643bbe612c5a473ed1b79deaa3 languageName: node linkType: hard From 2ed685770129c6c5465c01aa4fe784a88debf58c Mon Sep 17 00:00:00 2001 From: Moses Odutusin <48915357+thebolarin@users.noreply.github.com> Date: Mon, 15 Sep 2025 17:18:58 +0100 Subject: [PATCH 192/283] fix(eslint-plugin): [no-unnecessary-type-conversion] ignore enum members (#11490) * fix: enums in no-unnecessary-type-conversion * chore: fix lint issue --- .../src/rules/no-unnecessary-type-conversion.ts | 17 +++++++++++++++++ .../no-unnecessary-type-conversion.test.ts | 8 ++++++++ 2 files changed, 25 insertions(+) diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts index 088b8768b3af..d18f7617acfc 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts @@ -19,6 +19,18 @@ type MessageIds = | 'suggestSatisfies' | 'unnecessaryTypeConversion'; +function isEnumType(type: ts.Type): boolean { + return (type.getFlags() & ts.TypeFlags.EnumLike) !== 0; +} + +function isEnumMemberType(type: ts.Type): boolean { + const symbol = type.getSymbol(); + if (!symbol) { + return false; + } + return (symbol.flags & ts.SymbolFlags.EnumMember) !== 0; +} + export default createRule({ name: 'no-unnecessary-type-conversion', meta: { @@ -294,6 +306,11 @@ export default createRule({ ): void { const memberExpr = node.parent as TSESTree.MemberExpression; const type = getConstrainedTypeAtLocation(services, memberExpr.object); + + if (isEnumType(type) || isEnumMemberType(type)) { + return; + } + if (doesUnderlyingTypeMatchFlag(type, ts.TypeFlags.StringLike)) { const wrappingFixerParams = { node: memberExpr.parent, diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts index 50995fb3a90d..71f5e56e0d1a 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts @@ -97,6 +97,14 @@ ruleTester.run('no-unnecessary-type-conversion', rule, { '~~new Number();', 'Boolean(new Boolean());', '!!new Boolean();', + ` + enum CustomIds { + Id1 = 'id1', + Id2 = 'id2', + } + const customId = 'id1'; + const compareWithToString = customId === CustomIds.Id1.toString(); + `, ], invalid: [ From 684e63f2c60696cc0dddca9c7cbce927edaa263f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 12:20:32 -0400 Subject: [PATCH 193/283] chore(deps): update eslint monorepo to v9.35.0 (#11600) * fix(deps): update eslint monorepo to v9.35.0 * Bring in no-empty-function suggestions * Wait, it's a union --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Josh Goldberg --- .../tests/rules/no-empty-function.test.ts | 69 +++++++++++++++++++ .../eslint-plugin/typings/eslint-rules.d.ts | 2 +- yarn.lock | 20 +++--- 3 files changed, 80 insertions(+), 11 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/no-empty-function.test.ts b/packages/eslint-plugin/tests/rules/no-empty-function.test.ts index e3e5e39ccb90..4f36f96e584a 100644 --- a/packages/eslint-plugin/tests/rules/no-empty-function.test.ts +++ b/packages/eslint-plugin/tests/rules/no-empty-function.test.ts @@ -96,6 +96,16 @@ class Person { }, line: 3, messageId: 'unexpected', + suggestions: [ + { + messageId: 'suggestComment', + output: ` +class Person { + constructor(name: string) { /* empty */ } +} + `, + }, + ], }, ], }, @@ -113,6 +123,16 @@ class Person { }, line: 3, messageId: 'unexpected', + suggestions: [ + { + messageId: 'suggestComment', + output: ` +class Person { + otherMethod(name: string) { /* empty */ } +} + `, + }, + ], }, ], }, @@ -130,6 +150,16 @@ class Foo { }, line: 3, messageId: 'unexpected', + suggestions: [ + { + messageId: 'suggestComment', + output: ` +class Foo { + private constructor() { /* empty */ } +} + `, + }, + ], }, ], }, @@ -147,6 +177,16 @@ class Foo { }, line: 3, messageId: 'unexpected', + suggestions: [ + { + messageId: 'suggestComment', + output: ` +class Foo { + protected constructor() { /* empty */ } +} + `, + }, + ], }, ], }, @@ -162,6 +202,14 @@ function foo() {} }, line: 2, messageId: 'unexpected', + suggestions: [ + { + messageId: 'suggestComment', + output: ` +function foo() { /* empty */ } + `, + }, + ], }, ], }, @@ -180,6 +228,17 @@ class Foo { }, line: 4, messageId: 'unexpected', + suggestions: [ + { + messageId: 'suggestComment', + output: ` +class Foo { + @decorator() + foo() { /* empty */ } +} + `, + }, + ], }, ], }, @@ -197,6 +256,16 @@ class Foo extends Base { }, line: 3, messageId: 'unexpected', + suggestions: [ + { + messageId: 'suggestComment', + output: ` +class Foo extends Base { + override foo() { /* empty */ } +} + `, + }, + ], }, ], }, diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts index b7a830094823..589e2a8e4fb8 100644 --- a/packages/eslint-plugin/typings/eslint-rules.d.ts +++ b/packages/eslint-plugin/typings/eslint-rules.d.ts @@ -163,7 +163,7 @@ declare module 'eslint/lib/rules/no-empty-function' { import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< - 'unexpected', + 'suggestComment' | 'unexpected', [ { allow?: string[]; diff --git a/yarn.lock b/yarn.lock index 3fd5198cbab3..c0c1451746b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3679,7 +3679,7 @@ __metadata: languageName: node linkType: hard -"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0, @eslint-community/eslint-utils@npm:^4.5.1, @eslint-community/eslint-utils@npm:^4.7.0": +"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0, @eslint-community/eslint-utils@npm:^4.5.1, @eslint-community/eslint-utils@npm:^4.7.0, @eslint-community/eslint-utils@npm:^4.8.0": version: 4.9.0 resolution: "@eslint-community/eslint-utils@npm:4.9.0" dependencies: @@ -3762,10 +3762,10 @@ __metadata: languageName: node linkType: hard -"@eslint/js@npm:*, @eslint/js@npm:9.34.0, @eslint/js@npm:^9.26.0": - version: 9.34.0 - resolution: "@eslint/js@npm:9.34.0" - checksum: 933d4ba321b1abc83eecde40eb703871ce00f133eedec54cf928b7fedb61706174dd526997c3f151776922412e3d95cb3634f97ef7b5861b4908f9992f403a63 +"@eslint/js@npm:*, @eslint/js@npm:9.35.0, @eslint/js@npm:^9.26.0": + version: 9.35.0 + resolution: "@eslint/js@npm:9.35.0" + checksum: ea644f0b1abb4da49ba0cb61db4d039492e844d959e7127dd7c501aa27a256348496bce43334ecd3ca990c9a49fb3ea93d6729de0a79d216f63869236c153148 languageName: node linkType: hard @@ -9972,16 +9972,16 @@ __metadata: linkType: hard "eslint@npm:*, eslint@npm:^9.15.0, eslint@npm:^9.26.0": - version: 9.34.0 - resolution: "eslint@npm:9.34.0" + version: 9.35.0 + resolution: "eslint@npm:9.35.0" dependencies: - "@eslint-community/eslint-utils": ^4.2.0 + "@eslint-community/eslint-utils": ^4.8.0 "@eslint-community/regexpp": ^4.12.1 "@eslint/config-array": ^0.21.0 "@eslint/config-helpers": ^0.3.1 "@eslint/core": ^0.15.2 "@eslint/eslintrc": ^3.3.1 - "@eslint/js": 9.34.0 + "@eslint/js": 9.35.0 "@eslint/plugin-kit": ^0.3.5 "@humanfs/node": ^0.16.6 "@humanwhocodes/module-importer": ^1.0.1 @@ -10017,7 +10017,7 @@ __metadata: optional: true bin: eslint: bin/eslint.js - checksum: 6de97f6197774821a086783e1bd73b9518c4eb8896165e448a8bb2359142c63cad40faa5dc79bcdc28fab20b57e1376ccbb76a6ae081da5e94baa18d2d3b92fe + checksum: 45b12539f84d7ae474920f279b4a0f1e1074eaff152f6d2b6a5fb112174914853f18071876da6421c11d678319fd78745ea03ed56b6808d77f76397e488cde28 languageName: node linkType: hard From 77056f77e6fdca54b66ec692e5cefbd9f7a626dd Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 15 Sep 2025 17:04:30 +0000 Subject: [PATCH 194/283] chore(release): publish 8.44.0 --- CHANGELOG.md | 18 ++++ packages/ast-spec/CHANGELOG.md | 6 ++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 17 ++++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 6 ++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 213 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3565665f1cb7..aa5ceaaa6bea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +## 8.44.0 (2025-09-15) + +### 🚀 Features + +- **eslint-plugin:** [await-thenable] report invalid (non-promise) values passed to promise aggregator methods ([#11267](https://github.com/typescript-eslint/typescript-eslint/pull/11267)) + +### 🩹 Fixes + +- **deps:** update dependency @eslint-community/eslint-utils to v4.8.0 ([#11589](https://github.com/typescript-eslint/typescript-eslint/pull/11589)) +- **eslint-plugin:** [no-unnecessary-type-conversion] ignore enum members ([#11490](https://github.com/typescript-eslint/typescript-eslint/pull/11490)) + +### ❤️ Thank You + +- Moses Odutusin @thebolarin +- Ronen Amiel + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 7ed7bba831d0..4c7a8ba3e11c 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for ast-spec to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🚀 Features diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index dc67c399e45d..e89e369e0bbe 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.43.0", + "version": "8.44.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index ce4b358cad1b..b61c69fe769f 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,20 @@ +## 8.44.0 (2025-09-15) + +### 🚀 Features + +- **eslint-plugin:** [await-thenable] report invalid (non-promise) values passed to promise aggregator methods ([#11267](https://github.com/typescript-eslint/typescript-eslint/pull/11267)) + +### 🩹 Fixes + +- **eslint-plugin:** [no-unnecessary-type-conversion] ignore enum members ([#11490](https://github.com/typescript-eslint/typescript-eslint/pull/11490)) + +### ❤️ Thank You + +- Moses Odutusin @thebolarin +- Ronen Amiel + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🚀 Features diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index e86d12562509..d78a1182c1ba 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.43.0", + "version": "8.44.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.43.0", - "@typescript-eslint/type-utils": "8.43.0", - "@typescript-eslint/utils": "8.43.0", - "@typescript-eslint/visitor-keys": "8.43.0", + "@typescript-eslint/scope-manager": "8.44.0", + "@typescript-eslint/type-utils": "8.44.0", + "@typescript-eslint/utils": "8.44.0", + "@typescript-eslint/visitor-keys": "8.44.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.43.0", - "@typescript-eslint/rule-tester": "8.43.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.44.0", + "@typescript-eslint/rule-tester": "8.44.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.43.0", + "@typescript-eslint/parser": "^8.44.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 80efaa535cbf..8d1ea2c3c5a4 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index b152070d6d7d..19b621151505 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.43.0", + "version": "8.44.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.43.0", - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/typescript-estree": "8.43.0", - "@typescript-eslint/visitor-keys": "8.43.0", + "@typescript-eslint/scope-manager": "8.44.0", + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.0", + "@typescript-eslint/visitor-keys": "8.44.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 1f306a50c759..092a642891f9 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 97b05cd5eed0..da5b76225005 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.43.0", + "version": "8.44.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.43.0", - "@typescript-eslint/types": "^8.43.0", + "@typescript-eslint/tsconfig-utils": "^8.44.0", + "@typescript-eslint/types": "^8.44.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 070d93a9ffa4..7f895b5e5334 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 202c5811ec11..bbcbbfa3615f 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.43.0", + "version": "8.44.0", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.43.0", - "@typescript-eslint/utils": "8.43.0", + "@typescript-eslint/type-utils": "8.44.0", + "@typescript-eslint/utils": "8.44.0", "natural-compare": "^1.4.0", "prettier": "3.6.2" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index d3d95f8f405a..fecac3bc3086 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🩹 Fixes diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 1f93b49b727a..c30c880998ec 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.43.0", + "version": "8.44.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.43.0", - "@typescript-eslint/typescript-estree": "8.43.0", - "@typescript-eslint/utils": "8.43.0", + "@typescript-eslint/parser": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.0", + "@typescript-eslint/utils": "8.44.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index b2fc59f25ead..944dd764947f 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🩹 Fixes diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index e3416d621b3c..719daddf8f67 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.43.0", + "version": "8.44.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/visitor-keys": "8.43.0" + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/visitor-keys": "8.44.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.43.0", + "@typescript-eslint/typescript-estree": "8.44.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 91bede7256f5..e758fb5abd16 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index fc5f1f667245..b112bc1bb021 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.43.0", + "version": "8.44.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index f76b267d9ee7..6163c6f95df3 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🩹 Fixes diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 7f95c6572b5d..997aa43dc724 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.43.0", + "version": "8.44.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/typescript-estree": "8.43.0", - "@typescript-eslint/utils": "8.43.0", + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.0", + "@typescript-eslint/utils": "8.44.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.43.0", + "@typescript-eslint/parser": "8.44.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 25d996362475..9ab94998069d 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🩹 Fixes diff --git a/packages/types/package.json b/packages/types/package.json index 890b838e2549..824ae019c24b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.43.0", + "version": "8.44.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 1ffe823277da..92fdc7a6bc41 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🩹 Fixes diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index b7ec11091d60..55d767d36490 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.43.0", + "version": "8.44.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.43.0", - "@typescript-eslint/parser": "8.43.0", - "@typescript-eslint/typescript-estree": "8.43.0", - "@typescript-eslint/utils": "8.43.0" + "@typescript-eslint/eslint-plugin": "8.44.0", + "@typescript-eslint/parser": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.0", + "@typescript-eslint/utils": "8.44.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index e0d097bc0f88..bec95ad0397e 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for typescript-estree to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🚀 Features diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 283697eb4486..02d35fb5449e 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.43.0", + "version": "8.44.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.43.0", - "@typescript-eslint/tsconfig-utils": "8.43.0", - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/visitor-keys": "8.43.0", + "@typescript-eslint/project-service": "8.44.0", + "@typescript-eslint/tsconfig-utils": "8.44.0", + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/visitor-keys": "8.44.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index e6029c9e5864..6fb0ea01611e 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🩹 Fixes diff --git a/packages/utils/package.json b/packages/utils/package.json index 37c4c66a1aff..92d1f49bda3f 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.43.0", + "version": "8.44.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.43.0", - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/typescript-estree": "8.43.0" + "@typescript-eslint/scope-manager": "8.44.0", + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 34e4a4bbe64c..561af2e738aa 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 69ad03182abe..c48f8b7eba69 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.43.0", + "version": "8.44.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.43.0", + "@typescript-eslint/types": "8.44.0", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index c0c1451746b1..4aa74f3880d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5830,19 +5830,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.43.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.44.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.43.0 - "@typescript-eslint/rule-tester": 8.43.0 - "@typescript-eslint/scope-manager": 8.43.0 - "@typescript-eslint/type-utils": 8.43.0 - "@typescript-eslint/utils": 8.43.0 - "@typescript-eslint/visitor-keys": 8.43.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.44.0 + "@typescript-eslint/rule-tester": 8.44.0 + "@typescript-eslint/scope-manager": 8.44.0 + "@typescript-eslint/type-utils": 8.44.0 + "@typescript-eslint/utils": 8.44.0 + "@typescript-eslint/visitor-keys": 8.44.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5865,7 +5865,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.43.0 + "@typescript-eslint/parser": ^8.44.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -5881,14 +5881,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.43.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.44.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.43.0 - "@typescript-eslint/types": 8.43.0 - "@typescript-eslint/typescript-estree": 8.43.0 - "@typescript-eslint/visitor-keys": 8.43.0 + "@typescript-eslint/scope-manager": 8.44.0 + "@typescript-eslint/types": 8.44.0 + "@typescript-eslint/typescript-estree": 8.44.0 + "@typescript-eslint/visitor-keys": 8.44.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -5902,12 +5902,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.43.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.44.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.43.0 - "@typescript-eslint/types": ^8.43.0 + "@typescript-eslint/tsconfig-utils": ^8.44.0 + "@typescript-eslint/types": ^8.44.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -5918,12 +5918,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.43.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.44.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.43.0 - "@typescript-eslint/utils": 8.43.0 + "@typescript-eslint/type-utils": 8.44.0 + "@typescript-eslint/utils": 8.44.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -5934,15 +5934,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.43.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.44.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.43.0 - "@typescript-eslint/typescript-estree": 8.43.0 - "@typescript-eslint/utils": 8.43.0 + "@typescript-eslint/parser": 8.44.0 + "@typescript-eslint/typescript-estree": 8.44.0 + "@typescript-eslint/utils": 8.44.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5957,13 +5957,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.43.0, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.44.0, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.43.0 - "@typescript-eslint/typescript-estree": 8.43.0 - "@typescript-eslint/visitor-keys": 8.43.0 + "@typescript-eslint/types": 8.44.0 + "@typescript-eslint/typescript-estree": 8.44.0 + "@typescript-eslint/visitor-keys": 8.44.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -5974,7 +5974,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.43.0, @typescript-eslint/tsconfig-utils@^8.43.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.44.0, @typescript-eslint/tsconfig-utils@^8.44.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -5987,14 +5987,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.43.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.44.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.43.0 - "@typescript-eslint/types": 8.43.0 - "@typescript-eslint/typescript-estree": 8.43.0 - "@typescript-eslint/utils": 8.43.0 + "@typescript-eslint/parser": 8.44.0 + "@typescript-eslint/types": 8.44.0 + "@typescript-eslint/typescript-estree": 8.44.0 + "@typescript-eslint/utils": 8.44.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6009,7 +6009,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.43.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.43.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.44.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.44.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6082,15 +6082,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.43.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.44.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.43.0 - "@typescript-eslint/tsconfig-utils": 8.43.0 - "@typescript-eslint/types": 8.43.0 - "@typescript-eslint/visitor-keys": 8.43.0 + "@typescript-eslint/project-service": 8.44.0 + "@typescript-eslint/tsconfig-utils": 8.44.0 + "@typescript-eslint/types": 8.44.0 + "@typescript-eslint/visitor-keys": 8.44.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6108,14 +6108,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.43.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.44.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.43.0 - "@typescript-eslint/types": 8.43.0 - "@typescript-eslint/typescript-estree": 8.43.0 + "@typescript-eslint/scope-manager": 8.44.0 + "@typescript-eslint/types": 8.44.0 + "@typescript-eslint/typescript-estree": 8.44.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6127,11 +6127,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.43.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.44.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.43.0 + "@typescript-eslint/types": 8.44.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19360,10 +19360,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.43.0 - "@typescript-eslint/parser": 8.43.0 - "@typescript-eslint/typescript-estree": 8.43.0 - "@typescript-eslint/utils": 8.43.0 + "@typescript-eslint/eslint-plugin": 8.44.0 + "@typescript-eslint/parser": 8.44.0 + "@typescript-eslint/typescript-estree": 8.44.0 + "@typescript-eslint/utils": 8.44.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From 2f0c6ac62b797e2e57393962ae315078c6811a03 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Tue, 16 Sep 2025 22:41:04 +0800 Subject: [PATCH 195/283] chore(typescript-estree): simplify `convertImportAttributes` (#11594) * chore(typescript-estree): simplify `convertImportAttributes` * typo --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- packages/typescript-estree/src/convert.ts | 25 ++++++++--------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 0ffc735c3a14..ee7c128aca06 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -795,11 +795,13 @@ export class Converter { } private convertImportAttributes( - node: ts.ImportAttributes | undefined, + node: ts.ExportDeclaration | ts.ImportDeclaration, ): TSESTree.ImportAttribute[] { - return node == null - ? [] - : node.elements.map(element => this.convertChild(element)); + // eslint-disable-next-line @typescript-eslint/no-deprecated + const attributes = node.attributes ?? node.assertClause; + return ( + attributes?.elements.map(element => this.convertChild(element)) ?? [] + ); } private convertJSXIdentifier( @@ -2180,10 +2182,7 @@ export class Converter { this.#withDeprecatedAliasGetter( { type: AST_NODE_TYPES.ImportDeclaration, - attributes: this.convertImportAttributes( - // eslint-disable-next-line @typescript-eslint/no-deprecated - node.attributes ?? node.assertClause, - ), + attributes: this.convertImportAttributes(node), importKind: 'value', source: this.convertChild(node.moduleSpecifier), specifiers: [], @@ -2261,10 +2260,7 @@ export class Converter { this.#withDeprecatedAliasGetter( { type: AST_NODE_TYPES.ExportNamedDeclaration, - attributes: this.convertImportAttributes( - // eslint-disable-next-line @typescript-eslint/no-deprecated - node.attributes ?? node.assertClause, - ), + attributes: this.convertImportAttributes(node), declaration: null, exportKind: node.isTypeOnly ? 'type' : 'value', source: this.convertChild(node.moduleSpecifier), @@ -2284,10 +2280,7 @@ export class Converter { this.#withDeprecatedAliasGetter( { type: AST_NODE_TYPES.ExportAllDeclaration, - attributes: this.convertImportAttributes( - // eslint-disable-next-line @typescript-eslint/no-deprecated - node.attributes ?? node.assertClause, - ), + attributes: this.convertImportAttributes(node), exported: node.exportClause?.kind === SyntaxKind.NamespaceExport ? this.convertChild(node.exportClause.name) From 328a96de48e753174b0e934dbb5504937f246189 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 22 Sep 2025 20:49:11 +0800 Subject: [PATCH 196/283] chore(typescript-estree): add `Converter#convertChildren()` (#11592) * refactor(typescript-estree): add `Converter#covertChildren()` * Linting * Fix --- packages/typescript-estree/src/convert.ts | 111 +++++++++++----------- 1 file changed, 54 insertions(+), 57 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index ee7c128aca06..6fd3f245f87c 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -643,6 +643,19 @@ export class Converter { return this.converter(child, parent, false); } + /** + * Converts TypeScript node array into an ESTree node list. + * @param children the child `ts.NodeArray` or `ts.Node[]` + * @param parent parentNode + * @returns the converted ESTree node list + */ + private convertChildren( + children: ts.Node[] | ts.NodeArray, + parent?: ts.Node, + ): any[] { + return children.map(child => this.converter(child, parent, false)); + } + /** * Converts a TypeScript node into an ESTree node. * @param child the child ts.Node @@ -702,9 +715,7 @@ export class Converter { return this.createNode(node, { type: AST_NODE_TYPES.TSTypeParameterInstantiation, range, - params: typeArguments.map(typeArgument => - this.convertChild(typeArgument), - ), + params: this.convertChildren(typeArguments), }); } @@ -730,9 +741,7 @@ export class Converter { type: AST_NODE_TYPES.TSTypeParameterDeclaration, loc: getLocFor(range, this.ast), range, - params: typeParameters.map(typeParameter => - this.convertChild(typeParameter), - ), + params: this.convertChildren(typeParameters), } as TSESTree.TSTypeParameterDeclaration; } @@ -750,8 +759,9 @@ export class Converter { return parameters.map(param => { const convertedParam = this.convertChild(param) as TSESTree.Parameter; - convertedParam.decorators = - getDecorators(param)?.map(el => this.convertChild(el)) ?? []; + convertedParam.decorators = this.convertChildren( + getDecorators(param) ?? [], + ); return convertedParam; }); @@ -799,9 +809,7 @@ export class Converter { ): TSESTree.ImportAttribute[] { // eslint-disable-next-line @typescript-eslint/no-deprecated const attributes = node.attributes ?? node.assertClause; - return ( - attributes?.elements.map(element => this.convertChild(element)) ?? [] - ); + return this.convertChildren(attributes?.elements ?? []); } private convertJSXIdentifier( @@ -1062,7 +1070,7 @@ export class Converter { return this.createNode(node, { type: AST_NODE_TYPES.SwitchStatement, - cases: node.caseBlock.clauses.map(el => this.convertChild(el)), + cases: this.convertChildren(node.caseBlock.clauses), discriminant: this.convertChild(node.expression), }); @@ -1071,7 +1079,7 @@ export class Converter { return this.createNode(node, { type: AST_NODE_TYPES.SwitchCase, // expression is present in case only - consequent: node.statements.map(el => this.convertChild(el)), + consequent: this.convertChildren(node.statements), test: node.kind === SyntaxKind.CaseClause ? this.convertChild(node.expression) @@ -1261,9 +1269,7 @@ export class Converter { case SyntaxKind.VariableStatement: { const result = this.createNode(node, { type: AST_NODE_TYPES.VariableDeclaration, - declarations: node.declarationList.declarations.map(el => - this.convertChild(el), - ), + declarations: this.convertChildren(node.declarationList.declarations), declare: hasModifier(SyntaxKind.DeclareKeyword, node), kind: getDeclarationKind(node.declarationList), }); @@ -1340,7 +1346,7 @@ export class Converter { case SyntaxKind.VariableDeclarationList: { const result = this.createNode(node, { type: AST_NODE_TYPES.VariableDeclaration, - declarations: node.declarations.map(el => this.convertChild(el)), + declarations: this.convertChildren(node.declarations), declare: false, kind: getDeclarationKind(node), }); @@ -1391,7 +1397,7 @@ export class Converter { } return this.createNode(node, { type: AST_NODE_TYPES.ArrayExpression, - elements: node.elements.map(el => this.convertChild(el)), + elements: this.convertChildren(node.elements), }); } @@ -1553,8 +1559,7 @@ export class Converter { accessibility: getTSNodeAccessibility(node), computed: isComputedProperty(node.name), declare: hasModifier(SyntaxKind.DeclareKeyword, node), - decorators: - getDecorators(node)?.map(el => this.convertChild(el)) ?? [], + decorators: this.convertChildren(getDecorators(node) ?? []), definite: !!node.exclamationToken, key, optional: @@ -1616,7 +1621,7 @@ export class Converter { | TSESTree.TSAbstractMethodDefinition; if (parent.kind === SyntaxKind.ObjectLiteralExpression) { - method.params = node.parameters.map(el => this.convertChild(el)); + method.params = this.convertChildren(node.parameters); result = this.createNode(node, { type: AST_NODE_TYPES.Property, @@ -1652,8 +1657,7 @@ export class Converter { type: methodDefinitionType, accessibility: getTSNodeAccessibility(node), computed: isComputedProperty(node.name), - decorators: - getDecorators(node)?.map(el => this.convertChild(el)) ?? [], + decorators: this.convertChildren(getDecorators(node) ?? []), key: this.convertChild(node.name), kind: 'method', optional: !!node.questionToken, @@ -2135,16 +2139,14 @@ export class Converter { body: this.createNode(node, { type: AST_NODE_TYPES.ClassBody, range: [node.members.pos - 1, node.end], - body: node.members - .filter(isESTreeClassMember) - .map(el => this.convertChild(el)), + body: this.convertChildren( + node.members.filter(isESTreeClassMember), + ), }), declare: hasModifier(SyntaxKind.DeclareKeyword, node), - decorators: - getDecorators(node)?.map(el => this.convertChild(el)) ?? [], + decorators: this.convertChildren(getDecorators(node) ?? []), id: this.convertChild(node.name), - implements: - implementsClause?.types.map(el => this.convertChild(el)) ?? [], + implements: this.convertChildren(implementsClause?.types ?? []), superClass: extendsClause?.types[0] ? this.convertChild(extendsClause.types[0].expression) : null, @@ -2218,9 +2220,9 @@ export class Converter { break; case SyntaxKind.NamedImports: result.specifiers.push( - ...node.importClause.namedBindings.elements.map( - el => this.convertChild(el) as TSESTree.ImportClause, - ), + ...(this.convertChildren( + node.importClause.namedBindings.elements, + ) as TSESTree.ImportClause[]), ); break; } @@ -2264,8 +2266,9 @@ export class Converter { declaration: null, exportKind: node.isTypeOnly ? 'type' : 'value', source: this.convertChild(node.moduleSpecifier), - specifiers: node.exportClause.elements.map(el => - this.convertChild(el, node), + specifiers: this.convertChildren( + node.exportClause.elements, + node, ), }, 'assertions', @@ -2501,7 +2504,7 @@ export class Converter { } const callee = this.convertChild(node.expression); - const args = node.arguments.map(el => this.convertChild(el)); + const args = this.convertChildren(node.arguments); const typeArguments = node.typeArguments && this.convertTypeArgumentsToTypeParameterInstantiation( @@ -2531,9 +2534,7 @@ export class Converter { // NOTE - NewExpression cannot have an optional chain in it return this.createNode(node, { type: AST_NODE_TYPES.NewExpression, - arguments: node.arguments - ? node.arguments.map(el => this.convertChild(el)) - : [], + arguments: this.convertChildren(node.arguments ?? []), callee: this.convertChild(node.expression), typeArguments, }); @@ -2671,7 +2672,7 @@ export class Converter { case SyntaxKind.JsxElement: return this.createNode(node, { type: AST_NODE_TYPES.JSXElement, - children: node.children.map(el => this.convertChild(el)), + children: this.convertChildren(node.children), closingElement: this.convertChild(node.closingElement), openingElement: this.convertChild(node.openingElement), }); @@ -2679,7 +2680,7 @@ export class Converter { case SyntaxKind.JsxFragment: return this.createNode(node, { type: AST_NODE_TYPES.JSXFragment, - children: node.children.map(el => this.convertChild(el)), + children: this.convertChildren(node.children), closingFragment: this.convertChild(node.closingFragment), openingFragment: this.convertChild(node.openingFragment), }); @@ -2696,9 +2697,7 @@ export class Converter { openingElement: this.createNode(node, { type: AST_NODE_TYPES.JSXOpeningElement, range: getRange(node, this.ast), - attributes: node.attributes.properties.map(el => - this.convertChild(el), - ), + attributes: this.convertChildren(node.attributes.properties), name: this.convertJSXTagName(node.tagName, node), selfClosing: true, typeArguments: node.typeArguments @@ -2714,9 +2713,7 @@ export class Converter { case SyntaxKind.JsxOpeningElement: { return this.createNode(node, { type: AST_NODE_TYPES.JSXOpeningElement, - attributes: node.attributes.properties.map(el => - this.convertChild(el), - ), + attributes: this.convertChildren(node.attributes.properties), name: this.convertJSXTagName(node.tagName, node), selfClosing: false, typeArguments: @@ -2859,7 +2856,7 @@ export class Converter { case SyntaxKind.TypeLiteral: { return this.createNode(node, { type: AST_NODE_TYPES.TSTypeLiteral, - members: node.members.map(el => this.convertChild(el)), + members: this.convertChildren(node.members), }); } @@ -2983,7 +2980,7 @@ export class Converter { return this.createNode(node, { type: AST_NODE_TYPES.TSIndexSignature, accessibility: getTSNodeAccessibility(node), - parameters: node.parameters.map(el => this.convertChild(el)), + parameters: this.convertChildren(node.parameters), readonly: hasModifier(SyntaxKind.ReadonlyKeyword, node), static: hasModifier(SyntaxKind.StaticKeyword, node), typeAnnotation: @@ -3109,7 +3106,7 @@ export class Converter { body: this.createNode(node, { type: AST_NODE_TYPES.TSInterfaceBody, range: [node.members.pos - 1, node.end], - body: node.members.map(member => this.convertChild(member)), + body: this.convertChildren(node.members), }), declare: hasModifier(SyntaxKind.DeclareKeyword, node), extends: interfaceExtends, @@ -3245,7 +3242,7 @@ export class Converter { } case SyntaxKind.EnumDeclaration: { - const members = node.members.map(el => this.convertChild(el)); + const members = this.convertChildren(node.members); const result = this.createNode( node, this.#withDeprecatedGetter( @@ -3262,7 +3259,7 @@ export class Converter { }, 'members', `'body.members'`, - node.members.map(el => this.convertChild(el)), + this.convertChildren(node.members), ), ); @@ -3439,13 +3436,13 @@ export class Converter { case SyntaxKind.UnionType: { return this.createNode(node, { type: AST_NODE_TYPES.TSUnionType, - types: node.types.map(el => this.convertChild(el)), + types: this.convertChildren(node.types), }); } case SyntaxKind.IntersectionType: { return this.createNode(node, { type: AST_NODE_TYPES.TSIntersectionType, - types: node.types.map(el => this.convertChild(el)), + types: this.convertChildren(node.types), }); } case SyntaxKind.AsExpression: { @@ -3519,7 +3516,7 @@ export class Converter { // Tuple case SyntaxKind.TupleType: { - const elementTypes = node.elements.map(el => this.convertChild(el)); + const elementTypes = this.convertChildren(node.elements); return this.createNode(node, { type: AST_NODE_TYPES.TSTupleType, @@ -3678,7 +3675,7 @@ export class Converter { } const decorators = getDecorators(node); if (decorators?.length) { - result.decorators = decorators.map(el => this.convertChild(el)); + result.decorators = this.convertChildren(decorators); } // keys we never want to clone from the base typescript node as they @@ -3710,7 +3707,7 @@ export class Converter { .filter(([key]) => !KEYS_TO_NOT_COPY.has(key)) .forEach(([key, value]) => { if (Array.isArray(value)) { - result[key] = value.map(el => this.convertChild(el as TSNode)); + result[key] = this.convertChildren(value); } else if (value && typeof value === 'object' && value.kind) { // need to check node[key].kind to ensure we don't try to convert a symbol result[key] = this.convertChild(value as TSNode); From fde540eef7f69f9364f686fddd690a857edda1f5 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 22 Sep 2025 20:49:31 +0800 Subject: [PATCH 197/283] fix(typescript-estree): forbid class property with name `constructor` (#11590) * fix(typescript-estree): forbid class property with name `constructor` * Format fixtures --- .../key-constructor-string-escaped/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/key-constructor-string/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 79 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 92 ++++++++++++++++ .../snapshots/3-Babel-AST.shot | 79 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 92 ++++++++++++++++ .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 78 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 92 ++++++++++++++++ .../snapshots/3-Babel-AST.shot | 78 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 92 ++++++++++++++++ .../key-constructor-identifier/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../key-constructor-string-escaped/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/key-constructor-string/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 79 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 82 ++++++++++++++ .../snapshots/3-Babel-AST.shot | 79 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 82 ++++++++++++++ .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 78 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 82 ++++++++++++++ .../snapshots/3-Babel-AST.shot | 78 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 82 ++++++++++++++ .../key-constructor-string-escaped/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/key-constructor-string/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 79 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 102 ++++++++++++++++++ .../snapshots/3-Babel-AST.shot | 79 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 102 ++++++++++++++++++ .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 78 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 102 ++++++++++++++++++ .../snapshots/3-Babel-AST.shot | 78 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 102 ++++++++++++++++++ .../key-constructor-identifier/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../key-constructor-string-escaped/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/key-constructor-string/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 ++ .../snapshots/2-Babel-Error.shot | 10 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 79 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 92 ++++++++++++++++ .../snapshots/3-Babel-AST.shot | 79 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 92 ++++++++++++++++ .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 78 ++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 92 ++++++++++++++++ .../snapshots/3-Babel-AST.shot | 78 ++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 92 ++++++++++++++++ packages/typescript-estree/src/convert.ts | 10 ++ 81 files changed, 3022 insertions(+) create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts new file mode 100644 index 000000000000..fe9d09f5c8b5 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor '\u{63}onstructor' +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..1efee502ef1a --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string-escaped > TSESTree - Error`] +TSError + 1 | class Foo { +> 2 | accessor '\u{63}onstructor' + | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..b36c85229b5d --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string-escaped > Babel - Error`] +BabelError + 1 | class Foo { +> 2 | accessor '\u{63}onstructor' + | ^ Classes may not have a field named 'constructor'. (2:11) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..1b975851c82a --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string-escaped > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts new file mode 100644 index 000000000000..15b65f9026f1 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor 'constructor' +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..99225f26fe0f --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string > TSESTree - Error`] +TSError + 1 | class Foo { +> 2 | accessor 'constructor' + | ^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..bb359842fe1e --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string > Babel - Error`] +BabelError + 1 | class Foo { +> 2 | accessor 'constructor' + | ^ Classes may not have a field named 'constructor'. (2:11) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..d6b1cda3e19b --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts new file mode 100644 index 000000000000..176558f7f971 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor [constructor]; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..0bd9d71a1338 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [24, 35], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 37], + loc: { + start: { column: 2, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + ], + + range: [10, 39], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 39], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..ced41a5029ae --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,92 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [24, 35], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [35, 36], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [38, 39], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..0bd9d71a1338 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [24, 35], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 37], + loc: { + start: { column: 2, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + ], + + range: [10, 39], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 39], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..ced41a5029ae --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,92 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [24, 35], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [35, 36], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [38, 39], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/fixture.ts new file mode 100644 index 000000000000..acc5cfe6398a --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor ['constructor']; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..5b9bbadd0d07 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [24, 37], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 39], + loc: { + start: { column: 2, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + ], + + range: [10, 41], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..30151a9636c9 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,92 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [24, 37], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [38, 39], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [40, 41], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..5b9bbadd0d07 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [24, 37], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 39], + loc: { + start: { column: 2, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + ], + + range: [10, 41], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..30151a9636c9 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,92 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [24, 37], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [38, 39], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [40, 41], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts new file mode 100644 index 000000000000..581943685ffe --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + constructor +} diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..ed0ae4b78658 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-identifier > TSESTree - Error`] +TSError + 1 | class Foo { + 2 | constructor +> 3 | } + | ^ '(' expected. + 4 | diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..680ca51c5b1a --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-identifier > Babel - Error`] +BabelError + 1 | class Foo { +> 2 | constructor + | ^ Classes may not have a field named 'constructor'. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..dda789130572 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-identifier > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts new file mode 100644 index 000000000000..5dc0386f85fe --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + '\u{63}onstructor' +} diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..53cc50de6a35 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string-escaped > TSESTree - Error`] +TSError + 1 | class Foo { +> 2 | '\u{63}onstructor' + | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..130b27dcc413 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string-escaped > Babel - Error`] +BabelError + 1 | class Foo { +> 2 | '\u{63}onstructor' + | ^ Classes may not have a field named 'constructor'. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..b3922ac52bf5 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string-escaped > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts new file mode 100644 index 000000000000..d29a35ffdbb7 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + 'constructor' +} diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..46f1efa8ad71 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string > TSESTree - Error`] +TSError + 1 | class Foo { +> 2 | 'constructor' + | ^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..eaac47437927 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string > Babel - Error`] +BabelError + 1 | class Foo { +> 2 | 'constructor' + | ^ Classes may not have a field named 'constructor'. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..86e611b5b35d --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts new file mode 100644 index 000000000000..8846529091d9 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + [constructor]; +} diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..036f1181e9b7 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [15, 26], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 28], + loc: { + start: { column: 2, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + ], + + range: [10, 30], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..93100d49782c --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,82 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [14, 15], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [15, 26], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [26, 27], + loc: { + start: { column: 14, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [29, 30], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..036f1181e9b7 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [15, 26], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 28], + loc: { + start: { column: 2, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + ], + + range: [10, 30], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..93100d49782c --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,82 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [14, 15], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [15, 26], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [26, 27], + loc: { + start: { column: 14, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [29, 30], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts new file mode 100644 index 000000000000..955e0ccdd551 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + ['constructor']; +} diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a35a705153a3 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [15, 28], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 30], + loc: { + start: { column: 2, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + ], + + range: [10, 32], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d587dd5c180d --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,82 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [14, 15], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [15, 28], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [28, 29], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [31, 32], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a35a705153a3 --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [15, 28], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [14, 30], + loc: { + start: { column: 2, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + ], + + range: [10, 32], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..d587dd5c180d --- /dev/null +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,82 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [14, 15], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [15, 28], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [28, 29], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [31, 32], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts new file mode 100644 index 000000000000..2d83385d93bf --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + accessor '\u{63}onstructor' +} diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..e2a98ea43e52 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string-escaped > TSESTree - Error`] +TSError + 1 | abstract class Foo { +> 2 | accessor '\u{63}onstructor' + | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..73035ad32ef8 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string-escaped > Babel - Error`] +BabelError + 1 | abstract class Foo { +> 2 | accessor '\u{63}onstructor' + | ^ Classes may not have a field named 'constructor'. (2:11) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..f4851859171d --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string-escaped > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts new file mode 100644 index 000000000000..84fb8c4caa3f --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + accessor 'constructor' +} diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..97e1650fccca --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string > TSESTree - Error`] +TSError + 1 | abstract class Foo { +> 2 | accessor 'constructor' + | ^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..9f0cd2ea63f0 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string > Babel - Error`] +BabelError + 1 | abstract class Foo { +> 2 | accessor 'constructor' + | ^ Classes may not have a field named 'constructor'. (2:11) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..c6bb852e8a96 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts new file mode 100644 index 000000000000..e267f66d845d --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + accessor [constructor]; +} diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..82d28f21758a --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [33, 44], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 46], + loc: { + start: { column: 2, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + ], + + range: [19, 48], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..4941bcdc220c --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,102 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [23, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [32, 33], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [33, 44], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [44, 45], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [45, 46], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [47, 48], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..82d28f21758a --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [33, 44], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 46], + loc: { + start: { column: 2, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + ], + + range: [19, 48], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..4941bcdc220c --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,102 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [23, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [32, 33], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [33, 44], + loc: { + start: { column: 12, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [44, 45], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [45, 46], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [47, 48], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/fixture.ts b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/fixture.ts new file mode 100644 index 000000000000..dd4af2978b06 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + accessor ['constructor']; +} diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c1ef23b02e88 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [33, 46], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 48], + loc: { + start: { column: 2, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + ], + + range: [19, 50], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 50], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 51], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b3c97ec3fd6c --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,102 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [23, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [32, 33], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [33, 46], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [46, 47], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [47, 48], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [49, 50], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..c1ef23b02e88 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [33, 46], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 48], + loc: { + start: { column: 2, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + ], + + range: [19, 50], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 50], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 51], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..b3c97ec3fd6c --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,102 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [23, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [32, 33], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [33, 46], + loc: { + start: { column: 12, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [46, 47], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [47, 48], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [49, 50], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts new file mode 100644 index 000000000000..a70cc4d0b84e --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + constructor +} diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..d4dac96c3819 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-identifier > TSESTree - Error`] +TSError + 1 | abstract class Foo { + 2 | constructor +> 3 | } + | ^ '(' expected. + 4 | diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..40ef5d1ba178 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-identifier > Babel - Error`] +BabelError + 1 | abstract class Foo { +> 2 | constructor + | ^ Classes may not have a field named 'constructor'. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..c03db2425706 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-identifier > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts new file mode 100644 index 000000000000..3964b6ad536d --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + '\u{63}onstructor' +} diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..832a69aba874 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string-escaped > TSESTree - Error`] +TSError + 1 | abstract class Foo { +> 2 | '\u{63}onstructor' + | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..972fa63aaaf7 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string-escaped > Babel - Error`] +BabelError + 1 | abstract class Foo { +> 2 | '\u{63}onstructor' + | ^ Classes may not have a field named 'constructor'. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..c784e6ef8f7e --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string-escaped > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts new file mode 100644 index 000000000000..773be1c59705 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + 'constructor' +} diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..e70630a8db65 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string > TSESTree - Error`] +TSError + 1 | abstract class Foo { +> 2 | 'constructor' + | ^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..0b562418bd7a --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string > Babel - Error`] +BabelError + 1 | abstract class Foo { +> 2 | 'constructor' + | ^ Classes may not have a field named 'constructor'. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..e72b64ca43be --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts new file mode 100644 index 000000000000..0035d60f9a3b --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + [constructor]; +} diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a84556365ffa --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [24, 35], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 37], + loc: { + start: { column: 2, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + ], + + range: [19, 39], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 39], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f33b1b154313 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,92 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [24, 35], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [35, 36], + loc: { + start: { column: 14, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [36, 37], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [38, 39], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a84556365ffa --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,79 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [24, 35], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 37], + loc: { + start: { column: 2, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + ], + + range: [19, 39], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 39], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f33b1b154313 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,92 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [24, 35], + loc: { + start: { column: 3, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [35, 36], + loc: { + start: { column: 14, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [36, 37], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [38, 39], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts new file mode 100644 index 000000000000..d7fa2a53c79b --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + ['constructor']; +} diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..880411e5b0a1 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [24, 37], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 39], + loc: { + start: { column: 2, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + ], + + range: [19, 41], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a82ebf95ff87 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,92 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [24, 37], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [37, 38], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [38, 39], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [40, 41], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..880411e5b0a1 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot @@ -0,0 +1,78 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + decorators: [], + definite: false, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [24, 37], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [23, 39], + loc: { + start: { column: 2, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + ], + + range: [19, 41], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..a82ebf95ff87 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,92 @@ +[ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [24, 37], + loc: { + start: { column: 3, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [37, 38], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [38, 39], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [40, 41], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 6fd3f245f87c..bec26fede610 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1532,6 +1532,16 @@ export class Converter { ); } + if ( + node.name.kind === SyntaxKind.StringLiteral && + node.name.text === 'constructor' + ) { + this.#throwError( + node.name, + "Classes may not have a field named 'constructor'.", + ); + } + const isAccessor = hasModifier(SyntaxKind.AccessorKeyword, node); const type = (() => { if (isAccessor) { From 4fde781fdfeb38ac80256d20ac3d776479217b2d Mon Sep 17 00:00:00 2001 From: mdm317 Date: Mon, 22 Sep 2025 21:50:20 +0900 Subject: [PATCH 198/283] fix(eslint-plugin): [no-base-to-string] make ignoredTypeNames match type names without generics (#11597) fix: support generic in ignoreType --- .../src/rules/no-base-to-string.ts | 18 ++++++++++++++ .../tests/rules/no-base-to-string.test.ts | 24 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts index 26eadce99839..53d50bd4694f 100644 --- a/packages/eslint-plugin/src/rules/no-base-to-string.ts +++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts @@ -25,6 +25,13 @@ export type Options = [ }, ]; export type MessageIds = 'baseArrayJoin' | 'baseToString'; +const canHaveTypeParameters = (declaration: ts.Declaration) => { + return ( + ts.isTypeAliasDeclaration(declaration) || + ts.isInterfaceDeclaration(declaration) || + ts.isClassDeclaration(declaration) + ); +}; export default createRule({ name: 'no-base-to-string', @@ -231,6 +238,17 @@ export default createRule({ return Usefulness.Always; } + const symbol = type.aliasSymbol ?? type.getSymbol(); + const decl = symbol?.getDeclarations()?.[0]; + if ( + decl && + canHaveTypeParameters(decl) && + decl.typeParameters && + ignoredTypeNames.includes(symbol.name) + ) { + return Usefulness.Always; + } + if (ignoredTypeNames.includes(getTypeName(checker, type))) { return Usefulness.Always; } diff --git a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts index 8c61eda34e63..7e6fa055b55e 100644 --- a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts +++ b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts @@ -300,6 +300,30 @@ String(foo); `, options: [{ ignoredTypeNames: ['Foo'] }], }, + { + code: ` +interface MyError {} +declare const error: MyError; +error.toString(); + `, + options: [{ ignoredTypeNames: ['MyError'] }], + }, + { + code: ` +type MyError = {}; +declare const error: MyError; +error.toString(); + `, + options: [{ ignoredTypeNames: ['MyError'] }], + }, + { + code: ` +class MyError {} +declare const error: MyError; +error.toString(); + `, + options: [{ ignoredTypeNames: ['MyError'] }], + }, ` function String(value) { return value; From 20c3d97235956d7a5ea34c3e0c0be5e56d603575 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 22 Sep 2025 08:50:32 -0400 Subject: [PATCH 199/283] fix(eslint-plugin): [no-unsafe-enum-comparison] support unions of literals (#11599) * fix(eslint-plugin): [no-unsafe-enum-comparison] support unions of literals * lint fix --- .../src/rules/no-unsafe-enum-comparison.ts | 36 +++++---- .../rules/no-unsafe-enum-comparison.test.ts | 76 +++++++++++++++++++ 2 files changed, 98 insertions(+), 14 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts b/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts index c5f457db3618..051a827ee720 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts @@ -23,25 +23,33 @@ function typeViolates(leftTypeParts: ts.Type[], rightType: ts.Type): boolean { } function isNumberLike(type: ts.Type): boolean { - const typeParts = tsutils.intersectionConstituents(type); - - return typeParts.some(typePart => { - return tsutils.isTypeFlagSet( - typePart, - ts.TypeFlags.Number | ts.TypeFlags.NumberLike, + return tsutils + .unionConstituents(type) + .every(unionPart => + tsutils + .intersectionConstituents(unionPart) + .some(intersectionPart => + tsutils.isTypeFlagSet( + intersectionPart, + ts.TypeFlags.Number | ts.TypeFlags.NumberLike, + ), + ), ); - }); } function isStringLike(type: ts.Type): boolean { - const typeParts = tsutils.intersectionConstituents(type); - - return typeParts.some(typePart => { - return tsutils.isTypeFlagSet( - typePart, - ts.TypeFlags.String | ts.TypeFlags.StringLike, + return tsutils + .unionConstituents(type) + .every(unionPart => + tsutils + .intersectionConstituents(unionPart) + .some(intersectionPart => + tsutils.isTypeFlagSet( + intersectionPart, + ts.TypeFlags.String | ts.TypeFlags.StringLike, + ), + ), ); - }); } /** diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts index 89e28f163314..b10f3cc6ee5f 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts @@ -1165,5 +1165,81 @@ ruleTester.run('no-unsafe-enum-comparison', rule, { `, errors: [{ messageId: 'mismatchedCondition' }], }, + { + code: ` +enum NUMBER_ENUM { + First = 0, + Second = 1, +} + +type NumberUnion = 0 | 1; + +declare const numberUnion: NumberUnion; + +switch (numberUnion) { + case NUMBER_ENUM.First: + case NUMBER_ENUM.Second: + break; +} + `, + errors: [ + { + line: 12, + messageId: 'mismatchedCase', + }, + { + line: 13, + messageId: 'mismatchedCase', + }, + ], + }, + { + code: ` +enum STRING_ENUM { + First = 'one', + Second = 'two', +} + +type StringUnion = 'one' | 'two'; + +declare const stringUnion: StringUnion; + +switch (stringUnion) { + case STRING_ENUM.First: + case STRING_ENUM.Second: + break; +} + `, + errors: [ + { + line: 12, + messageId: 'mismatchedCase', + }, + { + line: 13, + messageId: 'mismatchedCase', + }, + ], + }, + { + code: ` +declare const stringUnion: 'foo' | 'bar'; + +enum StringEnum { + FOO = 'foo', + BAR = 'bar', +} + +declare const stringEnum: StringEnum; + +stringUnion === stringEnum; + `, + errors: [ + { + line: 11, + messageId: 'mismatchedCondition', + }, + ], + }, ], }); From e550780ba47f8ea2f7f65e01c1a86d978d161040 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 11:58:45 -0400 Subject: [PATCH 200/283] chore(deps): update dependency make-dir to v5.1.0 (#11612) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4aa74f3880d9..eb3130ba178c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13310,9 +13310,9 @@ __metadata: linkType: hard "make-dir@npm:*": - version: 5.0.0 - resolution: "make-dir@npm:5.0.0" - checksum: 9f40f4756af5138ca3b138f9e8af144b0420516e96b0e079d816a173d2f69b2ef3425abf20e25764d222c0939a9fd2bce91dd26c22002a559cd6beaea5c994d2 + version: 5.1.0 + resolution: "make-dir@npm:5.1.0" + checksum: 372abd9cbb2029bead4efe6c369c9af8ae77773d9a31ed5378fd7ae8072f06ea272aec5c7aba7543d3b8578a45b0bf90d86a78ab311afa4bc3446000977095a9 languageName: node linkType: hard From c392a0de2dba95ff24bc1f1730a8a85793d4d837 Mon Sep 17 00:00:00 2001 From: Ronen Amiel Date: Mon, 22 Sep 2025 19:00:09 +0300 Subject: [PATCH 201/283] fix(eslint-plugin): [await-thenable] should not report passing values to promise aggregators which may be a promise in an array literal (#11611) fix: do not report values that may be a promise in an array literal --- .../eslint-plugin/src/rules/await-thenable.ts | 15 ++++++++++++++- .../tests/rules/await-thenable.test.ts | 12 ++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/await-thenable.ts b/packages/eslint-plugin/src/rules/await-thenable.ts index 8c84eacc8788..70c87cc5d918 100644 --- a/packages/eslint-plugin/src/rules/await-thenable.ts +++ b/packages/eslint-plugin/src/rules/await-thenable.ts @@ -111,7 +111,7 @@ export default createRule<[], MessageId>({ const type = getConstrainedTypeAtLocation(services, element); const tsNode = services.esTreeNodeToTSNodeMap.get(element); - if (containsNonAwaitableType(type, tsNode, checker)) { + if (isAlwaysNonAwaitableType(type, tsNode, checker)) { context.report({ node: element, messageId: 'invalidPromiseAggregatorInput', @@ -281,6 +281,19 @@ function getValueTypesOfArrayLike( return null; } +function isAlwaysNonAwaitableType( + type: ts.Type, + node: ts.Node, + checker: ts.TypeChecker, +): boolean { + return tsutils + .unionConstituents(type) + .every( + typeArgumentPart => + needsToBeAwaited(checker, node, typeArgumentPart) === Awaitable.Never, + ); +} + function containsNonAwaitableType( type: ts.Type, node: ts.Node, diff --git a/packages/eslint-plugin/tests/rules/await-thenable.test.ts b/packages/eslint-plugin/tests/rules/await-thenable.test.ts index f1729d908bdb..0556ce4803de 100644 --- a/packages/eslint-plugin/tests/rules/await-thenable.test.ts +++ b/packages/eslint-plugin/tests/rules/await-thenable.test.ts @@ -683,6 +683,18 @@ Promise.all([ Promise.resolve(2), Promise.resolve(3), ...[Promise.resolve(4), Promise.resolve(5), Promise.resolve(6)], +]); + `, + }, + { + code: ` +declare const maybePromise: Promise | number; + +Promise.all([ + maybePromise, + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), ]); `, }, From e8b0b4d23800441decb15c2d3af32946fe63da9f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 12:04:02 -0400 Subject: [PATCH 202/283] chore(deps): update dependency globals to v16.4.0 (#11610) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index eb3130ba178c..497a924121ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11079,9 +11079,9 @@ __metadata: linkType: hard "globals@npm:^16.0.0": - version: 16.3.0 - resolution: "globals@npm:16.3.0" - checksum: 2f3467f27bd84dca7778b0f7b528718b697274f3ed0d12721b9af0a14a9b6eb20240cb221817c264a27bfc5b9fac3ae28f6168b39808f27c74142942fb953c73 + version: 16.4.0 + resolution: "globals@npm:16.4.0" + checksum: 934180f5c6cbb26f8b2832caa255050fface970eee45bde8757fabba384807c85640a12716aa5bcc47d781807839fee470c8c1f6159c6b8dc877668c56103880 languageName: node linkType: hard From c1980522cd11f2de1a49ff6a30b4be7765a843ff Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 22 Sep 2025 17:04:37 +0000 Subject: [PATCH 203/283] chore(release): publish 8.44.1 --- CHANGELOG.md | 18 ++++ packages/ast-spec/CHANGELOG.md | 12 +++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 16 +++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 12 +++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 224 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa5ceaaa6bea..8f7e3eb6e2db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +## 8.44.1 (2025-09-22) + +### 🩹 Fixes + +- **eslint-plugin:** [no-base-to-string] make ignoredTypeNames match type names without generics ([#11597](https://github.com/typescript-eslint/typescript-eslint/pull/11597)) +- **eslint-plugin:** [no-unsafe-enum-comparison] support unions of literals ([#11599](https://github.com/typescript-eslint/typescript-eslint/pull/11599)) +- **eslint-plugin:** [await-thenable] should not report passing values to promise aggregators which may be a promise in an array literal ([#11611](https://github.com/typescript-eslint/typescript-eslint/pull/11611)) +- **typescript-estree:** forbid class property with name `constructor` ([#11590](https://github.com/typescript-eslint/typescript-eslint/pull/11590)) + +### ❤️ Thank You + +- fisker Cheung @fisker +- Kirk Waiblinger @kirkwaiblinger +- mdm317 +- Ronen Amiel + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 4c7a8ba3e11c..fec4e2abcc96 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.44.1 (2025-09-22) + +### 🩹 Fixes + +- **typescript-estree:** forbid class property with name `constructor` ([#11590](https://github.com/typescript-eslint/typescript-eslint/pull/11590)) + +### ❤️ Thank You + +- fisker Cheung @fisker + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for ast-spec to align it with other projects, there were no code changes. diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index e89e369e0bbe..788732adc36f 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.44.0", + "version": "8.44.1", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index b61c69fe769f..f12996c79142 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,19 @@ +## 8.44.1 (2025-09-22) + +### 🩹 Fixes + +- **eslint-plugin:** [await-thenable] should not report passing values to promise aggregators which may be a promise in an array literal ([#11611](https://github.com/typescript-eslint/typescript-eslint/pull/11611)) +- **eslint-plugin:** [no-unsafe-enum-comparison] support unions of literals ([#11599](https://github.com/typescript-eslint/typescript-eslint/pull/11599)) +- **eslint-plugin:** [no-base-to-string] make ignoredTypeNames match type names without generics ([#11597](https://github.com/typescript-eslint/typescript-eslint/pull/11597)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger +- mdm317 +- Ronen Amiel + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) ### 🚀 Features diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index d78a1182c1ba..d01ee4e12e8b 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.44.0", + "version": "8.44.1", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.44.0", - "@typescript-eslint/type-utils": "8.44.0", - "@typescript-eslint/utils": "8.44.0", - "@typescript-eslint/visitor-keys": "8.44.0", + "@typescript-eslint/scope-manager": "8.44.1", + "@typescript-eslint/type-utils": "8.44.1", + "@typescript-eslint/utils": "8.44.1", + "@typescript-eslint/visitor-keys": "8.44.1", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.44.0", - "@typescript-eslint/rule-tester": "8.44.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.44.1", + "@typescript-eslint/rule-tester": "8.44.1", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.44.0", + "@typescript-eslint/parser": "^8.44.1", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 8d1ea2c3c5a4..e8a3d8afcb46 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 19b621151505..8087809d4884 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.44.0", + "version": "8.44.1", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.44.0", - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/typescript-estree": "8.44.0", - "@typescript-eslint/visitor-keys": "8.44.0", + "@typescript-eslint/scope-manager": "8.44.1", + "@typescript-eslint/types": "8.44.1", + "@typescript-eslint/typescript-estree": "8.44.1", + "@typescript-eslint/visitor-keys": "8.44.1", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 092a642891f9..55690ad57c69 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index da5b76225005..be0d5ba771fb 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.44.0", + "version": "8.44.1", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.44.0", - "@typescript-eslint/types": "^8.44.0", + "@typescript-eslint/tsconfig-utils": "^8.44.1", + "@typescript-eslint/types": "^8.44.1", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 7f895b5e5334..29320dcf7a2d 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index bbcbbfa3615f..8eee73cef414 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.44.0", + "version": "8.44.1", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.44.0", - "@typescript-eslint/utils": "8.44.0", + "@typescript-eslint/type-utils": "8.44.1", + "@typescript-eslint/utils": "8.44.1", "natural-compare": "^1.4.0", "prettier": "3.6.2" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index fecac3bc3086..89c694b8fa62 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index c30c880998ec..9472a7d024b0 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.44.0", + "version": "8.44.1", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.44.0", - "@typescript-eslint/typescript-estree": "8.44.0", - "@typescript-eslint/utils": "8.44.0", + "@typescript-eslint/parser": "8.44.1", + "@typescript-eslint/typescript-estree": "8.44.1", + "@typescript-eslint/utils": "8.44.1", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 944dd764947f..8f5948ab1f82 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 719daddf8f67..22e2476b5b90 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.44.0", + "version": "8.44.1", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/visitor-keys": "8.44.0" + "@typescript-eslint/types": "8.44.1", + "@typescript-eslint/visitor-keys": "8.44.1" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.1", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index e758fb5abd16..d4c37732a9f4 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index b112bc1bb021..fa1b2e343954 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.44.0", + "version": "8.44.1", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 6163c6f95df3..acc90600162d 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 997aa43dc724..a1b7b766950a 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.44.0", + "version": "8.44.1", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/typescript-estree": "8.44.0", - "@typescript-eslint/utils": "8.44.0", + "@typescript-eslint/types": "8.44.1", + "@typescript-eslint/typescript-estree": "8.44.1", + "@typescript-eslint/utils": "8.44.1", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.44.0", + "@typescript-eslint/parser": "8.44.1", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 9ab94998069d..75911ee3b7f0 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 824ae019c24b..e531f0e52f24 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.44.0", + "version": "8.44.1", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 92fdc7a6bc41..ea0fe52260b5 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 55d767d36490..9b2cae39fca3 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.44.0", + "version": "8.44.1", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.44.0", - "@typescript-eslint/parser": "8.44.0", - "@typescript-eslint/typescript-estree": "8.44.0", - "@typescript-eslint/utils": "8.44.0" + "@typescript-eslint/eslint-plugin": "8.44.1", + "@typescript-eslint/parser": "8.44.1", + "@typescript-eslint/typescript-estree": "8.44.1", + "@typescript-eslint/utils": "8.44.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index bec95ad0397e..d22e93409134 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.44.1 (2025-09-22) + +### 🩹 Fixes + +- **typescript-estree:** forbid class property with name `constructor` ([#11590](https://github.com/typescript-eslint/typescript-eslint/pull/11590)) + +### ❤️ Thank You + +- fisker Cheung @fisker + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for typescript-estree to align it with other projects, there were no code changes. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 02d35fb5449e..82432de9dcf6 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.44.0", + "version": "8.44.1", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.44.0", - "@typescript-eslint/tsconfig-utils": "8.44.0", - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/visitor-keys": "8.44.0", + "@typescript-eslint/project-service": "8.44.1", + "@typescript-eslint/tsconfig-utils": "8.44.1", + "@typescript-eslint/types": "8.44.1", + "@typescript-eslint/visitor-keys": "8.44.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 6fb0ea01611e..e9d6aa34c615 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index 92d1f49bda3f..8ea3a0308748 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.44.0", + "version": "8.44.1", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.44.0", - "@typescript-eslint/types": "8.44.0", - "@typescript-eslint/typescript-estree": "8.44.0" + "@typescript-eslint/scope-manager": "8.44.1", + "@typescript-eslint/types": "8.44.1", + "@typescript-eslint/typescript-estree": "8.44.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 561af2e738aa..5516fc1c32fc 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.1 (2025-09-22) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.0 (2025-09-15) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index c48f8b7eba69..0691965d0401 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.44.0", + "version": "8.44.1", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/types": "8.44.1", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 497a924121ce..dc5062b5cb69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5830,19 +5830,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.44.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.44.1, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.44.0 - "@typescript-eslint/rule-tester": 8.44.0 - "@typescript-eslint/scope-manager": 8.44.0 - "@typescript-eslint/type-utils": 8.44.0 - "@typescript-eslint/utils": 8.44.0 - "@typescript-eslint/visitor-keys": 8.44.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.44.1 + "@typescript-eslint/rule-tester": 8.44.1 + "@typescript-eslint/scope-manager": 8.44.1 + "@typescript-eslint/type-utils": 8.44.1 + "@typescript-eslint/utils": 8.44.1 + "@typescript-eslint/visitor-keys": 8.44.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5865,7 +5865,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.44.0 + "@typescript-eslint/parser": ^8.44.1 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -5881,14 +5881,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.44.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.44.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.44.0 - "@typescript-eslint/types": 8.44.0 - "@typescript-eslint/typescript-estree": 8.44.0 - "@typescript-eslint/visitor-keys": 8.44.0 + "@typescript-eslint/scope-manager": 8.44.1 + "@typescript-eslint/types": 8.44.1 + "@typescript-eslint/typescript-estree": 8.44.1 + "@typescript-eslint/visitor-keys": 8.44.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -5902,12 +5902,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.44.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.44.1, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.44.0 - "@typescript-eslint/types": ^8.44.0 + "@typescript-eslint/tsconfig-utils": ^8.44.1 + "@typescript-eslint/types": ^8.44.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -5918,12 +5918,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.44.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.44.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.44.0 - "@typescript-eslint/utils": 8.44.0 + "@typescript-eslint/type-utils": 8.44.1 + "@typescript-eslint/utils": 8.44.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -5934,15 +5934,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.44.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.44.1, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.44.0 - "@typescript-eslint/typescript-estree": 8.44.0 - "@typescript-eslint/utils": 8.44.0 + "@typescript-eslint/parser": 8.44.1 + "@typescript-eslint/typescript-estree": 8.44.1 + "@typescript-eslint/utils": 8.44.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5957,13 +5957,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.44.0, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.44.1, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.44.0 - "@typescript-eslint/typescript-estree": 8.44.0 - "@typescript-eslint/visitor-keys": 8.44.0 + "@typescript-eslint/types": 8.44.1 + "@typescript-eslint/typescript-estree": 8.44.1 + "@typescript-eslint/visitor-keys": 8.44.1 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -5974,7 +5974,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.44.0, @typescript-eslint/tsconfig-utils@^8.44.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.44.1, @typescript-eslint/tsconfig-utils@^8.44.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -5987,14 +5987,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.44.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.44.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.44.0 - "@typescript-eslint/types": 8.44.0 - "@typescript-eslint/typescript-estree": 8.44.0 - "@typescript-eslint/utils": 8.44.0 + "@typescript-eslint/parser": 8.44.1 + "@typescript-eslint/types": 8.44.1 + "@typescript-eslint/typescript-estree": 8.44.1 + "@typescript-eslint/utils": 8.44.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6009,7 +6009,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.44.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.44.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.44.1, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.44.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6082,15 +6082,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.44.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.44.1, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.44.0 - "@typescript-eslint/tsconfig-utils": 8.44.0 - "@typescript-eslint/types": 8.44.0 - "@typescript-eslint/visitor-keys": 8.44.0 + "@typescript-eslint/project-service": 8.44.1 + "@typescript-eslint/tsconfig-utils": 8.44.1 + "@typescript-eslint/types": 8.44.1 + "@typescript-eslint/visitor-keys": 8.44.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6108,14 +6108,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.44.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.44.1, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.44.0 - "@typescript-eslint/types": 8.44.0 - "@typescript-eslint/typescript-estree": 8.44.0 + "@typescript-eslint/scope-manager": 8.44.1 + "@typescript-eslint/types": 8.44.1 + "@typescript-eslint/typescript-estree": 8.44.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6127,11 +6127,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.44.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.44.1, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.44.0 + "@typescript-eslint/types": 8.44.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19360,10 +19360,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.44.0 - "@typescript-eslint/parser": 8.44.0 - "@typescript-eslint/typescript-estree": 8.44.0 - "@typescript-eslint/utils": 8.44.0 + "@typescript-eslint/eslint-plugin": 8.44.1 + "@typescript-eslint/parser": 8.44.1 + "@typescript-eslint/typescript-estree": 8.44.1 + "@typescript-eslint/utils": 8.44.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From 9fd1cc6c5aeaca5791aa8190ffa665cac7f91a01 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 25 Sep 2025 10:41:51 -0400 Subject: [PATCH 204/283] chore(deps): update dependency monaco-editor to ~0.53.0 (#11607) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/website/package.json | 2 +- yarn.lock | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/website/package.json b/packages/website/package.json index a8c3c676af7b..47c5a93a6204 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -73,7 +73,7 @@ "make-dir": "*", "mdast-util-from-markdown": "^2.0.1", "mdast-util-mdx": "^3.0.0", - "monaco-editor": "~0.52.0", + "monaco-editor": "~0.53.0", "raw-loader": "^4.0.2", "rimraf": "*", "stylelint": "^16.3.1", diff --git a/yarn.lock b/yarn.lock index dc5062b5cb69..de33b432a111 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5744,6 +5744,13 @@ __metadata: languageName: node linkType: hard +"@types/trusted-types@npm:^1.0.6": + version: 1.0.6 + resolution: "@types/trusted-types@npm:1.0.6" + checksum: 22b8efcb6116ab80d07542047135618ee282f2060c481e472126604d838c09e7dad33c9462d88c130aef2c3133aece516f00d6af7ff814f0612f7d19db720e6d + languageName: node + linkType: hard + "@types/trusted-types@npm:^2.0.2": version: 2.0.2 resolution: "@types/trusted-types@npm:2.0.2" @@ -14612,10 +14619,12 @@ __metadata: languageName: node linkType: hard -"monaco-editor@npm:~0.52.0": - version: 0.52.0 - resolution: "monaco-editor@npm:0.52.0" - checksum: 76ab4ea38dfd2bc5687a2d777d7fc14fd7182ac6ed1ed6819b76a47924434bf3a08bcb75c68cd5aff20db86a7633ac46b335a6971ae21a8723a7dcf3e8289931 +"monaco-editor@npm:~0.53.0": + version: 0.53.0 + resolution: "monaco-editor@npm:0.53.0" + dependencies: + "@types/trusted-types": ^1.0.6 + checksum: 353eca219334b62bdf825f4602aa2b98570c60e7059d257b0567da63fbb79b8eee8bea8448a597e297d0c96c9da3be9eb5153c1e8f279e5450d31c83f02125aa languageName: node linkType: hard @@ -20208,7 +20217,7 @@ __metadata: make-dir: "*" mdast-util-from-markdown: ^2.0.1 mdast-util-mdx: ^3.0.0 - monaco-editor: ~0.52.0 + monaco-editor: ~0.53.0 prettier: 3.6.2 prism-react-renderer: ^2.3.1 raw-loader: ^4.0.2 From 7ceed1755ee797b8b274aaa9b8d8355bc6f19237 Mon Sep 17 00:00:00 2001 From: Abraham Guo Date: Fri, 26 Sep 2025 21:32:41 -0500 Subject: [PATCH 205/283] chore(website): lint for missing `g` flag (#11645) lint for missing g flag --- eslint.config.mjs | 1 + .../website/src/components/editor/createProvideTwoslashInlay.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 391214cb6184..433085ceae89 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -322,6 +322,7 @@ export default defineConfig( 'jsdoc/tag-lines': 'off', 'regexp/no-dupe-disjunctions': 'error', + 'regexp/no-missing-g-flag': 'error', 'regexp/no-useless-character-class': 'error', 'regexp/no-useless-flag': 'error', 'regexp/no-useless-lazy': 'error', diff --git a/packages/website/src/components/editor/createProvideTwoslashInlay.ts b/packages/website/src/components/editor/createProvideTwoslashInlay.ts index 7ec378b4aff7..89f3c7bb26ce 100644 --- a/packages/website/src/components/editor/createProvideTwoslashInlay.ts +++ b/packages/website/src/components/editor/createProvideTwoslashInlay.ts @@ -9,7 +9,7 @@ import type { SandboxInstance } from './useSandboxServices'; function findTwoshashQueries(code: string): RegExpExecArray[] { // RegExp that matches '^//?$' - const twoslashQueryRegex = /^(\s*\/\/\s*\^\?)\s*$/m; + const twoslashQueryRegex = /^(\s*\/\/\s*\^\?)\s*$/gm; return [...code.matchAll(twoslashQueryRegex)]; } From 6743469c38fe75c7dff13c33f49ea6ba81dde10e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Sat, 27 Sep 2025 02:19:28 -0400 Subject: [PATCH 206/283] docs: switch outdated `overrides` FAQ to `files` (#11643) --- docs/troubleshooting/faqs/JavaScript.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/troubleshooting/faqs/JavaScript.mdx b/docs/troubleshooting/faqs/JavaScript.mdx index ac445281df3f..00e4acaf726c 100644 --- a/docs/troubleshooting/faqs/JavaScript.mdx +++ b/docs/troubleshooting/faqs/JavaScript.mdx @@ -11,7 +11,10 @@ import TabItem from '@theme/TabItem'; This is to be expected - ESLint rules do not check file extensions on purpose, as it causes issues in environments that use non-standard extensions (for example, a `.vue` and a `.md` file can both contain TypeScript code to be linted). -If you have some pure JavaScript code that you do not want to apply certain lint rules to, then you can use [ESLint's `overrides` configuration](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns) to turn off certain rules, or even change the parser based on glob patterns. +If you have some pure JavaScript code that you do not want to apply certain lint rules to, then you can use [ESLint's `files` configuration](https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-and-ignores) to either: + +- (recommended) only enable TypeScript-specific rules on TypeScript file extensions +- turn off TypeScript-specific rules on JavaScript-only file extensions ## Should I run ESLint on transpiled output JavaScript files? From c1f891d4aa09455ac6dcf76e2f611cc392faf679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Sat, 27 Sep 2025 02:20:55 -0400 Subject: [PATCH 207/283] fix(ast-spec): narrow ArrowFunctionExpression.generator to false (#11636) --- .../ast-spec/src/expression/ArrowFunctionExpression/spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts b/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts index 271578f8f01f..f160bf5d23d0 100644 --- a/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts +++ b/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts @@ -11,7 +11,7 @@ export interface ArrowFunctionExpression extends BaseNode { async: boolean; body: BlockStatement | Expression; expression: boolean; - generator: boolean; + generator: false; id: null; params: Parameter[]; returnType: TSTypeAnnotation | undefined; From 7eeb093fefb7a8e93041a5eff2024295370a02d5 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Mon, 29 Sep 2025 18:53:43 +0800 Subject: [PATCH 208/283] fix: disable generating declaration maps (#11627) build: disable generating declaration maps --- tsconfig.base.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.base.json b/tsconfig.base.json index ccc53afa64d9..1f6b9987bb96 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -4,7 +4,7 @@ "allowSyntheticDefaultImports": true, "composite": true, "declaration": true, - "declarationMap": true, + "declarationMap": false, "emitDeclarationOnly": true, "emitDecoratorMetadata": false, "esModuleInterop": true, From 590fac6a4ea60df97db0054584f607b9033f50f3 Mon Sep 17 00:00:00 2001 From: Moses Odutusin <48915357+thebolarin@users.noreply.github.com> Date: Mon, 29 Sep 2025 11:55:36 +0100 Subject: [PATCH 209/283] fix(eslint-plugin): [no-base-to-string] check if superclass is ignored (#11617) * chore: check if superclass is ignored * chore: fix linting issues * chore: increase code coverage * chore: add more test * chore: adds requested changes * chore: fix format issues * chore: trigger ci --- .../src/rules/no-base-to-string.ts | 32 ++++++- .../tests/rules/no-base-to-string.test.ts | 96 +++++++++++++++++++ 2 files changed, 127 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts index 53d50bd4694f..3612dc3da1ce 100644 --- a/packages/eslint-plugin/src/rules/no-base-to-string.ts +++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts @@ -212,6 +212,36 @@ export default createRule({ return Usefulness.Always; } + function hasBaseTypes(type: ts.Type): type is ts.InterfaceType { + return ( + tsutils.isObjectType(type) && + tsutils.isObjectFlagSet( + type, + ts.ObjectFlags.Interface | ts.ObjectFlags.Class, + ) + ); + } + + function isIgnoredTypeOrBase( + type: ts.Type, + seen = new Set(), + ): boolean { + if (seen.has(type)) { + return false; + } + + seen.add(type); + + const typeName = getTypeName(checker, type); + return ( + ignoredTypeNames.includes(typeName) || + (hasBaseTypes(type) && + checker + .getBaseTypes(type) + .some(base => isIgnoredTypeOrBase(base, seen))) + ); + } + function collectToStringCertainty( type: ts.Type, visited: Set, @@ -249,7 +279,7 @@ export default createRule({ return Usefulness.Always; } - if (ignoredTypeNames.includes(getTypeName(checker, type))) { + if (isIgnoredTypeOrBase(type)) { return Usefulness.Always; } diff --git a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts index 7e6fa055b55e..a75e9130b921 100644 --- a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts +++ b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts @@ -324,6 +324,47 @@ error.toString(); `, options: [{ ignoredTypeNames: ['MyError'] }], }, + { + code: ` +interface Animal {} +interface Serializable {} +interface Cat extends Animal, Serializable {} + +declare const whiskers: Cat; +whiskers.toString(); + `, + options: [{ ignoredTypeNames: ['Animal'] }], + }, + { + code: ` +interface MyError extends Error {} + +declare const error: MyError; +error.toString(); + `, + }, + { + code: ` +class UnknownBase {} +class CustomError extends UnknownBase {} + +declare const err: CustomError; +err.toString(); + `, + options: [{ ignoredTypeNames: ['UnknownBase'] }], + }, + { + code: ` +interface Animal {} +interface Dog extends Animal {} +interface Cat extends Animal {} + +declare const dog: Dog; +declare const cat: Cat; +cat.toString(); + `, + options: [{ ignoredTypeNames: ['Animal'] }], + }, ` function String(value) { return value; @@ -2265,5 +2306,60 @@ v.join(); }, ], }, + { + code: ` +interface Dog extends Animal {} + +declare const labrador: Dog; +labrador.toString(); + `, + errors: [ + { + data: { + certainty: 'will', + name: 'labrador', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` +interface A extends B {} +interface B extends A {} + +declare const a: A; +a.toString(); + `, + errors: [ + { + data: { + certainty: 'will', + name: 'a', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + interface Base {} + interface Left extends Base {} + interface Right extends Base {} + interface Diamond extends Left, Right {} + + declare const d: Diamond; + d.toString(); + `, + errors: [ + { + data: { + certainty: 'will', + name: 'd', + }, + messageId: 'baseToString', + }, + ], + }, ], }); From 9530e0266919d5bb539023dd949f199d6a2d593a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 06:59:55 -0400 Subject: [PATCH 210/283] chore(deps): update dependency typedoc-plugin-markdown to v4.9.0 (#11649) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index de33b432a111..c033c51b3ee2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19340,11 +19340,11 @@ __metadata: linkType: hard "typedoc-plugin-markdown@npm:^4.6.3": - version: 4.8.1 - resolution: "typedoc-plugin-markdown@npm:4.8.1" + version: 4.9.0 + resolution: "typedoc-plugin-markdown@npm:4.9.0" peerDependencies: typedoc: 0.28.x - checksum: 5a8a78728d6c0831292591d0f0e3594818d7c616a977b2164fc2d4744828644e8bceeea2ab62d4a376671337c9b87392a4192d1022008c0a3504df6f2971d2d4 + checksum: cabdbf299e7f4c3db14878cfd630b2447bdee97dd668916028b4d8f5cb2049126178e747acd47a476806ebde35a112dec6c7b678198ad222087fc8410b2c0d1c languageName: node linkType: hard From ad32ce2e9b5f61f93d9d2bf699d7f1abe9155a17 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 29 Sep 2025 23:08:22 +0800 Subject: [PATCH 211/283] chore: update test fixtures to avoid spellcheck error (#11626) * chore: update test fixtures to avoid spellcheck error * Update snapshot --- .../fixtures/_error_/key-constructor-string-escaped/fixture.ts | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../key-constructor-string-escaped/snapshots/2-Babel-Error.shot | 2 +- .../fixtures/_error_/key-constructor-string-escaped/fixture.ts | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../key-constructor-string-escaped/snapshots/2-Babel-Error.shot | 2 +- .../fixtures/_error_/key-constructor-string-escaped/fixture.ts | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../key-constructor-string-escaped/snapshots/2-Babel-Error.shot | 2 +- .../fixtures/_error_/key-constructor-string-escaped/fixture.ts | 2 +- .../snapshots/1-TSESTree-Error.shot | 2 +- .../key-constructor-string-escaped/snapshots/2-Babel-Error.shot | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts index fe9d09f5c8b5..bbf0ef59cee9 100644 --- a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts @@ -1,3 +1,3 @@ class Foo { - accessor '\u{63}onstructor' + accessor 'construct\u{6f}r' } diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot index 1efee502ef1a..bb514364efe2 100644 --- a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot @@ -3,7 +3,7 @@ exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string-escaped > TSESTree - Error`] TSError 1 | class Foo { -> 2 | accessor '\u{63}onstructor' +> 2 | accessor 'construct\u{6f}r' | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. 3 | } 4 | diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot index b36c85229b5d..056333536528 100644 --- a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot @@ -3,7 +3,7 @@ exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string-escaped > Babel - Error`] BabelError 1 | class Foo { -> 2 | accessor '\u{63}onstructor' +> 2 | accessor 'construct\u{6f}r' | ^ Classes may not have a field named 'constructor'. (2:11) 3 | } 4 | diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts index 5dc0386f85fe..3449ebe932d7 100644 --- a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts @@ -1,3 +1,3 @@ class Foo { - '\u{63}onstructor' + 'construct\u{6f}r' } diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot index 53cc50de6a35..e7cc82f40aad 100644 --- a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot @@ -3,7 +3,7 @@ exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string-escaped > TSESTree - Error`] TSError 1 | class Foo { -> 2 | '\u{63}onstructor' +> 2 | 'construct\u{6f}r' | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. 3 | } 4 | diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot index 130b27dcc413..702bec4df14e 100644 --- a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot @@ -3,7 +3,7 @@ exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string-escaped > Babel - Error`] BabelError 1 | class Foo { -> 2 | '\u{63}onstructor' +> 2 | 'construct\u{6f}r' | ^ Classes may not have a field named 'constructor'. (2:2) 3 | } 4 | diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts index 2d83385d93bf..cf5081dbe114 100644 --- a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts @@ -1,3 +1,3 @@ abstract class Foo { - accessor '\u{63}onstructor' + accessor 'construct\u{6f}r' } diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot index e2a98ea43e52..c852da13a3fa 100644 --- a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot @@ -3,7 +3,7 @@ exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string-escaped > TSESTree - Error`] TSError 1 | abstract class Foo { -> 2 | accessor '\u{63}onstructor' +> 2 | accessor 'construct\u{6f}r' | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. 3 | } 4 | diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot index 73035ad32ef8..8b2bdb1d6685 100644 --- a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot @@ -3,7 +3,7 @@ exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string-escaped > Babel - Error`] BabelError 1 | abstract class Foo { -> 2 | accessor '\u{63}onstructor' +> 2 | accessor 'construct\u{6f}r' | ^ Classes may not have a field named 'constructor'. (2:11) 3 | } 4 | diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts index 3964b6ad536d..59eeeb52941e 100644 --- a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts @@ -1,3 +1,3 @@ abstract class Foo { - '\u{63}onstructor' + 'construct\u{6f}r' } diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot index 832a69aba874..7db0a089389d 100644 --- a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot @@ -3,7 +3,7 @@ exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string-escaped > TSESTree - Error`] TSError 1 | abstract class Foo { -> 2 | '\u{63}onstructor' +> 2 | 'construct\u{6f}r' | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'. 3 | } 4 | diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot index 972fa63aaaf7..3d7fc01c39af 100644 --- a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot @@ -3,7 +3,7 @@ exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string-escaped > Babel - Error`] BabelError 1 | abstract class Foo { -> 2 | '\u{63}onstructor' +> 2 | 'construct\u{6f}r' | ^ Classes may not have a field named 'constructor'. (2:2) 3 | } 4 | From eb57a3ed083d45b4b978cf10e0aa5be46727f597 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 29 Sep 2025 23:09:59 +0800 Subject: [PATCH 212/283] chore: slightly improve `convertComments` (#11632) --- packages/typescript-estree/src/convert-comments.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/typescript-estree/src/convert-comments.ts b/packages/typescript-estree/src/convert-comments.ts index 234f62ec802c..c1d6a6e05121 100644 --- a/packages/typescript-estree/src/convert-comments.ts +++ b/packages/typescript-estree/src/convert-comments.ts @@ -34,14 +34,14 @@ export function convertComments( const textEnd = comment.kind === ts.SyntaxKind.SingleLineCommentTrivia ? // single line comments end at the end - range[1] - textStart + range[1] : // multiline comments end 2 characters early - range[1] - textStart - 2; + range[1] - 2; comments.push({ type, loc, range, - value: code.slice(textStart, textStart + textEnd), + value: code.slice(textStart, textEnd), }); }, ast, From 9aebdaf1b31b7f0fdc2c6a18d34a347accf59568 Mon Sep 17 00:00:00 2001 From: Moses Odutusin <48915357+thebolarin@users.noreply.github.com> Date: Mon, 29 Sep 2025 16:11:16 +0100 Subject: [PATCH 213/283] docs: add parserOptions note to Type Checking (#11523) * docs: add parserOptions note to Type Checking * chore: update shared-config * Update docs/users/Shared_Configurations.mdx --------- Co-authored-by: Joshua Chen --- docs/users/Shared_Configurations.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/users/Shared_Configurations.mdx b/docs/users/Shared_Configurations.mdx index ea4c554e37af..ae59cd7c360b 100644 --- a/docs/users/Shared_Configurations.mdx +++ b/docs/users/Shared_Configurations.mdx @@ -67,14 +67,21 @@ module.exports = { If your project enables [typed linting](../getting-started/Typed_Linting.mdx), we suggest enabling the [`recommended-type-checked`](#recommended-type-checked) and [`stylistic-type-checked`](#stylistic-type-checked) configurations to start: +:::note +To use type-checking, you also need to configure `languageOptions.parserOptions` as shown in [typed linting docs](../getting-started/Typed_Linting.mdx). +::: + ```js title="eslint.config.mjs" export default defineConfig( eslint.configs.recommended, + // Added lines start tseslint.configs.recommendedTypeChecked, tseslint.configs.stylisticTypeChecked, + // Added lines end + // Other configuration... ); ``` @@ -85,9 +92,12 @@ export default defineConfig( module.exports = { extends: [ 'eslint:recommended', + // Added lines start 'plugin:@typescript-eslint/recommended-type-checked', 'plugin:@typescript-eslint/stylistic-type-checked', + // Added lines end ], + // Other configuration... }; ``` From f2eeb9d9f354fc1fe5ba22272ad2dc747cec0c1d Mon Sep 17 00:00:00 2001 From: Yukihiro Hasegawa <49516827+y-hsgw@users.noreply.github.com> Date: Tue, 30 Sep 2025 00:21:41 +0900 Subject: [PATCH 214/283] feat(eslint-plugin): expose rule name via RuleModule interface (#11616) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: expose rule name on RuleModule interface * fix: resolve type errors after adding name to RuleModule * Update packages/utils/src/ts-eslint/Rule.ts Co-authored-by: Josh Goldberg ✨ * Update packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts Co-authored-by: Josh Goldberg ✨ * fix: update rule name in no-unused-vars test to match definition * refactor: add name property to RuleWithMeta --------- Co-authored-by: Josh Goldberg ✨ --- .../rules/no-unused-vars/no-unused-vars-eslint.test.ts | 1 + .../tests/rules/no-unused-vars/no-unused-vars.test.ts | 1 + packages/rule-tester/tests/RuleTester.test.ts | 6 ++++++ packages/rule-tester/tests/filename.test.ts | 1 + packages/utils/src/eslint-utils/RuleCreator.ts | 4 ++++ packages/utils/src/ts-eslint/Rule.ts | 5 +++++ 6 files changed, 18 insertions(+) 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 d05d538d2731..aa1fb5b9b018 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 @@ -40,6 +40,7 @@ ruleTester.defineRule('use-every-a', { schema: [], type: 'problem', }, + name: 'use-every-a', }); /** 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 5f40bbcdc3cc..10014dcc66d7 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 @@ -32,6 +32,7 @@ ruleTester.defineRule('collect-unused-vars', { schema: [], type: 'problem', }, + name: 'collect-unused-vars', }); ruleTester.run('no-unused-vars', rule, { diff --git a/packages/rule-tester/tests/RuleTester.test.ts b/packages/rule-tester/tests/RuleTester.test.ts index 73a5a05d45cf..054986010bc9 100644 --- a/packages/rule-tester/tests/RuleTester.test.ts +++ b/packages/rule-tester/tests/RuleTester.test.ts @@ -94,6 +94,7 @@ const NOOP_RULE: RuleModule<'error'> = { schema: [], type: 'problem', }, + name: 'rule', }; function windowsToPosixPath(p: string): string { @@ -1108,6 +1109,7 @@ describe('RuleTester - hooks', () => { schema: [], type: 'problem', }, + name: 'rule', }; const ruleTester = new RuleTester(); @@ -1331,6 +1333,7 @@ describe('RuleTester - multipass fixer', () => { schema: [], type: 'problem', }, + name: 'rule', }; it('passes with no output', () => { @@ -1416,6 +1419,7 @@ describe('RuleTester - multipass fixer', () => { schema: [], type: 'problem', }, + name: 'rule', }; it('passes with correct string output', () => { @@ -1538,6 +1542,7 @@ describe('RuleTester - multipass fixer', () => { schema: [], type: 'problem', }, + name: 'rule', }; it('passes with correct array output', () => { @@ -1644,6 +1649,7 @@ describe('RuleTester - run types', () => { ], type: 'suggestion', }, + name: 'rule', }; describe('infer from `rule` parameter', () => { diff --git a/packages/rule-tester/tests/filename.test.ts b/packages/rule-tester/tests/filename.test.ts index 8f3442cf670a..943ab1894a38 100644 --- a/packages/rule-tester/tests/filename.test.ts +++ b/packages/rule-tester/tests/filename.test.ts @@ -19,6 +19,7 @@ const rule = ESLintUtils.RuleCreator.withoutDocs({ type: 'problem', hasSuggestions: true, }, + name: 'rule', defaultOptions: [], create: context => ({ Program(node): void { diff --git a/packages/utils/src/eslint-utils/RuleCreator.ts b/packages/utils/src/eslint-utils/RuleCreator.ts index cd06aee6231f..57ab282c3632 100644 --- a/packages/utils/src/eslint-utils/RuleCreator.ts +++ b/packages/utils/src/eslint-utils/RuleCreator.ts @@ -36,6 +36,7 @@ export interface RuleWithMeta< Docs = unknown, > extends RuleCreateAndOptions { meta: RuleMetaData; + name: string; } export interface RuleWithMetaAndName< @@ -76,6 +77,7 @@ export function RuleCreator( url: urlCreator(name), }, }, + name, ...rule, }); }; @@ -89,6 +91,7 @@ function createRule< create, defaultOptions, meta, + name, }: Readonly>): RuleModule< MessageIds, Options, @@ -101,6 +104,7 @@ function createRule< }, defaultOptions, meta, + name, }; } diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 1a4920a3e79e..be28d4a0b9ec 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -735,6 +735,11 @@ export interface RuleModule< * Metadata about the rule */ meta: RuleMetaData; + + /** + * Rule name + */ + name: string; } export type AnyRuleModule = RuleModule; From 61bbd3413dc7d3d54e2e15e961ffe47feb451d0b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 11:29:04 -0400 Subject: [PATCH 215/283] chore(deps): update dependency knip to v5.64.0 (#11658) * chore(deps): update dependency knip to v5.64.0 * Remove redundant entries --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Josh Goldberg --- knip.ts | 9 +- yarn.lock | 253 +++++++++++++++++++++++++++--------------------------- 2 files changed, 127 insertions(+), 135 deletions(-) diff --git a/knip.ts b/knip.ts index 2756c39029ba..517eedc8bd68 100644 --- a/knip.ts +++ b/knip.ts @@ -116,11 +116,7 @@ export default { }, 'packages/types': { - project: [ - 'src/**/*.ts!', - '!src/generated/**/*.ts', - 'tools/copy-ast-spec.mts', - ], + project: ['src/**/*.ts!', '!src/generated/**/*.ts'], }, 'packages/typescript-estree': { @@ -179,7 +175,6 @@ export default { '@docusaurus/useDocusaurusContext', '@docusaurus/useBaseUrl', '@docusaurus/BrowserOnly', - '@docusaurus/module-type-aliases', '@generated/docusaurus.config', '^@site/.*', '^@theme/.*', @@ -203,7 +198,7 @@ export default { ], ignoreDependencies: [ // virtual module - 'vt', + 'vt:*', ], }, 'tools/dummypkg': {}, diff --git a/yarn.lock b/yarn.lock index c033c51b3ee2..fe900625b64a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3290,31 +3290,31 @@ __metadata: languageName: node linkType: hard -"@emnapi/core@npm:^1.1.0, @emnapi/core@npm:^1.4.5": - version: 1.4.5 - resolution: "@emnapi/core@npm:1.4.5" +"@emnapi/core@npm:^1.1.0, @emnapi/core@npm:^1.5.0": + version: 1.5.0 + resolution: "@emnapi/core@npm:1.5.0" dependencies: - "@emnapi/wasi-threads": 1.0.4 + "@emnapi/wasi-threads": 1.1.0 tslib: ^2.4.0 - checksum: ae4800fe2bcc1c790e588ce19e299fa85c6e1fe2a4ac44eda26be1ad4220b6121de18a735d5fa81307a86576fe2038ab53bde5f8f6aa3708b9276d6600a50b52 + checksum: 089a506a4f6a2416b9917050802c20ac76b350b1160116482c3542cf89cd707c832ca18c163ddac4e9cb1df06f02e6cd324cadc60b82aed27d51e0baca1f4b4f languageName: node linkType: hard -"@emnapi/runtime@npm:^1.1.0, @emnapi/runtime@npm:^1.4.5": - version: 1.4.5 - resolution: "@emnapi/runtime@npm:1.4.5" +"@emnapi/runtime@npm:^1.1.0, @emnapi/runtime@npm:^1.5.0": + version: 1.5.0 + resolution: "@emnapi/runtime@npm:1.5.0" dependencies: tslib: ^2.4.0 - checksum: 99ab25d55cf1ceeec12f83b60f48e744f8e1dfc8d52a2ed81b3b09bf15182e61ef55f25b69d51ec83044861bddaa4404e7c3285bf71dd518a7980867e41c2a10 + checksum: 03b23bdc0bb72bce4d8967ca29d623c2599af18977975c10532577db2ec89a57d97d2c76c5c4bde856c7c29302b9f7af357e921c42bd952bdda206972185819a languageName: node linkType: hard -"@emnapi/wasi-threads@npm:1.0.4": - version: 1.0.4 - resolution: "@emnapi/wasi-threads@npm:1.0.4" +"@emnapi/wasi-threads@npm:1.1.0": + version: 1.1.0 + resolution: "@emnapi/wasi-threads@npm:1.1.0" dependencies: tslib: ^2.4.0 - checksum: 106cbb0c86e0e5a8830a3262105a6531e09ebcc21724f0da64ec49d76d87cbf894e0afcbc3a3621a104abf7465e3f758bffb5afa61a308c31abc847525c10d93 + checksum: 6cffe35f3e407ae26236092991786db5968b4265e6e55f4664bf6f2ce0508e2a02a44ce6ebb16f2acd2f6589efb293f4f9d09cc9fbf80c00fc1a203accc94196 languageName: node linkType: hard @@ -4111,14 +4111,14 @@ __metadata: languageName: node linkType: hard -"@napi-rs/wasm-runtime@npm:^1.0.3": - version: 1.0.3 - resolution: "@napi-rs/wasm-runtime@npm:1.0.3" +"@napi-rs/wasm-runtime@npm:^1.0.5": + version: 1.0.5 + resolution: "@napi-rs/wasm-runtime@npm:1.0.5" dependencies: - "@emnapi/core": ^1.4.5 - "@emnapi/runtime": ^1.4.5 - "@tybys/wasm-util": ^0.10.0 - checksum: e105c8f3bfc07ccbbccc17e6abb6d3f5a9cf685930842c4f5439c6d4a7ccab3d89da43fc8627f222a021beb7f78171f80ce3c488e3bd3a2156a049cd8224ebf0 + "@emnapi/core": ^1.5.0 + "@emnapi/runtime": ^1.5.0 + "@tybys/wasm-util": ^0.10.1 + checksum: 22005c6e9d77854938cf0c832bb630533108ea1f3617d1cf40fa814bc1351412fb98d4d4ea63099c9963bc4ca63cf691ca6e370a490adc5fd7d42721005367c5 languageName: node linkType: hard @@ -4335,137 +4335,137 @@ __metadata: languageName: node linkType: hard -"@oxc-resolver/binding-android-arm-eabi@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-android-arm-eabi@npm:11.7.1" +"@oxc-resolver/binding-android-arm-eabi@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-android-arm-eabi@npm:11.8.4" conditions: os=android & cpu=arm languageName: node linkType: hard -"@oxc-resolver/binding-android-arm64@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-android-arm64@npm:11.7.1" +"@oxc-resolver/binding-android-arm64@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-android-arm64@npm:11.8.4" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@oxc-resolver/binding-darwin-arm64@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-darwin-arm64@npm:11.7.1" +"@oxc-resolver/binding-darwin-arm64@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-darwin-arm64@npm:11.8.4" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@oxc-resolver/binding-darwin-x64@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-darwin-x64@npm:11.7.1" +"@oxc-resolver/binding-darwin-x64@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-darwin-x64@npm:11.8.4" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@oxc-resolver/binding-freebsd-x64@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-freebsd-x64@npm:11.7.1" +"@oxc-resolver/binding-freebsd-x64@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-freebsd-x64@npm:11.8.4" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.7.1" +"@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.8.4" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm-musleabihf@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-linux-arm-musleabihf@npm:11.7.1" +"@oxc-resolver/binding-linux-arm-musleabihf@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-linux-arm-musleabihf@npm:11.8.4" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm64-gnu@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-linux-arm64-gnu@npm:11.7.1" +"@oxc-resolver/binding-linux-arm64-gnu@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-linux-arm64-gnu@npm:11.8.4" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm64-musl@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-linux-arm64-musl@npm:11.7.1" +"@oxc-resolver/binding-linux-arm64-musl@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-linux-arm64-musl@npm:11.8.4" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@oxc-resolver/binding-linux-ppc64-gnu@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-linux-ppc64-gnu@npm:11.7.1" +"@oxc-resolver/binding-linux-ppc64-gnu@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-linux-ppc64-gnu@npm:11.8.4" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-riscv64-gnu@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-linux-riscv64-gnu@npm:11.7.1" +"@oxc-resolver/binding-linux-riscv64-gnu@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-linux-riscv64-gnu@npm:11.8.4" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-riscv64-musl@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-linux-riscv64-musl@npm:11.7.1" +"@oxc-resolver/binding-linux-riscv64-musl@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-linux-riscv64-musl@npm:11.8.4" conditions: os=linux & cpu=riscv64 & libc=musl languageName: node linkType: hard -"@oxc-resolver/binding-linux-s390x-gnu@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-linux-s390x-gnu@npm:11.7.1" +"@oxc-resolver/binding-linux-s390x-gnu@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-linux-s390x-gnu@npm:11.8.4" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-x64-gnu@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-linux-x64-gnu@npm:11.7.1" +"@oxc-resolver/binding-linux-x64-gnu@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-linux-x64-gnu@npm:11.8.4" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-x64-musl@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-linux-x64-musl@npm:11.7.1" +"@oxc-resolver/binding-linux-x64-musl@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-linux-x64-musl@npm:11.8.4" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@oxc-resolver/binding-wasm32-wasi@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-wasm32-wasi@npm:11.7.1" +"@oxc-resolver/binding-wasm32-wasi@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-wasm32-wasi@npm:11.8.4" dependencies: - "@napi-rs/wasm-runtime": ^1.0.3 + "@napi-rs/wasm-runtime": ^1.0.5 conditions: cpu=wasm32 languageName: node linkType: hard -"@oxc-resolver/binding-win32-arm64-msvc@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-win32-arm64-msvc@npm:11.7.1" +"@oxc-resolver/binding-win32-arm64-msvc@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-win32-arm64-msvc@npm:11.8.4" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@oxc-resolver/binding-win32-ia32-msvc@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-win32-ia32-msvc@npm:11.7.1" +"@oxc-resolver/binding-win32-ia32-msvc@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-win32-ia32-msvc@npm:11.8.4" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@oxc-resolver/binding-win32-x64-msvc@npm:11.7.1": - version: 11.7.1 - resolution: "@oxc-resolver/binding-win32-x64-msvc@npm:11.7.1" +"@oxc-resolver/binding-win32-x64-msvc@npm:11.8.4": + version: 11.8.4 + resolution: "@oxc-resolver/binding-win32-x64-msvc@npm:11.8.4" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -5226,12 +5226,12 @@ __metadata: languageName: node linkType: hard -"@tybys/wasm-util@npm:^0.10.0": - version: 0.10.0 - resolution: "@tybys/wasm-util@npm:0.10.0" +"@tybys/wasm-util@npm:^0.10.1": + version: 0.10.1 + resolution: "@tybys/wasm-util@npm:0.10.1" dependencies: tslib: ^2.4.0 - checksum: c3034e0535b91f28dc74c72fc538f353cda0fa9107bb313e8b89f101402b7dc8e400442d07560775cdd7cb63d33549867ed776372fbaa41dc68bcd108e5cff8a + checksum: b8b281ffa9cd01cb6d45a4dddca2e28fd0cb6ad67cf091ba4a73ac87c0d6bd6ce188c332c489e87c20b0750b0b6fe3b99e30e1cd2227ec16da692f51c778944e languageName: node linkType: hard @@ -12657,12 +12657,12 @@ __metadata: languageName: node linkType: hard -"jiti@npm:^2.5.1": - version: 2.5.1 - resolution: "jiti@npm:2.5.1" +"jiti@npm:^2.6.0": + version: 2.6.0 + resolution: "jiti@npm:2.6.0" bin: jiti: lib/jiti-cli.mjs - checksum: db901281e01013c27d46d6c5cde5fa817082f32232c92099043df11e135d00ccd1b4356a9ba356a3293e91855bd7437b6df5ae0ae6ad2c384d9bd59df926633c + checksum: 2bd869527bfbb23b5210344881b4f2f5fd86b7c9c703001036544762411af73fe0f95097ba025a738874085143939664173360aafea7d7cbc4ca3bbc325774a9 languageName: node linkType: hard @@ -12900,29 +12900,28 @@ __metadata: linkType: hard "knip@npm:^5.41.1": - version: 5.63.0 - resolution: "knip@npm:5.63.0" + version: 5.64.1 + resolution: "knip@npm:5.64.1" dependencies: "@nodelib/fs.walk": ^1.2.3 fast-glob: ^3.3.3 formatly: ^0.3.0 - jiti: ^2.5.1 + jiti: ^2.6.0 js-yaml: ^4.1.0 minimist: ^1.2.8 - oxc-resolver: ^11.6.2 + oxc-resolver: ^11.8.3 picocolors: ^1.1.1 picomatch: ^4.0.1 smol-toml: ^1.4.1 strip-json-comments: 5.0.2 - zod: ^3.22.4 - zod-validation-error: ^3.0.3 + zod: ^4.1.11 peerDependencies: "@types/node": ">=18" - typescript: ">=5.0.4" + typescript: ">=5.0.4 <7" bin: knip: bin/knip.js knip-bun: bin/knip-bun.js - checksum: bbb8eda2469c3f2eddfa19e746732984bd6ac0485e34b650933f172ceecc8e6ac84ff8a481c85dcc3792cba3c135c63ab13f0159c4df4872ad3accb6c0a4cb84 + checksum: b56970725cc6949ce4b0c8922fa9e89408f4b6ad92f29af561e011f533bced83b9ec30e282a25a2b5c0de4206673f3317f09151df3c6f39a2423efe95514dfcc languageName: node linkType: hard @@ -15180,29 +15179,29 @@ __metadata: languageName: node linkType: hard -"oxc-resolver@npm:^11.6.2": - version: 11.7.1 - resolution: "oxc-resolver@npm:11.7.1" - dependencies: - "@oxc-resolver/binding-android-arm-eabi": 11.7.1 - "@oxc-resolver/binding-android-arm64": 11.7.1 - "@oxc-resolver/binding-darwin-arm64": 11.7.1 - "@oxc-resolver/binding-darwin-x64": 11.7.1 - "@oxc-resolver/binding-freebsd-x64": 11.7.1 - "@oxc-resolver/binding-linux-arm-gnueabihf": 11.7.1 - "@oxc-resolver/binding-linux-arm-musleabihf": 11.7.1 - "@oxc-resolver/binding-linux-arm64-gnu": 11.7.1 - "@oxc-resolver/binding-linux-arm64-musl": 11.7.1 - "@oxc-resolver/binding-linux-ppc64-gnu": 11.7.1 - "@oxc-resolver/binding-linux-riscv64-gnu": 11.7.1 - "@oxc-resolver/binding-linux-riscv64-musl": 11.7.1 - "@oxc-resolver/binding-linux-s390x-gnu": 11.7.1 - "@oxc-resolver/binding-linux-x64-gnu": 11.7.1 - "@oxc-resolver/binding-linux-x64-musl": 11.7.1 - "@oxc-resolver/binding-wasm32-wasi": 11.7.1 - "@oxc-resolver/binding-win32-arm64-msvc": 11.7.1 - "@oxc-resolver/binding-win32-ia32-msvc": 11.7.1 - "@oxc-resolver/binding-win32-x64-msvc": 11.7.1 +"oxc-resolver@npm:^11.8.3": + version: 11.8.4 + resolution: "oxc-resolver@npm:11.8.4" + dependencies: + "@oxc-resolver/binding-android-arm-eabi": 11.8.4 + "@oxc-resolver/binding-android-arm64": 11.8.4 + "@oxc-resolver/binding-darwin-arm64": 11.8.4 + "@oxc-resolver/binding-darwin-x64": 11.8.4 + "@oxc-resolver/binding-freebsd-x64": 11.8.4 + "@oxc-resolver/binding-linux-arm-gnueabihf": 11.8.4 + "@oxc-resolver/binding-linux-arm-musleabihf": 11.8.4 + "@oxc-resolver/binding-linux-arm64-gnu": 11.8.4 + "@oxc-resolver/binding-linux-arm64-musl": 11.8.4 + "@oxc-resolver/binding-linux-ppc64-gnu": 11.8.4 + "@oxc-resolver/binding-linux-riscv64-gnu": 11.8.4 + "@oxc-resolver/binding-linux-riscv64-musl": 11.8.4 + "@oxc-resolver/binding-linux-s390x-gnu": 11.8.4 + "@oxc-resolver/binding-linux-x64-gnu": 11.8.4 + "@oxc-resolver/binding-linux-x64-musl": 11.8.4 + "@oxc-resolver/binding-wasm32-wasi": 11.8.4 + "@oxc-resolver/binding-win32-arm64-msvc": 11.8.4 + "@oxc-resolver/binding-win32-ia32-msvc": 11.8.4 + "@oxc-resolver/binding-win32-x64-msvc": 11.8.4 napi-postinstall: ^0.3.0 dependenciesMeta: "@oxc-resolver/binding-android-arm-eabi": @@ -15243,7 +15242,7 @@ __metadata: optional: true "@oxc-resolver/binding-win32-x64-msvc": optional: true - checksum: 44b60d188ec8f27c193d056317944ad70f2aca5e1435ee4a03d24a07c5b4c460ed57a6a855a3f4b268014d374059199a17ae2c14452e08d2ad6a53c665bf1180 + checksum: 21a513b06d0f15a4ea941c5554485796b22694ef87555b06c29d86acd45aaf5de54698eabb649a8095a0e303212c66c184404c64eb5b3e24c60ba50c46f26e26 languageName: node linkType: hard @@ -20775,22 +20774,20 @@ __metadata: languageName: node linkType: hard -"zod-validation-error@npm:^3.0.3": - version: 3.2.0 - resolution: "zod-validation-error@npm:3.2.0" - peerDependencies: - zod: ^3.18.0 - checksum: 4d541566ff4bd54cc7c1c547ee69e50a11ff14c48d378f7c600146513e250067f8a9bac0170285d346d00095685cbc29a4cd84f9c6371bb4fd3ed29d0fb98be3 - languageName: node - linkType: hard - -"zod@npm:^3.22.4, zod@npm:^3.25.67": +"zod@npm:^3.25.67": version: 3.25.67 resolution: "zod@npm:3.25.67" checksum: 56ab904d33b1cd00041ce64ae05b0628fcbfeb7e707fa31cd498a97b540135e4dfe685200c9c62aea307695ee132870b4bc34f035228ea728aa75cc96a4954cb languageName: node linkType: hard +"zod@npm:^4.1.11": + version: 4.1.11 + resolution: "zod@npm:4.1.11" + checksum: 022d59f85ebe054835fbcdc96a93c01479a64321104f846cb5644812c91e00d17ae3479f823956ec9b04e4351dd32841e1f12c567e81bc43f6e21ef5cc02ce3c + languageName: node + linkType: hard + "zwitch@npm:^2.0.0": version: 2.0.4 resolution: "zwitch@npm:2.0.4" From fcff188cb074cc8c17b8434f806a5339904ee515 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 11:33:54 -0400 Subject: [PATCH 216/283] chore(deps): update eslint monorepo to v9.36.0 (#11644) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Josh Goldberg ✨ --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index fe900625b64a..a56cec5cef00 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3762,10 +3762,10 @@ __metadata: languageName: node linkType: hard -"@eslint/js@npm:*, @eslint/js@npm:9.35.0, @eslint/js@npm:^9.26.0": - version: 9.35.0 - resolution: "@eslint/js@npm:9.35.0" - checksum: ea644f0b1abb4da49ba0cb61db4d039492e844d959e7127dd7c501aa27a256348496bce43334ecd3ca990c9a49fb3ea93d6729de0a79d216f63869236c153148 +"@eslint/js@npm:*, @eslint/js@npm:9.36.0, @eslint/js@npm:^9.26.0": + version: 9.36.0 + resolution: "@eslint/js@npm:9.36.0" + checksum: 17ff28272337357783b55e76417e61306e528dced99bb49d49e06298023b4071cb30f4aeb0bf30a337817d3eb3132784db6b8edd3a90118c5217833136712713 languageName: node linkType: hard @@ -9979,8 +9979,8 @@ __metadata: linkType: hard "eslint@npm:*, eslint@npm:^9.15.0, eslint@npm:^9.26.0": - version: 9.35.0 - resolution: "eslint@npm:9.35.0" + version: 9.36.0 + resolution: "eslint@npm:9.36.0" dependencies: "@eslint-community/eslint-utils": ^4.8.0 "@eslint-community/regexpp": ^4.12.1 @@ -9988,7 +9988,7 @@ __metadata: "@eslint/config-helpers": ^0.3.1 "@eslint/core": ^0.15.2 "@eslint/eslintrc": ^3.3.1 - "@eslint/js": 9.35.0 + "@eslint/js": 9.36.0 "@eslint/plugin-kit": ^0.3.5 "@humanfs/node": ^0.16.6 "@humanwhocodes/module-importer": ^1.0.1 @@ -10024,7 +10024,7 @@ __metadata: optional: true bin: eslint: bin/eslint.js - checksum: 45b12539f84d7ae474920f279b4a0f1e1074eaff152f6d2b6a5fb112174914853f18071876da6421c11d678319fd78745ea03ed56b6808d77f76397e488cde28 + checksum: 08a02a1d474cf7ea63ef9328e638751c939a1c08b99f7812f0f44a96e3b8346ab3bbca3af57da8b3e74cbc6619e41645fd3dcb3adda94d1cb826f02664e2d44c languageName: node linkType: hard From 967764e158c5935430149b3563c403b72d5d6366 Mon Sep 17 00:00:00 2001 From: mdm317 Date: Tue, 30 Sep 2025 00:35:24 +0900 Subject: [PATCH 217/283] fix(eslint-plugin): [prefer-nullish-coalescing] ignoreBooleanCoercion should not apply to top-level ternary expressions (#11614) report only when ternary is top-level inside Boolean --- .../src/rules/prefer-nullish-coalescing.ts | 6 +- .../rules/prefer-nullish-coalescing.test.ts | 84 +++++++++++++------ 2 files changed, 63 insertions(+), 27 deletions(-) diff --git a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts index d611e7b079a9..0956b558b10a 100644 --- a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts +++ b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts @@ -301,7 +301,11 @@ export default createRule({ if ( ignoreBooleanCoercion === true && - isBooleanConstructorContext(node, context) + isBooleanConstructorContext(node, context) && + !( + node.type === AST_NODE_TYPES.ConditionalExpression && + node.parent.type === AST_NODE_TYPES.CallExpression + ) ) { return false; } diff --git a/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts b/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts index 618d1c244414..e2c5f17c8e5d 100644 --- a/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts @@ -1253,32 +1253,6 @@ const test = Boolean(((a = b), b || c)); }, { code: ` -let a: string | true | undefined; -let b: string | boolean | undefined; - -const x = Boolean(a ? a : b); - `, - options: [ - { - ignoreBooleanCoercion: true, - }, - ], - }, - { - code: ` -let a: string | boolean | undefined; -let b: string | boolean | undefined; - -const test = Boolean(!a ? b : a); - `, - options: [ - { - ignoreBooleanCoercion: true, - }, - ], - }, - { - code: ` let a: string | boolean | undefined; let b: string | boolean | undefined; let c: string | boolean | undefined; @@ -5089,6 +5063,64 @@ const x = Boolean(1 + (a ?? b)); let a: string | true | undefined; let b: string | boolean | undefined; +const x = Boolean(a ? a : b); + `, + errors: [ + { + messageId: 'preferNullishOverTernary', + suggestions: [ + { + messageId: 'suggestNullish', + output: ` +let a: string | true | undefined; +let b: string | boolean | undefined; + +const x = Boolean(a ?? b); + `, + }, + ], + }, + ], + options: [ + { + ignoreBooleanCoercion: true, + }, + ], + }, + { + code: ` +let a: string | boolean | undefined; +let b: string | boolean | undefined; + +const test = Boolean(!a ? b : a); + `, + errors: [ + { + messageId: 'preferNullishOverTernary', + suggestions: [ + { + messageId: 'suggestNullish', + output: ` +let a: string | boolean | undefined; +let b: string | boolean | undefined; + +const test = Boolean(a ?? b); + `, + }, + ], + }, + ], + options: [ + { + ignoreBooleanCoercion: true, + }, + ], + }, + { + code: ` +let a: string | true | undefined; +let b: string | boolean | undefined; + declare function f(x: unknown): unknown; if (f(a || b)) { From 255e9e274b24f86f3179146c20c156506312c92c Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 29 Sep 2025 17:06:11 +0000 Subject: [PATCH 218/283] chore(release): publish 8.45.0 --- CHANGELOG.md | 23 +++++ packages/ast-spec/CHANGELOG.md | 12 +++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 19 ++++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 12 +++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 6 ++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 12 +++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 238 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f7e3eb6e2db..2b8ab0a05202 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,26 @@ +## 8.45.0 (2025-09-29) + +### 🚀 Features + +- **eslint-plugin:** expose rule name via RuleModule interface ([#11616](https://github.com/typescript-eslint/typescript-eslint/pull/11616)) + +### 🩹 Fixes + +- disable generating declaration maps ([#11627](https://github.com/typescript-eslint/typescript-eslint/pull/11627)) +- **ast-spec:** narrow ArrowFunctionExpression.generator to false ([#11636](https://github.com/typescript-eslint/typescript-eslint/pull/11636)) +- **eslint-plugin:** [no-base-to-string] check if superclass is ignored ([#11617](https://github.com/typescript-eslint/typescript-eslint/pull/11617)) +- **eslint-plugin:** [prefer-nullish-coalescing] ignoreBooleanCoercion should not apply to top-level ternary expressions ([#11614](https://github.com/typescript-eslint/typescript-eslint/pull/11614)) + +### ❤️ Thank You + +- Bjorn Lu +- Josh Goldberg ✨ +- mdm317 +- Moses Odutusin @thebolarin +- Yukihiro Hasegawa @y-hsgw + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) ### 🩹 Fixes diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index fec4e2abcc96..bc0e07c46d14 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.45.0 (2025-09-29) + +### 🩹 Fixes + +- **ast-spec:** narrow ArrowFunctionExpression.generator to false ([#11636](https://github.com/typescript-eslint/typescript-eslint/pull/11636)) + +### ❤️ Thank You + +- Josh Goldberg ✨ + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) ### 🩹 Fixes diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 788732adc36f..c043b77b4dbb 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.44.1", + "version": "8.45.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index f12996c79142..1b53ed8e8843 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,22 @@ +## 8.45.0 (2025-09-29) + +### 🚀 Features + +- **eslint-plugin:** expose rule name via RuleModule interface ([#11616](https://github.com/typescript-eslint/typescript-eslint/pull/11616)) + +### 🩹 Fixes + +- **eslint-plugin:** [prefer-nullish-coalescing] ignoreBooleanCoercion should not apply to top-level ternary expressions ([#11614](https://github.com/typescript-eslint/typescript-eslint/pull/11614)) +- **eslint-plugin:** [no-base-to-string] check if superclass is ignored ([#11617](https://github.com/typescript-eslint/typescript-eslint/pull/11617)) + +### ❤️ Thank You + +- mdm317 +- Moses Odutusin @thebolarin +- Yukihiro Hasegawa @y-hsgw + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) ### 🩹 Fixes diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index d01ee4e12e8b..84bce94a40c2 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.44.1", + "version": "8.45.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.44.1", - "@typescript-eslint/type-utils": "8.44.1", - "@typescript-eslint/utils": "8.44.1", - "@typescript-eslint/visitor-keys": "8.44.1", + "@typescript-eslint/scope-manager": "8.45.0", + "@typescript-eslint/type-utils": "8.45.0", + "@typescript-eslint/utils": "8.45.0", + "@typescript-eslint/visitor-keys": "8.45.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.44.1", - "@typescript-eslint/rule-tester": "8.44.1", + "@typescript-eslint/rule-schema-to-typescript-types": "8.45.0", + "@typescript-eslint/rule-tester": "8.45.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.44.1", + "@typescript-eslint/parser": "^8.45.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index e8a3d8afcb46..148e3265e057 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.45.0 (2025-09-29) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 8087809d4884..aa7f345fb173 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.44.1", + "version": "8.45.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.44.1", - "@typescript-eslint/types": "8.44.1", - "@typescript-eslint/typescript-estree": "8.44.1", - "@typescript-eslint/visitor-keys": "8.44.1", + "@typescript-eslint/scope-manager": "8.45.0", + "@typescript-eslint/types": "8.45.0", + "@typescript-eslint/typescript-estree": "8.45.0", + "@typescript-eslint/visitor-keys": "8.45.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 55690ad57c69..7217085d8e88 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.45.0 (2025-09-29) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index be0d5ba771fb..8954ebe69165 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.44.1", + "version": "8.45.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.44.1", - "@typescript-eslint/types": "^8.44.1", + "@typescript-eslint/tsconfig-utils": "^8.45.0", + "@typescript-eslint/types": "^8.45.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 29320dcf7a2d..17977ab0492a 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.45.0 (2025-09-29) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 8eee73cef414..bdb5dc885613 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.44.1", + "version": "8.45.0", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.44.1", - "@typescript-eslint/utils": "8.44.1", + "@typescript-eslint/type-utils": "8.45.0", + "@typescript-eslint/utils": "8.45.0", "natural-compare": "^1.4.0", "prettier": "3.6.2" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 89c694b8fa62..3c613e796f41 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.45.0 (2025-09-29) + +### 🚀 Features + +- **eslint-plugin:** expose rule name via RuleModule interface ([#11616](https://github.com/typescript-eslint/typescript-eslint/pull/11616)) + +### ❤️ Thank You + +- Yukihiro Hasegawa @y-hsgw + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 9472a7d024b0..87eccdd8595f 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.44.1", + "version": "8.45.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.44.1", - "@typescript-eslint/typescript-estree": "8.44.1", - "@typescript-eslint/utils": "8.44.1", + "@typescript-eslint/parser": "8.45.0", + "@typescript-eslint/typescript-estree": "8.45.0", + "@typescript-eslint/utils": "8.45.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 8f5948ab1f82..2caf9fb9dc4a 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.45.0 (2025-09-29) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 22e2476b5b90..fb9c03271b02 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.44.1", + "version": "8.45.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.44.1", - "@typescript-eslint/visitor-keys": "8.44.1" + "@typescript-eslint/types": "8.45.0", + "@typescript-eslint/visitor-keys": "8.45.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.44.1", + "@typescript-eslint/typescript-estree": "8.45.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index d4c37732a9f4..c46f153905b3 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.45.0 (2025-09-29) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index fa1b2e343954..286854329c8b 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.44.1", + "version": "8.45.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index acc90600162d..6f95accd3e83 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.45.0 (2025-09-29) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index a1b7b766950a..9816f01f37cb 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.44.1", + "version": "8.45.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.44.1", - "@typescript-eslint/typescript-estree": "8.44.1", - "@typescript-eslint/utils": "8.44.1", + "@typescript-eslint/types": "8.45.0", + "@typescript-eslint/typescript-estree": "8.45.0", + "@typescript-eslint/utils": "8.45.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.44.1", + "@typescript-eslint/parser": "8.45.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 75911ee3b7f0..06a9fadf74df 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.45.0 (2025-09-29) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index e531f0e52f24..272df4eddb9c 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.44.1", + "version": "8.45.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index ea0fe52260b5..307c04862040 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.45.0 (2025-09-29) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 9b2cae39fca3..c7767100da6c 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.44.1", + "version": "8.45.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.44.1", - "@typescript-eslint/parser": "8.44.1", - "@typescript-eslint/typescript-estree": "8.44.1", - "@typescript-eslint/utils": "8.44.1" + "@typescript-eslint/eslint-plugin": "8.45.0", + "@typescript-eslint/parser": "8.45.0", + "@typescript-eslint/typescript-estree": "8.45.0", + "@typescript-eslint/utils": "8.45.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index d22e93409134..0230830c43ef 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.45.0 (2025-09-29) + +This was a version bump only for typescript-estree to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) ### 🩹 Fixes diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 82432de9dcf6..7f3e72f55f35 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.44.1", + "version": "8.45.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.44.1", - "@typescript-eslint/tsconfig-utils": "8.44.1", - "@typescript-eslint/types": "8.44.1", - "@typescript-eslint/visitor-keys": "8.44.1", + "@typescript-eslint/project-service": "8.45.0", + "@typescript-eslint/tsconfig-utils": "8.45.0", + "@typescript-eslint/types": "8.45.0", + "@typescript-eslint/visitor-keys": "8.45.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index e9d6aa34c615..fb4091a5f528 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.45.0 (2025-09-29) + +### 🚀 Features + +- **eslint-plugin:** expose rule name via RuleModule interface ([#11616](https://github.com/typescript-eslint/typescript-eslint/pull/11616)) + +### ❤️ Thank You + +- Yukihiro Hasegawa @y-hsgw + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index 8ea3a0308748..0b189d847863 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.44.1", + "version": "8.45.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.44.1", - "@typescript-eslint/types": "8.44.1", - "@typescript-eslint/typescript-estree": "8.44.1" + "@typescript-eslint/scope-manager": "8.45.0", + "@typescript-eslint/types": "8.45.0", + "@typescript-eslint/typescript-estree": "8.45.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 5516fc1c32fc..f04350762015 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.45.0 (2025-09-29) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.44.1 (2025-09-22) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 0691965d0401..da60c60208f8 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.44.1", + "version": "8.45.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.44.1", + "@typescript-eslint/types": "8.45.0", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index a56cec5cef00..4b4a6accc5c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5837,19 +5837,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.44.1, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.45.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.44.1 - "@typescript-eslint/rule-tester": 8.44.1 - "@typescript-eslint/scope-manager": 8.44.1 - "@typescript-eslint/type-utils": 8.44.1 - "@typescript-eslint/utils": 8.44.1 - "@typescript-eslint/visitor-keys": 8.44.1 + "@typescript-eslint/rule-schema-to-typescript-types": 8.45.0 + "@typescript-eslint/rule-tester": 8.45.0 + "@typescript-eslint/scope-manager": 8.45.0 + "@typescript-eslint/type-utils": 8.45.0 + "@typescript-eslint/utils": 8.45.0 + "@typescript-eslint/visitor-keys": 8.45.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5872,7 +5872,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.44.1 + "@typescript-eslint/parser": ^8.45.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -5888,14 +5888,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.44.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.45.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.44.1 - "@typescript-eslint/types": 8.44.1 - "@typescript-eslint/typescript-estree": 8.44.1 - "@typescript-eslint/visitor-keys": 8.44.1 + "@typescript-eslint/scope-manager": 8.45.0 + "@typescript-eslint/types": 8.45.0 + "@typescript-eslint/typescript-estree": 8.45.0 + "@typescript-eslint/visitor-keys": 8.45.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -5909,12 +5909,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.44.1, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.45.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.44.1 - "@typescript-eslint/types": ^8.44.1 + "@typescript-eslint/tsconfig-utils": ^8.45.0 + "@typescript-eslint/types": ^8.45.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -5925,12 +5925,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.44.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.45.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.44.1 - "@typescript-eslint/utils": 8.44.1 + "@typescript-eslint/type-utils": 8.45.0 + "@typescript-eslint/utils": 8.45.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -5941,15 +5941,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.44.1, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.45.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.44.1 - "@typescript-eslint/typescript-estree": 8.44.1 - "@typescript-eslint/utils": 8.44.1 + "@typescript-eslint/parser": 8.45.0 + "@typescript-eslint/typescript-estree": 8.45.0 + "@typescript-eslint/utils": 8.45.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5964,13 +5964,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.44.1, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.45.0, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.44.1 - "@typescript-eslint/typescript-estree": 8.44.1 - "@typescript-eslint/visitor-keys": 8.44.1 + "@typescript-eslint/types": 8.45.0 + "@typescript-eslint/typescript-estree": 8.45.0 + "@typescript-eslint/visitor-keys": 8.45.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -5981,7 +5981,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.44.1, @typescript-eslint/tsconfig-utils@^8.44.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.45.0, @typescript-eslint/tsconfig-utils@^8.45.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -5994,14 +5994,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.44.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.45.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.44.1 - "@typescript-eslint/types": 8.44.1 - "@typescript-eslint/typescript-estree": 8.44.1 - "@typescript-eslint/utils": 8.44.1 + "@typescript-eslint/parser": 8.45.0 + "@typescript-eslint/types": 8.45.0 + "@typescript-eslint/typescript-estree": 8.45.0 + "@typescript-eslint/utils": 8.45.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6016,7 +6016,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.44.1, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.44.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.45.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.45.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6089,15 +6089,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.44.1, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.45.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.44.1 - "@typescript-eslint/tsconfig-utils": 8.44.1 - "@typescript-eslint/types": 8.44.1 - "@typescript-eslint/visitor-keys": 8.44.1 + "@typescript-eslint/project-service": 8.45.0 + "@typescript-eslint/tsconfig-utils": 8.45.0 + "@typescript-eslint/types": 8.45.0 + "@typescript-eslint/visitor-keys": 8.45.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6115,14 +6115,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.44.1, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.45.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.44.1 - "@typescript-eslint/types": 8.44.1 - "@typescript-eslint/typescript-estree": 8.44.1 + "@typescript-eslint/scope-manager": 8.45.0 + "@typescript-eslint/types": 8.45.0 + "@typescript-eslint/typescript-estree": 8.45.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6134,11 +6134,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.44.1, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.45.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.44.1 + "@typescript-eslint/types": 8.45.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19368,10 +19368,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.44.1 - "@typescript-eslint/parser": 8.44.1 - "@typescript-eslint/typescript-estree": 8.44.1 - "@typescript-eslint/utils": 8.44.1 + "@typescript-eslint/eslint-plugin": 8.45.0 + "@typescript-eslint/parser": 8.45.0 + "@typescript-eslint/typescript-estree": 8.45.0 + "@typescript-eslint/utils": 8.45.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From db09a7d5e551964b52b14cdb7bcd08ab094ef2b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Mon, 29 Sep 2025 16:27:43 -0400 Subject: [PATCH 219/283] Revert "feat(eslint-plugin): expose rule name via RuleModule interface" (#11663) Revert "feat(eslint-plugin): expose rule name via RuleModule interface (#11616)" This reverts commit f2eeb9d9f354fc1fe5ba22272ad2dc747cec0c1d. --- .../rules/no-unused-vars/no-unused-vars-eslint.test.ts | 1 - .../tests/rules/no-unused-vars/no-unused-vars.test.ts | 1 - packages/rule-tester/tests/RuleTester.test.ts | 6 ------ packages/rule-tester/tests/filename.test.ts | 1 - packages/utils/src/eslint-utils/RuleCreator.ts | 4 ---- packages/utils/src/ts-eslint/Rule.ts | 5 ----- 6 files changed, 18 deletions(-) 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 aa1fb5b9b018..d05d538d2731 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 @@ -40,7 +40,6 @@ ruleTester.defineRule('use-every-a', { schema: [], type: 'problem', }, - name: 'use-every-a', }); /** 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 10014dcc66d7..5f40bbcdc3cc 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 @@ -32,7 +32,6 @@ ruleTester.defineRule('collect-unused-vars', { schema: [], type: 'problem', }, - name: 'collect-unused-vars', }); ruleTester.run('no-unused-vars', rule, { diff --git a/packages/rule-tester/tests/RuleTester.test.ts b/packages/rule-tester/tests/RuleTester.test.ts index 054986010bc9..73a5a05d45cf 100644 --- a/packages/rule-tester/tests/RuleTester.test.ts +++ b/packages/rule-tester/tests/RuleTester.test.ts @@ -94,7 +94,6 @@ const NOOP_RULE: RuleModule<'error'> = { schema: [], type: 'problem', }, - name: 'rule', }; function windowsToPosixPath(p: string): string { @@ -1109,7 +1108,6 @@ describe('RuleTester - hooks', () => { schema: [], type: 'problem', }, - name: 'rule', }; const ruleTester = new RuleTester(); @@ -1333,7 +1331,6 @@ describe('RuleTester - multipass fixer', () => { schema: [], type: 'problem', }, - name: 'rule', }; it('passes with no output', () => { @@ -1419,7 +1416,6 @@ describe('RuleTester - multipass fixer', () => { schema: [], type: 'problem', }, - name: 'rule', }; it('passes with correct string output', () => { @@ -1542,7 +1538,6 @@ describe('RuleTester - multipass fixer', () => { schema: [], type: 'problem', }, - name: 'rule', }; it('passes with correct array output', () => { @@ -1649,7 +1644,6 @@ describe('RuleTester - run types', () => { ], type: 'suggestion', }, - name: 'rule', }; describe('infer from `rule` parameter', () => { diff --git a/packages/rule-tester/tests/filename.test.ts b/packages/rule-tester/tests/filename.test.ts index 943ab1894a38..8f3442cf670a 100644 --- a/packages/rule-tester/tests/filename.test.ts +++ b/packages/rule-tester/tests/filename.test.ts @@ -19,7 +19,6 @@ const rule = ESLintUtils.RuleCreator.withoutDocs({ type: 'problem', hasSuggestions: true, }, - name: 'rule', defaultOptions: [], create: context => ({ Program(node): void { diff --git a/packages/utils/src/eslint-utils/RuleCreator.ts b/packages/utils/src/eslint-utils/RuleCreator.ts index 57ab282c3632..cd06aee6231f 100644 --- a/packages/utils/src/eslint-utils/RuleCreator.ts +++ b/packages/utils/src/eslint-utils/RuleCreator.ts @@ -36,7 +36,6 @@ export interface RuleWithMeta< Docs = unknown, > extends RuleCreateAndOptions { meta: RuleMetaData; - name: string; } export interface RuleWithMetaAndName< @@ -77,7 +76,6 @@ export function RuleCreator( url: urlCreator(name), }, }, - name, ...rule, }); }; @@ -91,7 +89,6 @@ function createRule< create, defaultOptions, meta, - name, }: Readonly>): RuleModule< MessageIds, Options, @@ -104,7 +101,6 @@ function createRule< }, defaultOptions, meta, - name, }; } diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index be28d4a0b9ec..1a4920a3e79e 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -735,11 +735,6 @@ export interface RuleModule< * Metadata about the rule */ meta: RuleMetaData; - - /** - * Rule name - */ - name: string; } export type AnyRuleModule = RuleModule; From e6648afc6d5a8d1bd8190e2f879d4dce77250f83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Tue, 30 Sep 2025 09:46:50 -0400 Subject: [PATCH 220/283] chore: enable eslint-plugin/require-meta-schema-description internally (#11647) --- eslint.config.mjs | 1 - .../src/rules/plugin-test-formatting.ts | 2 ++ .../eslint-plugin/src/rules/ban-ts-comment.ts | 24 ++++++++++++++--- .../rules/explicit-member-accessibility.ts | 26 ++++++++++++++++--- .../src/rules/member-ordering.ts | 5 ++++ .../src/rules/method-signature-style.ts | 1 + .../src/rules/no-unnecessary-condition.ts | 3 +++ .../eslint-plugin/src/rules/no-unused-vars.ts | 1 + .../src/rules/no-use-before-define.ts | 2 ++ .../schema-snapshots/ban-ts-comment.shot | 16 +++++++++--- .../explicit-member-accessibility.shot | 20 ++++++++++---- .../schema-snapshots/member-ordering.shot | 20 ++++++++++---- .../method-signature-style.shot | 8 +++++- .../no-unnecessary-condition.shot | 12 ++++++--- .../schema-snapshots/no-unused-vars.shot | 6 +++-- .../no-use-before-define.shot | 6 +++-- 16 files changed, 122 insertions(+), 31 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 433085ceae89..05fb57e522ac 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -479,7 +479,6 @@ export default defineConfig( // TODO (43081j): maybe enable these one day? 'eslint-plugin/no-meta-replaced-by': 'off', 'eslint-plugin/require-meta-default-options': 'off', - 'eslint-plugin/require-meta-schema-description': 'off', }, }, { diff --git a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts index 26fcc60d8d2b..b4f22ae16dad 100644 --- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts +++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts @@ -145,6 +145,8 @@ export default createRule({ properties: { formatWithPrettier: { type: 'boolean', + description: + 'Whether to enforce formatting of code snippets using Prettier.', }, }, }, diff --git a/packages/eslint-plugin/src/rules/ban-ts-comment.ts b/packages/eslint-plugin/src/rules/ban-ts-comment.ts index e5ce60193628..7cd707ed742b 100644 --- a/packages/eslint-plugin/src/rules/ban-ts-comment.ts +++ b/packages/eslint-plugin/src/rules/ban-ts-comment.ts @@ -89,10 +89,26 @@ export default createRule({ description: 'A minimum character length for descriptions when `allow-with-description` is enabled.', }, - 'ts-check': { $ref: '#/items/0/$defs/directiveConfigSchema' }, - 'ts-expect-error': { $ref: '#/items/0/$defs/directiveConfigSchema' }, - 'ts-ignore': { $ref: '#/items/0/$defs/directiveConfigSchema' }, - 'ts-nocheck': { $ref: '#/items/0/$defs/directiveConfigSchema' }, + 'ts-check': { + $ref: '#/items/0/$defs/directiveConfigSchema', + description: + 'Whether allow ts-check directives, and with which restrictions.', + }, + 'ts-expect-error': { + $ref: '#/items/0/$defs/directiveConfigSchema', + description: + 'Whether and when expect-error directives, and with which restrictions.', + }, + 'ts-ignore': { + $ref: '#/items/0/$defs/directiveConfigSchema', + description: + 'Whether allow ts-ignore directives, and with which restrictions.', + }, + 'ts-nocheck': { + $ref: '#/items/0/$defs/directiveConfigSchema', + description: + 'Whether allow ts-nocheck directives, and with which restrictions.', + }, }, }, ], diff --git a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts index a7c8b991ed53..7fc724bb1e25 100644 --- a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts +++ b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts @@ -100,13 +100,31 @@ export default createRule({ description: 'Changes to required accessibility modifiers for specific kinds of class members.', properties: { - accessors: { $ref: '#/items/0/$defs/accessibilityLevel' }, - constructors: { $ref: '#/items/0/$defs/accessibilityLevel' }, - methods: { $ref: '#/items/0/$defs/accessibilityLevel' }, + accessors: { + $ref: '#/items/0/$defs/accessibilityLevel', + description: + 'Which member accessibility modifier requirements to apply for accessors.', + }, + constructors: { + $ref: '#/items/0/$defs/accessibilityLevel', + description: + 'Which member accessibility modifier requirements to apply for constructors.', + }, + methods: { + $ref: '#/items/0/$defs/accessibilityLevel', + description: + 'Which member accessibility modifier requirements to apply for methods.', + }, parameterProperties: { $ref: '#/items/0/$defs/accessibilityLevel', + description: + 'Which member accessibility modifier requirements to apply for parameterProperties.', + }, + properties: { + $ref: '#/items/0/$defs/accessibilityLevel', + description: + 'Which member accessibility modifier requirements to apply for properties.', }, - properties: { $ref: '#/items/0/$defs/accessibilityLevel' }, }, }, }, diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index f930292bf3f2..e0d1d387baed 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -790,18 +790,23 @@ export default createRule({ properties: { classes: { $ref: '#/items/0/$defs/baseConfig', + description: 'Which ordering to enforce for classes.', }, classExpressions: { $ref: '#/items/0/$defs/baseConfig', + description: 'Which ordering to enforce for classExpressions.', }, default: { $ref: '#/items/0/$defs/baseConfig', + description: 'Which ordering to enforce for default.', }, interfaces: { $ref: '#/items/0/$defs/typesConfig', + description: 'Which ordering to enforce for interfaces.', }, typeLiterals: { $ref: '#/items/0/$defs/typesConfig', + description: 'Which ordering to enforce for typeLiterals.', }, }, }, diff --git a/packages/eslint-plugin/src/rules/method-signature-style.ts b/packages/eslint-plugin/src/rules/method-signature-style.ts index 1d7826402d3f..c4e76b0593a4 100644 --- a/packages/eslint-plugin/src/rules/method-signature-style.ts +++ b/packages/eslint-plugin/src/rules/method-signature-style.ts @@ -31,6 +31,7 @@ export default createRule({ schema: [ { type: 'string', + description: 'The method signature style to enforce using.', enum: ['property', 'method'], }, ], diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts index 387bf5f2da33..b9a1ebb9a4bf 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts @@ -200,9 +200,12 @@ export default createRule({ oneOf: [ { type: 'boolean', + description: 'Always ignore or not ignore the loop conditions', }, { type: 'string', + description: + 'Which situations to ignore constant conditions in.', enum: ['always', 'never', 'only-allowed-literals'], }, ], diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index f2bfa26bb1a8..01d171b34bd2 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -86,6 +86,7 @@ export default createRule({ oneOf: [ { type: 'string', + description: 'Broad setting for unused variables to target.', enum: ['all', 'local'], }, { diff --git a/packages/eslint-plugin/src/rules/no-use-before-define.ts b/packages/eslint-plugin/src/rules/no-use-before-define.ts index e0dcef814cc7..11e51f0d5ee5 100644 --- a/packages/eslint-plugin/src/rules/no-use-before-define.ts +++ b/packages/eslint-plugin/src/rules/no-use-before-define.ts @@ -231,6 +231,8 @@ export default createRule({ oneOf: [ { type: 'string', + description: + 'Broadly set functions and allowNamedExports to false.', enum: ['nofunc'], }, { diff --git a/packages/eslint-plugin/tests/schema-snapshots/ban-ts-comment.shot b/packages/eslint-plugin/tests/schema-snapshots/ban-ts-comment.shot index ad8dac75ad73..9c5d8cf6deba 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/ban-ts-comment.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/ban-ts-comment.shot @@ -33,16 +33,20 @@ "type": "number" }, "ts-check": { - "$ref": "#/items/0/$defs/directiveConfigSchema" + "$ref": "#/items/0/$defs/directiveConfigSchema", + "description": "Whether allow ts-check directives, and with which restrictions." }, "ts-expect-error": { - "$ref": "#/items/0/$defs/directiveConfigSchema" + "$ref": "#/items/0/$defs/directiveConfigSchema", + "description": "Whether and when expect-error directives, and with which restrictions." }, "ts-ignore": { - "$ref": "#/items/0/$defs/directiveConfigSchema" + "$ref": "#/items/0/$defs/directiveConfigSchema", + "description": "Whether allow ts-ignore directives, and with which restrictions." }, "ts-nocheck": { - "$ref": "#/items/0/$defs/directiveConfigSchema" + "$ref": "#/items/0/$defs/directiveConfigSchema", + "description": "Whether allow ts-nocheck directives, and with which restrictions." } }, "type": "object" @@ -61,9 +65,13 @@ type DirectiveConfigSchema = type Options = [ { + /** Whether allow ts-check directives, and with which restrictions. */ 'ts-check'?: DirectiveConfigSchema; + /** Whether and when expect-error directives, and with which restrictions. */ 'ts-expect-error'?: DirectiveConfigSchema; + /** Whether allow ts-ignore directives, and with which restrictions. */ 'ts-ignore'?: DirectiveConfigSchema; + /** Whether allow ts-nocheck directives, and with which restrictions. */ 'ts-nocheck'?: DirectiveConfigSchema; /** A minimum character length for descriptions when `allow-with-description` is enabled. */ minimumDescriptionLength?: number; diff --git a/packages/eslint-plugin/tests/schema-snapshots/explicit-member-accessibility.shot b/packages/eslint-plugin/tests/schema-snapshots/explicit-member-accessibility.shot index ebdf7f52fabd..09e140871eb6 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/explicit-member-accessibility.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/explicit-member-accessibility.shot @@ -42,19 +42,24 @@ "description": "Changes to required accessibility modifiers for specific kinds of class members.", "properties": { "accessors": { - "$ref": "#/items/0/$defs/accessibilityLevel" + "$ref": "#/items/0/$defs/accessibilityLevel", + "description": "Which member accessibility modifier requirements to apply for accessors." }, "constructors": { - "$ref": "#/items/0/$defs/accessibilityLevel" + "$ref": "#/items/0/$defs/accessibilityLevel", + "description": "Which member accessibility modifier requirements to apply for constructors." }, "methods": { - "$ref": "#/items/0/$defs/accessibilityLevel" + "$ref": "#/items/0/$defs/accessibilityLevel", + "description": "Which member accessibility modifier requirements to apply for methods." }, "parameterProperties": { - "$ref": "#/items/0/$defs/accessibilityLevel" + "$ref": "#/items/0/$defs/accessibilityLevel", + "description": "Which member accessibility modifier requirements to apply for parameterProperties." }, "properties": { - "$ref": "#/items/0/$defs/accessibilityLevel" + "$ref": "#/items/0/$defs/accessibilityLevel", + "description": "Which member accessibility modifier requirements to apply for properties." } }, "type": "object" @@ -83,10 +88,15 @@ type Options = [ ignoredMethodNames?: string[]; /** Changes to required accessibility modifiers for specific kinds of class members. */ overrides?: { + /** Which member accessibility modifier requirements to apply for accessors. */ accessors?: AccessibilityLevel; + /** Which member accessibility modifier requirements to apply for constructors. */ constructors?: AccessibilityLevel; + /** Which member accessibility modifier requirements to apply for methods. */ methods?: AccessibilityLevel; + /** Which member accessibility modifier requirements to apply for parameterProperties. */ parameterProperties?: AccessibilityLevel; + /** Which member accessibility modifier requirements to apply for properties. */ properties?: AccessibilityLevel; }; }, diff --git a/packages/eslint-plugin/tests/schema-snapshots/member-ordering.shot b/packages/eslint-plugin/tests/schema-snapshots/member-ordering.shot index 4da3214b15d1..e9d92a53bd03 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/member-ordering.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/member-ordering.shot @@ -311,19 +311,24 @@ "additionalProperties": false, "properties": { "classes": { - "$ref": "#/items/0/$defs/baseConfig" + "$ref": "#/items/0/$defs/baseConfig", + "description": "Which ordering to enforce for classes." }, "classExpressions": { - "$ref": "#/items/0/$defs/baseConfig" + "$ref": "#/items/0/$defs/baseConfig", + "description": "Which ordering to enforce for classExpressions." }, "default": { - "$ref": "#/items/0/$defs/baseConfig" + "$ref": "#/items/0/$defs/baseConfig", + "description": "Which ordering to enforce for default." }, "interfaces": { - "$ref": "#/items/0/$defs/typesConfig" + "$ref": "#/items/0/$defs/typesConfig", + "description": "Which ordering to enforce for interfaces." }, "typeLiterals": { - "$ref": "#/items/0/$defs/typesConfig" + "$ref": "#/items/0/$defs/typesConfig", + "description": "Which ordering to enforce for typeLiterals." } }, "type": "object" @@ -525,10 +530,15 @@ type TypesConfig = type Options = [ { + /** Which ordering to enforce for classExpressions. */ classExpressions?: BaseConfig; + /** Which ordering to enforce for classes. */ classes?: BaseConfig; + /** Which ordering to enforce for default. */ default?: BaseConfig; + /** Which ordering to enforce for interfaces. */ interfaces?: TypesConfig; + /** Which ordering to enforce for typeLiterals. */ typeLiterals?: TypesConfig; }, ]; diff --git a/packages/eslint-plugin/tests/schema-snapshots/method-signature-style.shot b/packages/eslint-plugin/tests/schema-snapshots/method-signature-style.shot index 53587bcf325b..42b7d652fd2b 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/method-signature-style.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/method-signature-style.shot @@ -3,6 +3,7 @@ [ { + "description": "The method signature style to enforce using.", "enum": ["method", "property"], "type": "string" } @@ -11,4 +12,9 @@ # TYPES: -type Options = ['method' | 'property']; +type Options = [ + /** The method signature style to enforce using. */ + | 'property' + /** The method signature style to enforce using. */ + | 'method', +]; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-condition.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-condition.shot index 44388c6bd694..2f59fc5bdb8c 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-condition.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-condition.shot @@ -9,9 +9,11 @@ "description": "Whether to ignore constant loop conditions, such as `while (true)`.", "oneOf": [ { + "description": "Always ignore or not ignore the loop conditions", "type": "boolean" }, { + "description": "Which situations to ignore constant conditions in.", "enum": ["always", "never", "only-allowed-literals"], "type": "string" } @@ -37,11 +39,15 @@ type Options = [ { /** Whether to ignore constant loop conditions, such as `while (true)`. */ allowConstantLoopConditions?: - | 'always' | 'never' | 'only-allowed-literals' - /** Whether to ignore constant loop conditions, such as `while (true)`. */ - | boolean; + /** + * Whether to ignore constant loop conditions, such as `while (true)`. + * Always ignore or not ignore the loop conditions + */ + | boolean + /** Which situations to ignore constant conditions in. */ + | 'always'; /** Whether to not error when running with a tsconfig that has strictNullChecks turned. */ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean; /** Whether to check the asserted argument of a type predicate function for unnecessary conditions */ diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unused-vars.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unused-vars.shot index 0d9872aa6a11..68d726884fe3 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unused-vars.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unused-vars.shot @@ -5,6 +5,7 @@ { "oneOf": [ { + "description": "Broad setting for unused variables to target.", "enum": ["all", "local"], "type": "string" }, @@ -65,7 +66,6 @@ # TYPES: type Options = [ - | 'all' | 'local' | { /** Whether to check all, some, or no arguments. */ @@ -98,5 +98,7 @@ type Options = [ | 'all'; /** Regular expressions of variable names to not check for usage. */ varsIgnorePattern?: string; - }, + } + /** Broad setting for unused variables to target. */ + | 'all', ]; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-use-before-define.shot b/packages/eslint-plugin/tests/schema-snapshots/no-use-before-define.shot index f3864668838f..1aace09f842c 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-use-before-define.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-use-before-define.shot @@ -5,6 +5,7 @@ { "oneOf": [ { + "description": "Broadly set functions and allowNamedExports to false.", "enum": ["nofunc"], "type": "string" }, @@ -50,7 +51,6 @@ # TYPES: type Options = [ - | 'nofunc' | { /** Whether to ignore named exports. */ allowNamedExports?: boolean; @@ -66,5 +66,7 @@ type Options = [ typedefs?: boolean; /** Whether to ignore references to variables. */ variables?: boolean; - }, + } + /** Broadly set functions and allowNamedExports to false. */ + | 'nofunc', ]; From f5b9cfd67819bf33f038ac8301cea17f692fe483 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 09:59:47 -0400 Subject: [PATCH 221/283] chore(deps): update dependency @eslint/compat to v1.4.0 (#11664) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4b4a6accc5c4..1c943fd78410 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3698,14 +3698,16 @@ __metadata: linkType: hard "@eslint/compat@npm:^1.2.4": - version: 1.3.2 - resolution: "@eslint/compat@npm:1.3.2" + version: 1.4.0 + resolution: "@eslint/compat@npm:1.4.0" + dependencies: + "@eslint/core": ^0.16.0 peerDependencies: eslint: ^8.40 || 9 peerDependenciesMeta: eslint: optional: true - checksum: 64ef212d38c039b92d1210bbcc640bbc1d21335ff343ca3c6dcbd63d7e7fa734395ab476b7787dbc3466ff40c264db5b11322ac371b4a409f5850e053829010b + checksum: 090882a61e3c8fa1911ff796f9cf13ed645139760cdecb2444dcb6c75a0d2f2a379e62b1e83586a13ece2280ed8a3acea9cc125acb99bc68012575918ac8f26d languageName: node linkType: hard @@ -3745,6 +3747,15 @@ __metadata: languageName: node linkType: hard +"@eslint/core@npm:^0.16.0": + version: 0.16.0 + resolution: "@eslint/core@npm:0.16.0" + dependencies: + "@types/json-schema": ^7.0.15 + checksum: 5c08dbf08aa27a6e057003a05a29f483038b70e59f9ac7af26938d0fa4627383c95768e2154835260607de34975e8f407c10762af9a005ed348cd8039cc6aede + languageName: node + linkType: hard + "@eslint/eslintrc@npm:^3.2.0, @eslint/eslintrc@npm:^3.3.1": version: 3.3.1 resolution: "@eslint/eslintrc@npm:3.3.1" From aed00ddf4715047333f58d560d33dc68fd3e8444 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Tue, 30 Sep 2025 10:20:21 -0600 Subject: [PATCH 222/283] docs: account for time zones and DST better in release date (#11453) * docs: fix time zone and DST mistakes in release date * rename var --- docs/users/Releases.mdx | 45 +++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/docs/users/Releases.mdx b/docs/users/Releases.mdx index 81c6b504dddc..58a4e5c6175d 100644 --- a/docs/users/Releases.mdx +++ b/docs/users/Releases.mdx @@ -8,13 +8,44 @@ import useIsBrowser from '@docusaurus/useIsBrowser'; export function LocalTimeOfRelease() { const isBrowser = useIsBrowser(); - // An arbitrary Monday at 17:00 UTC. - const date = new Date('1970-01-05T17:00Z'); - const formatted = date.toLocaleTimeString('en-US', { + if (!isBrowser) { + // An arbitrary Monday at 17:00 UTC. + const arbitraryMonday = new Date('1970-01-05T17:00Z'); + return arbitraryMonday.toLocaleTimeString('en-US', { + hour: 'numeric', + minute: '2-digit', + timeZoneName: 'short', + timeZone: 'UTC', + }); + } + const now = new Date(); + const daysAgoToMonday = (now.getUTCDay() + 6) % 7; + // Calculate the previous Monday at 17:00 UTC. + const previousReleaseDate = new Date( + Date.UTC( + now.getUTCFullYear(), + now.getUTCMonth(), + now.getUTCDate() - daysAgoToMonday, + 17, + ), + ); + // This will happen if the current time is before 17:00 UTC on Monday. + if (previousReleaseDate > now) { + previousReleaseDate.setUTCDate(previousReleaseDate.getUTCDate() - 7); + } + // Next release is 7 days later. + const nextReleaseDate = new Date(previousReleaseDate.getTime()); + nextReleaseDate.setUTCDate(previousReleaseDate.getUTCDate() + 7); + // If we're near a DST time change, we want to display the time of the release that has the same UTC offset as now. + // If, for some reason, neither does, just display the local time of the next release. + const releaseWithSameUtcOffset = + [nextReleaseDate, previousReleaseDate].find( + date => date.getTimezoneOffset() === now.getTimezoneOffset(), + ) ?? nextReleaseDate; + const formatted = releaseWithSameUtcOffset.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', timeZoneName: 'short', - timeZone: isBrowser ? undefined : 'UTC', }); // Specify the day of week if it's not a Monday. const dayNames = [ @@ -26,8 +57,10 @@ export function LocalTimeOfRelease() { 'Friday', 'Saturday', ]; - if (date.getDay() !== date.getUTCDay()) { - return `${dayNames[date.getDay()]}s at ${formatted}`; + if ( + releaseWithSameUtcOffset.getDay() !== releaseWithSameUtcOffset.getUTCDay() + ) { + return `${dayNames[releaseWithSameUtcOffset.getDay()]}s at ${formatted}`; } return formatted; } From 01ee8d77b326f075daf6ddeda226426391643938 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Wed, 1 Oct 2025 02:42:59 -0600 Subject: [PATCH 223/283] chore: fix up some ast snapshot names (#11672) fix up ast snapshot names --- .../empty-type-parameters-in-arrow-function/fixture.ts | 4 +--- .../snapshots/1-TSESTree-Error.shot | 6 ++---- .../snapshots/2-Babel-Error.shot | 6 ++---- .../fixture.ts | 1 + .../snapshots/1-Babel-Error.shot | 3 +++ .../snapshots/1-TSESTree-Error.shot | 8 +++----- .../snapshots/2-Alignment-Error.shot | 2 +- .../snapshots/2-Babel-Error.shot | 8 ++++++++ .../snapshots/3-Alignment-Error.shot | 2 +- .../fixture.ts | 2 -- .../snapshots/1-TSESTree-Error.shot | 6 ++---- .../snapshots/2-Babel-Error.shot | 6 ++---- .../fixtures/_error_/empty-type-parameters/fixture.ts | 3 --- .../empty-type-parameters/snapshots/1-Babel-Error.shot | 3 --- .../empty-type-parameters/snapshots/2-Babel-Error.shot | 10 ---------- 15 files changed, 26 insertions(+), 44 deletions(-) create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-Babel-Error.shot rename packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/{empty-type-parameters => empty-type-parameters-in-function-declaration}/snapshots/1-TSESTree-Error.shot (55%) rename packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/{empty-type-parameters => empty-type-parameters-in-function-declaration}/snapshots/2-Alignment-Error.shot (52%) create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Babel-Error.shot rename packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/{empty-type-parameters => empty-type-parameters-in-function-declaration}/snapshots/3-Alignment-Error.shot (66%) delete mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts delete mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-Babel-Error.shot delete mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts index add9711e2f79..0367dc4b8cad 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts @@ -1,3 +1 @@ -// TODO: This fixture might be too large, and if so should be split up. - -function f1<>() {} +const arrowFunction = < /* empty */ >() => {}; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot index 4f12d12b51de..5c7d9964c1b8 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot @@ -2,8 +2,6 @@ exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-arrow-function > TSESTree - Error`] TSError - 1 | // TODO: This fixture might be too large, and if so should be split up. +> 1 | const arrowFunction = < /* empty */ >() => {}; + | ^ Type expected. 2 | -> 3 | function f1<>() {} - | ^^ Type parameter list cannot be empty. - 4 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot index bc141a4b2018..536bb927ec57 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot @@ -2,9 +2,7 @@ exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-arrow-function > Babel - Error`] BabelError - 1 | // TODO: This fixture might be too large, and if so should be split up. +> 1 | const arrowFunction = < /* empty */ >() => {}; + | ^ Type parameter list cannot be empty. (1:22) 2 | -> 3 | function f1<>() {} - | ^ Type parameter list cannot be empty. (3:11) - 4 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/fixture.ts new file mode 100644 index 000000000000..1dbabedb798c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/fixture.ts @@ -0,0 +1 @@ +function f1<>() {} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-Babel-Error.shot new file mode 100644 index 000000000000..12440d8874fa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-arrow-function Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (3:11)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-TSESTree-Error.shot similarity index 55% rename from packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot rename to packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-TSESTree-Error.shot index 5bf4050773dc..57bcc54e2635 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-TSESTree-Error.shot @@ -1,9 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters > TSESTree - Error`] +exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-declaration > TSESTree - Error`] TSError - 1 | // TODO: This fixture might be too large, and if so should be split up. - 2 | -> 3 | function f1<>() {} +> 1 | function f1<>() {} | ^^ Type parameter list cannot be empty. - 4 | + 2 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Alignment-Error.shot similarity index 52% rename from packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Alignment-Error.shot rename to packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Alignment-Error.shot index 14e18802b751..04350071ad74 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-arrow-function Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..e9932497ceaa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-declaration > Babel - Error`] +BabelError +> 1 | function f1<>() {} + | ^ Type parameter list cannot be empty. (1:11) + 2 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/3-Alignment-Error.shot similarity index 66% rename from packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot rename to packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/3-Alignment-Error.shot index a525062b1e95..8c7aff64046a 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters > Error Alignment`] +exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-declaration > Error Alignment`] Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts index 43d8a0629438..97b3b1bd5b97 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts @@ -1,3 +1 @@ -// TODO: This fixture might be too large, and if so should be split up. - const foo = function<>() {} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot index fa912f209747..baeead551b4b 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot @@ -2,8 +2,6 @@ exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-expression > TSESTree - Error`] TSError - 1 | // TODO: This fixture might be too large, and if so should be split up. - 2 | -> 3 | const foo = function<>() {} +> 1 | const foo = function<>() {} | ^^ Type parameter list cannot be empty. - 4 | + 2 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot index 0338cc8a0dd9..3dff8a44c1db 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot @@ -2,9 +2,7 @@ exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-expression > Babel - Error`] BabelError - 1 | // TODO: This fixture might be too large, and if so should be split up. +> 1 | const foo = function<>() {} + | ^ Type parameter list cannot be empty. (1:20) 2 | -> 3 | const foo = function<>() {} - | ^ Type parameter list cannot be empty. (3:20) - 4 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts deleted file mode 100644 index add9711e2f79..000000000000 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts +++ /dev/null @@ -1,3 +0,0 @@ -// TODO: This fixture might be too large, and if so should be split up. - -function f1<>() {} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-Babel-Error.shot deleted file mode 100644 index ae64111c78c0..000000000000 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-Babel-Error.shot +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (3:11)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot deleted file mode 100644 index 8a54317d1574..000000000000 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot +++ /dev/null @@ -1,10 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters > Babel - Error`] -BabelError - 1 | // TODO: This fixture might be too large, and if so should be split up. - 2 | -> 3 | function f1<>() {} - | ^ Type parameter list cannot be empty. (3:11) - 4 | - From d447248dff96956b85b6afc75bee824a340713fc Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Wed, 1 Oct 2025 05:30:51 -0600 Subject: [PATCH 224/283] fix(eslint-plugin): [no-floating-promises] remove excess parentheses in suggestions (#11487) fix excessive parens --- .cspell.json | 1 + .../src/rules/no-floating-promises.ts | 28 ++++++++----------- .../src/util/getOperatorPrecedence.ts | 4 +++ .../tests/rules/no-floating-promises.test.ts | 18 ++++++------ 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.cspell.json b/.cspell.json index ffe51471848e..91dc7f910d0f 100644 --- a/.cspell.json +++ b/.cspell.json @@ -150,6 +150,7 @@ "oxlint", "packagespecifier", "parameterised", + "parenthesization", "performant", "pluggable", "postprocess", diff --git a/packages/eslint-plugin/src/rules/no-floating-promises.ts b/packages/eslint-plugin/src/rules/no-floating-promises.ts index 32ecbe741681..b040d1c82122 100644 --- a/packages/eslint-plugin/src/rules/no-floating-promises.ts +++ b/packages/eslint-plugin/src/rules/no-floating-promises.ts @@ -1,16 +1,17 @@ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type * as ts from 'typescript'; import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'ts-api-utils'; -import * as ts from 'typescript'; import type { TypeOrValueSpecifier } from '../util'; import { createRule, - getOperatorPrecedence, + getOperatorPrecedenceForNode, getParserServices, isBuiltinSymbolLike, + isParenthesized, OperatorPrecedence, readonlynessOptionsDefaults, readonlynessOptionsSchema, @@ -168,10 +169,11 @@ export default createRule({ { messageId: 'floatingFixVoid', fix(fixer): TSESLint.RuleFix | TSESLint.RuleFix[] { - const tsNode = services.esTreeNodeToTSNodeMap.get( - node.expression, - ); - if (isHigherPrecedenceThanUnary(tsNode)) { + if ( + isParenthesized(expression, context.sourceCode) || + getOperatorPrecedenceForNode(expression) > + OperatorPrecedence.Unary + ) { return fixer.insertTextBefore(node, 'void '); } return [ @@ -223,8 +225,10 @@ export default createRule({ 'await', ); } - const tsNode = services.esTreeNodeToTSNodeMap.get(node.expression); - if (isHigherPrecedenceThanUnary(tsNode)) { + if ( + isParenthesized(expression, context.sourceCode) || + getOperatorPrecedenceForNode(expression) > OperatorPrecedence.Unary + ) { return fixer.insertTextBefore(node, 'await '); } return [ @@ -261,14 +265,6 @@ export default createRule({ ); } - function isHigherPrecedenceThanUnary(node: ts.Node): boolean { - const operator = ts.isBinaryExpression(node) - ? node.operatorToken.kind - : ts.SyntaxKind.Unknown; - const nodePrecedence = getOperatorPrecedence(node.kind, operator); - return nodePrecedence > OperatorPrecedence.Unary; - } - function isAsyncIife(node: TSESTree.ExpressionStatement): boolean { if (node.expression.type !== AST_NODE_TYPES.CallExpression) { return false; diff --git a/packages/eslint-plugin/src/util/getOperatorPrecedence.ts b/packages/eslint-plugin/src/util/getOperatorPrecedence.ts index 950708015d89..54b40af26e28 100644 --- a/packages/eslint-plugin/src/util/getOperatorPrecedence.ts +++ b/packages/eslint-plugin/src/util/getOperatorPrecedence.ts @@ -198,6 +198,10 @@ export enum OperatorPrecedence { Invalid = -1, } +/** + * Note that this does not take into account parenthesization. You should check + * for parenthesization separately if it's relevant to your usage. + */ export function getOperatorPrecedenceForNode( node: TSESTree.Node, ): OperatorPrecedence { diff --git a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts index e2a272f6f3dc..87ead2f2b19d 100644 --- a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts +++ b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts @@ -2044,7 +2044,7 @@ async function test() { messageId: 'floatingFixVoid', output: ` async function test() { - void ((Promise.resolve(), 123)); + void (Promise.resolve(), 123); (123, Promise.resolve()); (123, Promise.resolve(), 123); } @@ -2054,7 +2054,7 @@ async function test() { messageId: 'floatingFixAwait', output: ` async function test() { - await ((Promise.resolve(), 123)); + await (Promise.resolve(), 123); (123, Promise.resolve()); (123, Promise.resolve(), 123); } @@ -2071,7 +2071,7 @@ async function test() { output: ` async function test() { (Promise.resolve(), 123); - void ((123, Promise.resolve())); + void (123, Promise.resolve()); (123, Promise.resolve(), 123); } `, @@ -2081,7 +2081,7 @@ async function test() { output: ` async function test() { (Promise.resolve(), 123); - await ((123, Promise.resolve())); + await (123, Promise.resolve()); (123, Promise.resolve(), 123); } `, @@ -2098,7 +2098,7 @@ async function test() { async function test() { (Promise.resolve(), 123); (123, Promise.resolve()); - void ((123, Promise.resolve(), 123)); + void (123, Promise.resolve(), 123); } `, }, @@ -2108,7 +2108,7 @@ async function test() { async function test() { (Promise.resolve(), 123); (123, Promise.resolve()); - await ((123, Promise.resolve(), 123)); + await (123, Promise.resolve(), 123); } `, }, @@ -2237,7 +2237,7 @@ async function returnsPromise() { async function returnsPromise() { return 'value'; } -await ((1, returnsPromise())); +await (1, returnsPromise()); `, }, ], @@ -4556,13 +4556,13 @@ await promiseIntersection.finally(() => {}); { messageId: 'floatingFixVoid', output: ` -void ((Promise.resolve().finally(() => {}), 123)); +void (Promise.resolve().finally(() => {}), 123); `, }, { messageId: 'floatingFixAwait', output: ` -await ((Promise.resolve().finally(() => {}), 123)); +await (Promise.resolve().finally(() => {}), 123); `, }, ], From 94d0361fa761e6a2515fdb57f264033407de05e3 Mon Sep 17 00:00:00 2001 From: Aakarsh Chopra Date: Wed, 1 Oct 2025 17:01:01 +0530 Subject: [PATCH 225/283] docs: valid `string` type example (#11631) * docs: valid `string` type example Type example on [no-misused-spread ](https://typescript-eslint.io/rules/no-misused-spread) uses `Record`, which throws a type error when the example is copied * test: update snapshots --------- Co-authored-by: Josh Goldberg --- packages/eslint-plugin/docs/rules/no-misused-spread.mdx | 4 ++-- .../tests/docs-eslint-output-snapshots/no-misused-spread.shot | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/no-misused-spread.mdx b/packages/eslint-plugin/docs/rules/no-misused-spread.mdx index 5b3320e1e314..1aa09c5362de 100644 --- a/packages/eslint-plugin/docs/rules/no-misused-spread.mdx +++ b/packages/eslint-plugin/docs/rules/no-misused-spread.mdx @@ -37,7 +37,7 @@ That includes the following cases: declare const promise: Promise; const spreadPromise = { ...promise }; -declare function getObject(): Record; +declare function getObject(): Record; const getObjectSpread = { ...getObject }; declare const map: Map; @@ -64,7 +64,7 @@ const instanceSpread = { ...instance }; declare const promise: Promise; const spreadPromise = { ...(await promise) }; -declare function getObject(): Record; +declare function getObject(): Record; const getObjectSpread = { ...getObject() }; declare const map: Map; diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-spread.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-spread.shot index 591c08061e87..78c83f38a361 100644 --- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-spread.shot +++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-spread.shot @@ -4,7 +4,7 @@ declare const promise: Promise; const spreadPromise = { ...promise }; ~~~~~~~~~~ Using the spread operator on Promise in an object can cause unexpected behavior. Did you forget to await the promise? -declare function getObject(): Record; +declare function getObject(): Record; const getObjectSpread = { ...getObject }; ~~~~~~~~~~~~ Using the spread operator on a function without additional properties can cause unexpected behavior. Did you forget to call the function? @@ -37,7 +37,7 @@ Correct declare const promise: Promise; const spreadPromise = { ...(await promise) }; -declare function getObject(): Record; +declare function getObject(): Record; const getObjectSpread = { ...getObject() }; declare const map: Map; From e2d549e5a1ab005cc13d47a3c4c24da18954ce05 Mon Sep 17 00:00:00 2001 From: Mark de Dios <99303358+peanutenthusiast@users.noreply.github.com> Date: Wed, 1 Oct 2025 04:31:11 -0700 Subject: [PATCH 226/283] fix(rule-tester): deprecate TestCaseError#type and LintMessage#nodeType (#11628) * Update only throw error documentation allowRethrowing to true per source * Add deprecated comments to invalid test case #type, lint message #nodetype * Remove reference to TestCaseError.type, LintMessage.nodeType in ruleteser file * Remove refs to deprecated types * make nodeType optional in Linter.ts * Remove AST_NODE_TYPES import from no unused vars eslint test --- .../rules/no-unused-vars/no-unused-vars-eslint.test.ts | 4 ---- packages/rule-tester/src/RuleTester.ts | 8 -------- packages/rule-tester/src/types/InvalidTestCase.ts | 2 +- packages/rule-tester/tests/RuleTester.test.ts | 1 - packages/utils/src/ts-eslint/Linter.ts | 5 ++++- packages/website/src/components/linter/createLinter.ts | 1 - 6 files changed, 5 insertions(+), 16 deletions(-) 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 d05d538d2731..4573260c3271 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 @@ -6,7 +6,6 @@ import type { TestCaseError } from '@typescript-eslint/rule-tester'; import type { TSESTree } from '@typescript-eslint/utils'; import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import type { MessageIds } from '../../../src/rules/no-unused-vars'; @@ -88,13 +87,11 @@ function assignedError( * Returns an expected error for used-but-ignored variables. * @param varName The name of the variable * @param [additional] The additional text for the message data - * @param [type] The node type (defaults to "Identifier") * @returns An expected error object */ function usedIgnoredError( varName: string, additional = '', - type = AST_NODE_TYPES.Identifier, ): TestCaseError { return { data: { @@ -102,7 +99,6 @@ function usedIgnoredError( varName, }, messageId: 'usedIgnoredVar', - type, }; } diff --git a/packages/rule-tester/src/RuleTester.ts b/packages/rule-tester/src/RuleTester.ts index bd0d8cede4eb..723bc6b17227 100644 --- a/packages/rule-tester/src/RuleTester.ts +++ b/packages/rule-tester/src/RuleTester.ts @@ -1102,14 +1102,6 @@ export class RuleTester extends TestFramework { ); } - if (error.type) { - assert.strictEqual( - message.nodeType, - error.type, - `Error type should be ${error.type}, found ${message.nodeType}`, - ); - } - if (hasOwnProperty(error, 'line')) { assert.strictEqual( message.line, diff --git a/packages/rule-tester/src/types/InvalidTestCase.ts b/packages/rule-tester/src/types/InvalidTestCase.ts index 73e8f48a6771..f5ba876c8510 100644 --- a/packages/rule-tester/src/types/InvalidTestCase.ts +++ b/packages/rule-tester/src/types/InvalidTestCase.ts @@ -53,7 +53,7 @@ export interface TestCaseError { */ readonly suggestions?: readonly SuggestionOutput[] | null; /** - * The type of the reported AST node. + * @deprecated `type` is deprecated and will be removed in the next major version. */ readonly type?: AST_NODE_TYPES | AST_TOKEN_TYPES; diff --git a/packages/rule-tester/tests/RuleTester.test.ts b/packages/rule-tester/tests/RuleTester.test.ts index 73a5a05d45cf..b7a276c69e4c 100644 --- a/packages/rule-tester/tests/RuleTester.test.ts +++ b/packages/rule-tester/tests/RuleTester.test.ts @@ -144,7 +144,6 @@ describe(RuleTester, () => { line: 0, message: 'error', messageId: 'error', - nodeType: AST_NODE_TYPES.Program, ruleId: 'my-rule', severity: 2, source: null, diff --git a/packages/utils/src/ts-eslint/Linter.ts b/packages/utils/src/ts-eslint/Linter.ts index 499213d95f3b..7bbb2b316445 100644 --- a/packages/utils/src/ts-eslint/Linter.ts +++ b/packages/utils/src/ts-eslint/Linter.ts @@ -229,7 +229,10 @@ namespace Linter { */ message: string; messageId?: string; - nodeType: string; + /** + * @deprecated `nodeType` is deprecated and will be removed in the next major version. + */ + nodeType?: string; /** * The ID of the rule which makes this message. */ diff --git a/packages/website/src/components/linter/createLinter.ts b/packages/website/src/components/linter/createLinter.ts index eefd1b0e4287..c9c83aa2a34f 100644 --- a/packages/website/src/components/linter/createLinter.ts +++ b/packages/website/src/components/linter/createLinter.ts @@ -94,7 +94,6 @@ export function createLinter( column: 1, line: 1, message: String(e instanceof Error ? e.stack : e), - nodeType: '', ruleId: '', severity: 2, source: 'eslint', From f7e672eb3f57dcc5929116ae473e9de021197152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Wed, 1 Oct 2025 19:26:37 -0400 Subject: [PATCH 227/283] docs: explain the 'evaluating community engagement' issues process (#11671) --- docs/contributing/Issues.mdx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/contributing/Issues.mdx b/docs/contributing/Issues.mdx index 5a1945127d0f..9735fccbfd94 100644 --- a/docs/contributing/Issues.mdx +++ b/docs/contributing/Issues.mdx @@ -41,6 +41,24 @@ Consider searching through: 1. [Unassigned user-facing marked as `accepting prs` and `good first issue`](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+label%3A%22accepting+prs%22+-label%3A%22repo+maintenance%22+no%3Aassignee): to find issues marked as good for a first-timer 2. [Unassigned user-facing marked as `accepting prs` without `good first issue`](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22+-label%3A%22good+first+issue%22+-label%3A%22repo+maintenance%22+no%3Aassignee): once you've finished a few issues, to find more intermediate-level issues +## "Evaluating Community Engagement" + +The typescript-eslint project has limited maintenance bandwidth and cannot commit to every potentially valid issue. +It can be difficult to tell if some issues' impacts would be worth taking bandwidth away from other, higher-impact issues. +For those issues, we will: + +1. Add an `evaluating community engagement` label to indicate the issue is under review +2. Wait at least 3-6 months +3. Either accept or decline the issue, depending on how much engagement the issue receives + +If your issue is marked as `evaluating community engagement`, we encourage you to: + +- Socialize the issue online to find other users who are in favor of it +- Try out the proposed changes in your own projects + - If the issue is for a new lint rule, consider using our [Building ESLint Plugins documentation](https://typescript-eslint.io/developers/eslint-plugins) to create a standalone plugin users can try + +See [Maintenance > Issues > Community Engagement Evaluation](https://typescript-eslint.io/maintenance/issues/#community-engagement-evaluation) for documentation on our corresponding maintenance practices. + ## Questions and Support Requests The issue tracker is not an appropriate place for questions or support requests. From b01c53e4d66263648b1a68ac7285cba353f4ac68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Fri, 3 Oct 2025 07:22:43 -0400 Subject: [PATCH 228/283] docs(eslint-plugin): [no-explicit-any] add alternatives (#11199) * docs(eslint-plugin): [no-explicit-any] add alternatives * Added remaining alternative docs --- .../docs/rules/no-explicit-any.mdx | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/packages/eslint-plugin/docs/rules/no-explicit-any.mdx b/packages/eslint-plugin/docs/rules/no-explicit-any.mdx index f0c8c20c6dec..6b9a06f7538e 100644 --- a/packages/eslint-plugin/docs/rules/no-explicit-any.mdx +++ b/packages/eslint-plugin/docs/rules/no-explicit-any.mdx @@ -145,6 +145,86 @@ interface Garply { } ``` +## Alternatives to `any` + +If you do know the properties that exist on an object value, it's generally best to use an `interface` or `type` to describe those properties. +If a straightforward object type isn't sufficient, then you can choose between several strategies instead of `any`. +The following headings describe some of the more common strategies. + +### `unknown` + +If you don't know the data shape of a value, the `unknown` type is safer than `any`. +Like `any`, `unknown` indicates the value might be any kind of data with any properties. +Unlike `any`, `unknown` doesn't allow arbitrary property accesses: it requires the value be narrowed to a more specific type before being used. +See [The `unknown` type in TypeScript](https://mariusschulz.com/blog/the-unknown-type-in-typescript) for more information on `unknown`. + +### Index Signatures + +Some objects are used with arbitrary keys, especially in code that predates [`Map`s](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Set`s](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set). +TypeScript interfaces may be given an _"index signature"_ to indicate arbitrary keys are allowed on objects. + +For example, this type defines an object that must have an `apple` property with a `number` value, and may have any other string keys with `number | undefined` values: + +```ts +interface AllowsAnyStrings { + apple: number; + [i: string]: number | undefined; +} + +let fruits: AllowsAnyStrings; + +fruits = { apple: 0 }; // Ok +fruits.banana = 1; // Ok +fruits.cherry = undefined; // Ok +``` + +See [What does a TypeScript index signature actually mean?](https://stackoverflow.com/questions/58458308/what-does-a-typescript-index-signature-actually-mean) for more information on index signatures. + +### Union Types + +Some values can be one of multiple types. +TypeScript allows representing these with _"union"_ types: types that include a list of possible shapes for data. + +Union types are often used to describe "nullable" values: those that can either be a data type or `null` and/or `undefined`. +For example, the following `StringLike` type describes data that is either a `string` or `undefined`: + +```ts +type StringLike = string | undefined; + +let fruit: StringLike; + +fruit = 'apple'; // Ok +fruit = undefined; // Ok +``` + +See [TypeScript Handbook: Everyday Types > Union Types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) for more information on union types. + +### Type Parameter Constraints + +"Generic" type parameters are often used to represent a value of an unknown type. +It can be tempting to use `any` as a type parameter constraint, but this is not recommended. + +First, `extends any` on its own does nothing: `` is equivalent to ``. +See [`@typescript-eslint/no-unnecessary-type-constraint`](./no-unnecessary-type-constraint.mdx) for more information. + +Within type parameters, `never` and `unknown` otherwise can generally be used instead. +For example, the following code uses those two types in `AnyFunction` instead of `any`s to constrain `Callback` to any function type: + +```ts +type AnyFunction = (...args: never[]) => unknown; + +function curry(greeter: Greeter, prefix: string) { + return (...args: Parameters) => `${prefix}: ${greeter(...args)}`; +} + +const greet = (name: string) => `Hello, ${name}!`; +const greetWithDate = curry(greet, 'Logged: '); + +greetWithDate('linter'); // => "Logged: Hello, linter!" +``` + +See [When to use `never` and `unknown` in TypeScript](https://blog.logrocket.com/when-to-use-never-unknown-typescript) for more information on those types. + ## When Not To Use It `any` is always a dangerous escape hatch. From 760d299930d35878e55bb3a77d9845044a9a8ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Fri, 3 Oct 2025 07:25:19 -0400 Subject: [PATCH 229/283] fix(eslint-plugin): [unbound-method] improve wording around `this: void` and binding (#11634) --- .../eslint-plugin/src/rules/unbound-method.ts | 8 +++++--- .../unbound-method.shot | 15 +++++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/eslint-plugin/src/rules/unbound-method.ts b/packages/eslint-plugin/src/rules/unbound-method.ts index f92061f148d4..49f8dbe23802 100644 --- a/packages/eslint-plugin/src/rules/unbound-method.ts +++ b/packages/eslint-plugin/src/rules/unbound-method.ts @@ -100,8 +100,10 @@ const isNotImported = ( ); }; -const BASE_MESSAGE = - 'Avoid referencing unbound methods which may cause unintentional scoping of `this`.'; +const BASE_MESSAGE = [ + `A method that is not declared with \`this: void\` may cause unintentional scoping of \`this\` when separated from its object.`, + `Consider using an arrow function or explicitly \`.bind()\`ing the method to avoid calling the method with an unintended \`this\` value. `, +].join('\n'); export default createRule({ name: 'unbound-method', @@ -115,7 +117,7 @@ export default createRule({ }, messages: { unbound: BASE_MESSAGE, - unboundWithoutThisAnnotation: `${BASE_MESSAGE}\nIf your function does not access \`this\`, you can annotate it with \`this: void\`, or consider using an arrow function instead.`, + unboundWithoutThisAnnotation: `${BASE_MESSAGE}\nIf a function does not access \`this\`, it can be annotated with \`this: void\`.`, }, schema: [ { diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/unbound-method.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/unbound-method.shot index 13afc36a6e62..54db9a5b5cb7 100644 --- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/unbound-method.shot +++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/unbound-method.shot @@ -10,14 +10,16 @@ const instance = new MyClass(); // This logs the global scope (`window`/`global`), not the class instance const myLog = instance.log; - ~~~~~~~~~~~~ Avoid referencing unbound methods which may cause unintentional scoping of `this`. - If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead. + ~~~~~~~~~~~~ A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object. + Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. + If a function does not access `this`, it can be annotated with `this: void`. myLog(); // This log might later be called with an incorrect scope const { log } = instance; - ~~~ Avoid referencing unbound methods which may cause unintentional scoping of `this`. - If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead. + ~~~ A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object. + Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. + If a function does not access `this`, it can be annotated with `this: void`. // arith.double may refer to `this` internally const arith = { @@ -26,8 +28,9 @@ const arith = { }, }; const { double } = arith; - ~~~~~~ Avoid referencing unbound methods which may cause unintentional scoping of `this`. - If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead. + ~~~~~~ A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object. + Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value. + If a function does not access `this`, it can be annotated with `this: void`. Correct From 5c502923ca78a89eb70f3505d12251196c84697b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Fri, 3 Oct 2025 07:25:56 -0400 Subject: [PATCH 230/283] feat(typescript-estree): mention file specifics in project service allowDefaultProject error (#11635) * feat(typescript-estree): mention file specifics in project service allowDefaultProject error * test: normalize paths * Reset to main * Reset to main * Reset to main * Unnecessary .filter(Boolean) --- .../src/useProgramFromProjectService.ts | 18 +++++++++- .../lib/useProgramFromProjectService.test.ts | 36 ++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/packages/typescript-estree/src/useProgramFromProjectService.ts b/packages/typescript-estree/src/useProgramFromProjectService.ts index 9a365029de02..fec277ce4ea6 100644 --- a/packages/typescript-estree/src/useProgramFromProjectService.ts +++ b/packages/typescript-estree/src/useProgramFromProjectService.ts @@ -96,8 +96,24 @@ function openClientFileFromProjectService( } if (!isDefaultProjectAllowed) { + const baseMessage = `${wasNotFound}. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`; + const allowDefaultProject = + parseSettings.projectService?.allowDefaultProject; + + if (!allowDefaultProject) { + throw new Error(baseMessage); + } + + const relativeFilePath = path.relative( + parseSettings.tsconfigRootDir, + filePathAbsolute, + ); + throw new Error( - `${wasNotFound}. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`, + [ + baseMessage, + `allowDefaultProject is set to ${JSON.stringify(allowDefaultProject)}, which does not match '${relativeFilePath}'.`, + ].join('\n'), ); } } diff --git a/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts b/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts index 48e62e1c39b6..3e0a30a52940 100644 --- a/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts +++ b/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts @@ -167,7 +167,7 @@ describe(useProgramFromProjectService, () => { expect(service.reloadProjects).not.toHaveBeenCalled(); }); - it('throws an error after reloading projects when hasFullTypeInformation is enabled, the file is neither in the project service nor allowDefaultProject, and the last reload was recent', () => { + it('throws a non-file-specific error after reloading projects when hasFullTypeInformation is enabled, the file is neither in the project service nor an empty allowDefaultProject, and the last reload was recent', () => { const { service } = createMockProjectService(); service.openClientFile.mockReturnValueOnce({}).mockReturnValueOnce({}); @@ -189,6 +189,40 @@ describe(useProgramFromProjectService, () => { expect(service.reloadProjects).toHaveBeenCalledOnce(); }); + it('throws a file-specific error after reloading projects when hasFullTypeInformation is enabled, the file is neither in the project service nor a populated allowDefaultProject, and the last reload was recent', () => { + const { service } = createMockProjectService(); + const allowDefaultProject = ['a.js', 'b.js']; + + service.openClientFile.mockReturnValueOnce({}).mockReturnValueOnce({}); + + expect(() => + useProgramFromProjectService( + createProjectServiceSettings({ + allowDefaultProject, + lastReloadTimestamp: 0, + service, + }), + { + ...mockParseSettings, + projectService: { + allowDefaultProject, + lastReloadTimestamp: 0, + maximumDefaultProjectFileMatchCount: 8, + service, + }, + }, + true, + new Set(), + ), + ).toThrow( + [ + `${mockParseSettings.filePath} was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`, + `allowDefaultProject is set to ["a.js","b.js"], which does not match '${path.normalize('path/PascalCaseDirectory/camelCaseFile.ts')}'.`, + ].join('\n'), + ); + expect(service.reloadProjects).toHaveBeenCalledOnce(); + }); + it('returns a created program after reloading projects when hasFullTypeInformation is enabled, the file is only in the project service after reload, and the last reload was recent', () => { const { service } = createMockProjectService(); const program = { getSourceFile: vi.fn() }; From f2a53b1b3544941d5134ecd6aa4daa24b4f02eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Fri, 3 Oct 2025 07:26:10 -0400 Subject: [PATCH 231/283] docs(eslint-plugin): [no-base-to-string] remove incorrect ignoredTypeNames description of regular expressions (#11637) --- packages/eslint-plugin/src/rules/no-base-to-string.ts | 3 +-- .../tests/schema-snapshots/no-base-to-string.shot | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts index 3612dc3da1ce..0dbcfd2825ef 100644 --- a/packages/eslint-plugin/src/rules/no-base-to-string.ts +++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts @@ -60,8 +60,7 @@ export default createRule({ }, ignoredTypeNames: { type: 'array', - description: - 'Stringified regular expressions of type names to ignore.', + description: 'Stringified type names to ignore.', items: { type: 'string', }, diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-base-to-string.shot b/packages/eslint-plugin/tests/schema-snapshots/no-base-to-string.shot index 207398f5c070..20ae8b227f21 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-base-to-string.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-base-to-string.shot @@ -10,7 +10,7 @@ "type": "boolean" }, "ignoredTypeNames": { - "description": "Stringified regular expressions of type names to ignore.", + "description": "Stringified type names to ignore.", "items": { "type": "string" }, @@ -28,7 +28,7 @@ type Options = [ { /** Whether to also check values of type `unknown` */ checkUnknown?: boolean; - /** Stringified regular expressions of type names to ignore. */ + /** Stringified type names to ignore. */ ignoredTypeNames?: string[]; }, ]; From 0ee9352471de52ff0d6d4bc4aaf46976f7a6c27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Fri, 3 Oct 2025 07:26:21 -0400 Subject: [PATCH 232/283] docs(eslint-plugin): [prefer-optional-chain] remove unnecessary docs chainings (#11638) * docs(eslint-plugin): [prefer-optional-chain] remove unnecessary docs chainings * Correct docs note --- .../docs/rules/prefer-optional-chain.mdx | 9 +++------ .../prefer-optional-chain.shot | 12 ++++-------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/prefer-optional-chain.mdx b/packages/eslint-plugin/docs/rules/prefer-optional-chain.mdx index 777c80068e69..e63c2d819939 100644 --- a/packages/eslint-plugin/docs/rules/prefer-optional-chain.mdx +++ b/packages/eslint-plugin/docs/rules/prefer-optional-chain.mdx @@ -35,12 +35,7 @@ foo && foo.a && foo.a.b && foo.a.b.method && foo.a.b.method(); !foo || !foo.bar || !foo.bar.baz || !foo.bar.baz(); // this rule also supports converting chained strict nullish checks: -foo && - foo.a != null && - foo.a.b !== null && - foo.a.b.c != undefined && - foo.a.b.c.d !== undefined && - foo.a.b.c.d.e; +foo.a !== null && foo.a !== undefined && foo.a.b; ``` @@ -56,6 +51,8 @@ foo?.a?.b?.c?.d?.e; !foo?.bar; !foo?.[bar]; !foo?.bar?.baz?.(); + +foo?.a != null; ``` diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/prefer-optional-chain.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/prefer-optional-chain.shot index 8607ddca5bca..657b431aa542 100644 --- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/prefer-optional-chain.shot +++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/prefer-optional-chain.shot @@ -26,14 +26,8 @@ foo && foo.a && foo.a.b && foo.a.b.method && foo.a.b.method(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Prefer using an optional chain expression instead, as it's more concise and easier to read. // this rule also supports converting chained strict nullish checks: -foo && -~~~~~~ Prefer using an optional chain expression instead, as it's more concise and easier to read. - foo.a != null && -~~~~~~~~~~~~~~~ - foo.a.b !== null && - foo.a.b.c != undefined && - foo.a.b.c.d !== undefined && - foo.a.b.c.d.e; +foo.a !== null && foo.a !== undefined && foo.a.b; +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Prefer using an optional chain expression instead, as it's more concise and easier to read. Correct @@ -47,6 +41,8 @@ foo?.a?.b?.c?.d?.e; !foo?.[bar]; !foo?.bar?.baz?.(); +foo?.a != null; + Options: { "allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing": true } declare const foo: { bar: boolean } | null | undefined; From 09fe43b0692a06f982db9870ad106b3925592f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Fri, 3 Oct 2025 07:26:40 -0400 Subject: [PATCH 233/283] docs: mention eslint-plugin is implicit with flat config (#11639) --- docs/packages/ESLint_Plugin.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/packages/ESLint_Plugin.mdx b/docs/packages/ESLint_Plugin.mdx index 263d7e4123a5..d02afc4be7b0 100644 --- a/docs/packages/ESLint_Plugin.mdx +++ b/docs/packages/ESLint_Plugin.mdx @@ -11,6 +11,7 @@ sidebar_label: eslint-plugin :::info See [Getting Started](../getting-started/Quickstart.mdx) for documentation on how to lint your TypeScript code with ESLint. +If you're using ESLint's flat config (`eslint.config.*`), you don't need to install this package or `@typescript-eslint/parser` explicitly. ::: `@typescript-eslint/eslint-plugin` is an ESLint plugin used to load in custom rules and rule configurations lists from typescript-eslint. From e76274d7f9cbc358f658a582c5d3edaee9d47e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Fri, 3 Oct 2025 07:27:38 -0400 Subject: [PATCH 234/283] docs: mention allowing lib strings in no-misused-spread, TypeOrValueSpecifier (#11641) --- docs/packages/type-utils/TypeOrValueSpecifier.mdx | 6 ++++++ .../eslint-plugin/docs/rules/no-misused-spread.mdx | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/docs/packages/type-utils/TypeOrValueSpecifier.mdx b/docs/packages/type-utils/TypeOrValueSpecifier.mdx index 7a21d16cf26d..fd04f70cb3bc 100644 --- a/docs/packages/type-utils/TypeOrValueSpecifier.mdx +++ b/docs/packages/type-utils/TypeOrValueSpecifier.mdx @@ -76,6 +76,12 @@ Lib types include `lib.dom.d.ts` globals such as `Window` and `lib.es*.ts` globa ### LibSpecifier Examples +Matching all strings: + +```json +{ "from": "lib", "name": "string" } +``` + Matching all array-typed values: ```json diff --git a/packages/eslint-plugin/docs/rules/no-misused-spread.mdx b/packages/eslint-plugin/docs/rules/no-misused-spread.mdx index 1aa09c5362de..2748d7cce73f 100644 --- a/packages/eslint-plugin/docs/rules/no-misused-spread.mdx +++ b/packages/eslint-plugin/docs/rules/no-misused-spread.mdx @@ -121,6 +121,19 @@ const spreadBrandedString = [...brandedString]; +#### Examples + +If you intentionally spread over strings, you can use `allow` to explicitly allowlist them: + +```ts option='{"allow":[{ "from": "lib", "name": "string" }]}' +/* eslint @typescript-eslint/no-misused-spread: {"allow":[{ "from": "lib", "name": "string" }]} */ +declare const unbrandedString: string; + +const spreadUnbrandedString = [...unbrandedString]; +``` + +See the shared [`TypeOrValueSpecifier` format](/packages/type-utils/type-or-value-specifier) for more information. + ## When Not To Use It If your application intentionally works with raw data in unusual ways, such as directly manipulating class prototype chains, you might not want this rule. From 692d4eeeca905fe1c4e11808a4b73f6bfdcc34d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Fri, 3 Oct 2025 07:27:47 -0400 Subject: [PATCH 235/283] docs(eslint-plugin): [prefer-for-of] mention DOM elements and lib: dom.iterable (#11642) --- .../docs/rules/prefer-for-of.mdx | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/prefer-for-of.mdx b/packages/eslint-plugin/docs/rules/prefer-for-of.mdx index 0399c781ddd7..668023249c9c 100644 --- a/packages/eslint-plugin/docs/rules/prefer-for-of.mdx +++ b/packages/eslint-plugin/docs/rules/prefer-for-of.mdx @@ -47,4 +47,24 @@ for (let i = 0; i < array.length; i++) { -{/* Intentionally Omitted: When Not To Use It */} +## DOM Elements + +By default, TypeScript's type checking only allows `for-of` loops over DOM iterables such as `HTMLCollectionOf` when the `dom.iterable` `lib` option is enabled. +If you are using this rule in a project that works with DOM elements, be sure to enable `dom.iterable` in your TSConfig `lib`. +See [aka.ms/tsconfig#lib](http://aka.ms/tsconfig#lib) for more information. + +```json +{ + "compilerOptions": { + "strict": true, + "lib": ["esnext", "dom", "dom.iterable"] + } +} +``` + +## When Not To Use It + +Note that this rule does not use type information to determine whether iterated elements are arrays. +It only checks if a `.length` property is used in a loop. +If your project loops over objects that happen to have `.length`, this rule may report false positives. +You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule. From 64fe734b6c84925a877f4997bd6fd6bf507c1afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Fri, 3 Oct 2025 07:52:37 -0400 Subject: [PATCH 236/283] chore: add yarn-berry-deduplicate script and CI task (#11648) * chore: add yarn-berry-deduplicate script and CI task * Correct makeDirectory import * Revert sandbox changes --- .github/workflows/ci.yml | 2 +- package.json | 4 +- .../website/tools/generate-website-dts.mts | 2 +- yarn.lock | 557 +++++++++++++----- 4 files changed, 409 insertions(+), 156 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91e78e2a606a..89f484258879 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,7 +117,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - lint-task: ['lint', 'typecheck', 'knip'] + lint-task: ['deduplicate', 'lint', 'typecheck', 'knip'] env: NX_CI_EXECUTION_ENV: 'ubuntu-latest' steps: diff --git a/package.json b/package.json index 7ab91774e311..3d45d58e5ac3 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "check-format": "prettier --check .", "check-spelling": "cspell --config=.cspell.json \"**/*.{md,mdx,ts,mts,cts,js,cjs,mjs,tsx,jsx}\" --no-progress --show-context --show-suggestions", "clean": "nx run-many -t clean --parallel=20", + "deduplicate": "yarn-berry-deduplicate", "format": "prettier --ignore-path=$PROJECT_CWD/.prettierignore --config=$PROJECT_CWD/.prettierrc.json --write $INIT_CWD", "generate-breaking-changes": "nx run eslint-plugin:generate-breaking-changes", "generate-configs": "tsx tools/scripts/generate-configs.mts", @@ -102,7 +103,8 @@ "typescript-eslint": "workspace:^", "vite": "^6.3.5", "vitest": "^3.1.3", - "yargs": "17.7.2" + "yargs": "17.7.2", + "yarn-berry-deduplicate": "^6.1.3" }, "resolutions": { "@types/eslint-scope": "link:./tools/dummypkg", diff --git a/packages/website/tools/generate-website-dts.mts b/packages/website/tools/generate-website-dts.mts index 92e3e40bb534..37744792cd1f 100644 --- a/packages/website/tools/generate-website-dts.mts +++ b/packages/website/tools/generate-website-dts.mts @@ -1,5 +1,5 @@ import fetch from 'cross-fetch'; -import { makeDirectory } from 'make-dir'; +import makeDirectory from 'make-dir'; import * as fs from 'node:fs/promises'; import * as path from 'node:path'; import { fileURLToPath } from 'node:url'; diff --git a/yarn.lock b/yarn.lock index 1c943fd78410..c742e4bfff4b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -227,6 +227,15 @@ __metadata: languageName: node linkType: hard +"@arcanis/slice-ansi@npm:^1.1.1": + version: 1.1.1 + resolution: "@arcanis/slice-ansi@npm:1.1.1" + dependencies: + grapheme-splitter: ^1.0.4 + checksum: 14ed60cb45750d386c64229ac7bab20e10eedc193503fa4decff764162d329d6d3363ed2cd3debec833186ee54affe4f824f6e8eff531295117fd1ebda200270 + languageName: node + linkType: hard + "@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.16.0, @babel/code-frame@npm:^7.24.2, @babel/code-frame@npm:^7.27.1, @babel/code-frame@npm:^7.8.3": version: 7.27.1 resolution: "@babel/code-frame@npm:7.27.1" @@ -4889,7 +4898,7 @@ __metadata: languageName: node linkType: hard -"@sindresorhus/is@npm:^4.6.0": +"@sindresorhus/is@npm:^4.0.0, @sindresorhus/is@npm:^4.6.0": version: 4.6.0 resolution: "@sindresorhus/is@npm:4.6.0" checksum: 83839f13da2c29d55c97abc3bc2c55b250d33a0447554997a85c539e058e57b8da092da396e252b11ec24a0279a0bed1f537fa26302209327060643e327f81d2 @@ -5214,6 +5223,15 @@ __metadata: languageName: node linkType: hard +"@szmarczak/http-timer@npm:^4.0.5": + version: 4.0.6 + resolution: "@szmarczak/http-timer@npm:4.0.6" + dependencies: + defer-to-connect: ^2.0.0 + checksum: c29df3bcec6fc3bdec2b17981d89d9c9fc9bd7d0c9bcfe92821dc533f4440bc890ccde79971838b4ceed1921d456973c4180d7175ee1d0023ad0562240a58d95 + languageName: node + linkType: hard + "@szmarczak/http-timer@npm:^5.0.1": version: 5.0.1 resolution: "@szmarczak/http-timer@npm:5.0.1" @@ -5338,6 +5356,18 @@ __metadata: languageName: node linkType: hard +"@types/cacheable-request@npm:^6.0.1": + version: 6.0.3 + resolution: "@types/cacheable-request@npm:6.0.3" + dependencies: + "@types/http-cache-semantics": "*" + "@types/keyv": ^3.1.4 + "@types/node": "*" + "@types/responselike": ^1.0.0 + checksum: d9b26403fe65ce6b0cb3720b7030104c352bcb37e4fac2a7089a25a97de59c355fa08940658751f2f347a8512aa9d18fdb66ab3ade835975b2f454f2d5befbd9 + languageName: node + linkType: hard + "@types/chai@npm:^5.2.2": version: 5.2.2 resolution: "@types/chai@npm:5.2.2" @@ -5382,6 +5412,13 @@ __metadata: languageName: node linkType: hard +"@types/emscripten@npm:^1.39.6": + version: 1.41.2 + resolution: "@types/emscripten@npm:1.41.2" + checksum: b0321eb7211f23801e886a7fbbd12e105b357eea5bb32ab13617d8cd04946a48a80b34ee7fe075344e76859753af2279969f7a322dda23bfd328bcfdf339a100 + languageName: node + linkType: hard + "@types/eslint-plugin-jsx-a11y@npm:^6.10.0": version: 6.10.0 resolution: "@types/eslint-plugin-jsx-a11y@npm:6.10.0" @@ -5471,7 +5508,7 @@ __metadata: languageName: node linkType: hard -"@types/http-cache-semantics@npm:^4.0.2": +"@types/http-cache-semantics@npm:*, @types/http-cache-semantics@npm:^4.0.2": version: 4.0.4 resolution: "@types/http-cache-semantics@npm:4.0.4" checksum: 7f4dd832e618bc1e271be49717d7b4066d77c2d4eed5b81198eb987e532bb3e1c7e02f45d77918185bad936f884b700c10cebe06305f50400f382ab75055f9e8 @@ -5547,6 +5584,15 @@ __metadata: languageName: node linkType: hard +"@types/keyv@npm:^3.1.4": + version: 3.1.4 + resolution: "@types/keyv@npm:3.1.4" + dependencies: + "@types/node": "*" + checksum: e009a2bfb50e90ca9b7c6e8f648f8464067271fd99116f881073fa6fa76dc8d0133181dd65e6614d5fb1220d671d67b0124aef7d97dc02d7e342ab143a47779d + languageName: node + linkType: hard + "@types/lodash.merge@npm:4.6.9": version: 4.6.9 resolution: "@types/lodash.merge@npm:4.6.9" @@ -5704,6 +5750,15 @@ __metadata: languageName: node linkType: hard +"@types/responselike@npm:^1.0.0": + version: 1.0.3 + resolution: "@types/responselike@npm:1.0.3" + dependencies: + "@types/node": "*" + checksum: 6ac4b35723429b11b117e813c7acc42c3af8b5554caaf1fc750404c1ae59f9b7376bc69b9e9e194a5a97357a597c2228b7173d317320f0360d617b6425212f58 + languageName: node + linkType: hard + "@types/retry@npm:^0.12.0": version: 0.12.1 resolution: "@types/retry@npm:0.12.1" @@ -5720,10 +5775,10 @@ __metadata: languageName: node linkType: hard -"@types/semver@npm:^7.5.8": - version: 7.7.0 - resolution: "@types/semver@npm:7.7.0" - checksum: d488eaeddb23879a0a8a759bed667e1a76cb0dd4d23e3255538e24c189db387357953ca9e7a3bda2bb7f95e84cac8fe0db4fbe6b3456e893043337732d1d23cc +"@types/semver@npm:^7.1.0, @types/semver@npm:^7.5.8": + version: 7.7.1 + resolution: "@types/semver@npm:7.7.1" + checksum: 76d218e414482a398148d5c28f2bfa017108869f3fc18cda379c9d8d062348f8b9653ae2fa8642d3b5b52e211928fe8be34f22da4e1f08245c84e0e51e040673 languageName: node linkType: hard @@ -5755,6 +5810,13 @@ __metadata: languageName: node linkType: hard +"@types/treeify@npm:^1.0.0": + version: 1.0.3 + resolution: "@types/treeify@npm:1.0.3" + checksum: 777e579b30a916a781e7cbad2b7a76bc5473ff7bfe7167dd6de47f80f4386df5bf3d0dc34170afb75d52e75f6ed61cc109abf2324e093c1f9ecd4e79fec58d0c + languageName: node + linkType: hard + "@types/trusted-types@npm:^1.0.6": version: 1.0.6 resolution: "@types/trusted-types@npm:1.0.6" @@ -6097,6 +6159,7 @@ __metadata: vite: ^6.3.5 vitest: ^3.1.3 yargs: 17.7.2 + yarn-berry-deduplicate: ^6.1.3 languageName: unknown linkType: soft @@ -6491,6 +6554,62 @@ __metadata: languageName: node linkType: hard +"@yarnpkg/core@npm:^4.4.1": + version: 4.4.4 + resolution: "@yarnpkg/core@npm:4.4.4" + dependencies: + "@arcanis/slice-ansi": ^1.1.1 + "@types/semver": ^7.1.0 + "@types/treeify": ^1.0.0 + "@yarnpkg/fslib": ^3.1.3 + "@yarnpkg/libzip": ^3.2.2 + "@yarnpkg/parsers": ^3.0.3 + "@yarnpkg/shell": ^4.1.3 + camelcase: ^5.3.1 + chalk: ^4.1.2 + ci-info: ^4.0.0 + clipanion: ^4.0.0-rc.2 + cross-spawn: ^7.0.3 + diff: ^5.1.0 + dotenv: ^16.3.1 + es-toolkit: ^1.39.7 + fast-glob: ^3.2.2 + got: ^11.7.0 + hpagent: ^1.2.0 + micromatch: ^4.0.2 + p-limit: ^2.2.0 + semver: ^7.1.2 + strip-ansi: ^6.0.0 + tar: ^6.0.5 + tinylogic: ^2.0.0 + treeify: ^1.1.0 + tslib: ^2.4.0 + checksum: 0ed1c0fa9cb590de700b26c50ee021af19a29c7b4d04a0d121864ca1a47ce09280c56619eb947a28454731a0d7eec4ab08b7dda6eba68782f12a5e88e05bebc6 + languageName: node + linkType: hard + +"@yarnpkg/fslib@npm:^3.1.2, @yarnpkg/fslib@npm:^3.1.3": + version: 3.1.3 + resolution: "@yarnpkg/fslib@npm:3.1.3" + dependencies: + tslib: ^2.4.0 + checksum: 8d9bc2f40bf49d2bec1e0218b142a5504e5bbe1dec6b36000f58c0b0a048c8b00785370a19f0563d8a50d9c7ca6b09df6e7c68900d35ebb127734d65faa31618 + languageName: node + linkType: hard + +"@yarnpkg/libzip@npm:^3.2.2": + version: 3.2.2 + resolution: "@yarnpkg/libzip@npm:3.2.2" + dependencies: + "@types/emscripten": ^1.39.6 + "@yarnpkg/fslib": ^3.1.3 + tslib: ^2.4.0 + peerDependencies: + "@yarnpkg/fslib": ^3.1.3 + checksum: 68736d731ef18f54720ed0b26e24dd0a69adcf26ef5d1f1a2e7ac89c096e2fc50373ff7467158b3a3b3cc7579bbb8ab7e72ee79f2c9044bda0dac52fbf40819b + languageName: node + linkType: hard + "@yarnpkg/lockfile@npm:^1.1.0": version: 1.1.0 resolution: "@yarnpkg/lockfile@npm:1.1.0" @@ -6508,6 +6627,34 @@ __metadata: languageName: node linkType: hard +"@yarnpkg/parsers@npm:^3.0.3": + version: 3.0.3 + resolution: "@yarnpkg/parsers@npm:3.0.3" + dependencies: + js-yaml: ^3.10.0 + tslib: ^2.4.0 + checksum: d6f78ec15b36732a88aeb090d012756d03a855a301a29f0f4f725ac05186f2d2e26400ea5636016481bdca7d4a013f70d61141bc1add2048cf1c2e5132b9ecf8 + languageName: node + linkType: hard + +"@yarnpkg/shell@npm:^4.1.3": + version: 4.1.3 + resolution: "@yarnpkg/shell@npm:4.1.3" + dependencies: + "@yarnpkg/fslib": ^3.1.2 + "@yarnpkg/parsers": ^3.0.3 + chalk: ^4.1.2 + clipanion: ^4.0.0-rc.2 + cross-spawn: ^7.0.3 + fast-glob: ^3.2.2 + micromatch: ^4.0.2 + tslib: ^2.4.0 + bin: + shell: ./lib/cli.js + checksum: bb5a122b157d6a1652331542b26d07f63b1f796f264708b0126b3c5a87877150927e8e838bcf631f80469799c4b331b02c62b7ecb19325276590e28e2fe45557 + languageName: node + linkType: hard + "@zkochan/js-yaml@npm:0.0.7": version: 0.0.7 resolution: "@zkochan/js-yaml@npm:0.0.7" @@ -7474,6 +7621,13 @@ __metadata: languageName: node linkType: hard +"cacheable-lookup@npm:^5.0.3": + version: 5.0.4 + resolution: "cacheable-lookup@npm:5.0.4" + checksum: 763e02cf9196bc9afccacd8c418d942fc2677f22261969a4c2c2e760fa44a2351a81557bd908291c3921fe9beb10b976ba8fa50c5ca837c5a0dd945f16468f2d + languageName: node + linkType: hard + "cacheable-lookup@npm:^7.0.0": version: 7.0.0 resolution: "cacheable-lookup@npm:7.0.0" @@ -7496,6 +7650,21 @@ __metadata: languageName: node linkType: hard +"cacheable-request@npm:^7.0.2": + version: 7.0.4 + resolution: "cacheable-request@npm:7.0.4" + dependencies: + clone-response: ^1.0.2 + get-stream: ^5.1.0 + http-cache-semantics: ^4.0.0 + keyv: ^4.0.0 + lowercase-keys: ^2.0.0 + normalize-url: ^6.0.1 + responselike: ^2.0.0 + checksum: 0de9df773fd4e7dd9bd118959878f8f2163867e2e1ab3575ffbecbe6e75e80513dd0c68ba30005e5e5a7b377cc6162bbc00ab1db019bb4e9cb3c2f3f7a6f1ee4 + languageName: node + linkType: hard + "cacheable@npm:^1.10.4": version: 1.10.4 resolution: "cacheable@npm:1.10.4" @@ -7555,6 +7724,13 @@ __metadata: languageName: node linkType: hard +"camelcase@npm:^5.3.1": + version: 5.3.1 + resolution: "camelcase@npm:5.3.1" + checksum: e6effce26b9404e3c0f301498184f243811c30dfe6d0b9051863bd8e4034d09c8c2923794f280d6827e5aa055f6c434115ff97864a16a963366fb35fd673024b + languageName: node + linkType: hard + "camelcase@npm:^6.2.0": version: 6.3.0 resolution: "camelcase@npm:6.3.0" @@ -7745,10 +7921,10 @@ __metadata: languageName: node linkType: hard -"ci-info@npm:^4.2.0": - version: 4.2.0 - resolution: "ci-info@npm:4.2.0" - checksum: 0e3726721526f54c5b17cf44ab2ed69b842c756bcb4d2b26ce279e595a80a856aec9fb38a2986a2baca3de73d15895f3a01d2771c4aad93c898aae7e3ca0ceb1 +"ci-info@npm:^4.0.0, ci-info@npm:^4.2.0": + version: 4.3.0 + resolution: "ci-info@npm:4.3.0" + checksum: 77a851ec826e1fbcd993e0e3ef402e6a5e499c733c475af056b7808dea9c9ede53e560ed433020489a8efea2d824fd68ca203446c9988a0bac8475210b0d4491 languageName: node linkType: hard @@ -7812,20 +7988,13 @@ __metadata: languageName: node linkType: hard -"cli-spinners@npm:2.6.1": +"cli-spinners@npm:2.6.1, cli-spinners@npm:^2.5.0": version: 2.6.1 resolution: "cli-spinners@npm:2.6.1" checksum: 423409baaa7a58e5104b46ca1745fbfc5888bbd0b0c5a626e052ae1387060839c8efd512fb127e25769b3dc9562db1dc1b5add6e0b93b7ef64f477feb6416a45 languageName: node linkType: hard -"cli-spinners@npm:^2.5.0": - version: 2.7.0 - resolution: "cli-spinners@npm:2.7.0" - checksum: a9afaf73f58d1f951fb23742f503631b3cf513f43f4c7acb1b640100eb76bfa16efbcd1994d149ffc6603a6d75dd3d4a516a76f125f90dce437de9b16fd0ee6f - languageName: node - linkType: hard - "cli-table3@npm:^0.6.3": version: 0.6.3 resolution: "cli-table3@npm:0.6.3" @@ -7849,6 +8018,17 @@ __metadata: languageName: node linkType: hard +"clipanion@npm:^4.0.0-rc.2": + version: 4.0.0-rc.4 + resolution: "clipanion@npm:4.0.0-rc.4" + dependencies: + typanion: ^3.8.0 + peerDependencies: + typanion: "*" + checksum: a92aa03b24eb89292b7bda570973c164fff16a1c5ba4c4abdd1b0dd6110a57651752114ec9f5cfc29e2040213e514b3220142a2316c4fc4e659ba423caa296c7 + languageName: node + linkType: hard + "cliui@npm:^8.0.1": version: 8.0.1 resolution: "cliui@npm:8.0.1" @@ -7871,6 +8051,15 @@ __metadata: languageName: node linkType: hard +"clone-response@npm:^1.0.2": + version: 1.0.3 + resolution: "clone-response@npm:1.0.3" + dependencies: + mimic-response: ^1.0.0 + checksum: 4e671cac39b11c60aa8ba0a450657194a5d6504df51bca3fac5b3bd0145c4f8e8464898f87c8406b83232e3bc5cca555f51c1f9c8ac023969ebfbf7f6bdabb2e + languageName: node + linkType: hard + "clone@npm:^1.0.2": version: 1.0.4 resolution: "clone@npm:1.0.4" @@ -8013,6 +8202,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^9.4.1": + version: 9.5.0 + resolution: "commander@npm:9.5.0" + checksum: c7a3e27aa59e913b54a1bafd366b88650bc41d6651f0cbe258d4ff09d43d6a7394232a4dadd0bf518b3e696fdf595db1028a0d82c785b88bd61f8a440cecfade + languageName: node + linkType: hard + "comment-json@npm:^4.2.5": version: 4.2.5 resolution: "comment-json@npm:4.2.5" @@ -8901,7 +9097,7 @@ __metadata: languageName: node linkType: hard -"defer-to-connect@npm:^2.0.1": +"defer-to-connect@npm:^2.0.0, defer-to-connect@npm:^2.0.1": version: 2.0.1 resolution: "defer-to-connect@npm:2.0.1" checksum: 8a9b50d2f25446c0bfefb55a48e90afd58f85b21bcf78e9207cd7b804354f6409032a1705c2491686e202e64fc05f147aa5aa45f9aa82627563f045937f5791b @@ -9037,6 +9233,13 @@ __metadata: languageName: node linkType: hard +"diff@npm:^5.1.0": + version: 5.2.0 + resolution: "diff@npm:5.2.0" + checksum: 12b63ca9c36c72bafa3effa77121f0581b4015df18bc16bac1f8e263597735649f1a173c26f7eba17fb4162b073fee61788abe49610e6c70a2641fe1895443fd + languageName: node + linkType: hard + "dir-glob@npm:^3.0.1": version: 3.0.1 resolution: "dir-glob@npm:3.0.1" @@ -9188,7 +9391,7 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:^16.4.4, dotenv@npm:~16.4.5": +"dotenv@npm:^16.3.1, dotenv@npm:^16.4.4, dotenv@npm:~16.4.5": version: 16.4.5 resolution: "dotenv@npm:16.4.5" checksum: 301a12c3d44fd49888b74eb9ccf9f07a1f5df43f489e7fcb89647a2edcd84c42d6bc349dc8df099cd18f07c35c7b04685c1a4f3e6a6a9e6b30f8d48c15b7f49c @@ -9310,12 +9513,12 @@ __metadata: languageName: node linkType: hard -"end-of-stream@npm:^1.4.1": - version: 1.4.4 - resolution: "end-of-stream@npm:1.4.4" +"end-of-stream@npm:^1.1.0, end-of-stream@npm:^1.4.1": + version: 1.4.5 + resolution: "end-of-stream@npm:1.4.5" dependencies: once: ^1.4.0 - checksum: 530a5a5a1e517e962854a31693dbb5c0b2fc40b46dad2a56a2deec656ca040631124f4795823acc68238147805f8b021abbe221f4afed5ef3c8e8efc2024908b + checksum: 1e0cfa6e7f49887544e03314f9dfc56a8cb6dde910cbb445983ecc2ff426fc05946df9d75d8a21a3a64f2cecfe1bf88f773952029f46756b2ed64a24e95b1fb8 languageName: node linkType: hard @@ -9537,6 +9740,18 @@ __metadata: languageName: node linkType: hard +"es-toolkit@npm:^1.39.7": + version: 1.39.10 + resolution: "es-toolkit@npm:1.39.10" + dependenciesMeta: + "@trivago/prettier-plugin-sort-imports@4.3.0": + unplugged: true + prettier-plugin-sort-re-exports@0.0.1: + unplugged: true + checksum: 128d018238487ac58da9447c629943178498a4378737aaca3acc6b1948c0b45eb3d5f5a5c0487247b6b7b3d89b44dfd2977f531512dff7c31ec6b12485c9230d + languageName: node + linkType: hard + "esbuild@npm:^0.25.0, esbuild@npm:~0.25.0": version: 0.25.5 resolution: "esbuild@npm:0.25.5" @@ -10353,7 +10568,7 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:^3.2.11, fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.2, fast-glob@npm:^3.3.3": +"fast-glob@npm:^3.2.11, fast-glob@npm:^3.2.2, fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.2, fast-glob@npm:^3.3.3": version: 3.3.3 resolution: "fast-glob@npm:3.3.3" dependencies: @@ -10423,7 +10638,7 @@ __metadata: languageName: node linkType: hard -"fdir@npm:^6.4.4, fdir@npm:^6.5.0": +"fdir@npm:^6.4.4": version: 6.5.0 resolution: "fdir@npm:6.5.0" peerDependencies: @@ -10920,6 +11135,15 @@ __metadata: languageName: node linkType: hard +"get-stream@npm:^5.1.0": + version: 5.2.0 + resolution: "get-stream@npm:5.2.0" + dependencies: + pump: ^3.0.0 + checksum: 8bc1a23174a06b2b4ce600df38d6c98d2ef6d84e020c1ddad632ad75bac4e092eeb40e4c09e0761c35fc2dbc5e7fff5dab5e763a383582c4a167dd69a905bd12 + languageName: node + linkType: hard + "get-stream@npm:^6.0.0, get-stream@npm:^6.0.1": version: 6.0.1 resolution: "get-stream@npm:6.0.1" @@ -10986,7 +11210,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:*, glob@npm:^11.0.0, glob@npm:~11.0.2": +"glob@npm:*, glob@npm:~11.0.2": version: 11.0.3 resolution: "glob@npm:11.0.3" dependencies: @@ -11154,6 +11378,25 @@ __metadata: languageName: node linkType: hard +"got@npm:^11.7.0": + version: 11.8.6 + resolution: "got@npm:11.8.6" + dependencies: + "@sindresorhus/is": ^4.0.0 + "@szmarczak/http-timer": ^4.0.5 + "@types/cacheable-request": ^6.0.1 + "@types/responselike": ^1.0.0 + cacheable-lookup: ^5.0.3 + cacheable-request: ^7.0.2 + decompress-response: ^6.0.0 + http2-wrapper: ^1.0.0-beta.5.2 + lowercase-keys: ^2.0.0 + p-cancelable: ^2.0.0 + responselike: ^2.0.0 + checksum: bbc783578a8d5030c8164ef7f57ce41b5ad7db2ed13371e1944bef157eeca5a7475530e07c0aaa71610d7085474d0d96222c9f4268d41db333a17e39b463f45d + languageName: node + linkType: hard + "got@npm:^12.1.0": version: 12.6.1 resolution: "got@npm:12.6.1" @@ -11187,6 +11430,13 @@ __metadata: languageName: node linkType: hard +"grapheme-splitter@npm:^1.0.4": + version: 1.0.4 + resolution: "grapheme-splitter@npm:1.0.4" + checksum: 0c22ec54dee1b05cd480f78cf14f732cb5b108edc073572c4ec205df4cd63f30f8db8025afc5debc8835a8ddeacf648a1c7992fe3dcd6ad38f9a476d84906620 + languageName: node + linkType: hard + "graphemer@npm:^1.4.0": version: 1.4.0 resolution: "graphemer@npm:1.4.0" @@ -11490,6 +11740,13 @@ __metadata: languageName: node linkType: hard +"hpagent@npm:^1.2.0": + version: 1.2.0 + resolution: "hpagent@npm:1.2.0" + checksum: b029da695edae438cee4da2a437386f9db4ac27b3ceb7306d02e1b586c9c194741ed2e943c8a222e0cfefaf27ee3f863aca7ba1721b0950a2a19bf25bc0d85e2 + languageName: node + linkType: hard + "html-entities@npm:^2.3.2": version: 2.3.2 resolution: "html-entities@npm:2.3.2" @@ -11604,10 +11861,10 @@ __metadata: languageName: node linkType: hard -"http-cache-semantics@npm:^4.1.1": - version: 4.1.1 - resolution: "http-cache-semantics@npm:4.1.1" - checksum: 83ac0bc60b17a3a36f9953e7be55e5c8f41acc61b22583060e8dedc9dd5e3607c823a88d0926f9150e571f90946835c7fe150732801010845c72cd8bbff1a236 +"http-cache-semantics@npm:^4.0.0, http-cache-semantics@npm:^4.1.1": + version: 4.2.0 + resolution: "http-cache-semantics@npm:4.2.0" + checksum: 7a7246ddfce629f96832791176fd643589d954e6f3b49548dadb4290451961237fab8fcea41cd2008fe819d95b41c1e8b97f47d088afc0a1c81705287b4ddbcc languageName: node linkType: hard @@ -11690,6 +11947,16 @@ __metadata: languageName: node linkType: hard +"http2-wrapper@npm:^1.0.0-beta.5.2": + version: 1.0.3 + resolution: "http2-wrapper@npm:1.0.3" + dependencies: + quick-lru: ^5.1.1 + resolve-alpn: ^1.0.0 + checksum: 74160b862ec699e3f859739101ff592d52ce1cb207b7950295bf7962e4aa1597ef709b4292c673bece9c9b300efad0559fc86c71b1409c7a1e02b7229456003e + languageName: node + linkType: hard + "http2-wrapper@npm:^2.1.10": version: 2.2.1 resolution: "http2-wrapper@npm:2.2.1" @@ -12878,7 +13145,7 @@ __metadata: languageName: node linkType: hard -"keyv@npm:^4.5.3, keyv@npm:^4.5.4": +"keyv@npm:^4.0.0, keyv@npm:^4.5.3, keyv@npm:^4.5.4": version: 4.5.4 resolution: "keyv@npm:4.5.4" dependencies: @@ -13235,6 +13502,13 @@ __metadata: languageName: node linkType: hard +"lowercase-keys@npm:^2.0.0": + version: 2.0.0 + resolution: "lowercase-keys@npm:2.0.0" + checksum: 24d7ebd56ccdf15ff529ca9e08863f3c54b0b9d1edb97a3ae1af34940ae666c01a1e6d200707bce730a8ef76cb57cc10e65f245ecaaf7e6bc8639f2fb460ac23 + languageName: node + linkType: hard + "lowercase-keys@npm:^3.0.0": version: 3.0.0 resolution: "lowercase-keys@npm:3.0.0" @@ -13326,14 +13600,7 @@ __metadata: languageName: node linkType: hard -"make-dir@npm:*": - version: 5.1.0 - resolution: "make-dir@npm:5.1.0" - checksum: 372abd9cbb2029bead4efe6c369c9af8ae77773d9a31ed5378fd7ae8072f06ea272aec5c7aba7543d3b8578a45b0bf90d86a78ab311afa4bc3446000977095a9 - languageName: node - linkType: hard - -"make-dir@npm:^4.0.0": +"make-dir@npm:*, make-dir@npm:^4.0.0": version: 4.0.0 resolution: "make-dir@npm:4.0.0" dependencies: @@ -14341,20 +14608,13 @@ __metadata: languageName: node linkType: hard -"mime-db@npm:1.52.0": +"mime-db@npm:1.52.0, mime-db@npm:>= 1.43.0 < 2": version: 1.52.0 resolution: "mime-db@npm:1.52.0" checksum: 0d99a03585f8b39d68182803b12ac601d9c01abfa28ec56204fa330bc9f3d1c5e14beb049bafadb3dbdf646dfb94b87e24d4ec7b31b7279ef906a8ea9b6a513f languageName: node linkType: hard -"mime-db@npm:>= 1.43.0 < 2": - version: 1.54.0 - resolution: "mime-db@npm:1.54.0" - checksum: e99aaf2f23f5bd607deb08c83faba5dd25cf2fec90a7cc5b92d8260867ee08dab65312e1a589e60093dc7796d41e5fae013268418482f1db4c7d52d0a0960ac9 - languageName: node - linkType: hard - "mime-db@npm:~1.33.0": version: 1.33.0 resolution: "mime-db@npm:1.33.0" @@ -14410,6 +14670,13 @@ __metadata: languageName: node linkType: hard +"mimic-response@npm:^1.0.0": + version: 1.0.1 + resolution: "mimic-response@npm:1.0.1" + checksum: 034c78753b0e622bc03c983663b1cdf66d03861050e0c8606563d149bc2b02d63f62ce4d32be4ab50d0553ae0ffe647fc34d1f5281184c6e1e8cf4d85e8d9823 + languageName: node + linkType: hard + "mimic-response@npm:^3.1.0": version: 3.1.0 resolution: "mimic-response@npm:3.1.0" @@ -14450,7 +14717,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:3.0.4": +"minimatch@npm:3.0.4, minimatch@npm:~3.0.3": version: 3.0.4 resolution: "minimatch@npm:3.0.4" dependencies: @@ -14513,15 +14780,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:~3.0.3": - version: 3.0.8 - resolution: "minimatch@npm:3.0.8" - dependencies: - brace-expansion: ^1.1.7 - checksum: 850cca179cad715133132693e6963b0db64ab0988c4d211415b087fc23a3e46321e2c5376a01bf5623d8782aba8bdf43c571e2e902e51fdce7175c7215c29f8b - languageName: node - linkType: hard - "minimist@npm:^1.2.0, minimist@npm:^1.2.6, minimist@npm:^1.2.8": version: 1.2.8 resolution: "minimist@npm:1.2.8" @@ -14820,6 +15078,13 @@ __metadata: languageName: node linkType: hard +"normalize-url@npm:^6.0.1": + version: 6.1.0 + resolution: "normalize-url@npm:6.1.0" + checksum: 4a4944631173e7d521d6b80e4c85ccaeceb2870f315584fa30121f505a6dfd86439c5e3fdd8cd9e0e291290c41d0c3599f0cb12ab356722ed242584c30348e50 + languageName: node + linkType: hard + "normalize-url@npm:^8.0.0": version: 8.0.0 resolution: "normalize-url@npm:8.0.0" @@ -15093,7 +15358,7 @@ __metadata: languageName: node linkType: hard -"once@npm:^1.3.0, once@npm:^1.4.0": +"once@npm:^1.3.0, once@npm:^1.3.1, once@npm:^1.4.0": version: 1.4.0 resolution: "once@npm:1.4.0" dependencies: @@ -15257,6 +15522,13 @@ __metadata: languageName: node linkType: hard +"p-cancelable@npm:^2.0.0": + version: 2.1.1 + resolution: "p-cancelable@npm:2.1.1" + checksum: 3dba12b4fb4a1e3e34524535c7858fc82381bbbd0f247cc32dedc4018592a3950ce66b106d0880b4ec4c2d8d6576f98ca885dc1d7d0f274d1370be20e9523ddf + languageName: node + linkType: hard + "p-cancelable@npm:^3.0.0": version: 3.0.0 resolution: "p-cancelable@npm:3.0.0" @@ -15264,7 +15536,7 @@ __metadata: languageName: node linkType: hard -"p-limit@npm:^2.0.0": +"p-limit@npm:^2.0.0, p-limit@npm:^2.2.0": version: 2.3.0 resolution: "p-limit@npm:2.3.0" dependencies: @@ -16674,6 +16946,16 @@ __metadata: languageName: node linkType: hard +"pump@npm:^3.0.0": + version: 3.0.3 + resolution: "pump@npm:3.0.3" + dependencies: + end-of-stream: ^1.1.0 + once: ^1.3.1 + checksum: 52843fc933b838c0330f588388115a1b28ef2a5ffa7774709b142e35431e8ab0c2edec90de3fa34ebb72d59fef854f151eea7dfc211b6dcf586b384556bd2f39 + languageName: node + linkType: hard + "punycode.js@npm:^2.3.1": version: 2.3.1 resolution: "punycode.js@npm:2.3.1" @@ -17373,7 +17655,7 @@ __metadata: languageName: node linkType: hard -"resolve-alpn@npm:^1.2.0": +"resolve-alpn@npm:^1.0.0, resolve-alpn@npm:^1.2.0": version: 1.2.1 resolution: "resolve-alpn@npm:1.2.1" checksum: f558071fcb2c60b04054c99aebd572a2af97ef64128d59bef7ab73bd50d896a222a056de40ffc545b633d99b304c259ea9d0c06830d5c867c34f0bfa60b8eae0 @@ -17467,6 +17749,15 @@ __metadata: languageName: node linkType: hard +"responselike@npm:^2.0.0": + version: 2.0.1 + resolution: "responselike@npm:2.0.1" + dependencies: + lowercase-keys: ^2.0.0 + checksum: b122535466e9c97b55e69c7f18e2be0ce3823c5d47ee8de0d9c0b114aa55741c6db8bfbfce3766a94d1272e61bfb1ebf0a15e9310ac5629fbb7446a861b4fd3a + languageName: node + linkType: hard + "responselike@npm:^3.0.0": version: 3.0.0 resolution: "responselike@npm:3.0.0" @@ -17524,15 +17815,14 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:*": - version: 6.0.1 - resolution: "rimraf@npm:6.0.1" +"rimraf@npm:*, rimraf@npm:^5.0.5": + version: 5.0.10 + resolution: "rimraf@npm:5.0.10" dependencies: - glob: ^11.0.0 - package-json-from-dist: ^1.0.0 + glob: ^10.3.7 bin: rimraf: dist/esm/bin.mjs - checksum: 8ba5b84131c1344e9417cb7e8c05d8368bb73cbe5dd4c1d5eb49fc0b558209781658d18c450460e30607d0b7865bb067482839a2f343b186b07ae87715837e66 + checksum: 50e27388dd2b3fa6677385fc1e2966e9157c89c86853b96d02e6915663a96b7ff4d590e14f6f70e90f9b554093aa5dbc05ac3012876be558c06a65437337bc05 languageName: node linkType: hard @@ -17547,17 +17837,6 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^5.0.5": - version: 5.0.10 - resolution: "rimraf@npm:5.0.10" - dependencies: - glob: ^10.3.7 - bin: - rimraf: dist/esm/bin.mjs - checksum: 50e27388dd2b3fa6677385fc1e2966e9157c89c86853b96d02e6915663a96b7ff4d590e14f6f70e90f9b554093aa5dbc05ac3012876be558c06a65437337bc05 - languageName: node - linkType: hard - "rollup-plugin-terser@npm:^7.0.0": version: 7.0.2 resolution: "rollup-plugin-terser@npm:7.0.2" @@ -17586,7 +17865,7 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^4.34.9, rollup@npm:^4.43.0": +"rollup@npm:^4.34.9": version: 4.46.3 resolution: "rollup@npm:4.46.3" dependencies: @@ -17718,7 +17997,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:5.2.1, safe-buffer@npm:>=5.1.0, safe-buffer@npm:^5.1.0, safe-buffer@npm:~5.2.0": +"safe-buffer@npm:5.2.1, safe-buffer@npm:>=5.1.0, safe-buffer@npm:^5.1.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: b99c4b41fdd67a6aaf280fcd05e9ffb0813654894223afb78a31f14a19ad220bba8aba1cb14eddce1fcfb037155fe6de4e861784eb434f7d11ed58d1e70dd491 @@ -17868,7 +18147,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.0.0, semver@npm:^7.3.2, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3, semver@npm:^7.7.1, semver@npm:^7.7.2": +"semver@npm:^7.0.0, semver@npm:^7.1.2, semver@npm:^7.3.2, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3, semver@npm:^7.7.1, semver@npm:^7.7.2": version: 7.7.2 resolution: "semver@npm:7.7.2" bin: @@ -18600,16 +18879,7 @@ __metadata: languageName: node linkType: hard -"string_decoder@npm:^1.1.1": - version: 1.3.0 - resolution: "string_decoder@npm:1.3.0" - dependencies: - safe-buffer: ~5.2.0 - checksum: 8417646695a66e73aefc4420eb3b84cc9ffd89572861fe004e6aeb13c7bc00e2f616247505d2dbbef24247c372f70268f594af7126f43548565c68c117bdeb56 - languageName: node - linkType: hard - -"string_decoder@npm:~1.1.1": +"string_decoder@npm:^1.1.1, string_decoder@npm:~1.1.1": version: 1.1.1 resolution: "string_decoder@npm:1.1.1" dependencies: @@ -18947,17 +19217,17 @@ __metadata: languageName: node linkType: hard -"tar@npm:^6.1.11, tar@npm:^6.1.2": - version: 6.1.11 - resolution: "tar@npm:6.1.11" +"tar@npm:^6.0.5, tar@npm:^6.1.11, tar@npm:^6.1.2": + version: 6.2.1 + resolution: "tar@npm:6.2.1" dependencies: chownr: ^2.0.0 fs-minipass: ^2.0.0 - minipass: ^3.0.0 + minipass: ^5.0.0 minizlib: ^2.1.1 mkdirp: ^1.0.3 yallist: ^4.0.0 - checksum: a04c07bb9e2d8f46776517d4618f2406fb977a74d914ad98b264fc3db0fe8224da5bec11e5f8902c5b9bcb8ace22d95fbe3c7b36b8593b7dfc8391a25898f32f + checksum: f1322768c9741a25356c11373bce918483f40fa9a25c69c59410c8a1247632487edef5fe76c5f12ac51a6356d2f1829e96d2bc34098668a2fc34d76050ac2b6c languageName: node linkType: hard @@ -19079,6 +19349,13 @@ __metadata: languageName: node linkType: hard +"tinylogic@npm:^2.0.0": + version: 2.0.0 + resolution: "tinylogic@npm:2.0.0" + checksum: b966cbb41241a048095fb9e685d5e2020475fdea2c65b4ae51e5dee48964860a4505d987503c004b8a76e96b64c7da2f49954dd36c691d559c315d878ce7da29 + languageName: node + linkType: hard + "tinypool@npm:^1.1.1": version: 1.1.1 resolution: "tinypool@npm:1.1.1" @@ -19162,6 +19439,13 @@ __metadata: languageName: node linkType: hard +"treeify@npm:^1.1.0": + version: 1.1.0 + resolution: "treeify@npm:1.1.0" + checksum: aa00dded220c1dd052573bd6fc2c52862f09870851a284f0d3650d72bf913ba9b4f6b824f4f1ab81899bae29375f4266b07fe47cbf82343a1efa13cc09ce87af + languageName: node + linkType: hard + "trim-lines@npm:^3.0.0": version: 3.0.1 resolution: "trim-lines@npm:3.0.1" @@ -19208,7 +19492,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.3, tslib@npm:^2.3.0, tslib@npm:^2.4.0, tslib@npm:^2.6.0": +"tslib@npm:^2.0.3, tslib@npm:^2.3.0, tslib@npm:^2.4.0, tslib@npm:^2.4.1, tslib@npm:^2.6.0": version: 2.8.1 resolution: "tslib@npm:2.8.1" checksum: e4aba30e632b8c8902b47587fd13345e2827fa639e7c3121074d5ee0880723282411a8838f830b55100cbe4517672f84a2472667d355b81e8af165a55dc6203a @@ -19231,6 +19515,13 @@ __metadata: languageName: node linkType: hard +"typanion@npm:^3.8.0": + version: 3.14.0 + resolution: "typanion@npm:3.14.0" + checksum: fc0590d02c13c659eb1689e8adf7777e6c00dc911377e44cd36fe1b1271cfaca71547149f12cdc275058c0de5562a14e5273adbae66d47e6e0320e36007f5912 + languageName: node + linkType: hard + "type-check@npm:^0.4.0, type-check@npm:~0.4.0": version: 0.4.0 resolution: "type-check@npm:0.4.0" @@ -19785,62 +20076,7 @@ __metadata: languageName: node linkType: hard -"vite@npm:^5.0.0 || ^6.0.0 || ^7.0.0-0": - version: 7.1.3 - resolution: "vite@npm:7.1.3" - dependencies: - esbuild: ^0.25.0 - fdir: ^6.5.0 - fsevents: ~2.3.3 - picomatch: ^4.0.3 - postcss: ^8.5.6 - rollup: ^4.43.0 - tinyglobby: ^0.2.14 - peerDependencies: - "@types/node": ^20.19.0 || >=22.12.0 - jiti: ">=1.21.0" - less: ^4.0.0 - lightningcss: ^1.21.0 - sass: ^1.70.0 - sass-embedded: ^1.70.0 - stylus: ">=0.54.8" - sugarss: ^5.0.0 - terser: ^5.16.0 - tsx: ^4.8.1 - yaml: ^2.4.2 - dependenciesMeta: - fsevents: - optional: true - peerDependenciesMeta: - "@types/node": - optional: true - jiti: - optional: true - less: - optional: true - lightningcss: - optional: true - sass: - optional: true - sass-embedded: - optional: true - stylus: - optional: true - sugarss: - optional: true - terser: - optional: true - tsx: - optional: true - yaml: - optional: true - bin: - vite: bin/vite.js - checksum: 625974a3399d0e9f98e6c06d2ce83b982b5d76e030201809a6bbce03a1cbdb8ff4e0e0dc5e71cd4f402f3858afa8940e091551632a3423fddeb6afd213792d45 - languageName: node - linkType: hard - -"vite@npm:^6.3.5": +"vite@npm:^5.0.0 || ^6.0.0 || ^7.0.0-0, vite@npm:^6.3.5": version: 6.3.5 resolution: "vite@npm:6.3.5" dependencies: @@ -20771,6 +21007,21 @@ __metadata: languageName: node linkType: hard +"yarn-berry-deduplicate@npm:^6.1.3": + version: 6.1.3 + resolution: "yarn-berry-deduplicate@npm:6.1.3" + dependencies: + "@yarnpkg/core": ^4.4.1 + "@yarnpkg/parsers": ^3.0.3 + commander: ^9.4.1 + semver: ^7.3.8 + tslib: ^2.4.1 + bin: + yarn-berry-deduplicate: dist/cli.js + checksum: 8f5afa2d51c38629ca01b5c650fdf5bbc43caa8035d4e74cacd607e47596afa0baab1b787c7111997e37ff12991097502ee4371d61f0a4aa94c21b88e53c812f + languageName: node + linkType: hard + "yocto-queue@npm:^0.1.0": version: 0.1.0 resolution: "yocto-queue@npm:0.1.0" From 740a63fd3e0fe2d9c30ae5eff6a41b0941a3129b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Fri, 3 Oct 2025 07:59:39 -0400 Subject: [PATCH 237/283] feat(rule-schema-to-typescript-types): clean up and make public (#11633) * feat(rule-schema-to-typescript-types): clean up and make public * pr-title-validation.yml scopes * add to issue templates * add test * Update packages/rule-schema-to-typescript-types/tests/index.test.ts Co-authored-by: Francesco Trotta * Switch to module --------- Co-authored-by: Francesco Trotta --- .../ISSUE_TEMPLATE/06-bug-report-other.yaml | 1 + .../ISSUE_TEMPLATE/07-enhancement-other.yaml | 1 + .github/workflows/ci.yml | 1 + .github/workflows/pr-title-validation.yml | 1 + docs/packages/RuleSchemaToTypeScriptTypes.mdx | 36 +++++ .../adjacent-overload-signatures.shot | 2 +- .../schema-snapshots/await-thenable.shot | 2 +- .../schema-snapshots/ban-tslint-comment.shot | 2 +- .../schema-snapshots/default-param-last.shot | 2 +- .../no-array-constructor.shot | 2 +- .../schema-snapshots/no-array-delete.shot | 2 +- .../no-confusing-non-null-assertion.shot | 2 +- .../no-dupe-class-members.shot | 2 +- .../no-duplicate-enum-values.shot | 2 +- .../schema-snapshots/no-dynamic-delete.shot | 2 +- .../no-extra-non-null-assertion.shot | 2 +- .../schema-snapshots/no-for-in-array.shot | 2 +- .../schema-snapshots/no-implied-eval.shot | 2 +- .../no-import-type-side-effects.shot | 2 +- .../tests/schema-snapshots/no-loop-func.shot | 2 +- .../no-loss-of-precision.shot | 2 +- .../schema-snapshots/no-misused-new.shot | 2 +- .../schema-snapshots/no-mixed-enums.shot | 2 +- ...-non-null-asserted-nullish-coalescing.shot | 2 +- .../no-non-null-asserted-optional-chain.shot | 2 +- .../no-non-null-assertion.shot | 2 +- .../no-redundant-type-constituents.shot | 2 +- ...cessary-parameter-property-assignment.shot | 2 +- .../no-unnecessary-qualifier.shot | 2 +- .../no-unnecessary-template-expression.shot | 2 +- .../no-unnecessary-type-arguments.shot | 2 +- .../no-unnecessary-type-constraint.shot | 2 +- .../no-unnecessary-type-conversion.shot | 2 +- .../no-unnecessary-type-parameters.shot | 2 +- .../schema-snapshots/no-unsafe-argument.shot | 2 +- .../no-unsafe-assignment.shot | 2 +- .../schema-snapshots/no-unsafe-call.shot | 2 +- .../no-unsafe-declaration-merging.shot | 2 +- .../no-unsafe-enum-comparison.shot | 2 +- .../no-unsafe-function-type.shot | 2 +- .../no-unsafe-member-access.shot | 2 +- .../schema-snapshots/no-unsafe-return.shot | 2 +- .../no-unsafe-type-assertion.shot | 2 +- .../no-unsafe-unary-minus.shot | 2 +- .../no-useless-constructor.shot | 2 +- .../no-useless-empty-export.shot | 2 +- .../no-wrapper-object-types.shot | 2 +- .../non-nullable-type-assertion-style.shot | 2 +- .../schema-snapshots/prefer-as-const.shot | 2 +- .../prefer-enum-initializers.shot | 2 +- .../tests/schema-snapshots/prefer-find.shot | 2 +- .../tests/schema-snapshots/prefer-for-of.shot | 2 +- .../prefer-function-type.shot | 2 +- .../schema-snapshots/prefer-includes.shot | 2 +- .../prefer-namespace-keyword.shot | 2 +- .../prefer-reduce-type-parameter.shot | 2 +- .../schema-snapshots/prefer-regexp-exec.shot | 2 +- .../prefer-return-this-type.shot | 2 +- .../prefer-ts-expect-error.shot | 2 +- .../related-getter-setter-pairs.shot | 2 +- .../tests/schema-snapshots/require-await.shot | 2 +- ...se-unknown-in-catch-callback-variable.shot | 2 +- packages/eslint-plugin/tests/schemas.test.ts | 8 +- .../package.json | 10 +- .../src/generateArrayType.ts | 20 ++- .../src/generateObjectType.ts | 8 +- .../src/generateType.ts | 14 +- .../src/generateUnionType.ts | 10 +- .../src/index.ts | 57 +++---- .../src/optimizeAST.ts | 10 +- .../src/printAST.ts | 12 +- .../src/types.ts | 34 ++-- .../tests/index.test.ts | 148 ++++++++++++++++++ packages/website/docusaurus.config.mts | 54 ++++--- .../insertions/insertNewRuleReferences.ts | 11 +- packages/website/sidebars/sidebar.base.js | 1 + yarn.lock | 1 - 77 files changed, 372 insertions(+), 180 deletions(-) create mode 100644 docs/packages/RuleSchemaToTypeScriptTypes.mdx create mode 100644 packages/rule-schema-to-typescript-types/tests/index.test.ts diff --git a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml index 69fc7d6ef7d7..d1d8b6fc4225 100644 --- a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml +++ b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml @@ -41,6 +41,7 @@ body: - eslint-plugin - parser - project-service + - rule-schema-to-typescript-types - rule-tester - scope-manager - tsconfig-utils diff --git a/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml b/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml index 7250ea66e0f3..de9f9324e4c0 100644 --- a/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml +++ b/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml @@ -27,6 +27,7 @@ body: - eslint-plugin - parser - project-service + - rule-schema-to-typescript-types - rule-tester - scope-manager - tsconfig-utils diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89f484258879..38173f35a252 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,6 +195,7 @@ jobs: 'eslint-plugin-internal', 'parser', 'project-service', + 'rule-schema-to-typescript-types', 'rule-tester', 'scope-manager', 'tsconfig-utils', diff --git a/.github/workflows/pr-title-validation.yml b/.github/workflows/pr-title-validation.yml index 175ce9457a5e..a2a5e5e47a8a 100644 --- a/.github/workflows/pr-title-validation.yml +++ b/.github/workflows/pr-title-validation.yml @@ -39,6 +39,7 @@ jobs: eslint-plugin-internal parser project-service + rule-schema-to-typescript-types rule-tester scope-manager tsconfig-utils diff --git a/docs/packages/RuleSchemaToTypeScriptTypes.mdx b/docs/packages/RuleSchemaToTypeScriptTypes.mdx new file mode 100644 index 000000000000..c684c357c5f6 --- /dev/null +++ b/docs/packages/RuleSchemaToTypeScriptTypes.mdx @@ -0,0 +1,36 @@ +--- +id: rule-schema-to-typescript-types +sidebar_label: rule-schema-to-typescript-types +toc_max_heading_level: 3 +--- + +import GeneratedDocs from './rule-schema-to-typescript-types/generated/index.md'; + +# `@typescript-eslint/rule-schema-to-typescript-types` + + + +> Converts ESLint rule schemas to equivalent TypeScript type strings ✨ + +```ts +import { schemaToTypes } from '@typescript-eslint/rule-schema-to-typescript-types'; + +// " +// type Options = [ +// /** My great option! */ +// string[] +// ]; +// " +schemaToTypes({ + description: 'My great option!', + items: { type: 'string' }, + type: 'array', +}); +``` + +The following documentation is auto-generated from source code. + + diff --git a/packages/eslint-plugin/tests/schema-snapshots/adjacent-overload-signatures.shot b/packages/eslint-plugin/tests/schema-snapshots/adjacent-overload-signatures.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/adjacent-overload-signatures.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/adjacent-overload-signatures.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/await-thenable.shot b/packages/eslint-plugin/tests/schema-snapshots/await-thenable.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/await-thenable.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/await-thenable.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/ban-tslint-comment.shot b/packages/eslint-plugin/tests/schema-snapshots/ban-tslint-comment.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/ban-tslint-comment.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/ban-tslint-comment.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/default-param-last.shot b/packages/eslint-plugin/tests/schema-snapshots/default-param-last.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/default-param-last.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/default-param-last.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-array-constructor.shot b/packages/eslint-plugin/tests/schema-snapshots/no-array-constructor.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-array-constructor.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-array-constructor.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-array-delete.shot b/packages/eslint-plugin/tests/schema-snapshots/no-array-delete.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-array-delete.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-array-delete.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-confusing-non-null-assertion.shot b/packages/eslint-plugin/tests/schema-snapshots/no-confusing-non-null-assertion.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-confusing-non-null-assertion.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-confusing-non-null-assertion.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-dupe-class-members.shot b/packages/eslint-plugin/tests/schema-snapshots/no-dupe-class-members.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-dupe-class-members.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-dupe-class-members.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-duplicate-enum-values.shot b/packages/eslint-plugin/tests/schema-snapshots/no-duplicate-enum-values.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-duplicate-enum-values.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-duplicate-enum-values.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-dynamic-delete.shot b/packages/eslint-plugin/tests/schema-snapshots/no-dynamic-delete.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-dynamic-delete.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-dynamic-delete.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-extra-non-null-assertion.shot b/packages/eslint-plugin/tests/schema-snapshots/no-extra-non-null-assertion.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-extra-non-null-assertion.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-extra-non-null-assertion.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-for-in-array.shot b/packages/eslint-plugin/tests/schema-snapshots/no-for-in-array.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-for-in-array.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-for-in-array.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-implied-eval.shot b/packages/eslint-plugin/tests/schema-snapshots/no-implied-eval.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-implied-eval.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-implied-eval.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-import-type-side-effects.shot b/packages/eslint-plugin/tests/schema-snapshots/no-import-type-side-effects.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-import-type-side-effects.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-import-type-side-effects.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-loop-func.shot b/packages/eslint-plugin/tests/schema-snapshots/no-loop-func.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-loop-func.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-loop-func.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-loss-of-precision.shot b/packages/eslint-plugin/tests/schema-snapshots/no-loss-of-precision.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-loss-of-precision.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-loss-of-precision.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-misused-new.shot b/packages/eslint-plugin/tests/schema-snapshots/no-misused-new.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-misused-new.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-misused-new.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-mixed-enums.shot b/packages/eslint-plugin/tests/schema-snapshots/no-mixed-enums.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-mixed-enums.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-mixed-enums.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-nullish-coalescing.shot b/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-nullish-coalescing.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-nullish-coalescing.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-nullish-coalescing.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-optional-chain.shot b/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-optional-chain.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-optional-chain.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-non-null-asserted-optional-chain.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-non-null-assertion.shot b/packages/eslint-plugin/tests/schema-snapshots/no-non-null-assertion.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-non-null-assertion.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-non-null-assertion.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-redundant-type-constituents.shot b/packages/eslint-plugin/tests/schema-snapshots/no-redundant-type-constituents.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-redundant-type-constituents.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-redundant-type-constituents.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-parameter-property-assignment.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-parameter-property-assignment.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-parameter-property-assignment.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-parameter-property-assignment.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-qualifier.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-qualifier.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-qualifier.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-qualifier.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-template-expression.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-template-expression.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-template-expression.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-template-expression.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-arguments.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-arguments.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-arguments.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-arguments.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-constraint.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-constraint.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-constraint.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-constraint.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-conversion.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-conversion.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-conversion.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-conversion.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-parameters.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-parameters.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-parameters.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unnecessary-type-parameters.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-argument.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-argument.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-argument.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-argument.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-assignment.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-assignment.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-assignment.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-assignment.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-call.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-call.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-call.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-call.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-declaration-merging.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-declaration-merging.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-declaration-merging.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-declaration-merging.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-enum-comparison.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-enum-comparison.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-enum-comparison.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-enum-comparison.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-function-type.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-function-type.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-function-type.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-function-type.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-member-access.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-member-access.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-member-access.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-member-access.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-return.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-return.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-return.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-return.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-type-assertion.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-type-assertion.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-type-assertion.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-type-assertion.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-unary-minus.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-unary-minus.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-unary-minus.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-unary-minus.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-useless-constructor.shot b/packages/eslint-plugin/tests/schema-snapshots/no-useless-constructor.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-useless-constructor.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-useless-constructor.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-useless-empty-export.shot b/packages/eslint-plugin/tests/schema-snapshots/no-useless-empty-export.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-useless-empty-export.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-useless-empty-export.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-wrapper-object-types.shot b/packages/eslint-plugin/tests/schema-snapshots/no-wrapper-object-types.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-wrapper-object-types.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-wrapper-object-types.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/non-nullable-type-assertion-style.shot b/packages/eslint-plugin/tests/schema-snapshots/non-nullable-type-assertion-style.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/non-nullable-type-assertion-style.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/non-nullable-type-assertion-style.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-as-const.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-as-const.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/prefer-as-const.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-as-const.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-enum-initializers.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-enum-initializers.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/prefer-enum-initializers.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-enum-initializers.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-find.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-find.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/prefer-find.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-find.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-for-of.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-for-of.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/prefer-for-of.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-for-of.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-function-type.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-function-type.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/prefer-function-type.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-function-type.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-includes.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-includes.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/prefer-includes.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-includes.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-namespace-keyword.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-namespace-keyword.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/prefer-namespace-keyword.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-namespace-keyword.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-reduce-type-parameter.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-reduce-type-parameter.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/prefer-reduce-type-parameter.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-reduce-type-parameter.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-regexp-exec.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-regexp-exec.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/prefer-regexp-exec.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-regexp-exec.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-return-this-type.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-return-this-type.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/prefer-return-this-type.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-return-this-type.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-ts-expect-error.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-ts-expect-error.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/prefer-ts-expect-error.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-ts-expect-error.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/related-getter-setter-pairs.shot b/packages/eslint-plugin/tests/schema-snapshots/related-getter-setter-pairs.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/related-getter-setter-pairs.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/related-getter-setter-pairs.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/require-await.shot b/packages/eslint-plugin/tests/schema-snapshots/require-await.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/require-await.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/require-await.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schema-snapshots/use-unknown-in-catch-callback-variable.shot b/packages/eslint-plugin/tests/schema-snapshots/use-unknown-in-catch-callback-variable.shot index 42f81875ed94..cdd9f8375858 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/use-unknown-in-catch-callback-variable.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/use-unknown-in-catch-callback-variable.shot @@ -7,4 +7,4 @@ # TYPES: /** No options declared */ -type Options = []; \ No newline at end of file +type Options = []; diff --git a/packages/eslint-plugin/tests/schemas.test.ts b/packages/eslint-plugin/tests/schemas.test.ts index 14380218c9e8..4d4e5c9b2ac3 100644 --- a/packages/eslint-plugin/tests/schemas.test.ts +++ b/packages/eslint-plugin/tests/schemas.test.ts @@ -1,4 +1,4 @@ -import { compile } from '@typescript-eslint/rule-schema-to-typescript-types'; +import { schemaToTypes } from '@typescript-eslint/rule-schema-to-typescript-types'; import * as fs from 'node:fs/promises'; import * as path from 'node:path'; import prettier from 'prettier'; @@ -41,7 +41,7 @@ const ruleEntries = Object.entries(rules); describe('Rule schemas should be convertible to TS types for documentation purposes', async () => { const PRETTIER_CONFIG = { schema: await getPrettierConfig(SCHEMA_FILEPATH), - tsType: getPrettierConfig(TS_TYPE_FILEPATH), + tsType: await getPrettierConfig(TS_TYPE_FILEPATH), }; beforeAll(async () => { @@ -83,8 +83,8 @@ describe('Rule schemas should be convertible to TS types for documentation purpo ), PRETTIER_CONFIG.schema, ); - const compilationResult = await compile( - ruleDef.meta.schema, + const compilationResult = await prettier.format( + schemaToTypes(ruleDef.meta.schema), PRETTIER_CONFIG.tsType, ); diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index bdb5dc885613..44432badd288 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,8 +1,8 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", "version": "8.45.0", - "private": true, - "type": "commonjs", + "description": "Converts ESLint rule schemas to equivalent TypeScript type strings.", + "type": "module", "exports": { ".": { "types": "./index.d.ts", @@ -34,8 +34,7 @@ "dependencies": { "@typescript-eslint/type-utils": "8.45.0", "@typescript-eslint/utils": "8.45.0", - "natural-compare": "^1.4.0", - "prettier": "3.6.2" + "natural-compare": "^1.4.0" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", @@ -48,6 +47,9 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, + "publishConfig": { + "access": "public" + }, "nx": { "name": "rule-schema-to-typescript-types", "includedScripts": [ diff --git a/packages/rule-schema-to-typescript-types/src/generateArrayType.ts b/packages/rule-schema-to-typescript-types/src/generateArrayType.ts index 54c1499f8a6c..e86e51f72dce 100644 --- a/packages/rule-schema-to-typescript-types/src/generateArrayType.ts +++ b/packages/rule-schema-to-typescript-types/src/generateArrayType.ts @@ -5,11 +5,17 @@ import type { import { TSUtils } from '@typescript-eslint/utils'; -import type { ArrayAST, AST, RefMap, TupleAST, UnionAST } from './types'; +import type { + ArrayAST, + SchemaAST, + RefMap, + TupleAST, + UnionAST, +} from './types.js'; -import { NotSupportedError, UnexpectedError } from './errors'; -import { generateType } from './generateType'; -import { getCommentLines } from './getCommentLines'; +import { NotSupportedError, UnexpectedError } from './errors.js'; +import { generateType } from './generateType.js'; +import { getCommentLines } from './getCommentLines.js'; /** * If there are more than 20 tuple items then we will not make it a tuple type @@ -95,7 +101,7 @@ export function generateArrayType( const b: B = ['a', undefined, 'c'] // TS error */ const cumulativeTypesList = itemTypes.slice(0, minItems); - const typesToUnion: AST[] = []; + const typesToUnion: SchemaAST[] = []; if (cumulativeTypesList.length > 0) { // actually has minItems, so add the initial state typesToUnion.push(createTupleType(cumulativeTypesList)); @@ -131,8 +137,8 @@ export function generateArrayType( } function createTupleType( - elements: AST[], - spreadType: AST | null = null, + elements: SchemaAST[], + spreadType: SchemaAST | null = null, ): TupleAST { return { type: 'tuple', diff --git a/packages/rule-schema-to-typescript-types/src/generateObjectType.ts b/packages/rule-schema-to-typescript-types/src/generateObjectType.ts index 61a88a4f1e8c..1d2592f62aff 100644 --- a/packages/rule-schema-to-typescript-types/src/generateObjectType.ts +++ b/packages/rule-schema-to-typescript-types/src/generateObjectType.ts @@ -3,10 +3,10 @@ import type { JSONSchema4ObjectSchema } from '@typescript-eslint/utils/json-sche import { requiresQuoting } from '@typescript-eslint/type-utils'; import { TSUtils } from '@typescript-eslint/utils'; -import type { AST, ObjectAST, RefMap } from './types'; +import type { SchemaAST, ObjectAST, RefMap } from './types.js'; -import { generateType } from './generateType'; -import { getCommentLines } from './getCommentLines'; +import { generateType } from './generateType.js'; +import { getCommentLines } from './getCommentLines.js'; export function generateObjectType( schema: JSONSchema4ObjectSchema, @@ -14,7 +14,7 @@ export function generateObjectType( ): ObjectAST { const commentLines = getCommentLines(schema); - let indexSignature: AST | null = null; + let indexSignature: SchemaAST | null = null; if ( schema.additionalProperties === true || // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish diff --git a/packages/rule-schema-to-typescript-types/src/generateType.ts b/packages/rule-schema-to-typescript-types/src/generateType.ts index 00d4e0d6e9c0..f5ef138ce3a0 100644 --- a/packages/rule-schema-to-typescript-types/src/generateType.ts +++ b/packages/rule-schema-to-typescript-types/src/generateType.ts @@ -2,13 +2,13 @@ import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; import { TSUtils } from '@typescript-eslint/utils'; -import type { AST, RefMap } from './types'; +import type { SchemaAST, RefMap } from './types.js'; -import { NotSupportedError, UnexpectedError } from './errors'; -import { generateArrayType } from './generateArrayType'; -import { generateObjectType } from './generateObjectType'; -import { generateUnionType } from './generateUnionType'; -import { getCommentLines } from './getCommentLines'; +import { NotSupportedError, UnexpectedError } from './errors.js'; +import { generateArrayType } from './generateArrayType.js'; +import { generateObjectType } from './generateObjectType.js'; +import { generateUnionType } from './generateUnionType.js'; +import { getCommentLines } from './getCommentLines.js'; // keywords we probably should support but currently do not support const UNSUPPORTED_KEYWORDS = new Set([ @@ -22,7 +22,7 @@ const UNSUPPORTED_KEYWORDS = new Set([ 'patternProperties', ]); -export function generateType(schema: JSONSchema4, refMap: RefMap): AST { +export function generateType(schema: JSONSchema4, refMap: RefMap): SchemaAST { const unsupportedProps = Object.keys(schema).filter(key => UNSUPPORTED_KEYWORDS.has(key), ); diff --git a/packages/rule-schema-to-typescript-types/src/generateUnionType.ts b/packages/rule-schema-to-typescript-types/src/generateUnionType.ts index ced5d9bf63aa..6370abf3a8e1 100644 --- a/packages/rule-schema-to-typescript-types/src/generateUnionType.ts +++ b/packages/rule-schema-to-typescript-types/src/generateUnionType.ts @@ -3,20 +3,20 @@ import type { JSONSchema4Type, } from '@typescript-eslint/utils/json-schema'; -import type { AST, RefMap, UnionAST } from './types'; +import type { SchemaAST, RefMap, UnionAST } from './types.js'; -import { NotSupportedError } from './errors'; -import { generateType } from './generateType'; +import { NotSupportedError } from './errors.js'; +import { generateType } from './generateType.js'; export function generateUnionType( members: (JSONSchema4 | JSONSchema4Type)[], refMap: RefMap, ): UnionAST { - const elements: AST[] = []; + const elements: SchemaAST[] = []; for (const memberSchema of members) { elements.push( - ((): AST => { + ((): SchemaAST => { switch (typeof memberSchema) { case 'string': return { diff --git a/packages/rule-schema-to-typescript-types/src/index.ts b/packages/rule-schema-to-typescript-types/src/index.ts index e046d9ced2c6..d61da632a371 100644 --- a/packages/rule-schema-to-typescript-types/src/index.ts +++ b/packages/rule-schema-to-typescript-types/src/index.ts @@ -1,39 +1,34 @@ import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; import { TSUtils } from '@typescript-eslint/utils'; -import prettier from 'prettier'; -import type { AST } from './types'; +import type { SchemaAST } from './types.js'; -import { generateType } from './generateType'; -import { optimizeAST } from './optimizeAST'; -import { printTypeAlias } from './printAST'; +import { generateType } from './generateType.js'; +import { optimizeAST } from './optimizeAST.js'; +import { printTypeAlias } from './printAST.js'; -export async function compile( - schemaIn: JSONSchema4 | readonly JSONSchema4[], - prettierConfig: Promise, -): Promise { - const { isArraySchema, schema } = (() => { - if (TSUtils.isArray(schemaIn)) { - return { - isArraySchema: true, - schema: schemaIn, - }; - } - return { - isArraySchema: false, - schema: [schemaIn], - }; - })(); +/** + * Converts rule options schema(s) to the equivalent TypeScript type string. + * + * @param schema Original rule schema(s) as declared in `meta.schema`. + * @returns Stringified TypeScript type(s) equivalent to the options schema(s). + */ +export function schemaToTypes( + schema: JSONSchema4 | readonly JSONSchema4[], +): string { + const [isArraySchema, schemaNormalized] = TSUtils.isArray(schema) + ? [true, schema] + : [false, [schema]]; - if (schema.length === 0) { + if (schemaNormalized.length === 0) { return ['/** No options declared */', 'type Options = [];'].join('\n'); } const refTypes: string[] = []; - const types: AST[] = []; - for (let i = 0; i < schema.length; i += 1) { - const result = compileSchema(schema[i], i); + const types: SchemaAST[] = []; + for (let i = 0; i < schemaNormalized.length; i += 1) { + const result = compileSchema(schemaNormalized[i], i); refTypes.push(...result.refTypes); types.push(result.type); } @@ -47,21 +42,13 @@ export async function compile( }) : printTypeAlias('Options', types[0]); - const unformattedCode = [...refTypes, optionsType].join('\n\n'); - try { - return await prettier.format(unformattedCode, await prettierConfig); - } catch (e) { - if (e instanceof Error) { - e.message += `\n\nUnformatted Code:\n${unformattedCode}`; - } - throw e; - } + return [...refTypes, optionsType].join('\n\n'); } function compileSchema( schema: JSONSchema4, index: number, -): { refTypes: string[]; type: AST } { +): { refTypes: string[]; type: SchemaAST } { const refTypes: string[] = []; const refMap = new Map(); diff --git a/packages/rule-schema-to-typescript-types/src/optimizeAST.ts b/packages/rule-schema-to-typescript-types/src/optimizeAST.ts index 14a0fd1c778a..0ec3626a46cd 100644 --- a/packages/rule-schema-to-typescript-types/src/optimizeAST.ts +++ b/packages/rule-schema-to-typescript-types/src/optimizeAST.ts @@ -1,6 +1,6 @@ -import type { AST, UnionAST } from './types'; +import type { SchemaAST, UnionAST } from './types.js'; -export function optimizeAST(ast: AST | null): void { +export function optimizeAST(ast: SchemaAST | null): void { if (ast == null) { return; } @@ -40,7 +40,7 @@ export function optimizeAST(ast: AST | null): void { } // hacky way to deduplicate union members - const uniqueElementsMap = new Map(); + const uniqueElementsMap = new Map(); for (const element of elements) { uniqueElementsMap.set(JSON.stringify(element), element); } @@ -53,8 +53,8 @@ export function optimizeAST(ast: AST | null): void { } } -function unwrapUnions(union: UnionAST): AST[] { - const elements: AST[] = []; +function unwrapUnions(union: UnionAST): SchemaAST[] { + const elements: SchemaAST[] = []; for (const element of union.elements) { if (element.type === 'union') { elements.push(...unwrapUnions(element)); diff --git a/packages/rule-schema-to-typescript-types/src/printAST.ts b/packages/rule-schema-to-typescript-types/src/printAST.ts index 746d0b850b0c..a618b903a5d0 100644 --- a/packages/rule-schema-to-typescript-types/src/printAST.ts +++ b/packages/rule-schema-to-typescript-types/src/printAST.ts @@ -1,12 +1,12 @@ import naturalCompare from 'natural-compare'; -import type { AST, TupleAST } from './types'; +import type { SchemaAST, TupleAST } from './types.js'; -export function printTypeAlias(aliasName: string, ast: AST): string { +export function printTypeAlias(aliasName: string, ast: SchemaAST): string { return `${printComment(ast)}type ${aliasName} = ${printAST(ast).code}`; } -export function printASTWithComment(ast: AST): string { +export function printASTWithComment(ast: SchemaAST): string { const result = printAST(ast); return `${printComment(result)}${result.code}`; } @@ -36,7 +36,7 @@ interface CodeWithComments { code: string; commentLines: string[]; } -function printAST(ast: AST): CodeWithComments { +function printAST(ast: SchemaAST): CodeWithComments { switch (ast.type) { case 'array': { const code = printAndMaybeParenthesise(ast.elementType); @@ -124,7 +124,7 @@ function printAST(ast: AST): CodeWithComments { interface Element { code: string; - element: AST; + element: SchemaAST; } function compareElements(a: Element, b: Element): number { if (a.element.type !== b.element.type) { @@ -153,7 +153,7 @@ function compareElements(a: Element, b: Element): number { } } -function printAndMaybeParenthesise(ast: AST): CodeWithComments { +function printAndMaybeParenthesise(ast: SchemaAST): CodeWithComments { const printed = printAST(ast); if (ast.type === 'union') { return { diff --git a/packages/rule-schema-to-typescript-types/src/types.ts b/packages/rule-schema-to-typescript-types/src/types.ts index 9edcbf0b404c..e2026a4e8917 100644 --- a/packages/rule-schema-to-typescript-types/src/types.ts +++ b/packages/rule-schema-to-typescript-types/src/types.ts @@ -1,3 +1,6 @@ +/** + * Maps ref paths to generated type names. + */ export type RefMap = ReadonlyMap< // ref path string, @@ -5,7 +8,10 @@ export type RefMap = ReadonlyMap< string >; -export type AST = +/** + * Minimal representation of the nodes in a schema being compiled to types. + */ +export type SchemaAST = | ArrayAST | LiteralAST | ObjectAST @@ -13,37 +19,37 @@ export type AST = | TypeReferenceAST | UnionAST; -interface BaseASTNode { +export interface BaseSchemaASTNode { readonly commentLines: string[]; } -export interface ArrayAST extends BaseASTNode { - readonly elementType: AST; +export interface ArrayAST extends BaseSchemaASTNode { + readonly elementType: SchemaAST; readonly type: 'array'; } -export interface LiteralAST extends BaseASTNode { +export interface LiteralAST extends BaseSchemaASTNode { readonly code: string; readonly type: 'literal'; } -export interface ObjectAST extends BaseASTNode { - readonly indexSignature: AST | null; +export interface ObjectAST extends BaseSchemaASTNode { + readonly indexSignature: SchemaAST | null; readonly properties: { readonly name: string; readonly optional: boolean; - readonly type: AST; + readonly type: SchemaAST; }[]; readonly type: 'object'; } -export interface TupleAST extends BaseASTNode { - readonly elements: AST[]; - readonly spreadType: AST | null; +export interface TupleAST extends BaseSchemaASTNode { + readonly elements: SchemaAST[]; + readonly spreadType: SchemaAST | null; readonly type: 'tuple'; } -export interface TypeReferenceAST extends BaseASTNode { +export interface TypeReferenceAST extends BaseSchemaASTNode { readonly type: 'type-reference'; readonly typeName: string; } -export interface UnionAST extends BaseASTNode { - readonly elements: AST[]; +export interface UnionAST extends BaseSchemaASTNode { + readonly elements: SchemaAST[]; readonly type: 'union'; } diff --git a/packages/rule-schema-to-typescript-types/tests/index.test.ts b/packages/rule-schema-to-typescript-types/tests/index.test.ts new file mode 100644 index 000000000000..49db40f209f7 --- /dev/null +++ b/packages/rule-schema-to-typescript-types/tests/index.test.ts @@ -0,0 +1,148 @@ +import { schemaToTypes } from '../src/index.js'; + +describe(schemaToTypes, () => { + it('returns a [] type when the schema is an empty array', () => { + const actual = schemaToTypes([]); + + expect(actual).toMatchInlineSnapshot(` + "/** No options declared */ + type Options = [];" + `); + }); + + it('returns a single Options type when the schema is not an array', () => { + const actual = schemaToTypes({ type: 'string' }); + + expect(actual).toMatchInlineSnapshot(`"type Options = string"`); + }); + + it('returns an array Options type when the schema is an array', () => { + const actual = schemaToTypes([{ type: 'string' }]); + + expect(actual).toMatchInlineSnapshot(`"type Options = [string]"`); + }); + + it('returns a complex Options type when the schema contains an array of items', () => { + const actual = schemaToTypes([ + { + items: [{ type: 'string' }], + type: 'array', + }, + ]); + + expect(actual).toMatchInlineSnapshot(` + "type Options = [ | [] + | [string]]" + `); + }); + + it('returns a complex Options type when the schema is nested', () => { + const actual = schemaToTypes([ + { + description: 'My schema items.', + items: { type: 'string' }, + type: 'array', + }, + ]); + + expect(actual).toMatchInlineSnapshot(` + "type Options = [/** My schema items. */ + string[]]" + `); + }); + + it('factors in one $ref property when a $defs property exists at the top level', () => { + const actual = schemaToTypes([ + { + $defs: { + defOption: { + enum: ['a', 'b'], + type: 'string', + }, + }, + additionalProperties: false, + properties: { + one: { + $ref: '#/items/0/$defs/defOption', + }, + }, + type: 'object', + }, + ]); + + expect(actual).toMatchInlineSnapshot(` + "type DefOption = | 'a' + | 'b' + + type Options = [{ + one?: DefOption}]" + `); + }); + + it('factors in one $ref property when a definitions property exists at the top level', () => { + const actual = schemaToTypes([ + { + additionalProperties: false, + definitions: { + defOption: { + enum: ['a', 'b'], + type: 'string', + }, + }, + properties: { + one: { + $ref: '#/items/0/$defs/defOption', + }, + }, + type: 'object', + }, + ]); + + expect(actual).toMatchInlineSnapshot(` + "type DefOption = | 'a' + | 'b' + + type Options = [{ + one?: DefOption}]" + `); + }); + + it('factors in two $ref properties when two $defs properties exist at the top level', () => { + const actual = schemaToTypes([ + { + $defs: { + defOptionOne: { + enum: ['a', 'b'], + type: 'string', + }, + defOptionTwo: { + enum: ['c', 'd'], + type: 'string', + }, + }, + additionalProperties: false, + properties: { + one: { + $ref: '#/items/0/$defs/defOptionOne', + }, + two: { + $ref: '#/items/0/$defs/defOptionTwo', + }, + }, + type: 'object', + }, + ]); + + expect(actual).toMatchInlineSnapshot(` + "type DefOptionOne = | 'a' + | 'b' + + type DefOptionTwo = | 'c' + | 'd' + + type Options = [{ + one?: DefOptionOne; + two?: DefOptionTwo}]" + `); + }); +}); diff --git a/packages/website/docusaurus.config.mts b/packages/website/docusaurus.config.mts index 3e6ff8e252f4..9a51ea074f54 100644 --- a/packages/website/docusaurus.config.mts +++ b/packages/website/docusaurus.config.mts @@ -368,32 +368,34 @@ const config: Config = { organizationName: 'typescript-eslint', plugins: [ './plugins/recent-blog-posts/index.ts', - ...['ast-spec', 'project-service', 'tsconfig-utils', 'type-utils'].map( - packageName => [ - 'docusaurus-plugin-typedoc', - { - entryPoints: [`../${packageName}/src/index.ts`], - enumMembersFormat: 'table', - exclude: '**/*.d.ts', - excludeExternals: true, - groupOrder: ['Functions', 'Variables', '*'], - hidePageTitle: true, - id: `typedoc-generated-${packageName}`, - indexFormat: 'table', - out: `../../docs/packages/${packageName}/generated`, - outputFileStrategy: 'modules', - parametersFormat: 'table', - plugin: [ - require.resolve('./tools/typedoc-plugin-no-inherit-fork.mjs'), - ], - propertiesFormat: 'table', - readme: 'none', - tsconfig: `../${packageName}/tsconfig.json`, - typeDeclarationFormat: 'table', - useCodeBlocks: true, - }, - ], - ), + ...[ + 'ast-spec', + 'project-service', + 'rule-schema-to-typescript-types', + 'tsconfig-utils', + 'type-utils', + ].map(packageName => [ + 'docusaurus-plugin-typedoc', + { + entryPoints: [`../${packageName}/src/index.ts`], + enumMembersFormat: 'table', + exclude: '**/*.d.ts', + excludeExternals: true, + groupOrder: ['Functions', 'Variables', '*'], + hidePageTitle: true, + id: `typedoc-generated-${packageName}`, + indexFormat: 'table', + out: `../../docs/packages/${packageName}/generated`, + outputFileStrategy: 'modules', + parametersFormat: 'table', + plugin: [require.resolve('./tools/typedoc-plugin-no-inherit-fork.mjs')], + propertiesFormat: 'table', + readme: 'none', + tsconfig: `../${packageName}/tsconfig.json`, + typeDeclarationFormat: 'table', + useCodeBlocks: true, + }, + ]), require.resolve('./webpack.plugin'), ['@docusaurus/plugin-content-docs', pluginContentDocsOptions], ['@docusaurus/plugin-pwa', pluginPwaOptions], diff --git a/packages/website/plugins/generated-rule-docs/insertions/insertNewRuleReferences.ts b/packages/website/plugins/generated-rule-docs/insertions/insertNewRuleReferences.ts index 89230d62a2fb..2154ca000f61 100644 --- a/packages/website/plugins/generated-rule-docs/insertions/insertNewRuleReferences.ts +++ b/packages/website/plugins/generated-rule-docs/insertions/insertNewRuleReferences.ts @@ -2,7 +2,7 @@ import type { ESLintPluginDocs } from '@typescript-eslint/eslint-plugin/use-at-y import type * as mdast from 'mdast'; import type { MdxJsxFlowElement } from 'mdast-util-mdx'; -import { compile } from '@typescript-eslint/rule-schema-to-typescript-types'; +import { schemaToTypes } from '@typescript-eslint/rule-schema-to-typescript-types'; import { EOL } from 'node:os'; import * as path from 'node:path'; import prettier from 'prettier'; @@ -32,7 +32,7 @@ const PRETTIER_CONFIG_PATH = path.resolve( '..', '.prettierrc.json', ); -const prettierConfig = (async () => { +const lazyPrettierConfig = (async () => { const filepath = path.join(__dirname, 'file.ts'); const config = await prettier.resolveConfig(filepath, { config: PRETTIER_CONFIG_PATH, @@ -149,6 +149,7 @@ export async function insertNewRuleReferences( 'This rule is not configurable.', ); } else if (!COMPLICATED_RULE_OPTIONS.has(page.file.stem)) { + const prettierConfig = await lazyPrettierConfig; page.spliceChildren( page.headingIndices.options + 1, 0, @@ -159,11 +160,11 @@ export async function insertNewRuleReferences( lang: 'ts', type: 'code', value: [ - await compile(page.rule.meta.schema, prettierConfig), await prettier.format( - getRuleDefaultOptions(page), - await prettierConfig, + schemaToTypes(page.rule.meta.schema), + prettierConfig, ), + await prettier.format(getRuleDefaultOptions(page), prettierConfig), ] .join(EOL) .trim(), diff --git a/packages/website/sidebars/sidebar.base.js b/packages/website/sidebars/sidebar.base.js index 689a5bb14202..a6d6e196d9e0 100644 --- a/packages/website/sidebars/sidebar.base.js +++ b/packages/website/sidebars/sidebar.base.js @@ -104,6 +104,7 @@ module.exports = { 'packages/eslint-plugin-tslint', 'packages/parser', 'packages/project-service', + 'packages/rule-schema-to-typescript-types', 'packages/rule-tester', 'packages/scope-manager', 'packages/tsconfig-utils', diff --git a/yarn.lock b/yarn.lock index c742e4bfff4b..7fd4a2ff718d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6007,7 +6007,6 @@ __metadata: "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 - prettier: 3.6.2 rimraf: "*" typescript: "*" vitest: ^3.1.3 From 8de997ef305b3244238d85505f132410110e09c7 Mon Sep 17 00:00:00 2001 From: Younsang Na <77400131+nayounsang@users.noreply.github.com> Date: Fri, 3 Oct 2025 21:08:12 +0900 Subject: [PATCH 238/283] feat(eslint-plugin): [no-unused-vars] support explicit resource management with `ignoreUsingDeclarations` option (#11456) * feat: add ignoreUsingDeclarations option * test: add test case for using and await using * feat: implement report using and await using with option * test: fix test cases * chore: generate snapshots * chore: revert snapshots and commit only necessary snapshot * Revert "chore: generate snapshots" This reverts commit 01b73c26e51da78e1fcfbc5c254433a169fab6e0. * chore: commit only necessary snapshot * refactor: dont use else if after the unconditional continue * test: align tc with eslint * test: fix lint err * test: fix minor diff with eslint tc --- .../eslint-plugin/src/rules/no-unused-vars.ts | 19 +++++ .../no-unused-vars/no-unused-vars.test.ts | 75 +++++++++++++++++++ .../schema-snapshots/no-unused-vars.shot | 6 ++ 3 files changed, 100 insertions(+) diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index 01d171b34bd2..ce8e0abc3340 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -35,6 +35,7 @@ export type Options = [ destructuredArrayIgnorePattern?: string; ignoreClassWithStaticInitBlock?: boolean; ignoreRestSiblings?: boolean; + ignoreUsingDeclarations?: boolean; reportUsedIgnorePattern?: boolean; vars?: 'all' | 'local'; varsIgnorePattern?: string; @@ -49,6 +50,7 @@ interface TranslatedOptions { destructuredArrayIgnorePattern?: RegExp; ignoreClassWithStaticInitBlock: boolean; ignoreRestSiblings: boolean; + ignoreUsingDeclarations: boolean; reportUsedIgnorePattern: boolean; vars: 'all' | 'local'; varsIgnorePattern?: RegExp; @@ -128,6 +130,11 @@ export default createRule({ description: 'Whether to ignore sibling properties in `...` destructurings.', }, + ignoreUsingDeclarations: { + type: 'boolean', + description: + 'Whether to ignore using or await using declarations.', + }, reportUsedIgnorePattern: { type: 'boolean', description: @@ -163,6 +170,7 @@ export default createRule({ caughtErrors: 'all', ignoreClassWithStaticInitBlock: false, ignoreRestSiblings: false, + ignoreUsingDeclarations: false, reportUsedIgnorePattern: false, vars: 'all', }; @@ -174,6 +182,9 @@ export default createRule({ options.args = firstOption.args ?? options.args; options.ignoreRestSiblings = firstOption.ignoreRestSiblings ?? options.ignoreRestSiblings; + options.ignoreUsingDeclarations = + firstOption.ignoreUsingDeclarations ?? + options.ignoreUsingDeclarations; options.caughtErrors = firstOption.caughtErrors ?? options.caughtErrors; options.ignoreClassWithStaticInitBlock = firstOption.ignoreClassWithStaticInitBlock ?? @@ -549,6 +560,14 @@ export default createRule({ continue; } + if ( + def.type === TSESLint.Scope.DefinitionType.Variable && + options.ignoreUsingDeclarations && + (def.parent.kind === 'await using' || def.parent.kind === 'using') + ) { + continue; + } + if (hasRestSpreadSibling(variable)) { continue; } 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 5f40bbcdc3cc..75dbb87439a7 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 @@ -1715,6 +1715,48 @@ export {}; ], filename: 'foo.d.ts', }, + { + code: ` +using resource = getResource(); + `, + errors: [ + { + data: { + action: 'assigned a value', + additional: '', + varName: 'resource', + }, + line: 2, + messageId: 'unusedVar', + }, + ], + languageOptions: { + parserOptions: { + ecmaVersion: 2026, + }, + }, + }, + { + code: ` +await using resource = getResource(); + `, + errors: [ + { + data: { + action: 'assigned a value', + additional: '', + varName: 'resource', + }, + line: 2, + messageId: 'unusedVar', + }, + ], + languageOptions: { + parserOptions: { + ecmaVersion: 2026, + }, + }, + }, ], valid: [ @@ -3018,5 +3060,38 @@ declare class Bar {} `, filename: 'foo.d.ts', }, + { + code: ` +using resource = getResource(); +resource; + `, + languageOptions: { + parserOptions: { + ecmaVersion: 2026, + }, + }, + }, + { + code: ` +using resource = getResource(); + `, + languageOptions: { + parserOptions: { + ecmaVersion: 2026, + }, + }, + options: [{ ignoreUsingDeclarations: true }], + }, + { + code: ` +await using resource = getResource(); + `, + languageOptions: { + parserOptions: { + ecmaVersion: 2026, + }, + }, + options: [{ ignoreUsingDeclarations: true }], + }, ], }); diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unused-vars.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unused-vars.shot index 68d726884fe3..fa83b7e42e8e 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unused-vars.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unused-vars.shot @@ -42,6 +42,10 @@ "description": "Whether to ignore sibling properties in `...` destructurings.", "type": "boolean" }, + "ignoreUsingDeclarations": { + "description": "Whether to ignore using or await using declarations.", + "type": "boolean" + }, "reportUsedIgnorePattern": { "description": "Whether to report variables that match any of the valid ignore pattern options if they have been used.", "type": "boolean" @@ -89,6 +93,8 @@ type Options = [ ignoreClassWithStaticInitBlock?: boolean; /** Whether to ignore sibling properties in `...` destructurings. */ ignoreRestSiblings?: boolean; + /** Whether to ignore using or await using declarations. */ + ignoreUsingDeclarations?: boolean; /** Whether to report variables that match any of the valid ignore pattern options if they have been used. */ reportUsedIgnorePattern?: boolean; /** Whether to check all variables or only locally-declared variables. */ From 2efd0ec6b5201de57a34f3fdbd45e66cb0b43567 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Fri, 3 Oct 2025 20:08:46 +0800 Subject: [PATCH 239/283] chore(typescript-estree): extract modifier check logic into a separate file (#11595) * Extract `check-modifiers` * Move `throwError` --- .../typescript-estree/src/check-modifiers.ts | 375 ++++++++++++++++++ packages/typescript-estree/src/convert.ts | 247 +----------- packages/typescript-estree/src/node-utils.ts | 118 +----- 3 files changed, 378 insertions(+), 362 deletions(-) create mode 100644 packages/typescript-estree/src/check-modifiers.ts diff --git a/packages/typescript-estree/src/check-modifiers.ts b/packages/typescript-estree/src/check-modifiers.ts new file mode 100644 index 000000000000..1a21288347eb --- /dev/null +++ b/packages/typescript-estree/src/check-modifiers.ts @@ -0,0 +1,375 @@ +import * as ts from 'typescript'; + +import type { TSNode } from './ts-estree'; + +import { getDecorators, getModifiers } from './getModifiers'; +import { + getDeclarationKind, + hasModifier, + isThisIdentifier, + createError, +} from './node-utils'; + +const SyntaxKind = ts.SyntaxKind; + +// `ts.nodeIsMissing` +function nodeIsMissing(node: ts.Node | undefined): boolean { + if (node == null) { + return true; + } + return ( + node.pos === node.end && + node.pos >= 0 && + node.kind !== SyntaxKind.EndOfFileToken + ); +} + +// `ts.nodeIsPresent` +function nodeIsPresent(node: ts.Node | undefined): node is ts.Node { + return !nodeIsMissing(node); +} + +// `ts.hasAbstractModifier` +function hasAbstractModifier(node: ts.Node): boolean { + return hasModifier(SyntaxKind.AbstractKeyword, node); +} + +// `ts.getThisParameter` +function getThisParameter( + signature: ts.SignatureDeclaration, +): ts.ParameterDeclaration | null { + if (signature.parameters.length && !ts.isJSDocSignature(signature)) { + const thisParameter = signature.parameters[0]; + if (parameterIsThisKeyword(thisParameter)) { + return thisParameter; + } + } + + return null; +} + +// `ts.parameterIsThisKeyword` +function parameterIsThisKeyword(parameter: ts.ParameterDeclaration): boolean { + return isThisIdentifier(parameter.name); +} + +// `ts.getContainingFunction` +function getContainingFunction( + node: ts.Node, +): ts.SignatureDeclaration | undefined { + return ts.findAncestor(node.parent, ts.isFunctionLike); +} + +// Rewrite version of `ts.nodeCanBeDecorated` +// Returns `true` for both `useLegacyDecorators: true` and `useLegacyDecorators: false` +function nodeCanBeDecorated(node: TSNode): boolean { + switch (node.kind) { + case SyntaxKind.ClassDeclaration: + return true; + case SyntaxKind.ClassExpression: + // `ts.nodeCanBeDecorated` returns `false` if `useLegacyDecorators: true` + return true; + case SyntaxKind.PropertyDeclaration: { + const { parent } = node; + + // `ts.nodeCanBeDecorated` uses this if `useLegacyDecorators: true` + if (ts.isClassDeclaration(parent)) { + return true; + } + + // `ts.nodeCanBeDecorated` uses this if `useLegacyDecorators: false` + if (ts.isClassLike(parent) && !hasAbstractModifier(node)) { + return true; + } + + return false; + } + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.MethodDeclaration: { + const { parent } = node; + // In `ts.nodeCanBeDecorated` + // when `useLegacyDecorators: true` uses `ts.isClassDeclaration` + // when `useLegacyDecorators: true` uses `ts.isClassLike` + return ( + Boolean(node.body) && + (ts.isClassDeclaration(parent) || ts.isClassLike(parent)) + ); + } + case SyntaxKind.Parameter: { + // `ts.nodeCanBeDecorated` returns `false` if `useLegacyDecorators: false` + + const { parent } = node; + const grandparent = parent.parent; + + return ( + Boolean(parent) && + 'body' in parent && + Boolean(parent.body) && + (parent.kind === SyntaxKind.Constructor || + parent.kind === SyntaxKind.MethodDeclaration || + parent.kind === SyntaxKind.SetAccessor) && + getThisParameter(parent) !== node && + Boolean(grandparent) && + grandparent.kind === SyntaxKind.ClassDeclaration + ); + } + } + + return false; +} + +function nodeHasIllegalDecorators( + node: ts.Node, +): node is { illegalDecorators: ts.Node[] } & ts.Node { + return !!( + 'illegalDecorators' in node && + (node.illegalDecorators as unknown[] | undefined)?.length + ); +} + +function throwError(node: ts.Node, message: string): never { + const ast = node.getSourceFile(); + const start = node.getStart(ast); + const end = node.getEnd(); + + throw createError(message, ast, start, end); +} + +export function checkModifiers(node: ts.Node): void { + // typescript<5.0.0 + if (nodeHasIllegalDecorators(node)) { + throwError(node.illegalDecorators[0], 'Decorators are not valid here.'); + } + + for (const decorator of getDecorators( + node, + /* includeIllegalDecorators */ true, + ) ?? []) { + // `checkGrammarModifiers` function in typescript + if (!nodeCanBeDecorated(node as TSNode)) { + if (ts.isMethodDeclaration(node) && !nodeIsPresent(node.body)) { + throwError( + decorator, + 'A decorator can only decorate a method implementation, not an overload.', + ); + } else { + throwError(decorator, 'Decorators are not valid here.'); + } + } + } + + for (const modifier of getModifiers( + node, + /* includeIllegalModifiers */ true, + ) ?? []) { + if (modifier.kind !== SyntaxKind.ReadonlyKeyword) { + if ( + node.kind === SyntaxKind.PropertySignature || + node.kind === SyntaxKind.MethodSignature + ) { + throwError( + modifier, + `'${ts.tokenToString( + modifier.kind, + )}' modifier cannot appear on a type member`, + ); + } + + if ( + node.kind === SyntaxKind.IndexSignature && + (modifier.kind !== SyntaxKind.StaticKeyword || + !ts.isClassLike(node.parent)) + ) { + throwError( + modifier, + `'${ts.tokenToString( + modifier.kind, + )}' modifier cannot appear on an index signature`, + ); + } + } + + if ( + modifier.kind !== SyntaxKind.InKeyword && + modifier.kind !== SyntaxKind.OutKeyword && + modifier.kind !== SyntaxKind.ConstKeyword && + node.kind === SyntaxKind.TypeParameter + ) { + throwError( + modifier, + `'${ts.tokenToString( + modifier.kind, + )}' modifier cannot appear on a type parameter`, + ); + } + + if ( + (modifier.kind === SyntaxKind.InKeyword || + modifier.kind === SyntaxKind.OutKeyword) && + (node.kind !== SyntaxKind.TypeParameter || + !( + ts.isInterfaceDeclaration(node.parent) || + ts.isClassLike(node.parent) || + ts.isTypeAliasDeclaration(node.parent) + )) + ) { + throwError( + modifier, + `'${ts.tokenToString( + modifier.kind, + )}' modifier can only appear on a type parameter of a class, interface or type alias`, + ); + } + + if ( + modifier.kind === SyntaxKind.ReadonlyKeyword && + node.kind !== SyntaxKind.PropertyDeclaration && + node.kind !== SyntaxKind.PropertySignature && + node.kind !== SyntaxKind.IndexSignature && + node.kind !== SyntaxKind.Parameter + ) { + throwError( + modifier, + "'readonly' modifier can only appear on a property declaration or index signature.", + ); + } + + if ( + modifier.kind === SyntaxKind.DeclareKeyword && + ts.isClassLike(node.parent) && + !ts.isPropertyDeclaration(node) + ) { + throwError( + modifier, + `'${ts.tokenToString( + modifier.kind, + )}' modifier cannot appear on class elements of this kind.`, + ); + } + + if ( + modifier.kind === SyntaxKind.DeclareKeyword && + ts.isVariableStatement(node) + ) { + const declarationKind = getDeclarationKind(node.declarationList); + if (declarationKind === 'using' || declarationKind === 'await using') { + throwError( + modifier, + `'declare' modifier cannot appear on a '${declarationKind}' declaration.`, + ); + } + } + + if ( + modifier.kind === SyntaxKind.AbstractKeyword && + node.kind !== SyntaxKind.ClassDeclaration && + node.kind !== SyntaxKind.ConstructorType && + node.kind !== SyntaxKind.MethodDeclaration && + node.kind !== SyntaxKind.PropertyDeclaration && + node.kind !== SyntaxKind.GetAccessor && + node.kind !== SyntaxKind.SetAccessor + ) { + throwError( + modifier, + `'${ts.tokenToString( + modifier.kind, + )}' modifier can only appear on a class, method, or property declaration.`, + ); + } + + if ( + (modifier.kind === SyntaxKind.StaticKeyword || + modifier.kind === SyntaxKind.PublicKeyword || + modifier.kind === SyntaxKind.ProtectedKeyword || + modifier.kind === SyntaxKind.PrivateKeyword) && + (node.parent.kind === SyntaxKind.ModuleBlock || + node.parent.kind === SyntaxKind.SourceFile) + ) { + throwError( + modifier, + `'${ts.tokenToString( + modifier.kind, + )}' modifier cannot appear on a module or namespace element.`, + ); + } + + if ( + modifier.kind === SyntaxKind.AccessorKeyword && + node.kind !== SyntaxKind.PropertyDeclaration + ) { + throwError( + modifier, + "'accessor' modifier can only appear on a property declaration.", + ); + } + + // `checkGrammarAsyncModifier` function in `typescript` + if ( + modifier.kind === SyntaxKind.AsyncKeyword && + node.kind !== SyntaxKind.MethodDeclaration && + node.kind !== SyntaxKind.FunctionDeclaration && + node.kind !== SyntaxKind.FunctionExpression && + node.kind !== SyntaxKind.ArrowFunction + ) { + throwError(modifier, "'async' modifier cannot be used here."); + } + + // `checkGrammarModifiers` function in `typescript` + if ( + node.kind === SyntaxKind.Parameter && + (modifier.kind === SyntaxKind.StaticKeyword || + modifier.kind === SyntaxKind.ExportKeyword || + modifier.kind === SyntaxKind.DeclareKeyword || + modifier.kind === SyntaxKind.AsyncKeyword) + ) { + throwError( + modifier, + `'${ts.tokenToString( + modifier.kind, + )}' modifier cannot appear on a parameter.`, + ); + } + + // `checkGrammarModifiers` function in `typescript` + if ( + modifier.kind === SyntaxKind.PublicKeyword || + modifier.kind === SyntaxKind.ProtectedKeyword || + modifier.kind === SyntaxKind.PrivateKeyword + ) { + for (const anotherModifier of getModifiers(node) ?? []) { + if ( + anotherModifier !== modifier && + (anotherModifier.kind === SyntaxKind.PublicKeyword || + anotherModifier.kind === SyntaxKind.ProtectedKeyword || + anotherModifier.kind === SyntaxKind.PrivateKeyword) + ) { + throwError(anotherModifier, `Accessibility modifier already seen.`); + } + } + } + + // `checkParameter` function in `typescript` + if ( + node.kind === SyntaxKind.Parameter && + // In `typescript` package, it's `ts.hasSyntacticModifier(node, ts.ModifierFlags.ParameterPropertyModifier)` + // https://github.com/typescript-eslint/typescript-eslint/pull/6615#discussion_r1136489935 + (modifier.kind === SyntaxKind.PublicKeyword || + modifier.kind === SyntaxKind.PrivateKeyword || + modifier.kind === SyntaxKind.ProtectedKeyword || + modifier.kind === SyntaxKind.ReadonlyKeyword || + modifier.kind === SyntaxKind.OverrideKeyword) + ) { + const func = getContainingFunction(node); + + if ( + !(func?.kind === SyntaxKind.Constructor && nodeIsPresent(func.body)) + ) { + throwError( + modifier, + 'A parameter property is only allowed in a constructor implementation.', + ); + } + } + } +} diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index bec26fede610..1de256d20740 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -10,13 +10,13 @@ import type { import type { SemanticOrSyntacticError } from './semantic-or-syntactic-errors'; import type { TSESTree, TSESTreeToTSNode, TSNode } from './ts-estree'; +import { checkModifiers } from './check-modifiers'; import { getDecorators, getModifiers } from './getModifiers'; import { canContainDirective, createError, findNextToken, getBinaryExpressionType, - getContainingFunction, getDeclarationKind, getLastModifier, getLineAndCharacterFor, @@ -34,9 +34,6 @@ import { isOptional, isThisInTypeQuery, isValidAssignmentTarget, - nodeCanBeDecorated, - nodeHasIllegalDecorators, - nodeIsPresent, unescapeStringLiteralText, } from './node-utils'; import { AST_NODE_TYPES } from './ts-estree'; @@ -158,247 +155,7 @@ export class Converter { return; } - // typescript<5.0.0 - if (nodeHasIllegalDecorators(node)) { - this.#throwError( - node.illegalDecorators[0], - 'Decorators are not valid here.', - ); - } - - for (const decorator of getDecorators( - node, - /* includeIllegalDecorators */ true, - ) ?? []) { - // `checkGrammarModifiers` function in typescript - if (!nodeCanBeDecorated(node as TSNode)) { - if (ts.isMethodDeclaration(node) && !nodeIsPresent(node.body)) { - this.#throwError( - decorator, - 'A decorator can only decorate a method implementation, not an overload.', - ); - } else { - this.#throwError(decorator, 'Decorators are not valid here.'); - } - } - } - - for (const modifier of getModifiers( - node, - /* includeIllegalModifiers */ true, - ) ?? []) { - if (modifier.kind !== SyntaxKind.ReadonlyKeyword) { - if ( - node.kind === SyntaxKind.PropertySignature || - node.kind === SyntaxKind.MethodSignature - ) { - this.#throwError( - modifier, - `'${ts.tokenToString( - modifier.kind, - )}' modifier cannot appear on a type member`, - ); - } - - if ( - node.kind === SyntaxKind.IndexSignature && - (modifier.kind !== SyntaxKind.StaticKeyword || - !ts.isClassLike(node.parent)) - ) { - this.#throwError( - modifier, - `'${ts.tokenToString( - modifier.kind, - )}' modifier cannot appear on an index signature`, - ); - } - } - - if ( - modifier.kind !== SyntaxKind.InKeyword && - modifier.kind !== SyntaxKind.OutKeyword && - modifier.kind !== SyntaxKind.ConstKeyword && - node.kind === SyntaxKind.TypeParameter - ) { - this.#throwError( - modifier, - `'${ts.tokenToString( - modifier.kind, - )}' modifier cannot appear on a type parameter`, - ); - } - - if ( - (modifier.kind === SyntaxKind.InKeyword || - modifier.kind === SyntaxKind.OutKeyword) && - (node.kind !== SyntaxKind.TypeParameter || - !( - ts.isInterfaceDeclaration(node.parent) || - ts.isClassLike(node.parent) || - ts.isTypeAliasDeclaration(node.parent) - )) - ) { - this.#throwError( - modifier, - `'${ts.tokenToString( - modifier.kind, - )}' modifier can only appear on a type parameter of a class, interface or type alias`, - ); - } - - if ( - modifier.kind === SyntaxKind.ReadonlyKeyword && - node.kind !== SyntaxKind.PropertyDeclaration && - node.kind !== SyntaxKind.PropertySignature && - node.kind !== SyntaxKind.IndexSignature && - node.kind !== SyntaxKind.Parameter - ) { - this.#throwError( - modifier, - "'readonly' modifier can only appear on a property declaration or index signature.", - ); - } - - if ( - modifier.kind === SyntaxKind.DeclareKeyword && - ts.isClassLike(node.parent) && - !ts.isPropertyDeclaration(node) - ) { - this.#throwError( - modifier, - `'${ts.tokenToString( - modifier.kind, - )}' modifier cannot appear on class elements of this kind.`, - ); - } - - if ( - modifier.kind === SyntaxKind.DeclareKeyword && - ts.isVariableStatement(node) - ) { - const declarationKind = getDeclarationKind(node.declarationList); - if (declarationKind === 'using' || declarationKind === 'await using') { - this.#throwError( - modifier, - `'declare' modifier cannot appear on a '${declarationKind}' declaration.`, - ); - } - } - - if ( - modifier.kind === SyntaxKind.AbstractKeyword && - node.kind !== SyntaxKind.ClassDeclaration && - node.kind !== SyntaxKind.ConstructorType && - node.kind !== SyntaxKind.MethodDeclaration && - node.kind !== SyntaxKind.PropertyDeclaration && - node.kind !== SyntaxKind.GetAccessor && - node.kind !== SyntaxKind.SetAccessor - ) { - this.#throwError( - modifier, - `'${ts.tokenToString( - modifier.kind, - )}' modifier can only appear on a class, method, or property declaration.`, - ); - } - - if ( - (modifier.kind === SyntaxKind.StaticKeyword || - modifier.kind === SyntaxKind.PublicKeyword || - modifier.kind === SyntaxKind.ProtectedKeyword || - modifier.kind === SyntaxKind.PrivateKeyword) && - (node.parent.kind === SyntaxKind.ModuleBlock || - node.parent.kind === SyntaxKind.SourceFile) - ) { - this.#throwError( - modifier, - `'${ts.tokenToString( - modifier.kind, - )}' modifier cannot appear on a module or namespace element.`, - ); - } - - if ( - modifier.kind === SyntaxKind.AccessorKeyword && - node.kind !== SyntaxKind.PropertyDeclaration - ) { - this.#throwError( - modifier, - "'accessor' modifier can only appear on a property declaration.", - ); - } - - // `checkGrammarAsyncModifier` function in `typescript` - if ( - modifier.kind === SyntaxKind.AsyncKeyword && - node.kind !== SyntaxKind.MethodDeclaration && - node.kind !== SyntaxKind.FunctionDeclaration && - node.kind !== SyntaxKind.FunctionExpression && - node.kind !== SyntaxKind.ArrowFunction - ) { - this.#throwError(modifier, "'async' modifier cannot be used here."); - } - - // `checkGrammarModifiers` function in `typescript` - if ( - node.kind === SyntaxKind.Parameter && - (modifier.kind === SyntaxKind.StaticKeyword || - modifier.kind === SyntaxKind.ExportKeyword || - modifier.kind === SyntaxKind.DeclareKeyword || - modifier.kind === SyntaxKind.AsyncKeyword) - ) { - this.#throwError( - modifier, - `'${ts.tokenToString( - modifier.kind, - )}' modifier cannot appear on a parameter.`, - ); - } - - // `checkGrammarModifiers` function in `typescript` - if ( - modifier.kind === SyntaxKind.PublicKeyword || - modifier.kind === SyntaxKind.ProtectedKeyword || - modifier.kind === SyntaxKind.PrivateKeyword - ) { - for (const anotherModifier of getModifiers(node) ?? []) { - if ( - anotherModifier !== modifier && - (anotherModifier.kind === SyntaxKind.PublicKeyword || - anotherModifier.kind === SyntaxKind.ProtectedKeyword || - anotherModifier.kind === SyntaxKind.PrivateKeyword) - ) { - this.#throwError( - anotherModifier, - `Accessibility modifier already seen.`, - ); - } - } - } - - // `checkParameter` function in `typescript` - if ( - node.kind === SyntaxKind.Parameter && - // In `typescript` package, it's `ts.hasSyntacticModifier(node, ts.ModifierFlags.ParameterPropertyModifier)` - // https://github.com/typescript-eslint/typescript-eslint/pull/6615#discussion_r1136489935 - (modifier.kind === SyntaxKind.PublicKeyword || - modifier.kind === SyntaxKind.PrivateKeyword || - modifier.kind === SyntaxKind.ProtectedKeyword || - modifier.kind === SyntaxKind.ReadonlyKeyword || - modifier.kind === SyntaxKind.OverrideKeyword) - ) { - const func = getContainingFunction(node)!; - - if ( - !(func.kind === SyntaxKind.Constructor && nodeIsPresent(func.body)) - ) { - this.#throwError( - modifier, - 'A parameter property is only allowed in a constructor implementation.', - ); - } - } - } + checkModifiers(node); } #throwError(node: number | ts.Node | TSESTree.Range, message: string): never { diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 640b493d63bb..3200e74ec020 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -1,6 +1,6 @@ import * as ts from 'typescript'; -import type { TSESTree, TSNode } from './ts-estree'; +import type { TSESTree } from './ts-estree'; import { getModifiers } from './getModifiers'; import { xhtmlEntities } from './jsx/xhtml-entities'; @@ -692,15 +692,6 @@ export function createError( return new TSError(message, ast.fileName, { end, start }); } -export function nodeHasIllegalDecorators( - node: ts.Node, -): node is { illegalDecorators: ts.Node[] } & ts.Node { - return !!( - 'illegalDecorators' in node && - (node.illegalDecorators as unknown[] | undefined)?.length - ); -} - export function nodeHasTokens(n: ts.Node, ast: ts.SourceFile): boolean { // If we have a token or node that has a non-zero width, it must have tokens. // Note: getWidth() does not take trivia into account. @@ -762,113 +753,6 @@ export function isThisInTypeQuery(node: ts.Node): boolean { return node.parent.kind === SyntaxKind.TypeQuery; } -// `ts.nodeIsMissing` -function nodeIsMissing(node: ts.Node | undefined): boolean { - if (node == null) { - return true; - } - return ( - node.pos === node.end && - node.pos >= 0 && - node.kind !== SyntaxKind.EndOfFileToken - ); -} - -// `ts.nodeIsPresent` -export function nodeIsPresent(node: ts.Node | undefined): node is ts.Node { - return !nodeIsMissing(node); -} - -// `ts.getContainingFunction` -export function getContainingFunction( - node: ts.Node, -): ts.SignatureDeclaration | undefined { - return ts.findAncestor(node.parent, ts.isFunctionLike); -} - -// `ts.hasAbstractModifier` -function hasAbstractModifier(node: ts.Node): boolean { - return hasModifier(SyntaxKind.AbstractKeyword, node); -} - -// `ts.getThisParameter` -function getThisParameter( - signature: ts.SignatureDeclaration, -): ts.ParameterDeclaration | null { - if (signature.parameters.length && !ts.isJSDocSignature(signature)) { - const thisParameter = signature.parameters[0]; - if (parameterIsThisKeyword(thisParameter)) { - return thisParameter; - } - } - - return null; -} - -// `ts.parameterIsThisKeyword` -function parameterIsThisKeyword(parameter: ts.ParameterDeclaration): boolean { - return isThisIdentifier(parameter.name); -} - -// Rewrite version of `ts.nodeCanBeDecorated` -// Returns `true` for both `useLegacyDecorators: true` and `useLegacyDecorators: false` -export function nodeCanBeDecorated(node: TSNode): boolean { - switch (node.kind) { - case SyntaxKind.ClassDeclaration: - return true; - case SyntaxKind.ClassExpression: - // `ts.nodeCanBeDecorated` returns `false` if `useLegacyDecorators: true` - return true; - case SyntaxKind.PropertyDeclaration: { - const { parent } = node; - - // `ts.nodeCanBeDecorated` uses this if `useLegacyDecorators: true` - if (ts.isClassDeclaration(parent)) { - return true; - } - - // `ts.nodeCanBeDecorated` uses this if `useLegacyDecorators: false` - if (ts.isClassLike(parent) && !hasAbstractModifier(node)) { - return true; - } - - return false; - } - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.MethodDeclaration: { - const { parent } = node; - // In `ts.nodeCanBeDecorated` - // when `useLegacyDecorators: true` uses `ts.isClassDeclaration` - // when `useLegacyDecorators: true` uses `ts.isClassLike` - return ( - Boolean(node.body) && - (ts.isClassDeclaration(parent) || ts.isClassLike(parent)) - ); - } - case SyntaxKind.Parameter: { - // `ts.nodeCanBeDecorated` returns `false` if `useLegacyDecorators: false` - - const { parent } = node; - const grandparent = parent.parent; - - return ( - Boolean(parent) && - 'body' in parent && - Boolean(parent.body) && - (parent.kind === SyntaxKind.Constructor || - parent.kind === SyntaxKind.MethodDeclaration || - parent.kind === SyntaxKind.SetAccessor) && - getThisParameter(parent) !== node && - Boolean(grandparent) && - grandparent.kind === SyntaxKind.ClassDeclaration - ); - } - } - - return false; -} - export function isValidAssignmentTarget(node: ts.Node): boolean { switch (node.kind) { case SyntaxKind.Identifier: From f8412ce22b6e7e12121759d34b306d5f4019f1e5 Mon Sep 17 00:00:00 2001 From: Victor Genaev Date: Fri, 3 Oct 2025 14:09:21 +0200 Subject: [PATCH 240/283] fix(eslint-plugin): [no-deprecated] ignore deprecated `export import`s (#11603) * fix(eslint-plugin): no-deprecated should not report deprecation on TSImportEqualsDeclaration * fixup! fix(eslint-plugin): no-deprecated should not report deprecation on TSImportEqualsDeclaration --- packages/eslint-plugin/src/rules/no-deprecated.ts | 4 ++++ .../tests/rules/no-deprecated.test.ts | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/packages/eslint-plugin/src/rules/no-deprecated.ts b/packages/eslint-plugin/src/rules/no-deprecated.ts index 71b333488b55..f186feec02ae 100644 --- a/packages/eslint-plugin/src/rules/no-deprecated.ts +++ b/packages/eslint-plugin/src/rules/no-deprecated.ts @@ -157,6 +157,10 @@ export default createRule({ case AST_NODE_TYPES.TSTypeParameter: return true; + // treat `export import Bar = Foo;` (and `import Foo = require('...')`) as declarations + case AST_NODE_TYPES.TSImportEqualsDeclaration: + return parent.id === node; + default: return false; } diff --git a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts index e5a0937f4264..6a643ab704c8 100644 --- a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts +++ b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts @@ -245,6 +245,21 @@ ruleTester.run('no-deprecated', rule, { declare const x: Props; const { anchor = '' } = x; `, + ` + namespace Foo {} + + /** + * @deprecated + */ + export import Bar = Foo; + `, + ` + /** + * @deprecated + */ + export import Bar = require('./deprecated'); + `, + ` interface Props { anchor: 'foo'; From cdd6384c1247fd2db5883c7a99417e5493212ca2 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Fri, 3 Oct 2025 06:31:01 -0600 Subject: [PATCH 241/283] chore: convert eslint-plugin-internal to ESM (#11651) * convert eslint-plugin-internal to ESM * replace import.meta.dirname --- packages/eslint-plugin-internal/index.d.ts | 4 ++-- packages/eslint-plugin-internal/package.json | 1 + packages/eslint-plugin-internal/src/index.ts | 15 +++++---------- .../src/rules/debug-namespace.ts | 4 ++-- .../src/rules/eqeq-nullish.ts | 4 ++-- .../eslint-plugin-internal/src/rules/index.ts | 16 ++++++++-------- .../src/rules/no-poorly-typed-ts-props.ts | 2 +- .../no-relative-paths-to-internal-packages.ts | 9 +++++++-- .../src/rules/no-typescript-default-import.ts | 2 +- .../src/rules/no-typescript-estree-import.ts | 2 +- .../src/rules/plugin-test-formatting.ts | 8 +++++++- .../src/rules/prefer-ast-types-enum.ts | 4 ++-- .../src/util/createRule.ts | 6 +++--- .../eslint-plugin-internal/src/util/index.ts | 2 +- .../src/util/packagejson.ts | 17 +++++++++++++++++ .../eslint-plugin-internal/tests/RuleTester.ts | 5 +++++ .../tests/rules/debug-namespace.test.ts | 2 +- .../tests/rules/eqeq-nullish.test.ts | 2 +- .../rules/no-poorly-typed-ts-props.test.ts | 4 ++-- ...-relative-paths-to-internal-packages.test.ts | 2 +- .../rules/no-typescript-default-import.test.ts | 2 +- .../tests/rules/no-typescript-estree.test.ts | 2 +- .../tests/rules/plugin-test-formatting.test.ts | 4 ++-- .../tests/rules/prefer-ast-types-enum.test.ts | 2 +- 24 files changed, 75 insertions(+), 46 deletions(-) create mode 100644 packages/eslint-plugin-internal/src/util/packagejson.ts diff --git a/packages/eslint-plugin-internal/index.d.ts b/packages/eslint-plugin-internal/index.d.ts index 8c2962c75da3..68fc87c70ca0 100644 --- a/packages/eslint-plugin-internal/index.d.ts +++ b/packages/eslint-plugin-internal/index.d.ts @@ -2,8 +2,8 @@ import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; import type rules from './rules'; -declare const cjsExport: { +declare const defaultExport: { meta: FlatConfig.PluginMeta; rules: typeof rules; }; -export = cjsExport; +export default defaultExport; diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 9b105586f76a..a6e86293d069 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -3,6 +3,7 @@ "private": true, "main": "dist/index.js", "types": "index.d.ts", + "type": "module", "repository": { "type": "git", "url": "https://github.com/typescript-eslint/typescript-eslint.git", diff --git a/packages/eslint-plugin-internal/src/index.ts b/packages/eslint-plugin-internal/src/index.ts index 68991268506a..a299b00ec525 100644 --- a/packages/eslint-plugin-internal/src/index.ts +++ b/packages/eslint-plugin-internal/src/index.ts @@ -1,17 +1,12 @@ import type { Linter } from '@typescript-eslint/utils/ts-eslint'; -import rules from './rules'; +import rules from './rules/index.js'; +import packageJson from './util/packagejson.js'; -// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder -const { name, version } = require('../package.json') as { - name: string; - version: string; -}; - -export = { +export default { meta: { - name, - version, + name: packageJson.name, + version: packageJson.version, }, rules, } satisfies Linter.Plugin; diff --git a/packages/eslint-plugin-internal/src/rules/debug-namespace.ts b/packages/eslint-plugin-internal/src/rules/debug-namespace.ts index ca76f5e1870f..9852edbb961f 100755 --- a/packages/eslint-plugin-internal/src/rules/debug-namespace.ts +++ b/packages/eslint-plugin-internal/src/rules/debug-namespace.ts @@ -2,7 +2,7 @@ import type { TSESTree } from '@typescript-eslint/utils'; import { getStaticValue } from '@typescript-eslint/utils/ast-utils'; -import { createRule } from '../util'; +import { createRule } from '../util/index.js'; function filePathToNamespace(filePath: string) { const relativePath = filePath @@ -20,7 +20,7 @@ function filePathToNamespace(filePath: string) { } export default createRule({ - name: __filename, + name: 'debug-namespace', meta: { type: 'problem', docs: { diff --git a/packages/eslint-plugin-internal/src/rules/eqeq-nullish.ts b/packages/eslint-plugin-internal/src/rules/eqeq-nullish.ts index f118b1c10cfc..0680b631102c 100644 --- a/packages/eslint-plugin-internal/src/rules/eqeq-nullish.ts +++ b/packages/eslint-plugin-internal/src/rules/eqeq-nullish.ts @@ -4,10 +4,10 @@ import { NullThrowsReasons, } from '@typescript-eslint/utils/eslint-utils'; -import { createRule } from '../util'; +import { createRule } from '../util/index.js'; export default createRule({ - name: __filename, + name: 'eqeq-nullish', meta: { type: 'suggestion', docs: { diff --git a/packages/eslint-plugin-internal/src/rules/index.ts b/packages/eslint-plugin-internal/src/rules/index.ts index 806618f909e4..01e13ea50660 100644 --- a/packages/eslint-plugin-internal/src/rules/index.ts +++ b/packages/eslint-plugin-internal/src/rules/index.ts @@ -1,13 +1,13 @@ import type { Linter } from '@typescript-eslint/utils/ts-eslint'; -import debugNamespace from './debug-namespace'; -import eqeqNullish from './eqeq-nullish'; -import noPoorlyTypedTsProps from './no-poorly-typed-ts-props'; -import noRelativePathsToInternalPackages from './no-relative-paths-to-internal-packages'; -import noTypescriptDefaultImport from './no-typescript-default-import'; -import noTypescriptEstreeImport from './no-typescript-estree-import'; -import pluginTestFormatting from './plugin-test-formatting'; -import preferASTTypesEnum from './prefer-ast-types-enum'; +import debugNamespace from './debug-namespace.js'; +import eqeqNullish from './eqeq-nullish.js'; +import noPoorlyTypedTsProps from './no-poorly-typed-ts-props.js'; +import noRelativePathsToInternalPackages from './no-relative-paths-to-internal-packages.js'; +import noTypescriptDefaultImport from './no-typescript-default-import.js'; +import noTypescriptEstreeImport from './no-typescript-estree-import.js'; +import pluginTestFormatting from './plugin-test-formatting.js'; +import preferASTTypesEnum from './prefer-ast-types-enum.js'; export default { 'debug-namespace': debugNamespace, diff --git a/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts b/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts index 2da006d07bd9..ac537777b070 100644 --- a/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts +++ b/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts @@ -2,7 +2,7 @@ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import { ESLintUtils } from '@typescript-eslint/utils'; -import { createRule } from '../util'; +import { createRule } from '../util/index.js'; /* TypeScript declares some bad types for certain properties. diff --git a/packages/eslint-plugin-internal/src/rules/no-relative-paths-to-internal-packages.ts b/packages/eslint-plugin-internal/src/rules/no-relative-paths-to-internal-packages.ts index b366ee764fcb..b2eaa1d0d2f4 100644 --- a/packages/eslint-plugin-internal/src/rules/no-relative-paths-to-internal-packages.ts +++ b/packages/eslint-plugin-internal/src/rules/no-relative-paths-to-internal-packages.ts @@ -1,12 +1,17 @@ import path from 'node:path'; +import { fileURLToPath } from 'node:url'; -import { createRule } from '../util'; +import { createRule } from '../util/index.js'; + +// Replace with import.meta.dirname when minimum node version supports it +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); export const REPO_ROOT = path.resolve(__dirname, '../../../..'); export const PACKAGES_DIR = path.join(REPO_ROOT, 'packages'); export default createRule({ - name: __filename, + name: 'no-relative-paths-to-internal-packages', meta: { type: 'problem', docs: { diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts index bddfbe1f7955..c5937ac0c7d3 100644 --- a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts +++ b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts @@ -1,6 +1,6 @@ import type { TSESTree } from '@typescript-eslint/utils'; -import { createRule } from '../util'; +import { createRule } from '../util/index.js'; /* We have `allowSyntheticDefaultImports` turned on in this project, so there are two problems that arise: diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts index 27d0ce54852d..e598a6faf9d0 100644 --- a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts +++ b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts @@ -1,4 +1,4 @@ -import { createRule } from '../util'; +import { createRule } from '../util/index.js'; const TSESTREE_NAME = '@typescript-eslint/typescript-estree'; const TYPES_NAME = '@typescript-eslint/types'; diff --git a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts index b4f22ae16dad..e6cdef192490 100644 --- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts +++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts @@ -3,8 +3,14 @@ import type { TSESTree } from '@typescript-eslint/utils'; import prettier from '@prettier/sync'; import { getContextualType } from '@typescript-eslint/type-utils'; import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; -import { createRule } from '../util'; +import { createRule } from '../util/index.js'; + +// Replace with import.meta.dirname when minimum node version supports it +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); /* The strings that are used for eslint plugins will not be checked for formatting. diff --git a/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts b/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts index d6005443a50e..edf2bbf842f3 100755 --- a/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts +++ b/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts @@ -3,14 +3,14 @@ import type { TSESTree } from '@typescript-eslint/utils'; import { DefinitionType } from '@typescript-eslint/scope-manager'; import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; -import { createRule } from '../util'; +import { createRule } from '../util/index.js'; const isStringLiteral = ( node: TSESTree.Literal, ): node is TSESTree.StringLiteral => typeof node.value === 'string'; export default createRule({ - name: __filename, + name: 'prefer-ast-types-enum', meta: { type: 'problem', docs: { diff --git a/packages/eslint-plugin-internal/src/util/createRule.ts b/packages/eslint-plugin-internal/src/util/createRule.ts index 628498d08dad..ed6bcbca5198 100644 --- a/packages/eslint-plugin-internal/src/util/createRule.ts +++ b/packages/eslint-plugin-internal/src/util/createRule.ts @@ -1,8 +1,8 @@ import { ESLintUtils } from '@typescript-eslint/utils'; -// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder -// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -const { version }: { version: string } = require('../../package.json'); +import packageJson from './packagejson.js'; + +const { version } = packageJson; export interface ESLintPluginInternalDocs { requiresTypeChecking?: true; diff --git a/packages/eslint-plugin-internal/src/util/index.ts b/packages/eslint-plugin-internal/src/util/index.ts index cd13da0f5cd3..71f5bf4fab22 100644 --- a/packages/eslint-plugin-internal/src/util/index.ts +++ b/packages/eslint-plugin-internal/src/util/index.ts @@ -1 +1 @@ -export * from './createRule'; +export * from './createRule.js'; diff --git a/packages/eslint-plugin-internal/src/util/packagejson.ts b/packages/eslint-plugin-internal/src/util/packagejson.ts new file mode 100644 index 000000000000..2b2aa40efceb --- /dev/null +++ b/packages/eslint-plugin-internal/src/util/packagejson.ts @@ -0,0 +1,17 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +// Replace with import.meta.dirname when minimum node version supports it +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const packageJsonPath = path.join(__dirname, '../../package.json'); +const packageJsonContents = fs.readFileSync(packageJsonPath, 'utf-8'); +const packageJsonValue = JSON.parse(packageJsonContents) as { + name: string; + version: string; +}; + +// eslint-disable-next-line import/no-default-export +export default packageJsonValue; diff --git a/packages/eslint-plugin-internal/tests/RuleTester.ts b/packages/eslint-plugin-internal/tests/RuleTester.ts index 1c7e60f12d4b..15d182f0310d 100644 --- a/packages/eslint-plugin-internal/tests/RuleTester.ts +++ b/packages/eslint-plugin-internal/tests/RuleTester.ts @@ -1,4 +1,9 @@ import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +// Replace with import.meta.dirname when minimum node version supports it +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); export function getFixturesRootDir(): string { return path.join(__dirname, 'fixtures'); diff --git a/packages/eslint-plugin-internal/tests/rules/debug-namespace.test.ts b/packages/eslint-plugin-internal/tests/rules/debug-namespace.test.ts index 53e7ea81da15..8482087448ac 100644 --- a/packages/eslint-plugin-internal/tests/rules/debug-namespace.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/debug-namespace.test.ts @@ -1,6 +1,6 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import rule from '../../src/rules/debug-namespace'; +import rule from '../../src/rules/debug-namespace.js'; const ruleTester = new RuleTester(); diff --git a/packages/eslint-plugin-internal/tests/rules/eqeq-nullish.test.ts b/packages/eslint-plugin-internal/tests/rules/eqeq-nullish.test.ts index 663270002e45..10aca8c45955 100644 --- a/packages/eslint-plugin-internal/tests/rules/eqeq-nullish.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/eqeq-nullish.test.ts @@ -1,6 +1,6 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import rule from '../../src/rules/eqeq-nullish'; +import rule from '../../src/rules/eqeq-nullish.js'; const ruleTester = new RuleTester(); diff --git a/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts b/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts index cee60c1a8675..cd43599c85b6 100644 --- a/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts @@ -1,8 +1,8 @@ /* eslint-disable @typescript-eslint/internal/prefer-ast-types-enum */ import { RuleTester } from '@typescript-eslint/rule-tester'; -import rule from '../../src/rules/no-poorly-typed-ts-props'; -import { getFixturesRootDir } from '../RuleTester'; +import rule from '../../src/rules/no-poorly-typed-ts-props.js'; +import { getFixturesRootDir } from '../RuleTester.js'; const ruleTester = new RuleTester({ languageOptions: { diff --git a/packages/eslint-plugin-internal/tests/rules/no-relative-paths-to-internal-packages.test.ts b/packages/eslint-plugin-internal/tests/rules/no-relative-paths-to-internal-packages.test.ts index b67fc8b64224..36b966725f79 100644 --- a/packages/eslint-plugin-internal/tests/rules/no-relative-paths-to-internal-packages.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/no-relative-paths-to-internal-packages.test.ts @@ -3,7 +3,7 @@ import path from 'node:path'; import rule, { PACKAGES_DIR, -} from '../../src/rules/no-relative-paths-to-internal-packages'; +} from '../../src/rules/no-relative-paths-to-internal-packages.js'; const ruleTester = new RuleTester({ languageOptions: { diff --git a/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts b/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts index 7284c154e458..83c1f7349a8e 100644 --- a/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts @@ -1,6 +1,6 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import rule from '../../src/rules/no-typescript-default-import'; +import rule from '../../src/rules/no-typescript-default-import.js'; const ruleTester = new RuleTester(); diff --git a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts index a727f98d0d61..077169eb7dde 100644 --- a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts @@ -1,6 +1,6 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import rule from '../../src/rules/no-typescript-estree-import'; +import rule from '../../src/rules/no-typescript-estree-import.js'; const ruleTester = new RuleTester(); diff --git a/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts b/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts index 29ee7dde5168..6ec2ce42a6a3 100644 --- a/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts @@ -1,7 +1,7 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import rule from '../../src/rules/plugin-test-formatting'; -import { getFixturesRootDir } from '../RuleTester'; +import rule from '../../src/rules/plugin-test-formatting.js'; +import { getFixturesRootDir } from '../RuleTester.js'; const ruleTester = new RuleTester({ languageOptions: { diff --git a/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts b/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts index c9273578ef0e..0c3ca98fbaad 100644 --- a/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts @@ -2,7 +2,7 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; import { DefinitionType } from '@typescript-eslint/scope-manager'; import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; -import rule from '../../src/rules/prefer-ast-types-enum'; +import rule from '../../src/rules/prefer-ast-types-enum.js'; const ruleTester = new RuleTester(); From 7f5fed7922385479613f4d79a28615014174a556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Sun, 5 Oct 2025 06:14:49 -0400 Subject: [PATCH 242/283] chore: remove unused batchedSingleLineTests test utility (#11675) --- .../src/rules/plugin-test-formatting.ts | 4 - packages/eslint-plugin/tests/RuleTester.ts | 80 ------------------- 2 files changed, 84 deletions(-) diff --git a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts index e6cdef192490..9ca6bd0b6311 100644 --- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts +++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts @@ -561,10 +561,6 @@ export default createRule({ AST_NODE_TYPES.ArrayExpression, AST_NODE_TYPES.ObjectExpression, ].join(' > ')]: checkInvalidTest, - // special case for our batchedSingleLineTests utility - 'CallExpression[callee.name = "batchedSingleLineTests"] > ObjectExpression': - checkInvalidTest, - /** * generic, type-aware handling for any old object * this is a fallback to handle random variables people declare or object diff --git a/packages/eslint-plugin/tests/RuleTester.ts b/packages/eslint-plugin/tests/RuleTester.ts index 7e003e7fa5f1..4cb13dad0dcb 100644 --- a/packages/eslint-plugin/tests/RuleTester.ts +++ b/packages/eslint-plugin/tests/RuleTester.ts @@ -1,85 +1,5 @@ -import type { - InvalidTestCase, - ValidTestCase, -} from '@typescript-eslint/rule-tester'; - import * as path from 'node:path'; export function getFixturesRootDir(): string { return path.join(__dirname, 'fixtures'); } - -/** - * Converts a batch of single line tests into a number of separate test cases. - * This makes it easier to write tests which use the same options. - * - * Why wouldn't you just leave them as one test? - * Because it makes the test error messages harder to decipher. - * This way each line will fail separately, instead of them all failing together. - * - * @deprecated - DO NOT USE THIS FOR NEW RULES - */ -export function batchedSingleLineTests( - test: ValidTestCase, -): ValidTestCase[]; -/** - * Converts a batch of single line tests into a number of separate test cases. - * This makes it easier to write tests which use the same options. - * - * Why wouldn't you just leave them as one test? - * Because it makes the test error messages harder to decipher. - * This way each line will fail separately, instead of them all failing together. - * - * Make sure you have your line numbers correct for error reporting, as it will match - * the line numbers up with the split tests! - * - * @deprecated - DO NOT USE THIS FOR NEW RULES - */ -export function batchedSingleLineTests< - MessageIds extends string, - Options extends readonly unknown[], ->( - test: InvalidTestCase, -): InvalidTestCase[]; -export function batchedSingleLineTests< - MessageIds extends string, - Options extends readonly unknown[], ->( - options: - | ValidTestCase - | ({ - output?: string | null; - } & Omit, 'output'>), -): (InvalidTestCase | ValidTestCase)[] { - // -- eslint counts lines from 1 - const lineOffset = options.code.startsWith('\n') ? 2 : 1; - const output = - 'output' in options && options.output - ? options.output.trim().split('\n') - : null; - return options.code - .trim() - .split('\n') - .map((code, i) => { - const lineNum = i + lineOffset; - const errors = - 'errors' in options - ? options.errors.filter(e => e.line === lineNum) - : []; - const returnVal = { - ...options, - code, - errors: errors.map(e => ({ - ...e, - line: 1, - })), - }; - if (output?.[i]) { - return { - ...returnVal, - output: output[i], - }; - } - return returnVal; - }); -} From ae94954c71785ace3364c545ddf0f76c5edc1028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Mon, 6 Oct 2025 08:06:52 -0400 Subject: [PATCH 243/283] docs: mention advancement info in contributor tiers (#11670) * docs: mention advancement info in contributor tiers * Update docs/maintenance/Contributor_Tiers.mdx Co-authored-by: Brad Zacher --------- Co-authored-by: Brad Zacher --- docs/maintenance/Contributor_Tiers.mdx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/maintenance/Contributor_Tiers.mdx b/docs/maintenance/Contributor_Tiers.mdx index 769d523b8e18..ada16278379b 100644 --- a/docs/maintenance/Contributor_Tiers.mdx +++ b/docs/maintenance/Contributor_Tiers.mdx @@ -76,6 +76,21 @@ We treat everything here as approximate numbers. We're a small enough team to informally discuss changes ad hoc and allow off-by-one-or-two months. ::: +## Advancement + +Are you looking to graduate from _contributor_ to _committer_? +Great! + +Roughly speaking, we're looking for folks who are interested in growing towards: + +- Being able to contribute to docs & ideation discussions, not just chores + rule fixes & features +- Being able to empathetically understand the needs of lint rule users (i.e. not just their own personal preferences) +- Consistently sending high-quality issues and PRs + - It's expected that some will have long rounds of discussion; we're more looking to avoid making "common" mistakes repeatedly (requesting review with failing builds, clear large gaps in logic, etc.) + +If you've been sending issues and pull requests to typescript-eslint for a few months and want to get more involved, please reach out to one of the maintainers over Discord or email. +We'd love to support you in joining the team. + ## Pointing Although it's impossible to accurately estimate software projects, we want to roughly establish expectations of effort+time spent on the tiers. From dc0bc7608cb1700990d7a3f3d4492c314bc15ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Mon, 6 Oct 2025 08:07:15 -0400 Subject: [PATCH 244/283] docs: explained tsconfigRootDir and removed unnecessary listings (#11661) --- docs/getting-started/Typed_Linting.mdx | 1 - docs/packages/Parser.mdx | 51 +++++++++++-------- docs/packages/TypeScript_ESLint.mdx | 1 - docs/troubleshooting/faqs/Frameworks.mdx | 1 - docs/troubleshooting/faqs/General.mdx | 1 - .../typed-linting/Monorepos.mdx | 3 -- .../typed-linting/Performance.mdx | 1 - docs/troubleshooting/typed-linting/index.mdx | 2 - docs/users/Shared_Configurations.mdx | 1 - 9 files changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/getting-started/Typed_Linting.mdx b/docs/getting-started/Typed_Linting.mdx index bc36f5589735..066774382586 100644 --- a/docs/getting-started/Typed_Linting.mdx +++ b/docs/getting-started/Typed_Linting.mdx @@ -33,7 +33,6 @@ export default defineConfig( languageOptions: { parserOptions: { projectService: true, - tsconfigRootDir: import.meta.dirname, }, }, }, diff --git a/docs/packages/Parser.mdx b/docs/packages/Parser.mdx index 52a294e67e41..28f5c7bee463 100644 --- a/docs/packages/Parser.mdx +++ b/docs/packages/Parser.mdx @@ -63,7 +63,7 @@ interface ParserOptions { ### `disallowAutomaticSingleRunInference` -> Default `process.env.TSESTREE_SINGLE_RUN` or `true`. +> Default: `process.env.TSESTREE_SINGLE_RUN` or `true`. Whether to stop using common heuristics to infer whether ESLint is being used as part of a single run (as opposed to `--fix` mode or in a persistent session such as an editor extension). In other words, typescript-eslint is faster by default, and this option disables an automatic performance optimization. @@ -94,7 +94,7 @@ Optional additional options to describe how to parse the raw syntax. #### `jsx` -> Default `false`. +> Default: `false`. Enable parsing JSX when `true`. More details can be found in the [TypeScript handbook's JSX docs](https://www.typescriptlang.org/docs/handbook/jsx.html). @@ -115,13 +115,13 @@ The exact behavior is as follows: #### `globalReturn` -> Default `false`. +> Default: `false`. This options allows you to tell the parser if you want to allow global `return` statements in your codebase. ### `ecmaVersion` -> Default `2018`. +> Default: `2018`. Accepts any valid ECMAScript version number or `'latest'`: @@ -135,19 +135,19 @@ Specifies the version of ECMAScript syntax you want to use. This is used by the ### `emitDecoratorMetadata` -> Default `undefined`. +> Default: `undefined`. This option allow you to tell parser to act as if `emitDecoratorMetadata: true` is set in `tsconfig.json`, but without [type-aware linting](../getting-started/Typed_Linting.mdx). In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster. ### `experimentalDecorators` -> Default `undefined`. +> Default: `undefined`. This option allow you to tell parser to act as if `experimentalDecorators: true` is set in `tsconfig.json`, but without [type-aware linting](../getting-started/Typed_Linting.mdx). In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster. ### `extraFileExtensions` -> Default `undefined`. +> Default: `undefined`. This option allows you to provide one or more additional file extensions which should be considered in the TypeScript Program compilation. The default extensions are `['.js', '.mjs', '.cjs', '.jsx', '.ts', '.mts', '.cts', '.tsx']`. @@ -159,7 +159,7 @@ See [Changes to `extraFileExtensions` with `projectService`](../troubleshooting/ ### `isolatedDeclarations` -> Default `undefined`. +> Default: `undefined`. This option allow you to tell parser to act as if `isolatedDeclarations: true` is set in `tsconfig.json`, but without [type-aware linting](../getting-started/Typed_Linting.mdx). In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster. @@ -181,7 +181,7 @@ If you do not use lint rules like `eslint-plugin-deprecation` that rely on TS's ### `jsxFragmentName` -> Default `null` +> Default: `null` The identifier that's used for JSX fragment elements (after transpilation). If `null`, assumes transpilation will always use a member of the configured `jsxPragma`. @@ -191,7 +191,7 @@ If you provide `parserOptions.project`, you do not need to set this, as it will ### `jsxPragma` -> Default `'React'` +> Default: `'React'` The identifier that's used for JSX Elements creation (after transpilation). If you're using a library other than React (like `preact`), then you should change this value. If you are using the [new JSX transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) you can set this to `null`. @@ -202,7 +202,7 @@ If you provide `parserOptions.project`, you do not need to set this, as it will ### `lib` -> Default `['es2018']` +> Default: `['es2018']` For valid options, see the [TypeScript compiler options](https://www.typescriptlang.org/tsconfig#lib). @@ -212,7 +212,7 @@ If you provide `parserOptions.project`, you do not need to set this, as it will ### `programs` -> Default `undefined`. +> Default: `undefined`. This option allows you to programmatically provide an instance of a TypeScript Program object that will provide type information to rules. This will override any programs that would have been computed from `parserOptions.project`. @@ -226,7 +226,7 @@ All linted files must be part of the provided program(s). We now recommend using [`projectService`](#projectservice) instead of `project` for easier configuration and faster linting. ::: -> Default `undefined`. +> Default: `undefined`. A path to your project's TSConfig. **This setting or [`projectService`](#projectservice) are required to use [rules which require type information](../getting-started/Typed_Linting.mdx)**. @@ -287,7 +287,7 @@ For an option that allows linting files outside of your TSConfig file(s), see [` ### `projectService` -> Default `false`. +> Default: `false`. Specifies using TypeScript APIs to generate type information for rules. It will automatically use the nearest `tsconfig.json` for each file (like `project: true`). @@ -355,7 +355,7 @@ See [Troubleshooting & FAQs > Typed Linting > Project Service Issues](../trouble ##### `allowDefaultProject` -> Default `[]` _(none)_ +> Default: `[]` _(none)_ Globs of files to allow running with the default project compiler options despite not being matched by the project service. It takes in an array of string paths that will be resolved relative to the [`tsconfigRootDir`](#tsconfigrootdir). @@ -371,7 +371,7 @@ There are several restrictions on this option to prevent it from being overused: ##### `defaultProject` -> Default `'tsconfig.json'` +> Default: `'tsconfig.json'` Path to a TSConfig to use instead of TypeScript's default project configuration. It takes in a string path that will be resolved relative to the [`tsconfigRootDir`](#tsconfigrootdir). @@ -380,7 +380,7 @@ It takes in a string path that will be resolved relative to the [`tsconfigRootDi ##### `loadTypeScriptPlugins` -> Default `false` +> Default: `false` Whether the project service should be allowed to load [TypeScript plugins](https://www.typescriptlang.org/tsconfig/plugins.html). This is `false` by default to prevent plugins from registering persistent file watchers or other operations that might prevent ESLint processes from exiting when run on the command-line. @@ -405,7 +405,7 @@ Each file match slows down linting, so if you do need to use this, please file a ### `projectFolderIgnoreList` -> Default `["**/node_modules/**"]`. +> Default: `["**/node_modules/**"]`. This option allows you to ignore folders from being included in your provided list of `project`s. This is useful if you have configured glob patterns, but want to make sure you ignore certain folders. @@ -416,14 +416,25 @@ For example, by default it will ensure that a glob like `./**/tsconfig.json` wil ### `tsconfigRootDir` -> Default `undefined`. +> Default: the directory of the ESLint config file. This option allows you to provide the root directory for relative TSConfig paths specified in the `project` option above. Doing so ensures running ESLint from a directory other than the root will still be able to find your TSConfig. +`tsconfigRootDir` uses the call stack to determine the closest `eslint.config.*` ESLint config file. +In rare edge cases, that detection logic may be tricked by unusual paths and resolve to an incorrect value. +Manually specifying `tsconfigRootDir` to the directory of your ESLint config file will work around those issues: + +```js +parserOptions: { + tsconfigRootDir: import.meta.dirname, + // or, in CommonJS, __dirname +} +``` + ### `warnOnUnsupportedTypeScriptVersion` -> Default `true`. +> Default: `true`. This option allows you to toggle the warning that the parser will give you if you use a version of TypeScript which is not explicitly supported. The warning message would look like this: diff --git a/docs/packages/TypeScript_ESLint.mdx b/docs/packages/TypeScript_ESLint.mdx index e2c283adf146..be021f9f3f5a 100644 --- a/docs/packages/TypeScript_ESLint.mdx +++ b/docs/packages/TypeScript_ESLint.mdx @@ -269,7 +269,6 @@ export default defineConfig({ parser: tseslint.parser, parserOptions: { projectService: true, - tsconfigRootDir: import.meta.dirname, }, }, rules: { diff --git a/docs/troubleshooting/faqs/Frameworks.mdx b/docs/troubleshooting/faqs/Frameworks.mdx index f80be6a84296..15de567c5533 100644 --- a/docs/troubleshooting/faqs/Frameworks.mdx +++ b/docs/troubleshooting/faqs/Frameworks.mdx @@ -27,7 +27,6 @@ export default defineConfig( // Add this line extraFileExtensions: ['.vue'], projectService: true, - tsconfigRootDir: import.meta.dirname, }, }, }, diff --git a/docs/troubleshooting/faqs/General.mdx b/docs/troubleshooting/faqs/General.mdx index aa04254f59b9..bf42e64c3ce9 100644 --- a/docs/troubleshooting/faqs/General.mdx +++ b/docs/troubleshooting/faqs/General.mdx @@ -251,7 +251,6 @@ export default defineConfig( languageOptions: { parserOptions: { projectService: true, - tsconfigRootDir: import.meta.dirname, }, }, }, diff --git a/docs/troubleshooting/typed-linting/Monorepos.mdx b/docs/troubleshooting/typed-linting/Monorepos.mdx index 2364b9defe24..49e118408adb 100644 --- a/docs/troubleshooting/typed-linting/Monorepos.mdx +++ b/docs/troubleshooting/typed-linting/Monorepos.mdx @@ -66,7 +66,6 @@ export default defineConfig( project: true, // Add this line project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'], - tsconfigRootDir: import.meta.dirname, }, }, }, @@ -89,7 +88,6 @@ module.exports = { project: true, // Add this line project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'], - tsconfigRootDir: import.meta.dirname, }, plugins: ['@typescript-eslint'], root: true, @@ -118,7 +116,6 @@ export default defineConfig( project: ['./tsconfig.eslint.json', './**/tsconfig.json'], // Add this line project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'], - tsconfigRootDir: import.meta.dirname, }, }, }, diff --git a/docs/troubleshooting/typed-linting/Performance.mdx b/docs/troubleshooting/typed-linting/Performance.mdx index 66b9e2bfbe13..9a3e0a3fbcc4 100644 --- a/docs/troubleshooting/typed-linting/Performance.mdx +++ b/docs/troubleshooting/typed-linting/Performance.mdx @@ -186,7 +186,6 @@ export default defineConfig( { languageOptions: { parserOptions: { - tsconfigRootDir: import.meta.dirname, // Remove this line project: ['./**/tsconfig.json'], // Add this line diff --git a/docs/troubleshooting/typed-linting/index.mdx b/docs/troubleshooting/typed-linting/index.mdx index 5b76f5c53ad3..c43b96d118a4 100644 --- a/docs/troubleshooting/typed-linting/index.mdx +++ b/docs/troubleshooting/typed-linting/index.mdx @@ -78,7 +78,6 @@ export default defineConfig( languageOptions: { parserOptions: { projectService: true, - tsconfigRootDir: import.meta.dirname, }, }, }, @@ -303,7 +302,6 @@ export default defineConfig({ languageOptions: { parserOptions: { project: './tsconfig.eslint.json', - tsconfigRootDir: import.meta.dirname, }, }, // ... diff --git a/docs/users/Shared_Configurations.mdx b/docs/users/Shared_Configurations.mdx index ae59cd7c360b..5d8cd232cc1a 100644 --- a/docs/users/Shared_Configurations.mdx +++ b/docs/users/Shared_Configurations.mdx @@ -380,7 +380,6 @@ export default defineConfig( languageOptions: { parserOptions: { projectService: true, - tsconfigRootDir: import.meta.dirname, }, }, }, From a62f625521385447fd5e22bd02a3cbc3dbdf7f2c Mon Sep 17 00:00:00 2001 From: Richard Torres Date: Mon, 6 Oct 2025 08:15:14 -0400 Subject: [PATCH 245/283] fix(eslint-plugin): removed error type previously deprecated (#11674) removed error type previously deprecated --- .../class-methods-use-this-core.test.ts | 22 ----- .../tests/rules/consistent-return.test.ts | 13 --- .../tests/rules/no-array-constructor.test.ts | 14 ---- .../tests/rules/no-extraneous-class.test.ts | 8 +- .../tests/rules/no-loop-func.test.ts | 22 ----- .../tests/rules/no-redeclare.test.ts | 21 ----- .../tests/rules/no-restricted-imports.test.ts | 28 ------- .../rules/no-shadow/no-shadow-eslint.test.ts | 56 +------------ .../tests/rules/no-shadow/no-shadow.test.ts | 28 ------- .../tests/rules/no-this-alias.test.ts | 4 - .../rules/no-unnecessary-qualifier.test.ts | 10 --- .../tests/rules/no-use-before-define.test.ts | 42 ---------- .../rules/no-useless-constructor.test.ts | 10 --- .../tests/rules/prefer-destructuring.test.ts | 38 --------- .../tests/rules/prefer-function-type.test.ts | 18 ---- .../prefer-promise-reject-errors.test.ts | 83 ------------------- 16 files changed, 2 insertions(+), 415 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts b/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts index d0193efdc99d..e07263df6e98 100644 --- a/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts +++ b/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts @@ -1,7 +1,6 @@ /* eslint-disable @typescript-eslint/internal/plugin-test-formatting -- keeping eslint core formatting on purpose to make upstream diffing easier and so we don't need to edit line/cols */ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../../src/rules/class-methods-use-this'; @@ -17,7 +16,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -30,7 +28,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -43,7 +40,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -56,7 +52,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -69,7 +64,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -82,7 +76,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -95,7 +88,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -108,7 +100,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -122,7 +113,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'hasOwnProperty'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -136,7 +126,6 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: 'method' }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -150,14 +139,12 @@ ruleTester.run('class-methods-use-this', rule, { data: { name: "method 'foo'" }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 31, data: { name: 'private method #bar' }, line: 1, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 2022 } }, @@ -170,55 +157,46 @@ ruleTester.run('class-methods-use-this', rule, { column: 11, data: { name: "method 'foo'" }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 19, data: { name: "method 'bar'" }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 29, data: { name: "method '123'" }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 37, data: { name: "method 'baz'" }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 49, data: { name: 'method' }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 57, data: { name: 'method' }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 68, data: { name: "getter 'quux'" }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 81, data: { name: 'setter' }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, { column: 93, data: { name: "generator method 'quuux'" }, messageId: 'missingThis', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, diff --git a/packages/eslint-plugin/tests/rules/consistent-return.test.ts b/packages/eslint-plugin/tests/rules/consistent-return.test.ts index e62345932396..89574197c9fd 100644 --- a/packages/eslint-plugin/tests/rules/consistent-return.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-return.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/consistent-return'; import { getFixturesRootDir } from '../RuleTester'; @@ -226,7 +225,6 @@ ruleTester.run('consistent-return', rule, { endLine: 4, line: 4, messageId: 'missingReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -246,7 +244,6 @@ ruleTester.run('consistent-return', rule, { endLine: 5, line: 5, messageId: 'missingReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -270,7 +267,6 @@ ruleTester.run('consistent-return', rule, { endLine: 6, line: 6, messageId: 'unexpectedReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, { column: 11, @@ -279,7 +275,6 @@ ruleTester.run('consistent-return', rule, { endLine: 9, line: 9, messageId: 'missingReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -298,7 +293,6 @@ ruleTester.run('consistent-return', rule, { endLine: 4, line: 4, messageId: 'missingReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -317,7 +311,6 @@ ruleTester.run('consistent-return', rule, { endLine: 4, line: 4, messageId: 'unexpectedReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -336,7 +329,6 @@ ruleTester.run('consistent-return', rule, { endLine: 4, line: 4, messageId: 'missingReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -355,7 +347,6 @@ ruleTester.run('consistent-return', rule, { endLine: 4, line: 4, messageId: 'unexpectedReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -374,7 +365,6 @@ ruleTester.run('consistent-return', rule, { endLine: 4, line: 4, messageId: 'unexpectedReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -396,7 +386,6 @@ ruleTester.run('consistent-return', rule, { endLine: 7, line: 7, messageId: 'missingReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], }, @@ -417,7 +406,6 @@ ruleTester.run('consistent-return', rule, { endLine: 6, line: 6, messageId: 'unexpectedReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], options: [ @@ -444,7 +432,6 @@ ruleTester.run('consistent-return', rule, { endLine: 7, line: 7, messageId: 'unexpectedReturnValue', - type: AST_NODE_TYPES.ReturnStatement, }, ], options: [ diff --git a/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts b/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts index ce97e7e6a8a2..8ddff69ff3ab 100644 --- a/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts +++ b/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-array-constructor'; @@ -39,7 +38,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.NewExpression, }, ], output: '[];', @@ -49,7 +47,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '[];', @@ -59,7 +56,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '[];', @@ -69,7 +65,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '/* a */ /* b */ []; /* g */ /* h */', @@ -79,7 +74,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.NewExpression, }, ], output: '[x, y];', @@ -89,7 +83,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '[x, y];', @@ -99,7 +92,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '[x, y];', @@ -109,7 +101,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '/* a */ /* b */ [x, y]; /* g */ /* h */', @@ -119,7 +110,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.NewExpression, }, ], output: '[0, 1, 2];', @@ -129,7 +119,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '[0, 1, 2];', @@ -139,7 +128,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: '[0, 1, 2];', @@ -155,7 +143,6 @@ ruleTester.run('no-array-constructor', rule, { errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.CallExpression, }, ], output: ` @@ -173,7 +160,6 @@ new Array(0, 1, 2); errors: [ { messageId: 'useLiteral', - type: AST_NODE_TYPES.NewExpression, }, ], output: ` diff --git a/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts b/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts index 19d501a347b8..b04a60d2ad06 100644 --- a/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts +++ b/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-extraneous-class'; @@ -176,12 +175,7 @@ export default class { static hello() {} } `, - errors: [ - { - ...onlyStatic, - type: AST_NODE_TYPES.ClassDeclaration, - }, - ], + errors: [onlyStatic], }, { code: ` diff --git a/packages/eslint-plugin/tests/rules/no-loop-func.test.ts b/packages/eslint-plugin/tests/rules/no-loop-func.test.ts index 8b22f6a4ce8a..6075aec1b4ad 100644 --- a/packages/eslint-plugin/tests/rules/no-loop-func.test.ts +++ b/packages/eslint-plugin/tests/rules/no-loop-func.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-loop-func'; @@ -479,7 +478,6 @@ for (var i = 0; i < l; i++) { { data: { varNames: "'i'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], }, @@ -497,7 +495,6 @@ for (var i = 0; i < l; i++) { { data: { varNames: "'i', 'j'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], }, @@ -513,7 +510,6 @@ for (var i in {}) { { data: { varNames: "'i'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], }, @@ -529,7 +525,6 @@ for (var i of {}) { { data: { varNames: "'i'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -546,7 +541,6 @@ for (var i = 0; i < l; i++) { { data: { varNames: "'i'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.ArrowFunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -563,7 +557,6 @@ for (var i = 0; i < l; i++) { { data: { varNames: "'i'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], }, @@ -580,7 +573,6 @@ for (var i = 0; i < l; i++) { { data: { varNames: "'i'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionDeclaration, }, ], }, @@ -600,7 +592,6 @@ for (let i = 0; i < l; i++) { { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -619,7 +610,6 @@ for (let i in {}) { { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -638,7 +628,6 @@ a = 1; { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -659,7 +648,6 @@ for (let i = 0; i < l; i++) { { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -680,7 +668,6 @@ for (let i in {}) { { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionDeclaration, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -701,7 +688,6 @@ a = 1; { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.ArrowFunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -717,7 +703,6 @@ for (var i = 0; i < 10; ++i) { { data: { varNames: "'i'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.ArrowFunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -738,7 +723,6 @@ for (let x of xs) { { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -757,7 +741,6 @@ for (var x of xs) { { data: { varNames: "'x'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -774,7 +757,6 @@ for (var x of xs) { { data: { varNames: "'x'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -793,7 +775,6 @@ for (let x of xs) { { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -812,7 +793,6 @@ for (let x of xs) { { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -834,7 +814,6 @@ foo(); { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -856,7 +835,6 @@ foo(); { data: { varNames: "'a'" }, messageId: 'unsafeRefs', - type: AST_NODE_TYPES.FunctionExpression, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, diff --git a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts index 3d2f55e1d4e1..2b99a6168246 100644 --- a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts +++ b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-redeclare'; @@ -155,7 +154,6 @@ var a = 10; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -175,7 +173,6 @@ switch (foo) { id: 'b', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -190,7 +187,6 @@ var a = 10; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -205,7 +201,6 @@ var a = []; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -220,7 +215,6 @@ function a() {} id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -235,7 +229,6 @@ function a() {} id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -250,7 +243,6 @@ var a = function () {}; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -265,7 +257,6 @@ var a = new Date(); id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -281,14 +272,12 @@ var a = 15; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, { data: { id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -303,7 +292,6 @@ var a; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { sourceType: 'module' } }, @@ -319,7 +307,6 @@ var a; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { sourceType: 'module' } }, @@ -332,7 +319,6 @@ var a; id: 'Object', }, messageId: 'redeclaredAsBuiltin', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ builtinGlobals: true }], @@ -345,7 +331,6 @@ var a; id: 'top', }, messageId: 'redeclaredAsBuiltin', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { @@ -364,14 +349,12 @@ var { a = 0, b: Object = 0 } = {}; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, { data: { id: 'Object', }, messageId: 'redeclaredAsBuiltin', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -388,7 +371,6 @@ var { a = 0, b: Object = 0 } = {}; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { @@ -407,7 +389,6 @@ var { a = 0, b: Object = 0 } = {}; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { @@ -426,7 +407,6 @@ var { a = 0, b: Object = 0 } = {}; id: 'a', }, messageId: 'redeclared', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -442,7 +422,6 @@ var { a = 0, b: Object = 0 } = {}; id: 'b', }, messageId: 'redeclaredBySyntax', - type: AST_TOKEN_TYPES.Identifier, }, ], options: [{ builtinGlobals: true }], diff --git a/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts b/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts index b43a52ef8d71..c7f04a16db35 100644 --- a/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts +++ b/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-restricted-imports'; @@ -393,7 +392,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'path', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: ['import1', 'import2'], @@ -412,7 +410,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'path', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: ['import1', 'import2'], @@ -422,7 +419,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'path', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [{ paths: ['import1', 'import2'] }], @@ -432,7 +428,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'path', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [{ paths: ['import1', 'import2'] }], @@ -442,7 +437,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patterns', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -457,7 +451,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patterns', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ @@ -472,7 +465,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'pathWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -495,7 +487,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'pathWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ @@ -518,7 +509,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -538,7 +528,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ @@ -558,7 +547,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patternWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -582,7 +570,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patternWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ @@ -606,7 +593,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'path', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -624,7 +610,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'path', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -643,7 +628,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'pathWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -682,7 +666,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -703,7 +686,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ @@ -724,7 +706,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patternWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -744,7 +725,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patternWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ @@ -764,7 +744,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patternWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ @@ -784,7 +763,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patternWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -805,7 +783,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'path', - type: AST_NODE_TYPES.ExportAllDeclaration, }, ], options: ['import1'], @@ -815,7 +792,6 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'patterns', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -829,11 +805,9 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ImportDeclaration, }, ], options: [ @@ -854,11 +828,9 @@ import type { foo } from 'import2/private/bar'; errors: [ { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, { messageId: 'importNameWithCustomMessage', - type: AST_NODE_TYPES.ExportNamedDeclaration, }, ], options: [ diff --git a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts index c7c8fcbab3c5..1b009461ac9f 100644 --- a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts +++ b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts @@ -3,7 +3,6 @@ // License : https://github.com/eslint/eslint/blob/c4a70499720f48e27734068074fbeee4f48fb460/LICENSE import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../../src/rules/no-shadow'; @@ -27,7 +26,6 @@ function a(x) { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -47,7 +45,6 @@ var a = x => { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -68,7 +65,6 @@ function a(x) { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -87,7 +83,6 @@ function a(x) { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -106,7 +101,6 @@ function b() { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -128,7 +122,6 @@ setTimeout(function () { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -151,7 +144,6 @@ setTimeout(function () { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, { data: { @@ -160,7 +152,6 @@ setTimeout(function () { shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -179,7 +170,6 @@ var x = 1; shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -199,7 +189,6 @@ let x = 1; shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -219,7 +208,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -239,7 +227,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -259,7 +246,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -279,7 +265,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -297,7 +282,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -317,7 +301,6 @@ let a; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -338,7 +321,6 @@ var a; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -359,7 +341,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -380,7 +361,6 @@ const a = 1; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -401,7 +381,6 @@ var a; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -422,7 +401,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -443,7 +421,6 @@ let a; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -464,7 +441,6 @@ var a; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -485,7 +461,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -506,7 +481,6 @@ let a; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -527,7 +501,6 @@ var a; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -548,7 +521,6 @@ function a() {} shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -567,7 +539,6 @@ let a; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -586,7 +557,6 @@ var a; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -605,7 +575,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -625,7 +594,6 @@ function a() {} shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -643,7 +611,6 @@ function a() {} shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -662,7 +629,6 @@ function a() {} shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -680,7 +646,6 @@ function a() {} shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -699,7 +664,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -719,7 +683,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -739,7 +702,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -760,7 +722,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -780,7 +741,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -803,7 +763,6 @@ function a() {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -824,7 +783,6 @@ class A { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -845,7 +803,6 @@ class A { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, { data: { @@ -854,7 +811,6 @@ class A { shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -870,7 +826,6 @@ function foo() { name: 'Object', }, messageId: 'noShadowGlobal', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ builtinGlobals: true }], @@ -887,7 +842,6 @@ function foo() { name: 'top', }, messageId: 'noShadowGlobal', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { globals: { top: 'readonly' } }, @@ -901,12 +855,9 @@ function foo() { name: 'Object', }, messageId: 'noShadowGlobal', - type: AST_NODE_TYPES.Identifier, }, ], - languageOptions: { - parserOptions: { ecmaVersion: 6, sourceType: 'module' }, - }, + languageOptions: {}, options: [{ builtinGlobals: true }], }, { @@ -917,12 +868,10 @@ function foo() { name: 'top', }, messageId: 'noShadowGlobal', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { globals: { top: 'readonly' }, - parserOptions: { ecmaVersion: 6, sourceType: 'module' }, }, options: [{ builtinGlobals: true }], }, @@ -934,7 +883,6 @@ function foo() { name: 'Object', }, messageId: 'noShadowGlobal', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { @@ -950,7 +898,6 @@ function foo() { name: 'top', }, messageId: 'noShadowGlobal', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { @@ -975,7 +922,6 @@ function foo(cb) { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, diff --git a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts index 1378a1785ae2..4d5b84ad3d81 100644 --- a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts +++ b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../../src/rules/no-shadow'; @@ -328,7 +327,6 @@ function doThing(foo: number) {} shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ ignoreTypeValueShadow: false }], @@ -346,7 +344,6 @@ function doThing(foo: number) {} shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ ignoreTypeValueShadow: false }], @@ -364,7 +361,6 @@ function doThing(foo: number, bar: number) {} shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ ignoreTypeValueShadow: true }], @@ -387,7 +383,6 @@ declare module 'bar' { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -409,7 +404,6 @@ declare module 'baz' { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -431,7 +425,6 @@ declare module 'baz' { shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -448,7 +441,6 @@ let y; shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, { data: { @@ -457,7 +449,6 @@ let y; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -476,7 +467,6 @@ let y; shadowedLine: 2, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, @@ -495,7 +485,6 @@ type A = 1; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'types' }], @@ -513,7 +502,6 @@ type A = 1; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'types' }], @@ -531,7 +519,6 @@ interface A {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'types' }], @@ -549,7 +536,6 @@ interface A {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'types' }], @@ -569,7 +555,6 @@ type A = 1; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'types' }], @@ -589,7 +574,6 @@ type A = 1; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'types' }], @@ -608,7 +592,6 @@ type A = 1; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'all' }], @@ -626,7 +609,6 @@ type A = 1; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'all' }], @@ -644,7 +626,6 @@ interface A {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'all' }], @@ -662,7 +643,6 @@ interface A {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'all' }], @@ -682,7 +662,6 @@ type A = 1; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'all' }], @@ -702,7 +681,6 @@ type A = 1; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'all' }], @@ -721,7 +699,6 @@ type A = 1; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'functions-and-types' }], @@ -739,7 +716,6 @@ type A = 1; shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'functions-and-types' }], @@ -757,7 +733,6 @@ interface A {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'functions-and-types' }], @@ -775,7 +750,6 @@ interface A {} shadowedLine: 3, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'functions-and-types' }], @@ -795,7 +769,6 @@ type A = 1; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'functions-and-types' }], @@ -815,7 +788,6 @@ type A = 1; shadowedLine: 5, }, messageId: 'noShadow', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ hoist: 'functions-and-types' }], diff --git a/packages/eslint-plugin/tests/rules/no-this-alias.test.ts b/packages/eslint-plugin/tests/rules/no-this-alias.test.ts index 810092f744b2..0ad0667512c6 100644 --- a/packages/eslint-plugin/tests/rules/no-this-alias.test.ts +++ b/packages/eslint-plugin/tests/rules/no-this-alias.test.ts @@ -1,19 +1,15 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-this-alias'; const idError = { messageId: 'thisAssignment' as const, - type: AST_NODE_TYPES.Identifier, }; const destructureError = { messageId: 'thisDestructure' as const, - type: AST_NODE_TYPES.ObjectPattern, }; const arrayDestructureError = { messageId: 'thisDestructure' as const, - type: AST_NODE_TYPES.ArrayPattern, }; const ruleTester = new RuleTester(); diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts index 91a153d7dd33..8bbc814fd314 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-unnecessary-qualifier'; import { getFixturesRootDir } from '../RuleTester'; @@ -94,7 +93,6 @@ namespace A { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.Identifier, }, ], output: ` @@ -114,7 +112,6 @@ namespace A { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.Identifier, }, ], output: ` @@ -136,7 +133,6 @@ namespace A { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.Identifier, }, ], output: ` @@ -160,7 +156,6 @@ namespace A { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.TSQualifiedName, }, ], output: ` @@ -184,7 +179,6 @@ namespace A { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.TSQualifiedName, }, ], output: ` @@ -208,7 +202,6 @@ namespace A { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.MemberExpression, }, ], output: ` @@ -230,7 +223,6 @@ enum A { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.Identifier, }, ], output: ` @@ -252,7 +244,6 @@ namespace Foo { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.MemberExpression, }, ], output: ` @@ -274,7 +265,6 @@ declare module './foo' { errors: [ { messageId: 'unnecessaryQualifier', - type: AST_NODE_TYPES.Identifier, }, ], output: ` diff --git a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts index a08b8de812a9..8494eb33e658 100644 --- a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts +++ b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-use-before-define'; @@ -601,7 +600,6 @@ var a = 19; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { @@ -617,7 +615,6 @@ var a = 19; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -631,7 +628,6 @@ var a = 19; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -644,7 +640,6 @@ var a = function () {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -657,7 +652,6 @@ var a = [1, 3]; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -674,12 +668,10 @@ function a() { { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, { data: { name: 'b' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -692,7 +684,6 @@ var a = function () {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], options: ['nofunc'], @@ -708,7 +699,6 @@ var a = function () {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -722,7 +712,6 @@ function a() {} { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -740,7 +729,6 @@ try { { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -753,7 +741,6 @@ var a; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -767,7 +754,6 @@ class A {} { data: { name: 'A' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -783,7 +769,6 @@ class A {} { data: { name: 'A' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -797,7 +782,6 @@ var A = class {}; { data: { name: 'A' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -813,7 +797,6 @@ var A = class {}; { data: { name: 'A' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -831,7 +814,6 @@ a++; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -848,7 +830,6 @@ a++; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -864,7 +845,6 @@ a++; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -882,7 +862,6 @@ switch (foo) { { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -900,7 +879,6 @@ if (true) { { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -916,7 +894,6 @@ var a = function () {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ classes: false, functions: false }], @@ -930,7 +907,6 @@ var A = class {}; { data: { name: 'A' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -947,7 +923,6 @@ var A = class {}; { data: { name: 'A' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -961,7 +936,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -971,7 +945,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -982,7 +955,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -993,7 +965,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1004,7 +975,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1015,7 +985,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1026,7 +995,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1037,7 +1005,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1048,7 +1015,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1059,7 +1025,6 @@ var A = class {}; { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1073,7 +1038,6 @@ for (var a in a) { { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], }, @@ -1086,7 +1050,6 @@ for (var a of a) { { data: { name: 'a' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, @@ -1105,7 +1068,6 @@ const Foo = 2; { data: { name: 'Foo' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ ignoreTypeReferences: false }], @@ -1124,7 +1086,6 @@ class Foo { { data: { name: 'Foo' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ ignoreTypeReferences: false }], @@ -1145,7 +1106,6 @@ const Foo = { { data: { name: 'Foo' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ ignoreTypeReferences: false }], @@ -1164,7 +1124,6 @@ const baz = ''; { data: { name: 'baz' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], options: [{ ignoreTypeReferences: false }], @@ -1183,7 +1142,6 @@ var bar; { data: { name: 'bar' }, messageId: 'noUseBeforeDefine', - type: AST_NODE_TYPES.Identifier, }, ], languageOptions: { parserOptions }, diff --git a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts index 3d792dca4c7e..7eb57f812d2b 100644 --- a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts +++ b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/no-useless-constructor'; @@ -228,7 +227,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -253,7 +251,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -278,7 +275,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -303,7 +299,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -328,7 +323,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -353,7 +347,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -378,7 +371,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -403,7 +395,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, @@ -426,7 +417,6 @@ ${' '} `, }, ], - type: AST_NODE_TYPES.MethodDefinition, }, ], }, diff --git a/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts b/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts index 452990eadbcd..3c4b0fa576aa 100644 --- a/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts @@ -1,5 +1,4 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/prefer-destructuring'; import { getFixturesRootDir } from '../RuleTester'; @@ -482,7 +481,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [ @@ -497,7 +495,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [ @@ -512,7 +509,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [ @@ -535,7 +531,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: null, @@ -549,7 +544,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], output: null, @@ -563,7 +557,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: null, @@ -577,7 +570,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], output: null, @@ -593,7 +585,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: null, @@ -609,7 +600,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], output: null, @@ -623,7 +613,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: null, @@ -637,7 +626,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], output: null, @@ -651,7 +639,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: null, @@ -665,7 +652,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], output: null, @@ -679,7 +665,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: null, @@ -693,7 +678,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'array' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], output: null, @@ -707,7 +691,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], @@ -722,7 +705,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], @@ -737,7 +719,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [ @@ -758,7 +739,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [ @@ -780,7 +760,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [ @@ -799,7 +778,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [ @@ -818,7 +796,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [ @@ -837,7 +814,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [ @@ -856,7 +832,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [ @@ -875,7 +850,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [ @@ -893,7 +867,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], @@ -908,7 +881,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], @@ -925,7 +897,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: ` @@ -943,7 +914,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: ` @@ -958,7 +928,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: 'const {call} = () => null;', @@ -973,7 +942,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: ` @@ -991,7 +959,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: ` @@ -1008,7 +975,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], output: ` @@ -1027,7 +993,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], @@ -1043,7 +1008,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], @@ -1059,7 +1023,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.VariableDeclarator, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], @@ -1076,7 +1039,6 @@ ruleTester.run('prefer-destructuring', rule, { { data: { type: 'object' }, messageId: 'preferDestructuring', - type: AST_NODE_TYPES.AssignmentExpression, }, ], options: [{ object: true }, { enforceForRenamedProperties: true }], diff --git a/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts b/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts index 12f1bb333689..64109ab7e180 100644 --- a/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts @@ -55,7 +55,6 @@ interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -76,7 +75,6 @@ export default interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: null, @@ -94,7 +92,6 @@ interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -115,7 +112,6 @@ export interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -136,7 +132,6 @@ export interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -156,7 +151,6 @@ function foo(bar: { /* comment */ (s: string): number } | undefined): number { literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -177,7 +171,6 @@ type Foo = { literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -196,7 +189,6 @@ function foo(bar: { (s: string): number }): number { literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -217,7 +209,6 @@ function foo(bar: { (s: string): number } | undefined): number { literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -238,7 +229,6 @@ interface Foo extends Function { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -257,7 +247,6 @@ interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -276,7 +265,6 @@ interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -293,7 +281,6 @@ type Foo = { (this: string): T }; literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -312,7 +299,6 @@ interface Foo { interfaceName: 'Foo', }, messageId: 'unexpectedThisOnFunctionOnlyInterface', - type: AST_NODE_TYPES.TSThisType, }, ], output: null, @@ -329,7 +315,6 @@ interface Foo { interfaceName: 'Foo', }, messageId: 'unexpectedThisOnFunctionOnlyInterface', - type: AST_NODE_TYPES.TSThisType, }, ], output: null, @@ -355,7 +340,6 @@ interface Foo { literalOrInterface: phrases[AST_NODE_TYPES.TSInterfaceDeclaration], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -381,7 +365,6 @@ type X = {} | { (): void; } literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` @@ -398,7 +381,6 @@ type X = {} & { (): void; }; literalOrInterface: phrases[AST_NODE_TYPES.TSTypeLiteral], }, messageId: 'functionTypeOverCallableType', - type: AST_NODE_TYPES.TSCallSignatureDeclaration, }, ], output: ` diff --git a/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts b/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts index 09aa8d7e460e..d8edf4fb9c48 100644 --- a/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts @@ -1,5 +1,4 @@ import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import rule from '../../src/rules/prefer-promise-reject-errors'; import { getFixturesRootDir } from '../RuleTester'; @@ -320,7 +319,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -333,7 +331,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -346,7 +343,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -359,7 +355,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -372,7 +367,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -385,7 +379,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -398,7 +391,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -411,7 +403,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -424,7 +415,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], options: [{ allowEmptyReject: true }], @@ -438,7 +428,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -451,7 +440,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -464,7 +452,6 @@ ruleTester.run('prefer-promise-reject-errors', rule, { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -480,7 +467,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -496,7 +482,6 @@ Promise.reject(await foo()); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -512,7 +497,6 @@ Promise.reject(foo && new Error()); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -528,7 +512,6 @@ foo.reject(); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -542,7 +525,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -555,7 +537,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -568,7 +549,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -581,7 +561,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -594,7 +573,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -607,7 +585,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -622,7 +599,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -635,7 +611,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -648,7 +623,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -661,7 +635,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -674,7 +647,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -687,7 +659,6 @@ foo.reject(); endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -703,7 +674,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -719,7 +689,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -736,7 +705,6 @@ Promise.reject(foo); endLine: 4, line: 4, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -752,7 +720,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -768,7 +735,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -784,7 +750,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -800,7 +765,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -816,7 +780,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -832,7 +795,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -848,7 +810,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -864,7 +825,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -881,7 +841,6 @@ Promise.reject(foo); endLine: 4, line: 4, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -897,7 +856,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -913,7 +871,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -929,7 +886,6 @@ Promise.reject(foo); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -947,7 +903,6 @@ new Promise(function (resolve, reject) { endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -964,7 +919,6 @@ new Promise(function (resolve, reject) { endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -981,7 +935,6 @@ new Promise((resolve, reject) => { endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -994,7 +947,6 @@ new Promise((resolve, reject) => { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1014,7 +966,6 @@ new Promise((resolve, reject) => { endLine: 4, line: 4, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1027,7 +978,6 @@ new Promise((resolve, reject) => { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1040,7 +990,6 @@ new Promise((resolve, reject) => { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1057,7 +1006,6 @@ new Promise(function (reject, reject) { endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1074,7 +1022,6 @@ new Promise(function (foo, arguments) { endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1087,7 +1034,6 @@ new Promise(function (foo, arguments) { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1104,7 +1050,6 @@ new Promise(function ({}, reject) { endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1117,7 +1062,6 @@ new Promise(function ({}, reject) { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1130,7 +1074,6 @@ new Promise(function ({}, reject) { endLine: 1, line: 1, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1148,7 +1091,6 @@ new foo.bar((resolve, reject) => reject(5)); endLine: 5, line: 5, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1166,7 +1108,6 @@ new (foo?.bar)((resolve, reject) => reject(5)); endLine: 5, line: 5, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1182,7 +1123,6 @@ new foo((resolve, reject) => reject(5)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1198,7 +1138,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1214,7 +1153,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1231,7 +1169,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 4, line: 4, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1247,7 +1184,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1263,7 +1199,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1279,7 +1214,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1295,7 +1229,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1311,7 +1244,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1327,7 +1259,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1343,7 +1274,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1359,7 +1289,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1376,7 +1305,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 4, line: 4, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1392,7 +1320,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1408,7 +1335,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1424,7 +1350,6 @@ new Promise((resolve, reject) => reject(foo)); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1440,7 +1365,6 @@ Foo.reject(5); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1456,7 +1380,6 @@ foo.reject(5); endLine: 3, line: 3, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1473,7 +1396,6 @@ Bar.reject(5); endLine: 4, line: 4, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1491,7 +1413,6 @@ function fun(t: T): void { endLine: 4, line: 4, messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1503,7 +1424,6 @@ function fun(t: T): void { errors: [ { messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], options: [{ allowThrowingAny: false, allowThrowingUnknown: true }], @@ -1516,7 +1436,6 @@ function fun(t: T): void { errors: [ { messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], options: [{ allowThrowingAny: true, allowThrowingUnknown: false }], @@ -1529,7 +1448,6 @@ function fun(t: T): void { errors: [ { messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, @@ -1541,7 +1459,6 @@ function fun(t: T): void { errors: [ { messageId: 'rejectAnError', - type: AST_NODE_TYPES.CallExpression, }, ], }, From 5c1a1592ccb21868ddff8543988125af0219f831 Mon Sep 17 00:00:00 2001 From: Mister-Hope Date: Mon, 6 Oct 2025 20:19:14 +0800 Subject: [PATCH 246/283] feat(typescript-eslint): export util types (close #10848) (#10849) * feat(typescript-eslint): export util types * Reduce to FlatConfig and add docs --------- Co-authored-by: Josh Goldberg --- docs/packages/TypeScript_ESLint.mdx | 1 + packages/typescript-eslint/src/index.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/packages/TypeScript_ESLint.mdx b/docs/packages/TypeScript_ESLint.mdx index be021f9f3f5a..c1e5966d80fd 100644 --- a/docs/packages/TypeScript_ESLint.mdx +++ b/docs/packages/TypeScript_ESLint.mdx @@ -22,6 +22,7 @@ This package exports the following: | `configs` | [Shared ESLint (flat) configs](../users/Shared_Configurations.mdx) | | `parser` | A re-export of [`@typescript-eslint/parser`](./Parser.mdx) | | `plugin` | A re-export of [`@typescript-eslint/eslint-plugin`](./ESLint_Plugin.mdx) | +| `FlatConfig` | A re-export of the type from [`@typescript-eslint/utils`](./Utils.mdx) | ## Installation diff --git a/packages/typescript-eslint/src/index.ts b/packages/typescript-eslint/src/index.ts index c369d3605d2c..3f5f47da4b33 100644 --- a/packages/typescript-eslint/src/index.ts +++ b/packages/typescript-eslint/src/index.ts @@ -16,6 +16,8 @@ import type { import { config } from './config-helper'; import { getTSConfigRootDirFromStack } from './getTSConfigRootDirFromStack'; +export type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; + export const parser: CompatibleParser = rawPlugin.parser as CompatibleParser satisfies FlatConfig.Parser; From f0837984cb587a47bfa7737ed252fedf67346168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Mon, 6 Oct 2025 08:20:32 -0400 Subject: [PATCH 247/283] feat(eslint-plugin): [no-unsafe-member-access] add allowOptionalChaining option (#11659) * feat(eslint-plugin): [no-unsafe-member-access] add allowOptionalChaining option * Update rule schema snapshot * Fix docs * Add missing ts option; update snapshots * Apply suggestions from code review Co-authored-by: Ronen Amiel * Added test for allowOptionalChaining without optional * yarn test -u --------- Co-authored-by: Ronen Amiel --- .../docs/rules/no-unsafe-member-access.mdx | 37 +++++ .../src/rules/no-unsafe-member-access.ts | 59 +++++++- .../no-unsafe-member-access.shot | 17 +++ .../rules/no-unsafe-member-access.test.ts | 142 ++++++++++++++++++ .../no-unsafe-member-access.shot | 21 ++- 5 files changed, 267 insertions(+), 9 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-member-access.mdx b/packages/eslint-plugin/docs/rules/no-unsafe-member-access.mdx index 2f1eb0edbf0f..f96138fc93eb 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-member-access.mdx +++ b/packages/eslint-plugin/docs/rules/no-unsafe-member-access.mdx @@ -65,6 +65,43 @@ arr[idx++]; +## Options + +### `allowOptionalChaining` + +{/* insert option description */} + +Examples of code for this rule with `{ allowOptionalChaining: true }`: + + + + +```ts +declare const outer: any; + +outer.inner; +outer.middle.inner; +``` + + + + +```ts option='{ "allowOptionalChaining": true }' +declare const outer: any; + +outer?.inner; +outer?.middle?.inner; +``` + + + + +:::caution +We only recommend using `allowOptionalChaining` to help transition an existing project towards fully enabling `no-unsafe-member-access`. +Optional chaining makes it safer than normal property accesses in that you won't get a runtime error if the parent value is `null` or `undefined`. +However, it still results in an `any`-typed value, which is unsafe. +::: + ## When Not To Use It If your codebase has many existing `any`s or areas of unsafe code, it may be difficult to enable this rule. diff --git a/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts b/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts index 6cf16d5211e4..510d53c5e3e3 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts @@ -15,6 +15,7 @@ import { const enum State { Unsafe = 1, Safe = 2, + Chained = 3, } function createDataType(type: ts.Type): '`any`' | '`error` typed' { @@ -22,7 +23,18 @@ function createDataType(type: ts.Type): '`any`' | '`error` typed' { return isErrorType ? '`error` typed' : '`any`'; } -export default createRule({ +export type Options = [ + { + allowOptionalChaining?: boolean; + }, +]; + +export type MessageIds = + | 'unsafeComputedMemberAccess' + | 'unsafeMemberExpression' + | 'unsafeThisMemberExpression'; + +export default createRule({ name: 'no-unsafe-member-access', meta: { type: 'problem', @@ -41,10 +53,26 @@ export default createRule({ 'You can try to fix this by turning on the `noImplicitThis` compiler option, or adding a `this` parameter to the function.', ].join('\n'), }, - schema: [], + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowOptionalChaining: { + type: 'boolean', + description: + 'Whether to allow `?.` optional chains on `any` values.', + }, + }, + }, + ], }, - defaultOptions: [], - create(context) { + defaultOptions: [ + { + allowOptionalChaining: false, + }, + ], + create(context, [{ allowOptionalChaining }]) { const services = getParserServices(context); const compilerOptions = services.program.getCompilerOptions(); const isNoImplicitThis = tsutils.isStrictCompilerOptionEnabled( @@ -54,7 +82,20 @@ export default createRule({ const stateCache = new Map(); + // Case notes: + // value?.outer.middle.inner + // The ChainExpression is a child of the root expression, and a parent of all the MemberExpressions. + // But the left-most expression is what we want to report on: the inner-most expressions. + // In fact, this is true even if the chain is on the inside! + // value.outer.middle?.inner; + // It was already true that every `object` (MemberExpression) has optional: boolean + function checkMemberExpression(node: TSESTree.MemberExpression): State { + if (allowOptionalChaining && node.optional) { + stateCache.set(node, State.Chained); + return State.Chained; + } + const cachedState = stateCache.get(node); if (cachedState) { return cachedState; @@ -77,8 +118,7 @@ export default createRule({ if (state === State.Unsafe) { const propertyName = context.sourceCode.getText(node.property); - let messageId: 'unsafeMemberExpression' | 'unsafeThisMemberExpression' = - 'unsafeMemberExpression'; + let messageId: MessageIds = 'unsafeMemberExpression'; if (!isNoImplicitThis) { // `this.foo` or `this.foo[bar]` @@ -114,6 +154,13 @@ export default createRule({ 'MemberExpression[computed = true] > *.property'( node: TSESTree.Expression, ): void { + if ( + allowOptionalChaining && + (node.parent as TSESTree.MemberExpression).optional + ) { + return; + } + if ( // x[1] node.type === AST_NODE_TYPES.Literal || diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unsafe-member-access.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unsafe-member-access.shot index fee1bc00f418..91a7260593f1 100644 --- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unsafe-member-access.shot +++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unsafe-member-access.shot @@ -43,3 +43,20 @@ arr[1]; let idx = 1; arr[idx]; arr[idx++]; + +Incorrect + +declare const outer: any; + +outer.inner; + ~~~~~ Unsafe member access .inner on an `any` value. +outer.middle.inner; + ~~~~~~ Unsafe member access .middle on an `any` value. + +Correct +Options: { "allowOptionalChaining": true } + +declare const outer: any; + +outer?.inner; +outer?.middle?.inner; diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-member-access.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-member-access.test.ts index 089d20ee6e19..b300edf5bb0e 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-member-access.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-member-access.test.ts @@ -67,6 +67,38 @@ class B implements F.S.T.A {} ` interface B extends F.S.T.A {} `, + { + code: ` +function foo(x?: { a: number }) { + x?.a; +} + `, + options: [{ allowOptionalChaining: true }], + }, + { + code: ` +function foo(x?: { a: number }, y: string) { + x?.[y]; +} + `, + options: [{ allowOptionalChaining: true }], + }, + { + code: ` +function foo(x: { a: number }, y: 'a') { + x?.[y]; +} + `, + options: [{ allowOptionalChaining: true }], + }, + { + code: ` +function foo(x: { a: number }, y: NotKnown) { + x?.[y]; +} + `, + options: [{ allowOptionalChaining: true }], + }, ], invalid: [ { @@ -382,5 +414,115 @@ class C { }, ], }, + { + code: ` +let value: any; + +value?.middle.inner; + `, + errors: [ + { + column: 15, + data: { + property: '.inner', + type: '`any`', + }, + endColumn: 20, + line: 4, + messageId: 'unsafeMemberExpression', + }, + ], + options: [{ allowOptionalChaining: true }], + }, + { + code: ` +let value: any; + +value?.outer.middle.inner; + `, + errors: [ + { + column: 14, + data: { + property: '.middle', + type: '`any`', + }, + endColumn: 20, + line: 4, + messageId: 'unsafeMemberExpression', + }, + ], + options: [{ allowOptionalChaining: true }], + }, + { + code: ` +let value: any; + +value.outer?.middle.inner; + `, + errors: [ + { + column: 7, + data: { + property: '.outer', + type: '`any`', + }, + endColumn: 12, + line: 4, + messageId: 'unsafeMemberExpression', + }, + { + column: 21, + data: { + property: '.inner', + type: '`any`', + }, + endColumn: 26, + line: 4, + messageId: 'unsafeMemberExpression', + }, + ], + options: [{ allowOptionalChaining: true }], + }, + { + code: ` +let value: any; + +value.outer.middle?.inner; + `, + errors: [ + { + column: 7, + data: { + property: '.outer', + type: '`any`', + }, + endColumn: 12, + line: 4, + messageId: 'unsafeMemberExpression', + }, + ], + options: [{ allowOptionalChaining: true }], + }, + { + code: ` +function foo(x: { a: number }, y: NotKnown) { + x[y]; +} + `, + errors: [ + { + column: 5, + data: { + property: '[y]', + type: '`error` typed', + }, + endColumn: 6, + line: 3, + messageId: 'unsafeComputedMemberAccess', + }, + ], + options: [{ allowOptionalChaining: true }], + }, ], }); diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-member-access.shot b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-member-access.shot index cdd9f8375858..254c8f5ff07e 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-member-access.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-unsafe-member-access.shot @@ -1,10 +1,25 @@ # SCHEMA: -[] +[ + { + "additionalProperties": false, + "properties": { + "allowOptionalChaining": { + "description": "Whether to allow `?.` optional chains on `any` values.", + "type": "boolean" + } + }, + "type": "object" + } +] # TYPES: -/** No options declared */ -type Options = []; +type Options = [ + { + /** Whether to allow `?.` optional chains on `any` values. */ + allowOptionalChaining?: boolean; + }, +]; From 538f8ce2b15e967353ef72b3ff31acaf35120140 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 6 Oct 2025 20:38:09 +0800 Subject: [PATCH 248/283] fix(typescript-estree): forbid `abstract` modifier in object methods (#11656) Co-authored-by: Josh Goldberg --- .../fixtures/_error_/abstract-method/fixture.ts | 1 + .../abstract-method/snapshots/1-TSESTree-Error.shot | 7 +++++++ .../abstract-method/snapshots/2-Babel-Error.shot | 8 ++++++++ .../snapshots/3-Alignment-Error.shot | 4 ++++ packages/typescript-estree/src/check-modifiers.ts | 13 +++++++++++++ 5 files changed, 33 insertions(+) create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/3-Alignment-Error.shot diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/fixture.ts new file mode 100644 index 000000000000..8d7ba0694b01 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/fixture.ts @@ -0,0 +1 @@ +({abstract method(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..dc431453e57a --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > abstract-method > TSESTree - Error`] +TSError +> 1 | ({abstract method(){}}) + | ^^^^^^^^ 'abstract' modifier cannot be used here. + 2 | diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..b186e7ceed16 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > abstract-method > Babel - Error`] +BabelError +> 1 | ({abstract method(){}}) + | ^ Unexpected token, expected "," (1:11) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..2285aeb1e136 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > abstract-method > Error Alignment`] +Both errored diff --git a/packages/typescript-estree/src/check-modifiers.ts b/packages/typescript-estree/src/check-modifiers.ts index 1a21288347eb..b25956b8064f 100644 --- a/packages/typescript-estree/src/check-modifiers.ts +++ b/packages/typescript-estree/src/check-modifiers.ts @@ -371,5 +371,18 @@ export function checkModifiers(node: ts.Node): void { ); } } + + // There are more cases in `checkGrammarObjectLiteralExpression` in TypeScript. + // We may add more validations for them here in the future. + if ( + modifier.kind === SyntaxKind.AbstractKeyword && + node.kind === SyntaxKind.MethodDeclaration && + node.parent.kind === SyntaxKind.ObjectLiteralExpression + ) { + throwError( + modifier, + `'${ts.tokenToString(modifier.kind)}' modifier cannot be used here.`, + ); + } } } From d29bd0af64e4aa81ecaa0c969b09a237ea6d3142 Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Mon, 6 Oct 2025 08:49:31 -0400 Subject: [PATCH 249/283] feat(typescript-estree): private identifiers can only appear on LHS of in expressions (#9232) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(typescript-estree): private identifiers can only appear on LHS of in expressions * Fix lint issues * Update packages/typescript-estree/src/convert.ts Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> * yarn test -u --------- Co-authored-by: Josh Goldberg Co-authored-by: Josh Goldberg ✨ Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .../_error_/private-lhs-not-in/fixture.ts | 4 + .../snapshots/1-TSESTree-Error.shot | 10 ++ .../snapshots/2-Babel-Error.shot | 11 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../fixtures/_error_/private-rhs/fixture.ts | 4 + .../snapshots/1-TSESTree-Error.shot | 10 ++ .../private-rhs/snapshots/2-Babel-Error.shot | 11 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../fixtures/private-lhs-in/fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 138 +++++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 122 +++++++++++++++ .../private-lhs-in/snapshots/3-Babel-AST.shot | 138 +++++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 122 +++++++++++++++ .../snapshots/5-AST-Alignment-AST.shot | 146 ++++++++++++++++++ .../snapshots/6-AST-Alignment-Tokens.shot | 136 ++++++++++++++++ .../src/expression/BinaryExpression/spec.ts | 13 +- .../_error_/private-id-lhs/fixture.ts | 4 + .../snapshots/1-TSESTree-Error.shot | 10 ++ .../snapshots/2-Babel-Error.shot | 11 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/private-id-rhs/fixture.ts | 4 + .../snapshots/1-TSESTree-Error.shot | 10 ++ .../snapshots/2-Babel-Error.shot | 11 ++ .../snapshots/3-Alignment-Error.shot | 4 + packages/typescript-estree/src/convert.ts | 15 ++ 25 files changed, 948 insertions(+), 2 deletions(-) create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/fixture.ts create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/fixture.ts create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/fixture.ts create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/fixture.ts create mode 100644 packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/fixture.ts create mode 100644 packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/3-Alignment-Error.shot diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/fixture.ts b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/fixture.ts new file mode 100644 index 000000000000..daafa9ccb62f --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/fixture.ts @@ -0,0 +1,4 @@ +class A { + #a; + b = #a + 1; +} diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..ec75deb33cff --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-lhs-not-in > TSESTree - Error`] +TSError + 1 | class A { + 2 | #a; +> 3 | b = #a + 1; + | ^^ Private identifiers cannot appear on the right-hand-side of an 'in' expression. + 4 | } + 5 | diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..453c15f5a66d --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/2-Babel-Error.shot @@ -0,0 +1,11 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-lhs-not-in > Babel - Error`] +BabelError + 1 | class A { + 2 | #a; +> 3 | b = #a + 1; + | ^ Private names are only allowed in property accesses (`obj.#a`) or in `in` expressions (`#a in obj`). (3:6) + 4 | } + 5 | + diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..c95813948827 --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-lhs-not-in > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/fixture.ts b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/fixture.ts new file mode 100644 index 000000000000..ce0e507a49fd --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/fixture.ts @@ -0,0 +1,4 @@ +class A { + #a; + b = 1 in #a; +} diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..67636f0e09ec --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-rhs > TSESTree - Error`] +TSError + 1 | class A { + 2 | #a; +> 3 | b = 1 in #a; + | ^^ Private identifiers are only allowed on the left-hand-side of an 'in' expression. + 4 | } + 5 | diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..2014af3eb868 --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/2-Babel-Error.shot @@ -0,0 +1,11 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-rhs > Babel - Error`] +BabelError + 1 | class A { + 2 | #a; +> 3 | b = 1 in #a; + | ^ Private names are only allowed in property accesses (`obj.#a`) or in `in` expressions (`#a in obj`). (3:11) + 4 | } + 5 | + diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..802be146cc95 --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-rhs > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/fixture.ts b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/fixture.ts new file mode 100644 index 000000000000..f17ec7e20d07 --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/fixture.ts @@ -0,0 +1,4 @@ +class A { + #a; + b = #a in A; +} diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..83deb39f58c9 --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,138 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + decorators: [], + definite: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "a", + + range: [12, 14], + loc: { + start: { column: 2, line: 2 }, + end: { column: 4, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [12, 15], + loc: { + start: { column: 2, line: 2 }, + end: { column: 5, line: 2 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "b", + optional: false, + + range: [18, 19], + loc: { + start: { column: 2, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: BinaryExpression { + type: "BinaryExpression", + left: PrivateIdentifier { + type: "PrivateIdentifier", + name: "a", + + range: [22, 24], + loc: { + start: { column: 6, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + operator: "in", + right: Identifier { + type: "Identifier", + decorators: [], + name: "A", + optional: false, + + range: [28, 29], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [22, 29], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [18, 30], + loc: { + start: { column: 2, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + + range: [8, 32], + loc: { + start: { column: 8, line: 1 }, + end: { column: 1, line: 4 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "A", + optional: false, + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 5 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b599e3a8bb83 --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,122 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + PrivateIdentifier { + type: "PrivateIdentifier", + value: "a", + + range: [12, 14], + loc: { + start: { column: 2, line: 2 }, + end: { column: 4, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [14, 15], + loc: { + start: { column: 4, line: 2 }, + end: { column: 5, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [18, 19], + loc: { + start: { column: 2, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [20, 21], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + PrivateIdentifier { + type: "PrivateIdentifier", + value: "a", + + range: [22, 24], + loc: { + start: { column: 6, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [25, 27], + loc: { + start: { column: 9, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [28, 29], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [31, 32], + loc: { + start: { column: 0, line: 4 }, + end: { column: 1, line: 4 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..83deb39f58c9 --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/3-Babel-AST.shot @@ -0,0 +1,138 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + decorators: [], + definite: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "a", + + range: [12, 14], + loc: { + start: { column: 2, line: 2 }, + end: { column: 4, line: 2 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: null, + + range: [12, 15], + loc: { + start: { column: 2, line: 2 }, + end: { column: 5, line: 2 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + decorators: [], + definite: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "b", + optional: false, + + range: [18, 19], + loc: { + start: { column: 2, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + optional: false, + override: false, + readonly: false, + static: false, + value: BinaryExpression { + type: "BinaryExpression", + left: PrivateIdentifier { + type: "PrivateIdentifier", + name: "a", + + range: [22, 24], + loc: { + start: { column: 6, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + operator: "in", + right: Identifier { + type: "Identifier", + decorators: [], + name: "A", + optional: false, + + range: [28, 29], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [22, 29], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [18, 30], + loc: { + start: { column: 2, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + + range: [8, 32], + loc: { + start: { column: 8, line: 1 }, + end: { column: 1, line: 4 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "A", + optional: false, + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 5 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..b599e3a8bb83 --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,122 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + PrivateIdentifier { + type: "PrivateIdentifier", + value: "a", + + range: [12, 14], + loc: { + start: { column: 2, line: 2 }, + end: { column: 4, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [14, 15], + loc: { + start: { column: 4, line: 2 }, + end: { column: 5, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [18, 19], + loc: { + start: { column: 2, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [20, 21], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + PrivateIdentifier { + type: "PrivateIdentifier", + value: "a", + + range: [22, 24], + loc: { + start: { column: 6, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [25, 27], + loc: { + start: { column: 9, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [28, 29], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [31, 32], + loc: { + start: { column: 0, line: 4 }, + end: { column: 1, line: 4 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..be95b85d8e44 --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression BinaryExpression private-lhs-in AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', +- abstract: false, + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, +- decorators: Array [], +- definite: false, + key: PrivateIdentifier { + type: 'PrivateIdentifier', + name: 'a', + + range: [12, 14], + loc: { + start: { column: 2, line: 2 }, + end: { column: 4, line: 2 }, + }, + }, +- optional: false, +- override: false, +- readonly: false, + static: false, + value: null, + + range: [12, 15], + loc: { + start: { column: 2, line: 2 }, + end: { column: 5, line: 2 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, +- decorators: Array [], +- definite: false, + key: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'b', +- optional: false, + + range: [18, 19], + loc: { + start: { column: 2, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, +- optional: false, +- override: false, +- readonly: false, + static: false, + value: BinaryExpression { + type: 'BinaryExpression', + left: PrivateIdentifier { + type: 'PrivateIdentifier', + name: 'a', + + range: [22, 24], + loc: { + start: { column: 6, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + operator: 'in', + right: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'A', +- optional: false, + + range: [28, 29], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [22, 29], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [18, 30], + loc: { + start: { column: 2, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + + range: [8, 32], + loc: { + start: { column: 8, line: 1 }, + end: { column: 1, line: 4 }, + }, + }, +- declare: false, +- decorators: Array [], + id: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'A', +- optional: false, + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, +- implements: Array [], + superClass: null, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 4 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 5 }, + }, + }" +`; diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..31764d700643 --- /dev/null +++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression BinaryExpression private-lhs-in AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, +- Identifier { +- type: 'Identifier', +- value: '#a', ++ PrivateIdentifier { ++ type: 'PrivateIdentifier', ++ value: 'a', + + range: [12, 14], + loc: { + start: { column: 2, line: 2 }, + end: { column: 4, line: 2 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [14, 15], + loc: { + start: { column: 4, line: 2 }, + end: { column: 5, line: 2 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'b', + + range: [18, 19], + loc: { + start: { column: 2, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [20, 21], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, +- Identifier { +- type: 'Identifier', +- value: '#a', ++ PrivateIdentifier { ++ type: 'PrivateIdentifier', ++ value: 'a', + + range: [22, 24], + loc: { + start: { column: 6, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'in', + + range: [25, 27], + loc: { + start: { column: 9, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [28, 29], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [29, 30], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [31, 32], + loc: { + start: { column: 0, line: 4 }, + end: { column: 1, line: 4 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/expression/BinaryExpression/spec.ts b/packages/ast-spec/src/expression/BinaryExpression/spec.ts index 6c262d443064..874df2c6d586 100644 --- a/packages/ast-spec/src/expression/BinaryExpression/spec.ts +++ b/packages/ast-spec/src/expression/BinaryExpression/spec.ts @@ -7,9 +7,18 @@ import type { BinaryOperatorToText } from './BinaryOperatorToText'; export * from './BinaryOperatorToText'; -export interface BinaryExpression extends BaseNode { +export interface PrivateInExpression extends BaseNode { type: AST_NODE_TYPES.BinaryExpression; - left: Expression | PrivateIdentifier; + left: PrivateIdentifier; + operator: 'in'; + right: Expression; +} + +export interface SymmetricBinaryExpression extends BaseNode { + type: AST_NODE_TYPES.BinaryExpression; + left: Expression; operator: ValueOf; right: Expression; } + +export type BinaryExpression = PrivateInExpression | SymmetricBinaryExpression; diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/fixture.ts b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/fixture.ts new file mode 100644 index 000000000000..402329cc285f --- /dev/null +++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/fixture.ts @@ -0,0 +1,4 @@ +class A { + #a; + c = (#a, 1); +} diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..ba6e5a7a7e5f --- /dev/null +++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-lhs > TSESTree - Error`] +TSError + 1 | class A { + 2 | #a; +> 3 | c = (#a, 1); + | ^^ Private identifiers cannot appear on the right-hand-side of an 'in' expression. + 4 | } + 5 | diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..9006b349152b --- /dev/null +++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/2-Babel-Error.shot @@ -0,0 +1,11 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-lhs > Babel - Error`] +BabelError + 1 | class A { + 2 | #a; +> 3 | c = (#a, 1); + | ^ Private names are only allowed in property accesses (`obj.#a`) or in `in` expressions (`#a in obj`). (3:7) + 4 | } + 5 | + diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..15de730f25f8 --- /dev/null +++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-lhs > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/fixture.ts b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/fixture.ts new file mode 100644 index 000000000000..9f1df9d73fa4 --- /dev/null +++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/fixture.ts @@ -0,0 +1,4 @@ +class A { + #a; + c = (1, #a); +} diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..da508ef53ff0 --- /dev/null +++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-rhs > TSESTree - Error`] +TSError + 1 | class A { + 2 | #a; +> 3 | c = (1, #a); + | ^^ Private identifiers are only allowed on the left-hand-side of an 'in' expression. + 4 | } + 5 | diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..4a6a0b8baf68 --- /dev/null +++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/2-Babel-Error.shot @@ -0,0 +1,11 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-rhs > Babel - Error`] +BabelError + 1 | class A { + 2 | #a; +> 3 | c = (1, #a); + | ^ Private names are only allowed in property accesses (`obj.#a`) or in `in` expressions (`#a in obj`). (3:10) + 4 | } + 5 | + diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..aeb556b36b22 --- /dev/null +++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-rhs > Error Alignment`] +Both errored diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 1de256d20740..42d574124200 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2162,6 +2162,21 @@ export class Converter { // Binary Operations case SyntaxKind.BinaryExpression: { + if ( + node.operatorToken.kind !== SyntaxKind.InKeyword && + node.left.kind === SyntaxKind.PrivateIdentifier + ) { + this.#throwError( + node.left, + "Private identifiers cannot appear on the right-hand-side of an 'in' expression.", + ); + } else if (node.right.kind === SyntaxKind.PrivateIdentifier) { + this.#throwError( + node.right, + "Private identifiers are only allowed on the left-hand-side of an 'in' expression.", + ); + } + // TypeScript uses BinaryExpression for sequences as well if (isComma(node.operatorToken)) { const result = this.createNode(node, { From 02e02787425300e6b3e27903138fef4ead94c182 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 6 Oct 2025 20:54:21 +0800 Subject: [PATCH 250/283] fix(typescript-estree): forbid abstract method and accessor to have implementation (#11657) * fix(typescript-estree): forbid abstract method to have implementation * One more test * Fix tests? * Fix rule tests * Fix test * Fix test * Accessor * constructor --- .../_error_/abstract-constructor/fixture.ts | 3 +++ .../snapshots/1-TSESTree-Error.shot | 9 +++++++++ .../snapshots/2-Babel-Error.shot | 10 ++++++++++ .../snapshots/3-Alignment-Error.shot | 4 ++++ .../fixture.ts | 3 +++ .../snapshots/1-TSESTree-Error.shot | 9 +++++++++ .../snapshots/2-Babel-Error.shot | 10 ++++++++++ .../snapshots/3-Alignment-Error.shot | 4 ++++ .../fixture.ts | 3 +++ .../snapshots/1-TSESTree-Error.shot | 9 +++++++++ .../snapshots/2-Babel-Error.shot | 10 ++++++++++ .../snapshots/3-Alignment-Error.shot | 4 ++++ .../fixture.ts | 3 +++ .../snapshots/1-TSESTree-Error.shot | 9 +++++++++ .../snapshots/2-Babel-Error.shot | 10 ++++++++++ .../snapshots/3-Alignment-Error.shot | 4 ++++ .../tests/rules/member-ordering.test.ts | 11 ++++++++++- .../naming-convention.test.ts | 12 ++++++------ .../tests/rules/promise-function-async.test.ts | 5 ----- packages/typescript-estree/src/convert.ts | 18 ++++++++++++++---- packages/typescript-estree/src/node-utils.ts | 9 +++++++++ 21 files changed, 143 insertions(+), 16 deletions(-) create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/3-Alignment-Error.shot diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/fixture.ts new file mode 100644 index 000000000000..bd45e0a8a625 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + abstract constructor() { } +} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..8a67121b79c1 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-constructor > TSESTree - Error`] +TSError + 1 | abstract class Foo { +> 2 | abstract constructor() { } + | ^^^^^^^^ 'abstract' modifier can only appear on a class, method, or property declaration. + 3 | } + 4 | diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..b78e289f0c55 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-constructor > Babel - Error`] +BabelError + 1 | abstract class Foo { +> 2 | abstract constructor() { } + | ^ Method 'constructor' cannot have an implementation because it is marked abstract. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..dbd705849820 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-constructor > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/fixture.ts new file mode 100644 index 000000000000..0ac2bfca1dfd --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + abstract get getter() { } +} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..d7c0c1bcc98a --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-getter-with-implementation > TSESTree - Error`] +TSError + 1 | abstract class Foo { +> 2 | abstract get getter() { } + | ^^^^^^ An abstract accessor cannot have an implementation. + 3 | } + 4 | diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..fe0fe6660cf0 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-getter-with-implementation > Babel - Error`] +BabelError + 1 | abstract class Foo { +> 2 | abstract get getter() { } + | ^ Method 'getter' cannot have an implementation because it is marked abstract. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..748024e02a80 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-getter-with-implementation > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/fixture.ts new file mode 100644 index 000000000000..80fe821c5d29 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + abstract method() { } +} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..a65c609416d4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-method-with-implementation > TSESTree - Error`] +TSError + 1 | abstract class Foo { +> 2 | abstract method() { } + | ^^^^^^ Method 'method' cannot have an implementation because it is marked abstract. + 3 | } + 4 | diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..c345ce0399ec --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-method-with-implementation > Babel - Error`] +BabelError + 1 | abstract class Foo { +> 2 | abstract method() { } + | ^ Method 'method' cannot have an implementation because it is marked abstract. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..fff6cbc7c6ce --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-method-with-implementation > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/fixture.ts new file mode 100644 index 000000000000..fa7888c34cc9 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + abstract set setter(v) { } +} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..febb4fe5dcde --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-setter-with-implementation > TSESTree - Error`] +TSError + 1 | abstract class Foo { +> 2 | abstract set setter(v) { } + | ^^^^^^ An abstract accessor cannot have an implementation. + 3 | } + 4 | diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..c45ee034b7c3 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-setter-with-implementation > Babel - Error`] +BabelError + 1 | abstract class Foo { +> 2 | abstract set setter(v) { } + | ^ Method 'setter' cannot have an implementation because it is marked abstract. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..1e222f7febc0 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-setter-with-implementation > Error Alignment`] +Both errored diff --git a/packages/eslint-plugin/tests/rules/member-ordering.test.ts b/packages/eslint-plugin/tests/rules/member-ordering.test.ts index d53fe04d6d22..f885b156163c 100644 --- a/packages/eslint-plugin/tests/rules/member-ordering.test.ts +++ b/packages/eslint-plugin/tests/rules/member-ordering.test.ts @@ -4465,7 +4465,7 @@ abstract class Foo { B: string; public C() {} private D() {} - abstract E() {} + E() {} } `, errors: [ @@ -4478,6 +4478,15 @@ abstract class Foo { line: 4, messageId: 'incorrectGroupOrder', }, + { + column: 3, + data: { + name: 'E', + rank: 'private instance method', + }, + line: 7, + messageId: 'incorrectGroupOrder', + }, ], }, { diff --git a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts index c43b293c686e..076534645409 100644 --- a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts +++ b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts @@ -632,7 +632,7 @@ ruleTester.run('naming-convention', rule, { { code: ` class Ignored { - private static abstract some_name() {} + private static some_name() {} IgnoredDueToModifiers() {} } `, @@ -644,7 +644,7 @@ ruleTester.run('naming-convention', rule, { }, { format: ['UPPER_CASE'], - modifiers: ['abstract', 'static'], + modifiers: ['static'], selector: 'classMethod', }, ], @@ -1875,7 +1875,7 @@ ruleTester.run('naming-convention', rule, { { code: ` class Ignored { - private static abstract some_name() {} + private static some_name() {} IgnoredDueToModifiers() {} } `, @@ -1886,7 +1886,7 @@ ruleTester.run('naming-convention', rule, { }, { format: ['snake_case'], - modifiers: ['abstract', 'static'], + modifiers: ['static'], selector: 'classMethod', }, ], @@ -2118,10 +2118,10 @@ ruleTester.run('naming-convention', rule, { } } abstract class foo { - public abstract Bar() { + public Bar() { return 42; } - public abstract async async_bar() { + public async async_bar() { return 42; } } diff --git a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts index 2b6ddbdb9870..587445eba9b9 100644 --- a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts +++ b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts @@ -156,11 +156,6 @@ function foo(): Promise | boolean { code: ` abstract class Test { abstract test1(): Promise; - - // abstract method with body is always an error but it still parses into valid AST - abstract test2(): Promise { - return Promise.resolve(1); - } } `, }, diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 42d574124200..3facbe34af20 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -15,6 +15,7 @@ import { getDecorators, getModifiers } from './getModifiers'; import { canContainDirective, createError, + declarationNameToString, findNextToken, getBinaryExpressionType, getDeclarationKind, @@ -1356,6 +1357,18 @@ export class Converter { } // otherwise, it is a non-type accessor - intentional fallthrough case SyntaxKind.MethodDeclaration: { + const isAbstract = hasModifier(SyntaxKind.AbstractKeyword, node); + + if (isAbstract && node.body) { + this.#throwError( + node.name, + node.kind === SyntaxKind.GetAccessor || + node.kind === SyntaxKind.SetAccessor + ? 'An abstract accessor cannot have an implementation.' + : `Method '${declarationNameToString(node.name, this.ast)}' cannot have an implementation because it is marked abstract.`, + ); + } + const method = this.createNode< TSESTree.FunctionExpression | TSESTree.TSEmptyBodyFunctionExpression >(node, { @@ -1411,10 +1424,7 @@ export class Converter { /** * TypeScript class methods can be defined as "abstract" */ - const methodDefinitionType = hasModifier( - SyntaxKind.AbstractKeyword, - node, - ) + const methodDefinitionType = isAbstract ? AST_NODE_TYPES.TSAbstractMethodDefinition : AST_NODE_TYPES.MethodDefinition; diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 3200e74ec020..b5990014e589 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -803,3 +803,12 @@ export function getNamespaceModifiers( } return modifiers; } + +// `ts.declarationNameToString` +export function declarationNameToString( + name: ts.Node, + ast: ts.SourceFile, +): string { + const text = ast.text.slice(name.pos, name.end).trimStart(); + return text || '(Missing)'; +} From a97419124f93aef7e7748e4d0d768d6e79c28e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Mon, 6 Oct 2025 09:34:38 -0400 Subject: [PATCH 251/283] fix(eslint-plugin): [prefer-readonly-parameter-types] ignore tagged primitives (#11660) * fix(eslint-plugin): [prefer-readonly-parameter-types] ignore tagged primitives * A lot more testing, and no more length === 2 * fix lint complaitns * Fix more reports * git checkout main -- .vscode/launch.json * Suggestions on isTypeBrandedLiteralLike * Switch to .every --- .../rules/prefer-readonly-parameter-types.ts | 3 +- .../prefer-readonly-parameter-types.test.ts | 125 ++++++++++++++++++ packages/type-utils/src/index.ts | 1 + .../src/isTypeBrandedLiteralLike.ts | 50 +++++++ 4 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 packages/type-utils/src/isTypeBrandedLiteralLike.ts diff --git a/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts b/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts index 71e5efe2f74d..47c4dfaa023b 100644 --- a/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts +++ b/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts @@ -7,6 +7,7 @@ import type { TypeOrValueSpecifier } from '../util'; import { createRule, getParserServices, + isTypeBrandedLiteralLike, isTypeReadonly, readonlynessOptionsDefaults, readonlynessOptionsSchema, @@ -129,7 +130,7 @@ export default createRule({ treatMethodsAsReadonly: !!treatMethodsAsReadonly, }); - if (!isReadOnly) { + if (!isReadOnly && !isTypeBrandedLiteralLike(type)) { context.report({ node: actualParam, messageId: 'shouldBeReadonly', diff --git a/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts b/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts index 027f2f7ae49e..94381614160a 100644 --- a/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts @@ -320,6 +320,114 @@ function foo(arg: Test) {} const willNotCrash = (foo: Readonly) => {}; `, + ` +type TaggedBigInt = bigint & { + readonly __tag: unique symbol; +}; +function custom1(arg: TaggedBigInt) {} + `, + ` +type TaggedNumber = number & { + readonly __tag: unique symbol; +}; +function custom1(arg: TaggedNumber) {} + `, + ` +type TaggedString = string & { + readonly __tag: unique symbol; +}; +function custom1(arg: TaggedString) {} + `, + ` +type TaggedString = string & { + readonly __tagA: unique symbol; + readonly __tagB: unique symbol; +}; +function custom1(arg: TaggedString) {} + `, + ` +type TaggedString = string & { + readonly __tag: unique symbol; +}; + +type OtherSpecialString = string & { + readonly ' __other_tag': unique symbol; +}; + +function custom1(arg: TaggedString | OtherSpecialString) {} + `, + ` +type TaggedTemplateLiteral = \`\${string}-\${string}\` & { + readonly __tag: unique symbol; +}; +function custom1(arg: TaggedTemplateLiteral) {} + `, + ` +type TaggedNumber = 1 & { + readonly __tag: unique symbol; +}; + +function custom1(arg: TaggedNumber) {} + `, + ` +type TaggedNumber = (1 | 2) & { + readonly __tag: unique symbol; +}; + +function custom1(arg: TaggedNumber) {} + `, + ` +type TaggedString = ('a' | 'b') & { + readonly __tag: unique symbol; +}; + +function custom1(arg: TaggedString) {} + `, + ` +type Strings = 'one' | 'two' | 'three'; + +type TaggedString = Strings & { + readonly __tag: unique symbol; +}; + +function custom1(arg: TaggedString) {} + `, + ` +type Strings = 'one' | 'two' | 'three'; + +type TaggedString = Strings & { + __tag: unique symbol; +}; + +function custom1(arg: TaggedString) {} + `, + ` +type TaggedString = string & { + __tag: unique symbol; +} & { + __tag: unique symbol; +}; +function custom1(arg: TaggedString) {} + `, + ` +type TaggedString = string & { + __tagA: unique symbol; +} & { + __tagB: unique symbol; +}; +function custom1(arg: TaggedString) {} + `, + ` +type TaggedString = string & + ({ __tag: unique symbol } | { __tag: unique symbol }); +function custom1(arg: TaggedString) {} + `, + ` +type TaggedFunction = (() => void) & { + readonly __tag: unique symbol; +}; +function custom1(arg: TaggedFunction) {} + `, { code: ` type Callback = (options: T) => void; @@ -909,6 +1017,23 @@ function foo(arg: Test) {} }, ], }, + { + code: ` +class ClassExample {} +type Test = typeof ClassExample & { + readonly property: boolean; +}; +function foo(arg: Test) {} + `, + errors: [ + { + column: 14, + endColumn: 23, + line: 6, + messageId: 'shouldBeReadonly', + }, + ], + }, { code: ` const sym = Symbol('sym'); diff --git a/packages/type-utils/src/index.ts b/packages/type-utils/src/index.ts index 8435b4e1f429..8b83a1931405 100644 --- a/packages/type-utils/src/index.ts +++ b/packages/type-utils/src/index.ts @@ -6,6 +6,7 @@ export * from './getDeclaration'; export * from './getSourceFileOfNode'; export * from './getTypeName'; export * from './isSymbolFromDefaultLibrary'; +export * from './isTypeBrandedLiteralLike'; export * from './isTypeReadonly'; export * from './isUnsafeAssignment'; export * from './predicates'; diff --git a/packages/type-utils/src/isTypeBrandedLiteralLike.ts b/packages/type-utils/src/isTypeBrandedLiteralLike.ts new file mode 100644 index 000000000000..93852c95fbc4 --- /dev/null +++ b/packages/type-utils/src/isTypeBrandedLiteralLike.ts @@ -0,0 +1,50 @@ +import * as tsutils from 'ts-api-utils'; +import * as ts from 'typescript'; + +function isLiteralOrTaggablePrimitiveLike(type: ts.Type): boolean { + return ( + type.isLiteral() || + tsutils.isTypeFlagSet( + type, + ts.TypeFlags.BigInt | + ts.TypeFlags.Number | + ts.TypeFlags.String | + ts.TypeFlags.TemplateLiteral, + ) + ); +} + +function isObjectLiteralLike(type: ts.Type): boolean { + return ( + !type.getCallSignatures().length && + !type.getConstructSignatures().length && + tsutils.isObjectType(type) + ); +} + +function isTypeBrandedLiteral(type: ts.Type): boolean { + if (!type.isIntersection()) { + return false; + } + + let hadObjectLike = false; + let hadPrimitiveLike = false; + + for (const constituent of type.types) { + if (isObjectLiteralLike(constituent)) { + hadPrimitiveLike = true; + } else if (isLiteralOrTaggablePrimitiveLike(constituent)) { + hadObjectLike = true; + } else { + return false; + } + } + + return hadPrimitiveLike && hadObjectLike; +} + +export function isTypeBrandedLiteralLike(type: ts.Type): boolean { + return type.isUnion() + ? type.types.every(isTypeBrandedLiteral) + : isTypeBrandedLiteral(type); +} From aea862dcebc8e301f35af37639076f9efa8031a2 Mon Sep 17 00:00:00 2001 From: Younsang Na <77400131+nayounsang@users.noreply.github.com> Date: Mon, 6 Oct 2025 22:41:27 +0900 Subject: [PATCH 252/283] feat(eslint-plugin-internal): [no-dynamic-tests] new internal Lint rule to ban dynamic syntax in generating tests (#11323) * test: add test cases * feat: internal no-dynamic-tests rule * feat: export rule * fix: more suitable conditions * refactor: remove cmts * test: add valid tc for noFormat * fix: should allow noFormat tag * fix: narrow report node * test: add nested dynamic test * fix: fix err column * feat: enable object dynamic value * feat: key to validate * test: add test case for object value: error and code * fix: ban direct assigned test case * chore: test commit to enable new rule in CI * chore: make bulk supress file * chore: utility script for update bulk suprresion * fix: update lock * fix: revert weird script * chore: revert lock and package json * fix typecheck --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Co-authored-by: Josh Goldberg --- eslint-suppressions.json | 97 ++++++ eslint.config.mjs | 1 + package.json | 1 + .../eslint-plugin-internal/src/rules/index.ts | 2 + .../src/rules/no-dynamic-tests.ts | 140 +++++++++ .../tests/rules/no-dynamic-tests.test.ts | 289 ++++++++++++++++++ 6 files changed, 530 insertions(+) create mode 100644 eslint-suppressions.json create mode 100644 packages/eslint-plugin-internal/src/rules/no-dynamic-tests.ts create mode 100644 packages/eslint-plugin-internal/tests/rules/no-dynamic-tests.test.ts diff --git a/eslint-suppressions.json b/eslint-suppressions.json new file mode 100644 index 000000000000..eddbd9cba3f6 --- /dev/null +++ b/eslint-suppressions.json @@ -0,0 +1,97 @@ +{ + "packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 26 + } + }, + "packages/eslint-plugin/tests/rules/dot-notation.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 1 + } + }, + "packages/eslint-plugin/tests/rules/member-ordering/member-ordering-alphabetically-case-insensitive-order.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 4 + } + }, + "packages/eslint-plugin/tests/rules/member-ordering/member-ordering-alphabetically-order.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 4 + } + }, + "packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 12 + } + }, + "packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 12 + } + }, + "packages/eslint-plugin/tests/rules/no-invalid-this.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 43 + } + }, + "packages/eslint-plugin/tests/rules/no-loop-func.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 2 + } + }, + "packages/eslint-plugin/tests/rules/no-this-alias.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 14 + } + }, + "packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 44 + } + }, + "packages/eslint-plugin/tests/rules/no-unnecessary-template-expression.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 1 + } + }, + "packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 2 + } + }, + "packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 154 + } + }, + "packages/eslint-plugin/tests/rules/no-useless-empty-export.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 9 + } + }, + "packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 42 + } + }, + "packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 17 + } + }, + "packages/eslint-plugin/tests/rules/return-await.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 1 + } + }, + "packages/eslint-plugin/tests/rules/sort-type-constituents.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 4 + } + }, + "packages/eslint-plugin/tests/rules/unbound-method.test.ts": { + "@typescript-eslint/internal/no-dynamic-tests": { + "count": 3 + } + } +} diff --git a/eslint.config.mjs b/eslint.config.mjs index 05fb57e522ac..1c27183e58f5 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -428,6 +428,7 @@ export default defineConfig( ], name: 'eslint-plugin-and-eslint-plugin-internal/test-files/rules', rules: { + '@typescript-eslint/internal/no-dynamic-tests': 'error', '@typescript-eslint/internal/plugin-test-formatting': 'error', }, }, diff --git a/package.json b/package.json index 3d45d58e5ac3..fc18c47878f6 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "lint-markdown-fix": "yarn lint-markdown --fix", "lint-markdown": "markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore", "lint-stylelint": "nx lint website stylelint", + "lint-prune-suppressions": "nx run-many -t lint --projects=eslint-plugin-internal,eslint-plugin --prune-suppressions", "lint": "nx run-many -t lint", "postinstall": "tsx tools/scripts/postinstall.mts", "pre-commit": "lint-staged", diff --git a/packages/eslint-plugin-internal/src/rules/index.ts b/packages/eslint-plugin-internal/src/rules/index.ts index 01e13ea50660..7381fa1f11af 100644 --- a/packages/eslint-plugin-internal/src/rules/index.ts +++ b/packages/eslint-plugin-internal/src/rules/index.ts @@ -2,6 +2,7 @@ import type { Linter } from '@typescript-eslint/utils/ts-eslint'; import debugNamespace from './debug-namespace.js'; import eqeqNullish from './eqeq-nullish.js'; +import noDynamicTests from './no-dynamic-tests.js'; import noPoorlyTypedTsProps from './no-poorly-typed-ts-props.js'; import noRelativePathsToInternalPackages from './no-relative-paths-to-internal-packages.js'; import noTypescriptDefaultImport from './no-typescript-default-import.js'; @@ -12,6 +13,7 @@ import preferASTTypesEnum from './prefer-ast-types-enum.js'; export default { 'debug-namespace': debugNamespace, 'eqeq-nullish': eqeqNullish, + 'no-dynamic-tests': noDynamicTests, 'no-poorly-typed-ts-props': noPoorlyTypedTsProps, 'no-relative-paths-to-internal-packages': noRelativePathsToInternalPackages, 'no-typescript-default-import': noTypescriptDefaultImport, diff --git a/packages/eslint-plugin-internal/src/rules/no-dynamic-tests.ts b/packages/eslint-plugin-internal/src/rules/no-dynamic-tests.ts new file mode 100644 index 000000000000..bee236413868 --- /dev/null +++ b/packages/eslint-plugin-internal/src/rules/no-dynamic-tests.ts @@ -0,0 +1,140 @@ +import type { InvalidTestCase } from '@typescript-eslint/rule-tester'; +import type { TSESTree } from '@typescript-eslint/utils'; + +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + +import { createRule } from '../util/index.js'; + +export default createRule({ + name: 'no-dynamic-tests', + meta: { + type: 'problem', + docs: { + description: 'Disallow dynamic syntax in RuleTester test arrays', + }, + messages: { + noDynamicTests: + 'Dynamic syntax is not allowed in RuleTester test arrays. Use static values only.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function isRuleTesterCall(node: TSESTree.Node): boolean { + return ( + node.type === AST_NODE_TYPES.CallExpression && + node.callee.type === AST_NODE_TYPES.MemberExpression && + node.callee.object.type === AST_NODE_TYPES.Identifier && + node.callee.object.name === 'ruleTester' && + node.callee.property.type === AST_NODE_TYPES.Identifier && + node.callee.property.name === 'run' + ); + } + + function reportDynamicElements(node: TSESTree.Node): void { + switch (node.type) { + case AST_NODE_TYPES.CallExpression: + case AST_NODE_TYPES.SpreadElement: + case AST_NODE_TYPES.Identifier: + case AST_NODE_TYPES.BinaryExpression: + case AST_NODE_TYPES.ConditionalExpression: + case AST_NODE_TYPES.MemberExpression: + context.report({ + node, + messageId: 'noDynamicTests', + }); + break; + case AST_NODE_TYPES.TemplateLiteral: + node.expressions.forEach(expr => { + reportDynamicElements(expr); + }); + break; + case AST_NODE_TYPES.ArrayExpression: + node.elements.forEach(element => { + if (element) { + reportDynamicElements(element); + } + }); + break; + case AST_NODE_TYPES.ObjectExpression: + node.properties.forEach(prop => { + if (prop.type === AST_NODE_TYPES.SpreadElement) { + context.report({ + node: prop, + messageId: 'noDynamicTests', + }); + } else { + // InvalidTestCase extends ValidTestCase + type TestCaseKey = keyof InvalidTestCase; + const keyToValidate: TestCaseKey[] = ['code', 'errors']; + + if ( + prop.key.type === AST_NODE_TYPES.Identifier && + keyToValidate.includes(prop.key.name as TestCaseKey) + ) { + reportDynamicElements(prop.value); + } else if ( + prop.key.type === AST_NODE_TYPES.Literal && + keyToValidate.includes(prop.key.value as TestCaseKey) + ) { + reportDynamicElements(prop.value); + } + } + }); + break; + case AST_NODE_TYPES.TaggedTemplateExpression: + if ( + !( + node.tag.type === AST_NODE_TYPES.Identifier && + node.tag.name === 'noFormat' + ) + ) { + context.report({ + node: node.tag, + messageId: 'noDynamicTests', + }); + } + break; + case AST_NODE_TYPES.Literal: + default: + break; + } + } + + return { + CallExpression(node) { + if (isRuleTesterCall(node)) { + // If valid code, arg length is always 3 but we need to avoid conflict while dev + if (node.arguments.length < 3) { + return; + } + const testObject = node.arguments[2]; + + if (testObject.type === AST_NODE_TYPES.ObjectExpression) { + for (const prop of testObject.properties) { + const isTestCases = + prop.type === AST_NODE_TYPES.Property && + prop.key.type === AST_NODE_TYPES.Identifier && + (prop.key.name === 'valid' || prop.key.name === 'invalid'); + + if (isTestCases) { + if (prop.value.type === AST_NODE_TYPES.ArrayExpression) { + prop.value.elements.forEach(element => { + if (element) { + reportDynamicElements(element); + } + }); + } else { + context.report({ + node: prop.value, + messageId: 'noDynamicTests', + }); + } + } + } + } + } + }, + }; + }, +}); diff --git a/packages/eslint-plugin-internal/tests/rules/no-dynamic-tests.test.ts b/packages/eslint-plugin-internal/tests/rules/no-dynamic-tests.test.ts new file mode 100644 index 000000000000..dcb2ddbd007c --- /dev/null +++ b/packages/eslint-plugin-internal/tests/rules/no-dynamic-tests.test.ts @@ -0,0 +1,289 @@ +import { RuleTester } from '@typescript-eslint/rule-tester'; + +import rule from '../../src/rules/no-dynamic-tests.js'; + +const ruleTester = new RuleTester({ + languageOptions: { + parserOptions: { + ecmaFeatures: {}, + ecmaVersion: 6, + sourceType: 'module', + }, + }, +}); + +ruleTester.run('no-dynamic-tests', rule, { + invalid: [ + // Function calls in test arrays + { + code: ` +ruleTester.run('test', rule, { + valid: [generateTestCases()], + invalid: [], +}); + `, + errors: [ + { + column: 11, + line: 3, + messageId: 'noDynamicTests', + }, + ], + }, + { + code: ` +ruleTester.run('test', rule, { + valid: [], + invalid: [...getInvalidCases()], +}); + `, + errors: [ + { + column: 13, + line: 4, + messageId: 'noDynamicTests', + }, + ], + }, + // Spread operator in test arrays + { + code: ` +ruleTester.run('test', rule, { + valid: [...validTestCases], + invalid: [], +}); + `, + errors: [ + { + column: 11, + line: 3, + messageId: 'noDynamicTests', + }, + ], + }, + { + code: ` +ruleTester.run('test', rule, { + valid: [...validTestCases.map(t => t.code)], + invalid: [], +}); + `, + errors: [ + { + column: 11, + line: 3, + messageId: 'noDynamicTests', + }, + ], + }, + // Simple identifiers in test arrays + { + code: ` +ruleTester.run('test', rule, { + valid: [testCase], + invalid: [], +}); + `, + errors: [ + { + column: 11, + line: 3, + messageId: 'noDynamicTests', + }, + ], + }, + // Template literals in test arrays + { + code: ` +ruleTester.run('test', rule, { + valid: [\`\${getTest()}\`], + invalid: [], +}); + `, + errors: [ + { + column: 14, + line: 3, + messageId: 'noDynamicTests', + }, + ], + }, + // Binary expressions in test arrays + { + code: ` +ruleTester.run('test', rule, { + valid: ['test' + getSuffix()], + invalid: [], +}); + `, + errors: [ + { + column: 11, + line: 3, + messageId: 'noDynamicTests', + }, + ], + }, + // Conditional expressions in test arrays + { + code: ` +ruleTester.run('test', rule, { + valid: [shouldTest ? 'test1' : 'test2'], + invalid: [], +}); + `, + errors: [ + { + column: 11, + line: 3, + messageId: 'noDynamicTests', + }, + ], + }, + // Member expressions in test arrays + { + code: ` +ruleTester.run('test', rule, { + valid: [testConfig.cases], + invalid: [], +}); + `, + errors: [ + { + column: 11, + line: 3, + messageId: 'noDynamicTests', + }, + ], + }, + // Object spread + { + code: ` +ruleTester.run('test', rule, { + valid: [{ ...testConfig }], + invalid: [], +}); + `, + errors: [ + { + column: 13, + line: 3, + messageId: 'noDynamicTests', + }, + ], + }, + // Tag + { + code: ` +ruleTester.run('test', rule, { + valid: [foo\`const x = 1;\`], + invalid: [], +}); + `, + errors: [ + { + column: 11, + line: 3, + messageId: 'noDynamicTests', + }, + ], + }, + // Object Value + { + code: ` +ruleTester.run('test', rule, { + valid: [{ code: foo }], + invalid: [], +}); + `, + errors: [ + { + column: 19, + line: 3, + messageId: 'noDynamicTests', + }, + ], + }, + { + code: ` +ruleTester.run('test', rule, { + valid: [{ errors: [...getErrors()] }], + invalid: [], +}); + `, + errors: [ + { + column: 22, + line: 3, + messageId: 'noDynamicTests', + }, + ], + }, + // assign directly + { + code: ` +ruleTester.run('test', rule, { + valid: foo, + invalid: [], +}); + `, + errors: [ + { + column: 10, + line: 3, + messageId: 'noDynamicTests', + }, + ], + }, + ], + valid: [ + { + code: ` +ruleTester.run('test', rule, { + valid: ['const x = 1;'], + invalid: [], +}); + `, + }, + { + code: ` +ruleTester.run('test', rule, { + valid: ['const x = 1;', 'let y = 2;'], + invalid: [ + { + code: 'var z = 3;', + errors: [{ messageId: 'error' }], + }, + ], +}); + `, + }, + { + code: ` +ruleTester.run('test', rule, { + valid: [{ code: 'const x = 1;' }, { code: 'let y = 2;' }], + invalid: [], +}); + `, + }, + { + code: ` +ruleTester.run('test', rule, { + valid: [noFormat\`const x = 1;\`], + invalid: [], +}); + `, + }, + { + code: ` +ruleTester.run('test', rule, { + code: "import type { ValueOf } from './utils';", + filename: path.resolve( + PACKAGES_DIR, + 'ast-spec/src/expression/AssignmentExpression/spec.ts', + ), +}); + `, + }, + ], +}); From aec785e33d63b248231c3e68c9aeb792caf21acc Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 6 Oct 2025 17:05:03 +0000 Subject: [PATCH 253/283] chore(release): publish 8.46.0 --- CHANGELOG.md | 36 +++++++ packages/ast-spec/CHANGELOG.md | 18 ++++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 28 ++++++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 12 +++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 12 +++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 12 +++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 12 +++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 20 ++++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 12 +++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 298 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b8ab0a05202..428ab6db594b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,39 @@ +## 8.46.0 (2025-10-06) + +### 🚀 Features + +- **eslint-plugin:** [no-unsafe-member-access] add allowOptionalChaining option ([#11659](https://github.com/typescript-eslint/typescript-eslint/pull/11659)) +- **eslint-plugin-internal:** [no-dynamic-tests] new internal Lint rule to ban dynamic syntax in generating tests ([#11323](https://github.com/typescript-eslint/typescript-eslint/pull/11323)) +- **rule-schema-to-typescript-types:** clean up and make public ([#11633](https://github.com/typescript-eslint/typescript-eslint/pull/11633)) +- **typescript-eslint:** export util types ([#10848](https://github.com/typescript-eslint/typescript-eslint/pull/10848), [#10849](https://github.com/typescript-eslint/typescript-eslint/pull/10849)) +- **typescript-estree:** mention file specifics in project service allowDefaultProject error ([#11635](https://github.com/typescript-eslint/typescript-eslint/pull/11635)) +- **typescript-estree:** private identifiers can only appear on LHS of in expressions ([#9232](https://github.com/typescript-eslint/typescript-eslint/pull/9232)) + +### 🩹 Fixes + +- **eslint-plugin:** [no-floating-promises] remove excess parentheses in suggestions ([#11487](https://github.com/typescript-eslint/typescript-eslint/pull/11487)) +- **eslint-plugin:** [unbound-method] improve wording around `this: void` and binding ([#11634](https://github.com/typescript-eslint/typescript-eslint/pull/11634)) +- **eslint-plugin:** [no-deprecated] ignore deprecated `export import`s ([#11603](https://github.com/typescript-eslint/typescript-eslint/pull/11603)) +- **eslint-plugin:** removed error type previously deprecated ([#11674](https://github.com/typescript-eslint/typescript-eslint/pull/11674)) +- **eslint-plugin:** [prefer-readonly-parameter-types] ignore tagged primitives ([#11660](https://github.com/typescript-eslint/typescript-eslint/pull/11660)) +- **rule-tester:** deprecate TestCaseError#type and LintMessage#nodeType ([#11628](https://github.com/typescript-eslint/typescript-eslint/pull/11628)) +- **typescript-estree:** forbid `abstract` modifier in object methods ([#11656](https://github.com/typescript-eslint/typescript-eslint/pull/11656)) +- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](https://github.com/typescript-eslint/typescript-eslint/pull/11657)) + +### ❤️ Thank You + +- fisker Cheung @fisker +- Josh Goldberg ✨ +- Joshua Chen +- Kirk Waiblinger @kirkwaiblinger +- Mark de Dios @peanutenthusiast +- Mister-Hope @Mister-Hope +- Richard Torres @richardtorres314 +- Victor Genaev @mainframev +- Younsang Na @nayounsang + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index bc0e07c46d14..c6cd653d3a17 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,21 @@ +## 8.46.0 (2025-10-06) + +### 🚀 Features + +- **typescript-estree:** private identifiers can only appear on LHS of in expressions ([#9232](https://github.com/typescript-eslint/typescript-eslint/pull/9232)) + +### 🩹 Fixes + +- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](https://github.com/typescript-eslint/typescript-eslint/pull/11657)) +- **typescript-estree:** forbid `abstract` modifier in object methods ([#11656](https://github.com/typescript-eslint/typescript-eslint/pull/11656)) + +### ❤️ Thank You + +- fisker Cheung @fisker +- Joshua Chen + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) ### 🩹 Fixes diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index c043b77b4dbb..bdd7c564bf29 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.45.0", + "version": "8.46.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 1b53ed8e8843..7be59f6e0e40 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,31 @@ +## 8.46.0 (2025-10-06) + +### 🚀 Features + +- **eslint-plugin:** [no-unsafe-member-access] add allowOptionalChaining option ([#11659](https://github.com/typescript-eslint/typescript-eslint/pull/11659)) +- **rule-schema-to-typescript-types:** clean up and make public ([#11633](https://github.com/typescript-eslint/typescript-eslint/pull/11633)) + +### 🩹 Fixes + +- **eslint-plugin:** [prefer-readonly-parameter-types] ignore tagged primitives ([#11660](https://github.com/typescript-eslint/typescript-eslint/pull/11660)) +- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](https://github.com/typescript-eslint/typescript-eslint/pull/11657)) +- **eslint-plugin:** removed error type previously deprecated ([#11674](https://github.com/typescript-eslint/typescript-eslint/pull/11674)) +- **eslint-plugin:** [no-deprecated] ignore deprecated `export import`s ([#11603](https://github.com/typescript-eslint/typescript-eslint/pull/11603)) +- **eslint-plugin:** [unbound-method] improve wording around `this: void` and binding ([#11634](https://github.com/typescript-eslint/typescript-eslint/pull/11634)) +- **rule-tester:** deprecate TestCaseError#type and LintMessage#nodeType ([#11628](https://github.com/typescript-eslint/typescript-eslint/pull/11628)) +- **eslint-plugin:** [no-floating-promises] remove excess parentheses in suggestions ([#11487](https://github.com/typescript-eslint/typescript-eslint/pull/11487)) + +### ❤️ Thank You + +- fisker Cheung @fisker +- Josh Goldberg ✨ +- Kirk Waiblinger @kirkwaiblinger +- Mark de Dios @peanutenthusiast +- Richard Torres @richardtorres314 +- Victor Genaev @mainframev + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) ### 🚀 Features diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 84bce94a40c2..d4e233309acd 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.45.0", + "version": "8.46.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.45.0", - "@typescript-eslint/type-utils": "8.45.0", - "@typescript-eslint/utils": "8.45.0", - "@typescript-eslint/visitor-keys": "8.45.0", + "@typescript-eslint/scope-manager": "8.46.0", + "@typescript-eslint/type-utils": "8.46.0", + "@typescript-eslint/utils": "8.46.0", + "@typescript-eslint/visitor-keys": "8.46.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.45.0", - "@typescript-eslint/rule-tester": "8.45.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.46.0", + "@typescript-eslint/rule-tester": "8.46.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.45.0", + "@typescript-eslint/parser": "^8.46.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 148e3265e057..45579e3b5d5d 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.0 (2025-10-06) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index aa7f345fb173..ed6e1efc32d9 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.45.0", + "version": "8.46.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.45.0", - "@typescript-eslint/types": "8.45.0", - "@typescript-eslint/typescript-estree": "8.45.0", - "@typescript-eslint/visitor-keys": "8.45.0", + "@typescript-eslint/scope-manager": "8.46.0", + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/typescript-estree": "8.46.0", + "@typescript-eslint/visitor-keys": "8.46.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 7217085d8e88..23925751fe40 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.0 (2025-10-06) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 8954ebe69165..7de623639b7f 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.45.0", + "version": "8.46.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.45.0", - "@typescript-eslint/types": "^8.45.0", + "@typescript-eslint/tsconfig-utils": "^8.46.0", + "@typescript-eslint/types": "^8.46.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 17977ab0492a..f7280aeb60ec 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.46.0 (2025-10-06) + +### 🚀 Features + +- **rule-schema-to-typescript-types:** clean up and make public ([#11633](https://github.com/typescript-eslint/typescript-eslint/pull/11633)) + +### ❤️ Thank You + +- Josh Goldberg ✨ + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 44432badd288..b47a3fb329ab 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.45.0", + "version": "8.46.0", "description": "Converts ESLint rule schemas to equivalent TypeScript type strings.", "type": "module", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.45.0", - "@typescript-eslint/utils": "8.45.0", + "@typescript-eslint/type-utils": "8.46.0", + "@typescript-eslint/utils": "8.46.0", "natural-compare": "^1.4.0" }, "devDependencies": { diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 3c613e796f41..6d53afcf7509 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.46.0 (2025-10-06) + +### 🩹 Fixes + +- **rule-tester:** deprecate TestCaseError#type and LintMessage#nodeType ([#11628](https://github.com/typescript-eslint/typescript-eslint/pull/11628)) + +### ❤️ Thank You + +- Mark de Dios @peanutenthusiast + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) ### 🚀 Features diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 87eccdd8595f..b12bbd465ab6 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.45.0", + "version": "8.46.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.45.0", - "@typescript-eslint/typescript-estree": "8.45.0", - "@typescript-eslint/utils": "8.45.0", + "@typescript-eslint/parser": "8.46.0", + "@typescript-eslint/typescript-estree": "8.46.0", + "@typescript-eslint/utils": "8.46.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 2caf9fb9dc4a..9c273f69cb7b 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.0 (2025-10-06) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index fb9c03271b02..7bf9f5c6c957 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.45.0", + "version": "8.46.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.45.0", - "@typescript-eslint/visitor-keys": "8.45.0" + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/visitor-keys": "8.46.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.45.0", + "@typescript-eslint/typescript-estree": "8.46.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index c46f153905b3..56e6067e86e5 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.0 (2025-10-06) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 286854329c8b..0a489b1036ca 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.45.0", + "version": "8.46.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 6f95accd3e83..e3173aa353e5 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.46.0 (2025-10-06) + +### 🩹 Fixes + +- **eslint-plugin:** [prefer-readonly-parameter-types] ignore tagged primitives ([#11660](https://github.com/typescript-eslint/typescript-eslint/pull/11660)) + +### ❤️ Thank You + +- Josh Goldberg ✨ + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 9816f01f37cb..fb7d9b0df675 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.45.0", + "version": "8.46.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.45.0", - "@typescript-eslint/typescript-estree": "8.45.0", - "@typescript-eslint/utils": "8.45.0", + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/typescript-estree": "8.46.0", + "@typescript-eslint/utils": "8.46.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.45.0", + "@typescript-eslint/parser": "8.46.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 06a9fadf74df..a8b32d0d089e 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.0 (2025-10-06) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 272df4eddb9c..95466be524bb 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.45.0", + "version": "8.46.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 307c04862040..f16f92e76f8b 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.46.0 (2025-10-06) + +### 🚀 Features + +- **typescript-eslint:** export util types ([#10848](https://github.com/typescript-eslint/typescript-eslint/pull/10848), [#10849](https://github.com/typescript-eslint/typescript-eslint/pull/10849)) + +### ❤️ Thank You + +- Mister-Hope @Mister-Hope + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index c7767100da6c..19132a1a4198 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.45.0", + "version": "8.46.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.45.0", - "@typescript-eslint/parser": "8.45.0", - "@typescript-eslint/typescript-estree": "8.45.0", - "@typescript-eslint/utils": "8.45.0" + "@typescript-eslint/eslint-plugin": "8.46.0", + "@typescript-eslint/parser": "8.46.0", + "@typescript-eslint/typescript-estree": "8.46.0", + "@typescript-eslint/utils": "8.46.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 0230830c43ef..9f63c47283f1 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,23 @@ +## 8.46.0 (2025-10-06) + +### 🚀 Features + +- **typescript-estree:** private identifiers can only appear on LHS of in expressions ([#9232](https://github.com/typescript-eslint/typescript-eslint/pull/9232)) +- **typescript-estree:** mention file specifics in project service allowDefaultProject error ([#11635](https://github.com/typescript-eslint/typescript-eslint/pull/11635)) + +### 🩹 Fixes + +- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](https://github.com/typescript-eslint/typescript-eslint/pull/11657)) +- **typescript-estree:** forbid `abstract` modifier in object methods ([#11656](https://github.com/typescript-eslint/typescript-eslint/pull/11656)) + +### ❤️ Thank You + +- fisker Cheung @fisker +- Josh Goldberg ✨ +- Joshua Chen + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) This was a version bump only for typescript-estree to align it with other projects, there were no code changes. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 7f3e72f55f35..29d8b7f4e88b 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.45.0", + "version": "8.46.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.45.0", - "@typescript-eslint/tsconfig-utils": "8.45.0", - "@typescript-eslint/types": "8.45.0", - "@typescript-eslint/visitor-keys": "8.45.0", + "@typescript-eslint/project-service": "8.46.0", + "@typescript-eslint/tsconfig-utils": "8.46.0", + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/visitor-keys": "8.46.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index fb4091a5f528..1551ec7a7ab8 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.46.0 (2025-10-06) + +### 🩹 Fixes + +- **rule-tester:** deprecate TestCaseError#type and LintMessage#nodeType ([#11628](https://github.com/typescript-eslint/typescript-eslint/pull/11628)) + +### ❤️ Thank You + +- Mark de Dios @peanutenthusiast + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) ### 🚀 Features diff --git a/packages/utils/package.json b/packages/utils/package.json index 0b189d847863..21546d4601ed 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.45.0", + "version": "8.46.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.45.0", - "@typescript-eslint/types": "8.45.0", - "@typescript-eslint/typescript-estree": "8.45.0" + "@typescript-eslint/scope-manager": "8.46.0", + "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/typescript-estree": "8.46.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index f04350762015..4ead0db9eaa4 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.0 (2025-10-06) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.45.0 (2025-09-29) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index da60c60208f8..156e3591061e 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.45.0", + "version": "8.46.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.45.0", + "@typescript-eslint/types": "8.46.0", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 7fd4a2ff718d..abe0aa56244e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5910,19 +5910,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.45.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.46.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.45.0 - "@typescript-eslint/rule-tester": 8.45.0 - "@typescript-eslint/scope-manager": 8.45.0 - "@typescript-eslint/type-utils": 8.45.0 - "@typescript-eslint/utils": 8.45.0 - "@typescript-eslint/visitor-keys": 8.45.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.46.0 + "@typescript-eslint/rule-tester": 8.46.0 + "@typescript-eslint/scope-manager": 8.46.0 + "@typescript-eslint/type-utils": 8.46.0 + "@typescript-eslint/utils": 8.46.0 + "@typescript-eslint/visitor-keys": 8.46.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5945,7 +5945,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.45.0 + "@typescript-eslint/parser": ^8.46.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -5961,14 +5961,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.45.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.46.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.45.0 - "@typescript-eslint/types": 8.45.0 - "@typescript-eslint/typescript-estree": 8.45.0 - "@typescript-eslint/visitor-keys": 8.45.0 + "@typescript-eslint/scope-manager": 8.46.0 + "@typescript-eslint/types": 8.46.0 + "@typescript-eslint/typescript-estree": 8.46.0 + "@typescript-eslint/visitor-keys": 8.46.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -5982,12 +5982,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.45.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.46.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.45.0 - "@typescript-eslint/types": ^8.45.0 + "@typescript-eslint/tsconfig-utils": ^8.46.0 + "@typescript-eslint/types": ^8.46.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -5998,12 +5998,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.45.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.46.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.45.0 - "@typescript-eslint/utils": 8.45.0 + "@typescript-eslint/type-utils": 8.46.0 + "@typescript-eslint/utils": 8.46.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -6013,15 +6013,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.45.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.46.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.45.0 - "@typescript-eslint/typescript-estree": 8.45.0 - "@typescript-eslint/utils": 8.45.0 + "@typescript-eslint/parser": 8.46.0 + "@typescript-eslint/typescript-estree": 8.46.0 + "@typescript-eslint/utils": 8.46.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -6036,13 +6036,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.45.0, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.46.0, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.45.0 - "@typescript-eslint/typescript-estree": 8.45.0 - "@typescript-eslint/visitor-keys": 8.45.0 + "@typescript-eslint/types": 8.46.0 + "@typescript-eslint/typescript-estree": 8.46.0 + "@typescript-eslint/visitor-keys": 8.46.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -6053,7 +6053,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.45.0, @typescript-eslint/tsconfig-utils@^8.45.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.46.0, @typescript-eslint/tsconfig-utils@^8.46.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -6066,14 +6066,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.45.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.46.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.45.0 - "@typescript-eslint/types": 8.45.0 - "@typescript-eslint/typescript-estree": 8.45.0 - "@typescript-eslint/utils": 8.45.0 + "@typescript-eslint/parser": 8.46.0 + "@typescript-eslint/types": 8.46.0 + "@typescript-eslint/typescript-estree": 8.46.0 + "@typescript-eslint/utils": 8.46.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6088,7 +6088,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.45.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.45.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.46.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.46.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6162,15 +6162,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.45.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.46.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.45.0 - "@typescript-eslint/tsconfig-utils": 8.45.0 - "@typescript-eslint/types": 8.45.0 - "@typescript-eslint/visitor-keys": 8.45.0 + "@typescript-eslint/project-service": 8.46.0 + "@typescript-eslint/tsconfig-utils": 8.46.0 + "@typescript-eslint/types": 8.46.0 + "@typescript-eslint/visitor-keys": 8.46.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6188,14 +6188,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.45.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.46.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.45.0 - "@typescript-eslint/types": 8.45.0 - "@typescript-eslint/typescript-estree": 8.45.0 + "@typescript-eslint/scope-manager": 8.46.0 + "@typescript-eslint/types": 8.46.0 + "@typescript-eslint/typescript-estree": 8.46.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6207,11 +6207,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.45.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.46.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.45.0 + "@typescript-eslint/types": 8.46.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19669,10 +19669,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.45.0 - "@typescript-eslint/parser": 8.45.0 - "@typescript-eslint/typescript-estree": 8.45.0 - "@typescript-eslint/utils": 8.45.0 + "@typescript-eslint/eslint-plugin": 8.46.0 + "@typescript-eslint/parser": 8.46.0 + "@typescript-eslint/typescript-estree": 8.46.0 + "@typescript-eslint/utils": 8.46.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From 8b0520832d32a9f80911007693657760a5ff98cc Mon Sep 17 00:00:00 2001 From: Abraham Guo Date: Mon, 6 Oct 2025 20:54:58 -0500 Subject: [PATCH 254/283] fix(ast-spec): cleanup `TSLiteralType` (#11624) --- .../src/expression/UnaryExpression/spec.ts | 28 +++++++++++++++++-- .../ast-spec/src/type/TSLiteralType/spec.ts | 13 +++++++-- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/packages/ast-spec/src/expression/UnaryExpression/spec.ts b/packages/ast-spec/src/expression/UnaryExpression/spec.ts index b5733e5ed85a..e68cc35047d0 100644 --- a/packages/ast-spec/src/expression/UnaryExpression/spec.ts +++ b/packages/ast-spec/src/expression/UnaryExpression/spec.ts @@ -1,7 +1,31 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { UnaryExpressionBase } from '../../base/UnaryExpressionBase'; -export interface UnaryExpression extends UnaryExpressionBase { +interface UnaryExpressionSpecific + extends UnaryExpressionBase { type: AST_NODE_TYPES.UnaryExpression; - operator: '!' | '+' | '-' | 'delete' | 'typeof' | 'void' | '~'; + operator: T; } + +export type UnaryExpressionNot = UnaryExpressionSpecific<'!'>; + +export type UnaryExpressionPlus = UnaryExpressionSpecific<'+'>; + +export type UnaryExpressionMinus = UnaryExpressionSpecific<'-'>; + +export type UnaryExpressionDelete = UnaryExpressionSpecific<'delete'>; + +export type UnaryExpressionTypeof = UnaryExpressionSpecific<'typeof'>; + +export type UnaryExpressionVoid = UnaryExpressionSpecific<'void'>; + +export type UnaryExpressionBitwiseNot = UnaryExpressionSpecific<'~'>; + +export type UnaryExpression = + | UnaryExpressionBitwiseNot + | UnaryExpressionDelete + | UnaryExpressionMinus + | UnaryExpressionNot + | UnaryExpressionPlus + | UnaryExpressionTypeof + | UnaryExpressionVoid; diff --git a/packages/ast-spec/src/type/TSLiteralType/spec.ts b/packages/ast-spec/src/type/TSLiteralType/spec.ts index 39f6ae0d2961..7eca3ee2d9e5 100644 --- a/packages/ast-spec/src/type/TSLiteralType/spec.ts +++ b/packages/ast-spec/src/type/TSLiteralType/spec.ts @@ -1,10 +1,17 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; -import type { UnaryExpression } from '../../expression/UnaryExpression/spec'; -import type { UpdateExpression } from '../../expression/UpdateExpression/spec'; +import type { NullLiteral } from '../../expression/literal/NullLiteral/spec'; +import type { RegExpLiteral } from '../../expression/literal/RegExpLiteral/spec'; +import type { + UnaryExpressionMinus, + UnaryExpressionPlus, +} from '../../expression/UnaryExpression/spec'; import type { LiteralExpression } from '../../unions/LiteralExpression'; export interface TSLiteralType extends BaseNode { type: AST_NODE_TYPES.TSLiteralType; - literal: LiteralExpression | UnaryExpression | UpdateExpression; + literal: + | Exclude + | UnaryExpressionMinus + | UnaryExpressionPlus; } From 73003bfd143c1915c6f7a71741143c6be742df12 Mon Sep 17 00:00:00 2001 From: mdm317 Date: Tue, 7 Oct 2025 12:01:58 +0900 Subject: [PATCH 255/283] fix(eslint-plugin): [prefer-optional-chain] include mixed "nullish comparison style" chains in checks (#11533) --- .../src/rules/no-base-to-string.ts | 1 + .../src/rules/prefer-includes.ts | 2 +- .../analyzeChain.ts | 207 +- .../gatherLogicalOperands.ts | 177 +- .../src/rules/prefer-optional-chain.ts | 11 + .../rules/prefer-string-starts-ends-with.ts | 2 +- .../prefer-optional-chain.test.ts | 1832 ++++++++++++++++- 7 files changed, 2075 insertions(+), 157 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts index 0dbcfd2825ef..48fca65676ed 100644 --- a/packages/eslint-plugin/src/rules/no-base-to-string.ts +++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts @@ -317,6 +317,7 @@ export default createRule({ const declarations = toString.getDeclarations(); + // eslint-disable-next-line @typescript-eslint/prefer-optional-chain if (declarations == null || declarations.length !== 1) { // If there are multiple declarations, at least one of them must not be // the default object toString. diff --git a/packages/eslint-plugin/src/rules/prefer-includes.ts b/packages/eslint-plugin/src/rules/prefer-includes.ts index 6825fc042a6d..4da95f8f9866 100644 --- a/packages/eslint-plugin/src/rules/prefer-includes.ts +++ b/packages/eslint-plugin/src/rules/prefer-includes.ts @@ -39,7 +39,7 @@ export default createRule({ function isNumber(node: TSESTree.Node, value: number): boolean { const evaluated = getStaticValue(node, globalScope); - return evaluated != null && evaluated.value === value; + return evaluated?.value === value; } function isPositiveCheck(node: TSESTree.BinaryExpression): boolean { diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/analyzeChain.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/analyzeChain.ts index c4364765f92c..84c1ca6e9593 100644 --- a/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/analyzeChain.ts +++ b/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/analyzeChain.ts @@ -10,10 +10,10 @@ import type { } from '@typescript-eslint/utils/ts-eslint'; import { AST_NODE_TYPES } from '@typescript-eslint/utils'; -import { unionConstituents } from 'ts-api-utils'; +import { isFalsyType, unionConstituents } from 'ts-api-utils'; import * as ts from 'typescript'; -import type { ValidOperand } from './gatherLogicalOperands'; +import type { LastChainOperand, ValidOperand } from './gatherLogicalOperands'; import type { PreferOptionalChainMessageIds, PreferOptionalChainOptions, @@ -31,7 +31,7 @@ import { } from '../../util'; import { checkNullishAndReport } from './checkNullishAndReport'; import { compareNodes, NodeComparisonResult } from './compareNodes'; -import { NullishComparisonType } from './gatherLogicalOperands'; +import { ComparisonType, NullishComparisonType } from './gatherLogicalOperands'; function includesType( parserServices: ParserServicesWithTypeInformation, @@ -48,6 +48,109 @@ function includesType( return false; } +function isAlwaysTruthyOperand( + comparedName: TSESTree.Node, + nullishComparisonType: NullishComparisonType, + parserServices: ParserServicesWithTypeInformation, +): boolean { + const ANY_UNKNOWN_FLAGS = ts.TypeFlags.Any | ts.TypeFlags.Unknown; + const comparedNameType = parserServices.getTypeAtLocation(comparedName); + + if (isTypeFlagSet(comparedNameType, ANY_UNKNOWN_FLAGS)) { + return false; + } + switch (nullishComparisonType) { + case NullishComparisonType.Boolean: + case NullishComparisonType.NotBoolean: { + const types = unionConstituents(comparedNameType); + return types.every(type => !isFalsyType(type)); + } + case NullishComparisonType.NotStrictEqualUndefined: + case NullishComparisonType.NotStrictEqualNull: + case NullishComparisonType.StrictEqualNull: + case NullishComparisonType.StrictEqualUndefined: + return !isTypeFlagSet( + comparedNameType, + ts.TypeFlags.Null | ts.TypeFlags.Undefined, + ); + case NullishComparisonType.NotEqualNullOrUndefined: + case NullishComparisonType.EqualNullOrUndefined: + return !isTypeFlagSet( + comparedNameType, + ts.TypeFlags.Null | ts.TypeFlags.Undefined, + ); + } +} + +function isValidAndLastChainOperand( + ComparisonValueType: TSESTree.Node, + comparisonType: ComparisonType, + parserServices: ParserServicesWithTypeInformation, +) { + const type = parserServices.getTypeAtLocation(ComparisonValueType); + const ANY_UNKNOWN_FLAGS = ts.TypeFlags.Any | ts.TypeFlags.Unknown; + + const types = unionConstituents(type); + switch (comparisonType) { + case ComparisonType.Equal: { + const isNullish = types.some(t => + isTypeFlagSet( + t, + ANY_UNKNOWN_FLAGS | ts.TypeFlags.Null | ts.TypeFlags.Undefined, + ), + ); + return !isNullish; + } + case ComparisonType.StrictEqual: { + const isUndefined = types.some(t => + isTypeFlagSet(t, ANY_UNKNOWN_FLAGS | ts.TypeFlags.Undefined), + ); + return !isUndefined; + } + case ComparisonType.NotStrictEqual: { + return types.every(t => isTypeFlagSet(t, ts.TypeFlags.Undefined)); + } + case ComparisonType.NotEqual: { + return types.every(t => + isTypeFlagSet(t, ts.TypeFlags.Undefined | ts.TypeFlags.Null), + ); + } + } +} +function isValidOrLastChainOperand( + ComparisonValueType: TSESTree.Node, + comparisonType: ComparisonType, + parserServices: ParserServicesWithTypeInformation, +) { + const type = parserServices.getTypeAtLocation(ComparisonValueType); + const ANY_UNKNOWN_FLAGS = ts.TypeFlags.Any | ts.TypeFlags.Unknown; + + const types = unionConstituents(type); + switch (comparisonType) { + case ComparisonType.NotEqual: { + const isNullish = types.some(t => + isTypeFlagSet( + t, + ANY_UNKNOWN_FLAGS | ts.TypeFlags.Null | ts.TypeFlags.Undefined, + ), + ); + return !isNullish; + } + case ComparisonType.NotStrictEqual: { + const isUndefined = types.some(t => + isTypeFlagSet(t, ANY_UNKNOWN_FLAGS | ts.TypeFlags.Undefined), + ); + return !isUndefined; + } + case ComparisonType.Equal: + return types.every(t => + isTypeFlagSet(t, ts.TypeFlags.Undefined | ts.TypeFlags.Null), + ); + case ComparisonType.StrictEqual: + return types.every(t => isTypeFlagSet(t, ts.TypeFlags.Undefined)); + } +} + // I hate that these functions are identical aside from the enum values used // I can't think of a good way to reuse the code here in a way that will preserve // the type safety and simplicity. @@ -65,18 +168,7 @@ const analyzeAndChainOperand: OperandAnalyzer = ( chain, ) => { switch (operand.comparisonType) { - case NullishComparisonType.Boolean: { - const nextOperand = chain.at(index + 1); - if ( - nextOperand?.comparisonType === - NullishComparisonType.NotStrictEqualNull && - operand.comparedName.type === AST_NODE_TYPES.Identifier - ) { - return null; - } - return [operand]; - } - + case NullishComparisonType.Boolean: case NullishComparisonType.NotEqualNullOrUndefined: return [operand]; @@ -92,7 +184,8 @@ const analyzeAndChainOperand: OperandAnalyzer = ( return [operand, nextOperand]; } if ( - includesType( + nextOperand && + !includesType( parserServices, operand.comparedName, ts.TypeFlags.Undefined, @@ -101,10 +194,9 @@ const analyzeAndChainOperand: OperandAnalyzer = ( // we know the next operand is not an `undefined` check and that this // operand includes `undefined` - which means that making this an // optional chain would change the runtime behavior of the expression - return null; + return [operand]; } - - return [operand]; + return null; } case NullishComparisonType.NotStrictEqualUndefined: { @@ -156,6 +248,7 @@ const analyzeOrChainOperand: OperandAnalyzer = ( ) { return [operand, nextOperand]; } + if ( includesType( parserServices, @@ -168,7 +261,6 @@ const analyzeOrChainOperand: OperandAnalyzer = ( // optional chain would change the runtime behavior of the expression return null; } - return [operand]; } @@ -207,7 +299,7 @@ const analyzeOrChainOperand: OperandAnalyzer = ( * @returns The range to report. */ function getReportRange( - chain: ValidOperand[], + chain: { node: TSESTree.Expression }[], boundary: TSESTree.Range, sourceCode: SourceCode, ): TSESTree.Range { @@ -247,8 +339,10 @@ function getReportDescriptor( node: TSESTree.Node, operator: '&&' | '||', options: PreferOptionalChainOptions, - chain: ValidOperand[], + subChain: ValidOperand[], + lastChain: (LastChainOperand | ValidOperand) | undefined, ): ReportDescriptor { + const chain = lastChain ? [...subChain, lastChain] : subChain; const lastOperand = chain[chain.length - 1]; let useSuggestionFixer: boolean; @@ -264,6 +358,7 @@ function getReportDescriptor( // `undefined`, or else we're going to change the final type - which is // unsafe and might cause downstream type errors. else if ( + lastChain || lastOperand.comparisonType === NullishComparisonType.EqualNullOrUndefined || lastOperand.comparisonType === NullishComparisonType.NotEqualNullOrUndefined || @@ -521,10 +616,11 @@ export function analyzeChain( node: TSESTree.Node, operator: TSESTree.LogicalExpression['operator'], chain: ValidOperand[], + lastChainOperand?: LastChainOperand, ): void { // need at least 2 operands in a chain for it to be a chain if ( - chain.length <= 1 || + chain.length + (lastChainOperand ? 1 : 0) <= 1 || /* istanbul ignore next -- previous checks make this unreachable, but keep it for exhaustiveness check */ operator === '??' ) { @@ -544,16 +640,20 @@ export function analyzeChain( // Things like x !== null && x !== undefined have two nodes, but they are // one logical unit here, so we'll allow them to be grouped. let subChain: (readonly ValidOperand[] | ValidOperand)[] = []; + let lastChain: LastChainOperand | ValidOperand | undefined = undefined; const maybeReportThenReset = ( newChainSeed?: readonly [ValidOperand, ...ValidOperand[]], ): void => { - if (subChain.length > 1) { + if (subChain.length + (lastChain ? 1 : 0) > 1) { const subChainFlat = subChain.flat(); + const maybeNullishNodes = lastChain + ? subChainFlat.map(({ node }) => node) + : subChainFlat.slice(0, -1).map(({ node }) => node); checkNullishAndReport( context, parserServices, options, - subChainFlat.slice(0, -1).map(({ node }) => node), + maybeNullishNodes, getReportDescriptor( context.sourceCode, parserServices, @@ -561,6 +661,7 @@ export function analyzeChain( operator, options, subChainFlat, + lastChain, ), ); } @@ -578,6 +679,7 @@ export function analyzeChain( // ^^^^^^^^^^^ newChainSeed // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ second chain subChain = newChainSeed ? [newChainSeed] : []; + lastChain = undefined; }; for (let i = 0; i < chain.length; i += 1) { @@ -595,6 +697,35 @@ export function analyzeChain( // ^^^^^^^ invalid OR chain logical, but still part of // the chain for combination purposes + if (lastOperand) { + const comparisonResult = compareNodes( + lastOperand.comparedName, + operand.comparedName, + ); + switch (operand.comparisonType) { + case NullishComparisonType.StrictEqualUndefined: + case NullishComparisonType.NotStrictEqualUndefined: { + if (comparisonResult === NodeComparisonResult.Subset) { + lastChain = operand; + } + break; + } + case NullishComparisonType.StrictEqualNull: + case NullishComparisonType.NotStrictEqualNull: { + if ( + comparisonResult === NodeComparisonResult.Subset && + isAlwaysTruthyOperand( + lastOperand.comparedName, + lastOperand.comparisonType, + parserServices, + ) + ) { + lastChain = operand; + } + break; + } + } + } maybeReportThenReset(); continue; } @@ -624,7 +755,33 @@ export function analyzeChain( subChain.push(currentOperand); } } + const lastOperand = subChain.flat().at(-1); + if (lastOperand && lastChainOperand) { + const comparisonResult = compareNodes( + lastOperand.comparedName, + lastChainOperand.comparedName, + ); + const isValidLastChainOperand = + operator === '&&' + ? isValidAndLastChainOperand + : isValidOrLastChainOperand; + if ( + comparisonResult === NodeComparisonResult.Subset && + (isAlwaysTruthyOperand( + lastOperand.comparedName, + lastOperand.comparisonType, + parserServices, + ) || + isValidLastChainOperand( + lastChainOperand.comparisonValue, + lastChainOperand.comparisonType, + parserServices, + )) + ) { + lastChain = lastChainOperand; + } + } // check the leftovers maybeReportThenReset(); } diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/gatherLogicalOperands.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/gatherLogicalOperands.ts index fdb6996c612d..9092e1e67a75 100644 --- a/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/gatherLogicalOperands.ts +++ b/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/gatherLogicalOperands.ts @@ -25,6 +25,7 @@ const enum ComparisonValueType { } export const enum OperandValidity { Valid = 'Valid', + Last = 'Last', Invalid = 'Invalid', } export const enum NullishComparisonType { @@ -48,6 +49,12 @@ export const enum NullishComparisonType { /** `x` */ Boolean = 'Boolean', // eslint-disable-line @typescript-eslint/internal/prefer-ast-types-enum } +export const enum ComparisonType { + NotEqual = 'NotEqual', + Equal = 'Equal', + NotStrictEqual = 'NotStrictEqual', + StrictEqual = 'StrictEqual', +} export interface ValidOperand { comparedName: TSESTree.Node; comparisonType: NullishComparisonType; @@ -55,10 +62,18 @@ export interface ValidOperand { node: TSESTree.Expression; type: OperandValidity.Valid; } +export interface LastChainOperand { + comparedName: TSESTree.Node; + comparisonType: ComparisonType; + comparisonValue: TSESTree.Node; + isYoda: boolean; + node: TSESTree.BinaryExpression; + type: OperandValidity.Last; +} export interface InvalidOperand { type: OperandValidity.Invalid; } -type Operand = InvalidOperand | ValidOperand; +type Operand = InvalidOperand | LastChainOperand | ValidOperand; const NULLISH_FLAGS = ts.TypeFlags.Null | ts.TypeFlags.Undefined; function isValidFalseBooleanCheckType( @@ -182,61 +197,101 @@ export function gatherLogicalOperands( continue; } - switch (operand.operator) { - case '!=': - case '==': - if ( - comparedValue === ComparisonValueType.Null || - comparedValue === ComparisonValueType.Undefined - ) { - // x == null, x == undefined - result.push({ - comparedName: comparedExpression, - comparisonType: operand.operator.startsWith('!') - ? NullishComparisonType.NotEqualNullOrUndefined - : NullishComparisonType.EqualNullOrUndefined, - isYoda, - node: operand, - type: OperandValidity.Valid, - }); - continue; - } - // x == something :( - result.push({ type: OperandValidity.Invalid }); - continue; - - case '!==': - case '===': { - const comparedName = comparedExpression; - switch (comparedValue) { - case ComparisonValueType.Null: + if (operand.operator.startsWith('!') !== (node.operator === '||')) { + switch (operand.operator) { + case '!=': + case '==': + if ( + comparedValue === ComparisonValueType.Null || + comparedValue === ComparisonValueType.Undefined + ) { + // x == null, x == undefined result.push({ - comparedName, + comparedName: comparedExpression, comparisonType: operand.operator.startsWith('!') - ? NullishComparisonType.NotStrictEqualNull - : NullishComparisonType.StrictEqualNull, + ? NullishComparisonType.NotEqualNullOrUndefined + : NullishComparisonType.EqualNullOrUndefined, isYoda, node: operand, type: OperandValidity.Valid, }); continue; + } + break; + + case '!==': + case '===': { + const comparedName = comparedExpression; + switch (comparedValue) { + case ComparisonValueType.Null: + result.push({ + comparedName, + comparisonType: operand.operator.startsWith('!') + ? NullishComparisonType.NotStrictEqualNull + : NullishComparisonType.StrictEqualNull, + isYoda, + node: operand, + type: OperandValidity.Valid, + }); + continue; + + case ComparisonValueType.Undefined: + result.push({ + comparedName, + comparisonType: operand.operator.startsWith('!') + ? NullishComparisonType.NotStrictEqualUndefined + : NullishComparisonType.StrictEqualUndefined, + isYoda, + node: operand, + type: OperandValidity.Valid, + }); + continue; + } + } + } + } - case ComparisonValueType.Undefined: - result.push({ - comparedName, - comparisonType: operand.operator.startsWith('!') - ? NullishComparisonType.NotStrictEqualUndefined - : NullishComparisonType.StrictEqualUndefined, - isYoda, - node: operand, - type: OperandValidity.Valid, - }); - continue; + // x == something :( + // x === something :( + // x != something :( + // x !== something :( + const binaryComparisonChain = getBinaryComparisonChain(operand); + if (binaryComparisonChain) { + const { comparedName, comparedValue, isYoda } = binaryComparisonChain; + + switch (operand.operator) { + case '==': + case '===': { + const comparisonType = + operand.operator === '==' + ? ComparisonType.Equal + : ComparisonType.StrictEqual; + result.push({ + comparedName, + comparisonType, + comparisonValue: comparedValue, + isYoda, + node: operand, + type: OperandValidity.Last, + }); + continue; + } - default: - // x === something :( - result.push({ type: OperandValidity.Invalid }); - continue; + case '!=': + case '!==': { + const comparisonType = + operand.operator === '!=' + ? ComparisonType.NotEqual + : ComparisonType.NotStrictEqual; + result.push({ + comparedName, + comparisonType, + comparisonValue: comparedValue, + isYoda, + node: operand, + type: OperandValidity.Last, + }); + continue; } } } @@ -374,4 +429,32 @@ export function gatherLogicalOperands( return null; } + + function getBinaryComparisonChain(node: TSESTree.BinaryExpression) { + const { left, right } = node; + let isYoda = false; + const isLeftMemberExpression = + left.type === AST_NODE_TYPES.MemberExpression; + const isRightMemberExpression = + right.type === AST_NODE_TYPES.MemberExpression; + if (isLeftMemberExpression && !isRightMemberExpression) { + const [comparedName, comparedValue] = [left, right]; + return { + comparedName, + comparedValue, + isYoda, + }; + } + if (!isLeftMemberExpression && isRightMemberExpression) { + const [comparedName, comparedValue] = [right, left]; + + isYoda = true; + return { + comparedName, + comparedValue, + isYoda, + }; + } + return null; + } } diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts index 241f4240e78d..c3d61c0f0f70 100644 --- a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts +++ b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts @@ -138,6 +138,17 @@ export default createRule< currentChain, ); currentChain = []; + } else if (operand.type === OperandValidity.Last) { + analyzeChain( + context, + parserServices, + options, + node, + node.operator, + currentChain, + operand, + ); + currentChain = []; } else { currentChain.push(operand); } diff --git a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts index 39125b9dc891..8d15ad78e574 100644 --- a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts +++ b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts @@ -100,7 +100,7 @@ export default createRule({ value: number, ): node is TSESTree.Literal { const evaluated = getStaticValue(node, globalScope); - return evaluated != null && evaluated.value === value; + return evaluated?.value === value; } /** diff --git a/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts b/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts index b72289d020b2..a990d70b60bb 100644 --- a/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts @@ -698,6 +698,1540 @@ describe('|| {}', () => { }); }); +describe('chain ending with comparison', () => { + ruleTester.run('prefer-optional-chain', rule, { + invalid: [ + { + code: 'foo && foo.bar == 0;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == 0;`, + }, + { + code: 'foo && foo.bar == 1;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == 1;`, + }, + { + code: "foo && foo.bar == '123';", + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == '123';`, + }, + { + code: 'foo && foo.bar == {};', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == {};`, + }, + { + code: 'foo && foo.bar == false;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == false;`, + }, + { + code: 'foo && foo.bar == true;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == true;`, + }, + { + code: 'foo && foo.bar === 0;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === 0;`, + }, + { + code: 'foo && foo.bar === 1;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === 1;`, + }, + { + code: "foo && foo.bar === '123';", + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === '123';`, + }, + { + code: 'foo && foo.bar === {};', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === {};`, + }, + { + code: 'foo && foo.bar === false;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === false;`, + }, + { + code: 'foo && foo.bar === true;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === true;`, + }, + { + code: 'foo && foo.bar === null;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === null;`, + }, + { + code: 'foo && foo.bar !== undefined;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== undefined;`, + }, + { + code: 'foo && foo.bar != undefined;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != undefined;`, + }, + { + code: 'foo && foo.bar != null;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != null;`, + }, + { + code: 'foo != null && foo.bar == 0;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == 0;`, + }, + { + code: 'foo != null && foo.bar == 1;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == 1;`, + }, + { + code: "foo != null && foo.bar == '123';", + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == '123';`, + }, + { + code: 'foo != null && foo.bar == {};', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == {};`, + }, + { + code: 'foo != null && foo.bar == false;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == false;`, + }, + { + code: 'foo != null && foo.bar == true;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == true;`, + }, + { + code: 'foo != null && foo.bar === 0;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === 0;`, + }, + { + code: 'foo != null && foo.bar === 1;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === 1;`, + }, + { + code: "foo != null && foo.bar === '123';", + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === '123';`, + }, + { + code: 'foo != null && foo.bar === {};', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === {};`, + }, + { + code: 'foo != null && foo.bar === false;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === false;`, + }, + { + code: 'foo != null && foo.bar === true;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === true;`, + }, + { + code: 'foo != null && foo.bar === null;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === null;`, + }, + { + code: 'foo != null && foo.bar !== undefined;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== undefined;`, + }, + { + code: 'foo != null && foo.bar != undefined;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != undefined;`, + }, + { + code: 'foo != null && foo.bar != null;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != null;`, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar == x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar == x; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar == null; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar == null; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar == undefined; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar == undefined; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar === x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar === x; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar === undefined; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar === undefined; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar !== 0; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== 0; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar !== 1; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== 1; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar !== '123'; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== '123'; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar !== {}; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== {}; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar !== false; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== false; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar !== true; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== true; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar !== null; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== null; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar !== x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== x; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar != 0; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != 0; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar != 1; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != 1; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar != '123'; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != '123'; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar != {}; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != {}; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar != false; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != false; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar != true; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != true; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar != null; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != null; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo && foo.bar != x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != x; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar == x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar == x; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar == null; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar == null; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar == undefined; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar == undefined; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar === x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar === x; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar === undefined; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar === undefined; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar !== 0; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== 0; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar !== 1; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== 1; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar !== '123'; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== '123'; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar !== {}; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== {}; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar !== false; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== false; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar !== true; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== true; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar !== null; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== null; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar !== x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== x; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar != 0; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != 0; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar != 1; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != 1; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar != '123'; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != '123'; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar != {}; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != {}; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar != false; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != false; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar != true; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != true; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar != null; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != null; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo != null && foo.bar != x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != x; + `, + }, + { + code: ` + declare const foo: { bar: number } | 1; + foo && foo.bar == x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number } | 1; + foo?.bar == x; + `, + }, + { + code: ` + declare const foo: { bar: number } | 0; + foo != null && foo.bar == x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number } | 0; + foo?.bar == x; + `, + }, + { + code: '!foo || foo.bar != 0;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != 0;`, + }, + { + code: '!foo || foo.bar != 1;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != 1;`, + }, + { + code: "!foo || foo.bar != '123';", + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != '123';`, + }, + { + code: '!foo || foo.bar != {};', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != {};`, + }, + { + code: '!foo || foo.bar != false;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != false;`, + }, + { + code: '!foo || foo.bar != true;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != true;`, + }, + { + code: '!foo || foo.bar === undefined;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === undefined;`, + }, + { + code: '!foo || foo.bar == undefined;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == undefined;`, + }, + { + code: '!foo || foo.bar == null;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == null;`, + }, + { + code: '!foo || foo.bar !== 0;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== 0;`, + }, + { + code: '!foo || foo.bar !== 1;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== 1;`, + }, + { + code: "!foo || foo.bar !== '123';", + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== '123';`, + }, + { + code: '!foo || foo.bar !== {};', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== {};`, + }, + { + code: '!foo || foo.bar !== false;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== false;`, + }, + { + code: '!foo || foo.bar !== true;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== true;`, + }, + { + code: '!foo || foo.bar !== null;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== null;`, + }, + { + code: 'foo == null || foo.bar != 0;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != 0;`, + }, + { + code: 'foo == null || foo.bar != 1;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != 1;`, + }, + { + code: "foo == null || foo.bar != '123';", + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != '123';`, + }, + { + code: 'foo == null || foo.bar != {};', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != {};`, + }, + { + code: 'foo == null || foo.bar != false;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != false;`, + }, + { + code: 'foo == null || foo.bar != true;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar != true;`, + }, + { + code: 'foo == null || foo.bar === undefined;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar === undefined;`, + }, + { + code: 'foo == null || foo.bar == undefined;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == undefined;`, + }, + { + code: 'foo == null || foo.bar == null;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar == null;`, + }, + { + code: 'foo == null || foo.bar !== 0;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== 0;`, + }, + { + code: 'foo == null || foo.bar !== 1;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== 1;`, + }, + { + code: "foo == null || foo.bar !== '123';", + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== '123';`, + }, + { + code: 'foo == null || foo.bar !== {};', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== {};`, + }, + { + code: 'foo == null || foo.bar !== false;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== false;`, + }, + { + code: 'foo == null || foo.bar !== true;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== true;`, + }, + { + code: 'foo == null || foo.bar !== null;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `foo?.bar !== null;`, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar == x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar == x; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar == null; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar == null; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar == undefined; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar == undefined; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar === x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar === x; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar === undefined; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar === undefined; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar !== 0; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== 0; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar !== 1; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== 1; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar !== '123'; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== '123'; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar !== {}; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== {}; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar !== false; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== false; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar !== true; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== true; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar !== null; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== null; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar !== x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== x; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar != 0; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != 0; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar != 1; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != 1; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar != '123'; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != '123'; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar != {}; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != {}; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar != false; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != false; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar != true; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != true; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar != null; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != null; + `, + }, + { + code: ` + declare const foo: { bar: number }; + !foo || foo.bar != x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar != x; + `, + }, + + { + code: ` + declare const foo: { bar: number }; + foo == null || foo.bar == x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar == x; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo == null || foo.bar == null; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar == null; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo == null || foo.bar == undefined; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar == undefined; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo == null || foo.bar === x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar === x; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo == null || foo.bar === undefined; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar === undefined; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo == null || foo.bar !== 0; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== 0; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo == null || foo.bar !== 1; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== 1; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo == null || foo.bar !== '123'; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== '123'; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo == null || foo.bar !== {}; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== {}; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo == null || foo.bar !== false; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== false; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo == null || foo.bar !== true; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== true; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo == null || foo.bar !== null; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== null; + `, + }, + { + code: ` + declare const foo: { bar: number }; + foo == null || foo.bar !== x; + `, + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: ` + declare const foo: { bar: number }; + foo?.bar !== x; + `, + }, + // yoda case + { + code: "foo != null && null != foo.bar && '123' == foo.bar.baz;", + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `'123' == foo?.bar?.baz;`, + }, + { + code: "foo != null && null != foo.bar && '123' === foo.bar.baz;", + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `'123' === foo?.bar?.baz;`, + }, + { + code: 'foo != null && null != foo.bar && undefined !== foo.bar.baz;', + errors: [{ messageId: 'preferOptionalChain', suggestions: null }], + output: `undefined !== foo?.bar?.baz;`, + }, + ], + valid: [ + 'foo && foo.bar == x;', + 'foo && foo.bar == null;', + 'foo && foo.bar == undefined;', + 'foo && foo.bar === x;', + 'foo && foo.bar === undefined;', + 'foo && foo.bar !== 0;', + 'foo && foo.bar !== 1;', + "foo && foo.bar !== '123';", + 'foo && foo.bar !== {};', + 'foo && foo.bar !== false;', + 'foo && foo.bar !== true;', + 'foo && foo.bar !== null;', + 'foo && foo.bar !== x;', + 'foo && foo.bar != 0;', + 'foo && foo.bar != 1;', + "foo && foo.bar != '123';", + 'foo && foo.bar != {};', + 'foo && foo.bar != false;', + 'foo && foo.bar != true;', + 'foo && foo.bar != x;', + 'foo != null && foo.bar == x;', + 'foo != null && foo.bar == null;', + 'foo != null && foo.bar == undefined;', + 'foo != null && foo.bar === x;', + 'foo != null && foo.bar === undefined;', + 'foo != null && foo.bar !== 0;', + 'foo != null && foo.bar !== 1;', + "foo != null && foo.bar !== '123';", + 'foo != null && foo.bar !== {};', + 'foo != null && foo.bar !== false;', + 'foo != null && foo.bar !== true;', + 'foo != null && foo.bar !== null;', + 'foo != null && foo.bar !== x;', + 'foo != null && foo.bar != 0;', + 'foo != null && foo.bar != 1;', + "foo != null && foo.bar != '123';", + 'foo != null && foo.bar != {};', + 'foo != null && foo.bar != false;', + 'foo != null && foo.bar != true;', + 'foo != null && foo.bar != x;', + ` + declare const foo: { bar: number } | null; + foo && foo.bar == x; + `, + ` + declare const foo: { bar: number } | null; + foo && foo.bar == null; + `, + ` + declare const foo: { bar: number } | null; + foo && foo.bar == undefined; + `, + ` + declare const foo: { bar: number } | null; + foo && foo.bar === x; + `, + ` + declare const foo: { bar: number } | null; + foo && foo.bar === undefined; + `, + ` + declare const foo: { bar: number } | null; + foo && foo.bar !== 0; + `, + ` + declare const foo: { bar: number } | null; + foo && foo.bar !== 1; + `, + ` + declare const foo: { bar: number } | null; + foo && foo.bar !== '123'; + `, + ` + declare const foo: { bar: number } | null; + foo && foo.bar !== {}; + `, + ` + declare const foo: { bar: number } | null; + foo && foo.bar !== false; + `, + ` + declare const foo: { bar: number } | null; + foo && foo.bar !== true; + `, + ` + declare const foo: { bar: number } | null; + foo && foo.bar !== null; + `, + ` + declare const foo: { bar: number } | null; + foo && foo.bar !== x; + `, + ` + declare const foo: { bar: number } | null; + foo != null && foo.bar == x; + `, + ` + declare const foo: { bar: number } | null; + foo != null && foo.bar == null; + `, + ` + declare const foo: { bar: number } | null; + foo != null && foo.bar == undefined; + `, + ` + declare const foo: { bar: number } | null; + foo != null && foo.bar === x; + `, + ` + declare const foo: { bar: number } | null; + foo != null && foo.bar === undefined; + `, + ` + declare const foo: { bar: number } | null; + foo != null && foo.bar !== 0; + `, + ` + declare const foo: { bar: number } | null; + foo != null && foo.bar !== 1; + `, + ` + declare const foo: { bar: number } | null; + foo != null && foo.bar !== '123'; + `, + ` + declare const foo: { bar: number } | null; + foo != null && foo.bar !== {}; + `, + ` + declare const foo: { bar: number } | null; + foo != null && foo.bar !== false; + `, + ` + declare const foo: { bar: number } | null; + foo != null && foo.bar !== true; + `, + ` + declare const foo: { bar: number } | null; + foo != null && foo.bar !== null; + `, + ` + declare const foo: { bar: number } | null; + foo != null && foo.bar !== x; + `, + ` + declare const foo: { bar: number } | null; + foo !== null && foo !== undefined && foo.bar == null; + `, + ` + declare const foo: { bar: number } | null; + foo !== null && foo !== undefined && foo.bar === undefined; + `, + ` + declare const foo: { bar: number } | null; + foo !== null && foo !== undefined && foo.bar !== 1; + `, + ` + declare const foo: { bar: number } | null; + foo !== null && foo !== undefined && foo.bar != 1; + `, + + ` + declare const foo: { bar: number } | undefined; + foo !== null && foo !== undefined && foo.bar == null; + `, + ` + declare const foo: { bar: number } | undefined; + foo !== null && foo !== undefined && foo.bar === undefined; + `, + ` + declare const foo: { bar: number } | undefined; + foo !== null && foo !== undefined && foo.bar !== 1; + `, + ` + declare const foo: { bar: number } | undefined; + foo !== null && foo !== undefined && foo.bar != 1; + `, + ` + declare const foo: { bar: number } | null; + foo !== undefined && foo !== undefined && foo.bar == null; + `, + ` + declare const foo: { bar: number } | null; + foo !== undefined && foo !== undefined && foo.bar === undefined; + `, + ` + declare const foo: { bar: number } | null; + foo !== undefined && foo !== undefined && foo.bar !== 1; + `, + ` + declare const foo: { bar: number } | null; + foo !== undefined && foo !== undefined && foo.bar != 1; + `, + + ` + declare const foo: { bar: number } | undefined; + foo !== undefined && foo !== undefined && foo.bar == null; + `, + ` + declare const foo: { bar: number } | undefined; + foo !== undefined && foo !== undefined && foo.bar === undefined; + `, + ` + declare const foo: { bar: number } | undefined; + foo !== undefined && foo !== undefined && foo.bar !== 1; + `, + ` + declare const foo: { bar: number } | undefined; + foo !== undefined && foo !== undefined && foo.bar != 1; + `, + '!foo && foo.bar == 0;', + '!foo && foo.bar == 1;', + "!foo && foo.bar == '123';", + '!foo && foo.bar == {};', + '!foo && foo.bar == false;', + '!foo && foo.bar == true;', + '!foo && foo.bar === 0;', + '!foo && foo.bar === 1;', + "!foo && foo.bar === '123';", + '!foo && foo.bar === {};', + '!foo && foo.bar === false;', + '!foo && foo.bar === true;', + '!foo && foo.bar === null;', + '!foo && foo.bar !== undefined;', + '!foo && foo.bar != undefined;', + '!foo && foo.bar != null;', + 'foo == null && foo.bar == 0;', + 'foo == null && foo.bar == 1;', + "foo == null && foo.bar == '123';", + 'foo == null && foo.bar == {};', + 'foo == null && foo.bar == false;', + 'foo == null && foo.bar == true;', + 'foo == null && foo.bar === 0;', + 'foo == null && foo.bar === 1;', + "foo == null && foo.bar === '123';", + 'foo == null && foo.bar === {};', + 'foo == null && foo.bar === false;', + 'foo == null && foo.bar === true;', + 'foo == null && foo.bar === null;', + 'foo == null && foo.bar !== undefined;', + 'foo == null && foo.bar != null;', + 'foo == null && foo.bar != undefined;', + ` + declare const x: false | { a: string }; + x && x.a == x; + `, + ` + declare const x: '' | { a: string }; + x && x.a == x; + `, + ` + declare const x: 0 | { a: string }; + x && x.a == x; + `, + ` + declare const x: 0n | { a: string }; + x && x.a; + `, + '!foo || foo.bar != x;', + '!foo || foo.bar != null;', + '!foo || foo.bar != undefined;', + '!foo || foo.bar === 0;', + '!foo || foo.bar === 1;', + "!foo || foo.bar === '123';", + '!foo || foo.bar === {};', + '!foo || foo.bar === false;', + '!foo || foo.bar === true;', + '!foo || foo.bar === null;', + '!foo || foo.bar === x;', + '!foo || foo.bar == 0;', + '!foo || foo.bar == 1;', + "!foo || foo.bar == '123';", + '!foo || foo.bar == {};', + '!foo || foo.bar == false;', + '!foo || foo.bar == true;', + '!foo || foo.bar == x;', + '!foo || foo.bar !== x;', + '!foo || foo.bar !== undefined;', + 'foo == null || foo.bar != x;', + 'foo == null || foo.bar != null;', + 'foo == null || foo.bar != undefined;', + 'foo == null || foo.bar === 0;', + 'foo == null || foo.bar === 1;', + "foo == null || foo.bar === '123';", + 'foo == null || foo.bar === {};', + 'foo == null || foo.bar === false;', + 'foo == null || foo.bar === true;', + 'foo == null || foo.bar === null;', + 'foo == null || foo.bar === x;', + 'foo == null || foo.bar == 0;', + 'foo == null || foo.bar == 1;', + "foo == null || foo.bar == '123';", + 'foo == null || foo.bar == {};', + 'foo == null || foo.bar == false;', + 'foo == null || foo.bar == true;', + 'foo == null || foo.bar == x;', + 'foo == null || foo.bar !== x;', + 'foo == null || foo.bar !== undefined;', + 'foo || foo.bar != 0;', + 'foo || foo.bar != 1;', + "foo || foo.bar != '123';", + 'foo || foo.bar != {};', + 'foo || foo.bar != false;', + 'foo || foo.bar != true;', + 'foo || foo.bar === undefined;', + 'foo || foo.bar == undefined;', + 'foo || foo.bar == null;', + 'foo || foo.bar !== 0;', + 'foo || foo.bar !== 1;', + "foo || foo.bar !== '123';", + 'foo || foo.bar !== {};', + 'foo || foo.bar !== false;', + 'foo || foo.bar !== true;', + 'foo || foo.bar !== null;', + 'foo != null || foo.bar != 0;', + 'foo != null || foo.bar != 1;', + "foo != null || foo.bar != '123';", + 'foo != null || foo.bar != {};', + 'foo != null || foo.bar != false;', + 'foo != null || foo.bar != true;', + 'foo != null || foo.bar === undefined;', + 'foo != null || foo.bar == undefined;', + 'foo != null || foo.bar == null;', + 'foo != null || foo.bar !== 0;', + 'foo != null || foo.bar !== 1;', + "foo != null || foo.bar !== '123';", + 'foo != null || foo.bar !== {};', + 'foo != null || foo.bar !== false;', + 'foo != null || foo.bar !== true;', + 'foo != null || foo.bar !== null;', + ], + }); +}); + describe('hand-crafted cases', () => { ruleTester.run('prefer-optional-chain', rule, { invalid: [ @@ -714,8 +2248,7 @@ describe('hand-crafted cases', () => { { code: 'foo && foo.bar != null && foo.bar.baz !== undefined && foo.bar.baz.buzz;', errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: - 'foo?.bar != null && foo.bar.baz !== undefined && foo.bar.baz.buzz;', + output: 'foo?.bar?.baz !== undefined && foo.bar.baz.buzz;', }, { code: ` @@ -726,8 +2259,7 @@ describe('hand-crafted cases', () => { `, errors: [{ messageId: 'preferOptionalChain', suggestions: null }], output: ` - foo.bar?.baz != null && - foo.bar.baz.qux !== undefined && + foo.bar?.baz?.qux !== undefined && foo.bar.baz.qux.buzz; `, }, @@ -956,53 +2488,11 @@ describe('hand-crafted cases', () => { errors: [{ messageId: 'preferOptionalChain', suggestions: null }], output: '!foo.bar!.baz?.paz;', }, - { - code: ` - declare const foo: { bar: string } | null; - foo !== null && foo.bar !== null; - `, - errors: [ - { - messageId: 'preferOptionalChain', - suggestions: [ - { - messageId: 'optionalChainSuggest', - output: ` - declare const foo: { bar: string } | null; - foo?.bar !== null; - `, - }, - ], - }, - ], - output: null, - }, { code: 'foo != null && foo.bar != null;', errors: [{ messageId: 'preferOptionalChain', suggestions: null }], output: 'foo?.bar != null;', }, - { - code: ` - declare const foo: { bar: string | null } | null; - foo != null && foo.bar !== null; - `, - errors: [ - { - messageId: 'preferOptionalChain', - suggestions: [ - { - messageId: 'optionalChainSuggest', - output: ` - declare const foo: { bar: string | null } | null; - foo?.bar !== null; - `, - }, - ], - }, - ], - output: null, - }, { code: ` declare const foo: { bar: string | null } | null; @@ -1809,6 +3299,14 @@ const baz = foo?.bar; '(x || y) != null && (x || y).foo;', // TODO - should we handle this? '(await foo) && (await foo).bar;', + ` + declare const foo: { bar: string } | null; + foo !== null && foo.bar !== null; + `, + ` + declare const foo: { bar: string | null } | null; + foo != null && foo.bar !== null; + `, { code: ` declare const x: string; @@ -1991,16 +3489,58 @@ describe('base cases', () => { mutateCode: c => c.replaceAll('&&', '!== null &&'), mutateOutput: identity, operator: '&&', + skipIds: [20, 26], }), // but if the type is just `| null` - then it covers the cases and is // a valid conversion - invalid: BaseCases({ - mutateCode: c => c.replaceAll('&&', '!== null &&'), - mutateDeclaration: c => c.replaceAll('| undefined', ''), - mutateOutput: identity, - operator: '&&', - useSuggestionFixer: true, - }), + invalid: [ + ...BaseCases({ + mutateCode: c => c.replaceAll('&&', '!== null &&'), + mutateDeclaration: c => c.replaceAll('| undefined', ''), + mutateOutput: identity, + operator: '&&', + useSuggestionFixer: true, + }), + { + code: ` + declare const foo: { + bar: () => + | { baz: { buzz: (() => number) | null | undefined } | null | undefined } + | null + | undefined; + }; + foo.bar !== null && + foo.bar() !== null && + foo.bar().baz !== null && + foo.bar().baz.buzz !== null && + foo.bar().baz.buzz(); + `, + errors: [{ messageId: 'preferOptionalChain' }], + output: ` + declare const foo: { + bar: () => + | { baz: { buzz: (() => number) | null | undefined } | null | undefined } + | null + | undefined; + }; + foo.bar?.() !== null && + foo.bar().baz !== null && + foo.bar().baz.buzz !== null && + foo.bar().baz.buzz(); + `, + }, + { + code: ` + declare const foo: { bar: () => { baz: number } | null | undefined }; + foo.bar !== null && foo.bar?.() !== null && foo.bar?.().baz; + `, + errors: [{ messageId: 'preferOptionalChain' }], + output: ` + declare const foo: { bar: () => { baz: number } | null | undefined }; + foo.bar?.() !== null && foo.bar?.().baz; + `, + }, + ], }); }); @@ -2024,16 +3564,58 @@ describe('base cases', () => { mutateCode: c => c.replaceAll('&&', '!== undefined &&'), mutateOutput: identity, operator: '&&', + skipIds: [20, 26], }), // but if the type is just `| undefined` - then it covers the cases and is // a valid conversion - invalid: BaseCases({ - mutateCode: c => c.replaceAll('&&', '!== undefined &&'), - mutateDeclaration: c => c.replaceAll('| null', ''), - mutateOutput: identity, - operator: '&&', - useSuggestionFixer: true, - }), + invalid: [ + ...BaseCases({ + mutateCode: c => c.replaceAll('&&', '!== undefined &&'), + mutateDeclaration: c => c.replaceAll('| null', ''), + mutateOutput: identity, + operator: '&&', + useSuggestionFixer: true, + }), + { + code: ` + declare const foo: { + bar: () => + | { baz: { buzz: (() => number) | null | undefined } | null | undefined } + | null + | undefined; + }; + foo.bar !== undefined && + foo.bar() !== undefined && + foo.bar().baz !== undefined && + foo.bar().baz.buzz !== undefined && + foo.bar().baz.buzz(); + `, + errors: [{ messageId: 'preferOptionalChain' }], + output: ` + declare const foo: { + bar: () => + | { baz: { buzz: (() => number) | null | undefined } | null | undefined } + | null + | undefined; + }; + foo.bar?.() !== undefined && + foo.bar().baz !== undefined && + foo.bar().baz.buzz !== undefined && + foo.bar().baz.buzz(); + `, + }, + { + code: ` + declare const foo: { bar: () => { baz: number } | null | undefined }; + foo.bar !== undefined && foo.bar?.() !== undefined && foo.bar?.().baz; + `, + errors: [{ messageId: 'preferOptionalChain' }], + output: ` + declare const foo: { bar: () => { baz: number } | null | undefined }; + foo.bar?.() !== undefined && foo.bar?.().baz; + `, + }, + ], }); }); @@ -2072,21 +3654,63 @@ describe('base cases', () => { mutateCode: c => c.replaceAll('||', '=== null ||'), mutateOutput: identity, operator: '||', + skipIds: [20, 26], }), // but if the type is just `| null` - then it covers the cases and is // a valid conversion - invalid: BaseCases({ - mutateCode: c => - c - .replaceAll('||', '=== null ||') - // SEE TODO AT THE BOTTOM OF THE RULE - // We need to ensure the final operand is also a "valid" `||` check - .replace(/;$/, ' === null;'), - mutateDeclaration: c => c.replaceAll('| undefined', ''), - mutateOutput: c => c.replace(/;$/, ' === null;'), - operator: '||', - useSuggestionFixer: true, - }), + invalid: [ + ...BaseCases({ + mutateCode: c => + c + .replaceAll('||', '=== null ||') + // SEE TODO AT THE BOTTOM OF THE RULE + // We need to ensure the final operand is also a "valid" `||` check + .replace(/;$/, ' === null;'), + mutateDeclaration: c => c.replaceAll('| undefined', ''), + mutateOutput: c => c.replace(/;$/, ' === null;'), + operator: '||', + useSuggestionFixer: true, + }), + { + code: ` + declare const foo: { + bar: () => + | { baz: { buzz: (() => number) | null | undefined } | null | undefined } + | null + | undefined; + }; + foo.bar === null || + foo.bar() === null || + foo.bar().baz === null || + foo.bar().baz.buzz === null || + foo.bar().baz.buzz(); + `, + errors: [{ messageId: 'preferOptionalChain' }], + output: ` + declare const foo: { + bar: () => + | { baz: { buzz: (() => number) | null | undefined } | null | undefined } + | null + | undefined; + }; + foo.bar?.() === null || + foo.bar().baz === null || + foo.bar().baz.buzz === null || + foo.bar().baz.buzz(); + `, + }, + { + code: ` + declare const foo: { bar: () => { baz: number } | null | undefined }; + foo.bar === null || foo.bar?.() === null || foo.bar?.().baz; + `, + errors: [{ messageId: 'preferOptionalChain' }], + output: ` + declare const foo: { bar: () => { baz: number } | null | undefined }; + foo.bar?.() === null || foo.bar?.().baz; + `, + }, + ], }); }); @@ -2114,20 +3738,62 @@ describe('base cases', () => { mutateCode: c => c.replaceAll('||', '=== undefined ||'), mutateOutput: identity, operator: '||', + skipIds: [20, 26], }), // but if the type is just `| undefined` - then it covers the cases and is // a valid conversion - invalid: BaseCases({ - mutateCode: c => - c - .replaceAll('||', '=== undefined ||') - // SEE TODO AT THE BOTTOM OF THE RULE - // We need to ensure the final operand is also a "valid" `||` check - .replace(/;$/, ' === undefined;'), - mutateDeclaration: c => c.replaceAll('| null', ''), - mutateOutput: c => c.replace(/;$/, ' === undefined;'), - operator: '||', - }), + invalid: [ + ...BaseCases({ + mutateCode: c => + c + .replaceAll('||', '=== undefined ||') + // SEE TODO AT THE BOTTOM OF THE RULE + // We need to ensure the final operand is also a "valid" `||` check + .replace(/;$/, ' === undefined;'), + mutateDeclaration: c => c.replaceAll('| null', ''), + mutateOutput: c => c.replace(/;$/, ' === undefined;'), + operator: '||', + }), + { + code: ` + declare const foo: { + bar: () => + | { baz: { buzz: (() => number) | null | undefined } | null | undefined } + | null + | undefined; + }; + foo.bar === undefined || + foo.bar() === undefined || + foo.bar().baz === undefined || + foo.bar().baz.buzz === undefined || + foo.bar().baz.buzz(); + `, + errors: [{ messageId: 'preferOptionalChain' }], + output: ` + declare const foo: { + bar: () => + | { baz: { buzz: (() => number) | null | undefined } | null | undefined } + | null + | undefined; + }; + foo.bar?.() === undefined || + foo.bar().baz === undefined || + foo.bar().baz.buzz === undefined || + foo.bar().baz.buzz(); + `, + }, + { + code: ` + declare const foo: { bar: () => { baz: number } | null | undefined }; + foo.bar === undefined || foo.bar?.() === undefined || foo.bar?.().baz; + `, + errors: [{ messageId: 'preferOptionalChain' }], + output: ` + declare const foo: { bar: () => { baz: number } | null | undefined }; + foo.bar?.() === undefined || foo.bar?.().baz; + `, + }, + ], }); }); From a64b3ccb734a34326627cb5e2368e19f7534ecb8 Mon Sep 17 00:00:00 2001 From: Ronen Amiel Date: Wed, 8 Oct 2025 15:43:28 +0300 Subject: [PATCH 256/283] fix(eslint-plugin): [no-misused-promises] special-case `.finally` not to report when a promise returning function is provided as an argument (#11667) * initial implementation * use 'parseFinallyCall' to simplify implementation --- .../src/rules/no-misused-promises.ts | 22 +++++++++++++++++++ .../tests/rules/no-misused-promises.test.ts | 7 ++++++ 2 files changed, 29 insertions(+) diff --git a/packages/eslint-plugin/src/rules/no-misused-promises.ts b/packages/eslint-plugin/src/rules/no-misused-promises.ts index aa225d4e0aa2..b791fe150584 100644 --- a/packages/eslint-plugin/src/rules/no-misused-promises.ts +++ b/packages/eslint-plugin/src/rules/no-misused-promises.ts @@ -6,14 +6,17 @@ import * as ts from 'typescript'; import { createRule, + getConstrainedTypeAtLocation, getFunctionHeadLoc, getParserServices, isArrayMethodCallWithPredicate, isFunction, + isPromiseLike, isRestParameterDeclaration, nullThrows, NullThrowsReasons, } from '../util'; +import { parseFinallyCall } from '../util/promiseUtils'; export type Options = [ { @@ -360,6 +363,13 @@ export default createRule({ function checkArguments( node: TSESTree.CallExpression | TSESTree.NewExpression, ): void { + if ( + node.type === AST_NODE_TYPES.CallExpression && + isPromiseFinallyMethod(node) + ) { + return; + } + const tsNode = services.esTreeNodeToTSNodeMap.get(node); const voidArgs = voidFunctionArguments(checker, tsNode); if (voidArgs.size === 0) { @@ -563,6 +573,18 @@ export default createRule({ } } + function isPromiseFinallyMethod(node: TSESTree.CallExpression): boolean { + const promiseFinallyCall = parseFinallyCall(node, context); + + return ( + promiseFinallyCall != null && + isPromiseLike( + services.program, + getConstrainedTypeAtLocation(services, promiseFinallyCall.object), + ) + ); + } + function checkClassLikeOrInterfaceNode( node: | TSESTree.ClassDeclaration diff --git a/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts b/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts index 5f7f1faf8bb4..dc671e8869d6 100644 --- a/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts +++ b/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts @@ -1096,6 +1096,13 @@ declare const useCallback: unknown>( ) => T; useCallback(async () => {}); `, + ` +Promise.reject(3).finally(async () => {}); + `, + ` +const f = 'finally'; +Promise.reject(3)[f](async () => {}); + `, ], invalid: [ From de1fedb5b89f6f6afdae3e92ca6dee665d4beea5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 08:43:40 -0400 Subject: [PATCH 257/283] chore(deps): update dependency webpack to v5.102.0 (#11684) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/yarn.lock b/yarn.lock index abe0aa56244e..763bec740c6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19196,10 +19196,10 @@ __metadata: languageName: node linkType: hard -"tapable@npm:^2.0.0, tapable@npm:^2.1.1, tapable@npm:^2.2.0, tapable@npm:^2.2.1": - version: 2.2.1 - resolution: "tapable@npm:2.2.1" - checksum: 3b7a1b4d86fa940aad46d9e73d1e8739335efd4c48322cb37d073eb6f80f5281889bf0320c6d8ffcfa1a0dd5bfdbd0f9d037e252ef972aca595330538aac4d51 +"tapable@npm:^2.0.0, tapable@npm:^2.2.0, tapable@npm:^2.2.1, tapable@npm:^2.2.3": + version: 2.3.0 + resolution: "tapable@npm:2.3.0" + checksum: ada1194219ad550e3626d15019d87a2b8e77521d8463ab1135f46356e987a4c37eff1e87ffdd5acd573590962e519cc81e8ea6f7ed632c66bb58c0f12bd772a4 languageName: node linkType: hard @@ -20207,13 +20207,13 @@ __metadata: languageName: node linkType: hard -"watchpack@npm:^2.4.1": - version: 2.4.1 - resolution: "watchpack@npm:2.4.1" +"watchpack@npm:^2.4.4": + version: 2.4.4 + resolution: "watchpack@npm:2.4.4" dependencies: glob-to-regexp: ^0.4.1 graceful-fs: ^4.1.2 - checksum: 5b0179348655dcdf19cac7cb4ff923fdc024d630650c0bf6bec8899cf47c60e19d4f810a88dba692ed0e7f684cf0fcffea86efdbf6c35d81f031e328043b7fab + checksum: 469514a04bcdd7ea77d4b3c62d1f087eafbce64cbc728c89355d5710ee01311533456122da7c585d3654d5bfcf09e6085db1a6eb274c4762a18e370526d17561 languageName: node linkType: hard @@ -20370,8 +20370,8 @@ __metadata: linkType: hard "webpack@npm:^5.88.1, webpack@npm:^5.91.0, webpack@npm:^5.95.0": - version: 5.101.3 - resolution: "webpack@npm:5.101.3" + version: 5.102.0 + resolution: "webpack@npm:5.102.0" dependencies: "@types/eslint-scope": ^3.7.7 "@types/estree": ^1.0.8 @@ -20381,7 +20381,7 @@ __metadata: "@webassemblyjs/wasm-parser": ^1.14.1 acorn: ^8.15.0 acorn-import-phases: ^1.0.3 - browserslist: ^4.24.0 + browserslist: ^4.24.5 chrome-trace-event: ^1.0.2 enhanced-resolve: ^5.17.3 es-module-lexer: ^1.2.1 @@ -20394,16 +20394,16 @@ __metadata: mime-types: ^2.1.27 neo-async: ^2.6.2 schema-utils: ^4.3.2 - tapable: ^2.1.1 + tapable: ^2.2.3 terser-webpack-plugin: ^5.3.11 - watchpack: ^2.4.1 + watchpack: ^2.4.4 webpack-sources: ^3.3.3 peerDependenciesMeta: webpack-cli: optional: true bin: webpack: bin/webpack.js - checksum: d23fd86b6bc9854f9b488830d9aa123a7f654ee22849bc8670d0a22add88951f6d9cab1d04087758b642fc31115e3b97e0ac56b80b2200c04c486067aa945663 + checksum: 0df990632239a9127c36acf219f208e9f534fd53b4a4534ab4dbd6904cfbac10e44c73d5d04fd0617f0fe2150fc222f2839d7558b68c3a617855c8b71b8254cb languageName: node linkType: hard From 3f5fbf698e75ddd87874885ffbf937913761cdb0 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 13 Oct 2025 17:04:11 +0000 Subject: [PATCH 258/283] chore(release): publish 8.46.1 --- CHANGELOG.md | 16 +++ packages/ast-spec/CHANGELOG.md | 12 +++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 14 +++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 6 ++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 214 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 428ab6db594b..08cea6d1ebac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +## 8.46.1 (2025-10-13) + +### 🩹 Fixes + +- **ast-spec:** cleanup `TSLiteralType` ([#11624](https://github.com/typescript-eslint/typescript-eslint/pull/11624)) +- **eslint-plugin:** [prefer-optional-chain] include mixed "nullish comparison style" chains in checks ([#11533](https://github.com/typescript-eslint/typescript-eslint/pull/11533)) +- **eslint-plugin:** [no-misused-promises] special-case `.finally` not to report when a promise returning function is provided as an argument ([#11667](https://github.com/typescript-eslint/typescript-eslint/pull/11667)) + +### ❤️ Thank You + +- Abraham Guo +- mdm317 +- Ronen Amiel + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index c6cd653d3a17..219f836785a8 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.46.1 (2025-10-13) + +### 🩹 Fixes + +- **ast-spec:** cleanup `TSLiteralType` ([#11624](https://github.com/typescript-eslint/typescript-eslint/pull/11624)) + +### ❤️ Thank You + +- Abraham Guo + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) ### 🚀 Features diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index bdd7c564bf29..e43f80e01f69 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.46.0", + "version": "8.46.1", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 7be59f6e0e40..9e06dbd0a427 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,17 @@ +## 8.46.1 (2025-10-13) + +### 🩹 Fixes + +- **eslint-plugin:** [no-misused-promises] special-case `.finally` not to report when a promise returning function is provided as an argument ([#11667](https://github.com/typescript-eslint/typescript-eslint/pull/11667)) +- **eslint-plugin:** [prefer-optional-chain] include mixed "nullish comparison style" chains in checks ([#11533](https://github.com/typescript-eslint/typescript-eslint/pull/11533)) + +### ❤️ Thank You + +- mdm317 +- Ronen Amiel + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) ### 🚀 Features diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index d4e233309acd..3e6ccd98b9a2 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.46.0", + "version": "8.46.1", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.46.0", - "@typescript-eslint/type-utils": "8.46.0", - "@typescript-eslint/utils": "8.46.0", - "@typescript-eslint/visitor-keys": "8.46.0", + "@typescript-eslint/scope-manager": "8.46.1", + "@typescript-eslint/type-utils": "8.46.1", + "@typescript-eslint/utils": "8.46.1", + "@typescript-eslint/visitor-keys": "8.46.1", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.46.0", - "@typescript-eslint/rule-tester": "8.46.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.46.1", + "@typescript-eslint/rule-tester": "8.46.1", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.46.0", + "@typescript-eslint/parser": "^8.46.1", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 45579e3b5d5d..1093507356f5 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.1 (2025-10-13) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index ed6e1efc32d9..1da67fef90bd 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.46.0", + "version": "8.46.1", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.46.0", - "@typescript-eslint/types": "8.46.0", - "@typescript-eslint/typescript-estree": "8.46.0", - "@typescript-eslint/visitor-keys": "8.46.0", + "@typescript-eslint/scope-manager": "8.46.1", + "@typescript-eslint/types": "8.46.1", + "@typescript-eslint/typescript-estree": "8.46.1", + "@typescript-eslint/visitor-keys": "8.46.1", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 23925751fe40..3b10c4596cbc 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.1 (2025-10-13) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 7de623639b7f..78212eb7ec89 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.46.0", + "version": "8.46.1", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.46.0", - "@typescript-eslint/types": "^8.46.0", + "@typescript-eslint/tsconfig-utils": "^8.46.1", + "@typescript-eslint/types": "^8.46.1", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index f7280aeb60ec..45091e92496a 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.1 (2025-10-13) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) ### 🚀 Features diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index b47a3fb329ab..31da5b8086b6 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.46.0", + "version": "8.46.1", "description": "Converts ESLint rule schemas to equivalent TypeScript type strings.", "type": "module", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.46.0", - "@typescript-eslint/utils": "8.46.0", + "@typescript-eslint/type-utils": "8.46.1", + "@typescript-eslint/utils": "8.46.1", "natural-compare": "^1.4.0" }, "devDependencies": { diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 6d53afcf7509..10762eb60663 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.1 (2025-10-13) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) ### 🩹 Fixes diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index b12bbd465ab6..d94d3b565be6 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.46.0", + "version": "8.46.1", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.46.0", - "@typescript-eslint/typescript-estree": "8.46.0", - "@typescript-eslint/utils": "8.46.0", + "@typescript-eslint/parser": "8.46.1", + "@typescript-eslint/typescript-estree": "8.46.1", + "@typescript-eslint/utils": "8.46.1", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 9c273f69cb7b..5c73caa90084 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.1 (2025-10-13) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 7bf9f5c6c957..32669b55bcd3 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.46.0", + "version": "8.46.1", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.46.0", - "@typescript-eslint/visitor-keys": "8.46.0" + "@typescript-eslint/types": "8.46.1", + "@typescript-eslint/visitor-keys": "8.46.1" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.46.0", + "@typescript-eslint/typescript-estree": "8.46.1", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 56e6067e86e5..ff51316e6f78 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.1 (2025-10-13) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 0a489b1036ca..970065ac322f 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.46.0", + "version": "8.46.1", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index e3173aa353e5..c46cf6e734e4 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.1 (2025-10-13) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) ### 🩹 Fixes diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index fb7d9b0df675..3adbe12ab697 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.46.0", + "version": "8.46.1", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.46.0", - "@typescript-eslint/typescript-estree": "8.46.0", - "@typescript-eslint/utils": "8.46.0", + "@typescript-eslint/types": "8.46.1", + "@typescript-eslint/typescript-estree": "8.46.1", + "@typescript-eslint/utils": "8.46.1", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.46.0", + "@typescript-eslint/parser": "8.46.1", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index a8b32d0d089e..93ac7964f418 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.1 (2025-10-13) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 95466be524bb..3c25f4b1db49 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.46.0", + "version": "8.46.1", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index f16f92e76f8b..aa8169b2ec5c 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.1 (2025-10-13) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) ### 🚀 Features diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 19132a1a4198..8563c8a0cde6 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.46.0", + "version": "8.46.1", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.46.0", - "@typescript-eslint/parser": "8.46.0", - "@typescript-eslint/typescript-estree": "8.46.0", - "@typescript-eslint/utils": "8.46.0" + "@typescript-eslint/eslint-plugin": "8.46.1", + "@typescript-eslint/parser": "8.46.1", + "@typescript-eslint/typescript-estree": "8.46.1", + "@typescript-eslint/utils": "8.46.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 9f63c47283f1..41aa41f43b2f 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.1 (2025-10-13) + +This was a version bump only for typescript-estree to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) ### 🚀 Features diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 29d8b7f4e88b..a734ec40bfc3 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.46.0", + "version": "8.46.1", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.46.0", - "@typescript-eslint/tsconfig-utils": "8.46.0", - "@typescript-eslint/types": "8.46.0", - "@typescript-eslint/visitor-keys": "8.46.0", + "@typescript-eslint/project-service": "8.46.1", + "@typescript-eslint/tsconfig-utils": "8.46.1", + "@typescript-eslint/types": "8.46.1", + "@typescript-eslint/visitor-keys": "8.46.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 1551ec7a7ab8..19eb831f87e7 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.1 (2025-10-13) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) ### 🩹 Fixes diff --git a/packages/utils/package.json b/packages/utils/package.json index 21546d4601ed..4cec4b04e2bd 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.46.0", + "version": "8.46.1", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.46.0", - "@typescript-eslint/types": "8.46.0", - "@typescript-eslint/typescript-estree": "8.46.0" + "@typescript-eslint/scope-manager": "8.46.1", + "@typescript-eslint/types": "8.46.1", + "@typescript-eslint/typescript-estree": "8.46.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 4ead0db9eaa4..fd4d06aadeb2 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.1 (2025-10-13) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.0 (2025-10-06) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 156e3591061e..653f7dc4c6ca 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.46.0", + "version": "8.46.1", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.46.0", + "@typescript-eslint/types": "8.46.1", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 763bec740c6a..e9f3ec2ffc1c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5910,19 +5910,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.46.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.46.1, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.46.0 - "@typescript-eslint/rule-tester": 8.46.0 - "@typescript-eslint/scope-manager": 8.46.0 - "@typescript-eslint/type-utils": 8.46.0 - "@typescript-eslint/utils": 8.46.0 - "@typescript-eslint/visitor-keys": 8.46.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.46.1 + "@typescript-eslint/rule-tester": 8.46.1 + "@typescript-eslint/scope-manager": 8.46.1 + "@typescript-eslint/type-utils": 8.46.1 + "@typescript-eslint/utils": 8.46.1 + "@typescript-eslint/visitor-keys": 8.46.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5945,7 +5945,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.46.0 + "@typescript-eslint/parser": ^8.46.1 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -5961,14 +5961,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.46.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.46.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.46.0 - "@typescript-eslint/types": 8.46.0 - "@typescript-eslint/typescript-estree": 8.46.0 - "@typescript-eslint/visitor-keys": 8.46.0 + "@typescript-eslint/scope-manager": 8.46.1 + "@typescript-eslint/types": 8.46.1 + "@typescript-eslint/typescript-estree": 8.46.1 + "@typescript-eslint/visitor-keys": 8.46.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -5982,12 +5982,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.46.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.46.1, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.46.0 - "@typescript-eslint/types": ^8.46.0 + "@typescript-eslint/tsconfig-utils": ^8.46.1 + "@typescript-eslint/types": ^8.46.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -5998,12 +5998,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.46.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.46.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.46.0 - "@typescript-eslint/utils": 8.46.0 + "@typescript-eslint/type-utils": 8.46.1 + "@typescript-eslint/utils": 8.46.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -6013,15 +6013,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.46.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.46.1, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.46.0 - "@typescript-eslint/typescript-estree": 8.46.0 - "@typescript-eslint/utils": 8.46.0 + "@typescript-eslint/parser": 8.46.1 + "@typescript-eslint/typescript-estree": 8.46.1 + "@typescript-eslint/utils": 8.46.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -6036,13 +6036,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.46.0, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.46.1, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.46.0 - "@typescript-eslint/typescript-estree": 8.46.0 - "@typescript-eslint/visitor-keys": 8.46.0 + "@typescript-eslint/types": 8.46.1 + "@typescript-eslint/typescript-estree": 8.46.1 + "@typescript-eslint/visitor-keys": 8.46.1 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -6053,7 +6053,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.46.0, @typescript-eslint/tsconfig-utils@^8.46.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.46.1, @typescript-eslint/tsconfig-utils@^8.46.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -6066,14 +6066,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.46.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.46.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.46.0 - "@typescript-eslint/types": 8.46.0 - "@typescript-eslint/typescript-estree": 8.46.0 - "@typescript-eslint/utils": 8.46.0 + "@typescript-eslint/parser": 8.46.1 + "@typescript-eslint/types": 8.46.1 + "@typescript-eslint/typescript-estree": 8.46.1 + "@typescript-eslint/utils": 8.46.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6088,7 +6088,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.46.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.46.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.46.1, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.46.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6162,15 +6162,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.46.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.46.1, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.46.0 - "@typescript-eslint/tsconfig-utils": 8.46.0 - "@typescript-eslint/types": 8.46.0 - "@typescript-eslint/visitor-keys": 8.46.0 + "@typescript-eslint/project-service": 8.46.1 + "@typescript-eslint/tsconfig-utils": 8.46.1 + "@typescript-eslint/types": 8.46.1 + "@typescript-eslint/visitor-keys": 8.46.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6188,14 +6188,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.46.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.46.1, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.46.0 - "@typescript-eslint/types": 8.46.0 - "@typescript-eslint/typescript-estree": 8.46.0 + "@typescript-eslint/scope-manager": 8.46.1 + "@typescript-eslint/types": 8.46.1 + "@typescript-eslint/typescript-estree": 8.46.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6207,11 +6207,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.46.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.46.1, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.46.0 + "@typescript-eslint/types": 8.46.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19669,10 +19669,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.46.0 - "@typescript-eslint/parser": 8.46.0 - "@typescript-eslint/typescript-estree": 8.46.0 - "@typescript-eslint/utils": 8.46.0 + "@typescript-eslint/eslint-plugin": 8.46.1 + "@typescript-eslint/parser": 8.46.1 + "@typescript-eslint/typescript-estree": 8.46.1 + "@typescript-eslint/utils": 8.46.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From 698e7a828893e8d755d65fc90fa3f81321eeddaf Mon Sep 17 00:00:00 2001 From: mdm317 Date: Mon, 20 Oct 2025 07:17:30 +0900 Subject: [PATCH 259/283] fix(eslint-plugin): [prefer-optional-chain] skip optional chaining when it could change the result (#11702) --- .../analyzeChain.ts | 63 +- .../prefer-optional-chain.test.ts | 899 +++++------------- 2 files changed, 243 insertions(+), 719 deletions(-) diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/analyzeChain.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/analyzeChain.ts index 84c1ca6e9593..a2b11134e540 100644 --- a/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/analyzeChain.ts +++ b/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/analyzeChain.ts @@ -10,7 +10,7 @@ import type { } from '@typescript-eslint/utils/ts-eslint'; import { AST_NODE_TYPES } from '@typescript-eslint/utils'; -import { isFalsyType, unionConstituents } from 'ts-api-utils'; +import { unionConstituents } from 'ts-api-utils'; import * as ts from 'typescript'; import type { LastChainOperand, ValidOperand } from './gatherLogicalOperands'; @@ -48,40 +48,6 @@ function includesType( return false; } -function isAlwaysTruthyOperand( - comparedName: TSESTree.Node, - nullishComparisonType: NullishComparisonType, - parserServices: ParserServicesWithTypeInformation, -): boolean { - const ANY_UNKNOWN_FLAGS = ts.TypeFlags.Any | ts.TypeFlags.Unknown; - const comparedNameType = parserServices.getTypeAtLocation(comparedName); - - if (isTypeFlagSet(comparedNameType, ANY_UNKNOWN_FLAGS)) { - return false; - } - switch (nullishComparisonType) { - case NullishComparisonType.Boolean: - case NullishComparisonType.NotBoolean: { - const types = unionConstituents(comparedNameType); - return types.every(type => !isFalsyType(type)); - } - case NullishComparisonType.NotStrictEqualUndefined: - case NullishComparisonType.NotStrictEqualNull: - case NullishComparisonType.StrictEqualNull: - case NullishComparisonType.StrictEqualUndefined: - return !isTypeFlagSet( - comparedNameType, - ts.TypeFlags.Null | ts.TypeFlags.Undefined, - ); - case NullishComparisonType.NotEqualNullOrUndefined: - case NullishComparisonType.EqualNullOrUndefined: - return !isTypeFlagSet( - comparedNameType, - ts.TypeFlags.Null | ts.TypeFlags.Undefined, - ); - } -} - function isValidAndLastChainOperand( ComparisonValueType: TSESTree.Node, comparisonType: ComparisonType, @@ -710,20 +676,6 @@ export function analyzeChain( } break; } - case NullishComparisonType.StrictEqualNull: - case NullishComparisonType.NotStrictEqualNull: { - if ( - comparisonResult === NodeComparisonResult.Subset && - isAlwaysTruthyOperand( - lastOperand.comparedName, - lastOperand.comparisonType, - parserServices, - ) - ) { - lastChain = operand; - } - break; - } } } maybeReportThenReset(); @@ -768,16 +720,11 @@ export function analyzeChain( : isValidOrLastChainOperand; if ( comparisonResult === NodeComparisonResult.Subset && - (isAlwaysTruthyOperand( - lastOperand.comparedName, - lastOperand.comparisonType, + isValidLastChainOperand( + lastChainOperand.comparisonValue, + lastChainOperand.comparisonType, parserServices, - ) || - isValidLastChainOperand( - lastChainOperand.comparisonValue, - lastChainOperand.comparisonType, - parserServices, - )) + ) ) { lastChain = lastChainOperand; } diff --git a/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts b/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts index a990d70b60bb..52c59b479b68 100644 --- a/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts @@ -861,215 +861,6 @@ describe('chain ending with comparison', () => { errors: [{ messageId: 'preferOptionalChain', suggestions: null }], output: `foo?.bar != null;`, }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar == x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar == x; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar == null; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar == null; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar == undefined; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar == undefined; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar === x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar === x; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar === undefined; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar === undefined; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar !== 0; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== 0; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar !== 1; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== 1; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar !== '123'; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== '123'; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar !== {}; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== {}; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar !== false; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== false; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar !== true; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== true; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar !== null; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== null; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar !== x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== x; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar != 0; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != 0; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar != 1; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != 1; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar != '123'; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != '123'; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar != {}; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != {}; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar != false; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != false; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar != true; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != true; - `, - }, { code: ` declare const foo: { bar: number }; @@ -1081,226 +872,6 @@ describe('chain ending with comparison', () => { foo?.bar != null; `, }, - { - code: ` - declare const foo: { bar: number }; - foo && foo.bar != x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != x; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar == x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar == x; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar == null; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar == null; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar == undefined; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar == undefined; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar === x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar === x; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar === undefined; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar === undefined; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar !== 0; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== 0; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar !== 1; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== 1; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar !== '123'; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== '123'; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar !== {}; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== {}; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar !== false; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== false; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar !== true; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== true; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar !== null; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== null; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar !== x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== x; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar != 0; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != 0; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar != 1; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != 1; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar != '123'; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != '123'; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar != {}; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != {}; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar != false; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != false; - `, - }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar != true; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != true; - `, - }, { code: ` declare const foo: { bar: number }; @@ -1312,39 +883,6 @@ describe('chain ending with comparison', () => { foo?.bar != null; `, }, - { - code: ` - declare const foo: { bar: number }; - foo != null && foo.bar != x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != x; - `, - }, - { - code: ` - declare const foo: { bar: number } | 1; - foo && foo.bar == x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number } | 1; - foo?.bar == x; - `, - }, - { - code: ` - declare const foo: { bar: number } | 0; - foo != null && foo.bar == x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number } | 0; - foo?.bar == x; - `, - }, { code: '!foo || foo.bar != 0;', errors: [{ messageId: 'preferOptionalChain', suggestions: null }], @@ -1505,17 +1043,6 @@ describe('chain ending with comparison', () => { errors: [{ messageId: 'preferOptionalChain', suggestions: null }], output: `foo?.bar !== null;`, }, - { - code: ` - declare const foo: { bar: number }; - !foo || foo.bar == x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar == x; - `, - }, { code: ` declare const foo: { bar: number }; @@ -1538,17 +1065,6 @@ describe('chain ending with comparison', () => { foo?.bar == undefined; `, }, - { - code: ` - declare const foo: { bar: number }; - !foo || foo.bar === x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar === x; - `, - }, { code: ` declare const foo: { bar: number }; @@ -1637,17 +1153,6 @@ describe('chain ending with comparison', () => { foo?.bar !== null; `, }, - { - code: ` - declare const foo: { bar: number }; - !foo || foo.bar !== x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== x; - `, - }, { code: ` declare const foo: { bar: number }; @@ -1714,40 +1219,6 @@ describe('chain ending with comparison', () => { foo?.bar != true; `, }, - { - code: ` - declare const foo: { bar: number }; - !foo || foo.bar != null; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != null; - `, - }, - { - code: ` - declare const foo: { bar: number }; - !foo || foo.bar != x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar != x; - `, - }, - - { - code: ` - declare const foo: { bar: number }; - foo == null || foo.bar == x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar == x; - `, - }, { code: ` declare const foo: { bar: number }; @@ -1770,17 +1241,6 @@ describe('chain ending with comparison', () => { foo?.bar == undefined; `, }, - { - code: ` - declare const foo: { bar: number }; - foo == null || foo.bar === x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar === x; - `, - }, { code: ` declare const foo: { bar: number }; @@ -1869,17 +1329,6 @@ describe('chain ending with comparison', () => { foo?.bar !== null; `, }, - { - code: ` - declare const foo: { bar: number }; - foo == null || foo.bar !== x; - `, - errors: [{ messageId: 'preferOptionalChain', suggestions: null }], - output: ` - declare const foo: { bar: number }; - foo?.bar !== x; - `, - }, // yoda case { code: "foo != null && null != foo.bar && '123' == foo.bar.baz;", @@ -1898,10 +1347,10 @@ describe('chain ending with comparison', () => { }, ], valid: [ - 'foo && foo.bar == x;', + 'foo && foo.bar == undeclaredVar;', 'foo && foo.bar == null;', 'foo && foo.bar == undefined;', - 'foo && foo.bar === x;', + 'foo && foo.bar === undeclaredVar;', 'foo && foo.bar === undefined;', 'foo && foo.bar !== 0;', 'foo && foo.bar !== 1;', @@ -1910,18 +1359,18 @@ describe('chain ending with comparison', () => { 'foo && foo.bar !== false;', 'foo && foo.bar !== true;', 'foo && foo.bar !== null;', - 'foo && foo.bar !== x;', + 'foo && foo.bar !== undeclaredVar;', 'foo && foo.bar != 0;', 'foo && foo.bar != 1;', "foo && foo.bar != '123';", 'foo && foo.bar != {};', 'foo && foo.bar != false;', 'foo && foo.bar != true;', - 'foo && foo.bar != x;', - 'foo != null && foo.bar == x;', + 'foo && foo.bar != undeclaredVar;', + 'foo != null && foo.bar == undeclaredVar;', 'foo != null && foo.bar == null;', 'foo != null && foo.bar == undefined;', - 'foo != null && foo.bar === x;', + 'foo != null && foo.bar === undeclaredVar;', 'foo != null && foo.bar === undefined;', 'foo != null && foo.bar !== 0;', 'foo != null && foo.bar !== 1;', @@ -1930,17 +1379,185 @@ describe('chain ending with comparison', () => { 'foo != null && foo.bar !== false;', 'foo != null && foo.bar !== true;', 'foo != null && foo.bar !== null;', - 'foo != null && foo.bar !== x;', + 'foo != null && foo.bar !== undeclaredVar;', 'foo != null && foo.bar != 0;', 'foo != null && foo.bar != 1;', "foo != null && foo.bar != '123';", 'foo != null && foo.bar != {};', 'foo != null && foo.bar != false;', 'foo != null && foo.bar != true;', - 'foo != null && foo.bar != x;', + 'foo != null && foo.bar != undeclaredVar;', + ` + declare const foo: { bar: number }; + foo && foo.bar == undeclaredVar; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar == null; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar == undefined; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar === undeclaredVar; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar === undefined; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar !== 0; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar !== 1; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar !== '123'; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar !== {}; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar !== false; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar !== true; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar !== null; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar !== undeclaredVar; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar != 0; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar != 1; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar != '123'; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar != {}; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar != false; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar != true; + `, + ` + declare const foo: { bar: number }; + foo && foo.bar != undeclaredVar; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar == undeclaredVar; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar == null; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar == undefined; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar === undeclaredVar; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar === undefined; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar !== 0; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar !== 1; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar !== '123'; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar !== {}; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar !== false; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar !== true; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar !== null; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar !== undeclaredVar; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar != 0; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar != 1; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar != '123'; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar != {}; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar != false; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar != true; + `, + ` + declare const foo: { bar: number }; + foo != null && foo.bar != undeclaredVar; + `, + ` + declare const foo: { bar: number } | 1; + foo && foo.bar == undeclaredVar; + `, + ` + declare const foo: { bar: number } | 0; + foo != null && foo.bar == undeclaredVar; + `, ` declare const foo: { bar: number } | null; - foo && foo.bar == x; + foo && foo.bar == undeclaredVar; `, ` declare const foo: { bar: number } | null; @@ -1952,7 +1569,7 @@ describe('chain ending with comparison', () => { `, ` declare const foo: { bar: number } | null; - foo && foo.bar === x; + foo && foo.bar === undeclaredVar; `, ` declare const foo: { bar: number } | null; @@ -1988,11 +1605,11 @@ describe('chain ending with comparison', () => { `, ` declare const foo: { bar: number } | null; - foo && foo.bar !== x; + foo && foo.bar !== undeclaredVar; `, ` declare const foo: { bar: number } | null; - foo != null && foo.bar == x; + foo != null && foo.bar == undeclaredVar; `, ` declare const foo: { bar: number } | null; @@ -2004,7 +1621,7 @@ describe('chain ending with comparison', () => { `, ` declare const foo: { bar: number } | null; - foo != null && foo.bar === x; + foo != null && foo.bar === undeclaredVar; `, ` declare const foo: { bar: number } | null; @@ -2040,7 +1657,7 @@ describe('chain ending with comparison', () => { `, ` declare const foo: { bar: number } | null; - foo != null && foo.bar !== x; + foo != null && foo.bar !== undeclaredVar; `, ` declare const foo: { bar: number } | null; @@ -2108,6 +1725,26 @@ describe('chain ending with comparison', () => { declare const foo: { bar: number } | undefined; foo !== undefined && foo !== undefined && foo.bar != 1; `, + ` + declare const foo: { bar: number }; + !foo || foo.bar == undeclaredVar; + `, + ` + declare const foo: { bar: number }; + !foo || foo.bar === undeclaredVar; + `, + ` + declare const foo: { bar: number }; + !foo || foo.bar !== undeclaredVar; + `, + ` + declare const foo: { bar: number }; + !foo || foo.bar != null; + `, + ` + declare const foo: { bar: number }; + !foo || foo.bar != undeclaredVar; + `, '!foo && foo.bar == 0;', '!foo && foo.bar == 1;', "!foo && foo.bar == '123';", @@ -2141,22 +1778,22 @@ describe('chain ending with comparison', () => { 'foo == null && foo.bar != null;', 'foo == null && foo.bar != undefined;', ` - declare const x: false | { a: string }; - x && x.a == x; + declare const foo: false | { a: string }; + foo && foo.a == undeclaredVar; `, ` - declare const x: '' | { a: string }; - x && x.a == x; + declare const foo: '' | { a: string }; + foo && foo.a == undeclaredVar; `, ` - declare const x: 0 | { a: string }; - x && x.a == x; + declare const foo: 0 | { a: string }; + foo && foo.a == undeclaredVar; `, ` - declare const x: 0n | { a: string }; - x && x.a; + declare const foo: 0n | { a: string }; + foo && foo.a; `, - '!foo || foo.bar != x;', + '!foo || foo.bar != undeclaredVar;', '!foo || foo.bar != null;', '!foo || foo.bar != undefined;', '!foo || foo.bar === 0;', @@ -2166,17 +1803,29 @@ describe('chain ending with comparison', () => { '!foo || foo.bar === false;', '!foo || foo.bar === true;', '!foo || foo.bar === null;', - '!foo || foo.bar === x;', + '!foo || foo.bar === undeclaredVar;', '!foo || foo.bar == 0;', '!foo || foo.bar == 1;', "!foo || foo.bar == '123';", '!foo || foo.bar == {};', '!foo || foo.bar == false;', '!foo || foo.bar == true;', - '!foo || foo.bar == x;', - '!foo || foo.bar !== x;', + '!foo || foo.bar == undeclaredVar;', + '!foo || foo.bar !== undeclaredVar;', '!foo || foo.bar !== undefined;', - 'foo == null || foo.bar != x;', + ` + declare const foo: { bar: number }; + foo == null || foo.bar == undeclaredVar; + `, + ` + declare const foo: { bar: number }; + foo == null || foo.bar === undeclaredVar; + `, + ` + declare const foo: { bar: number }; + foo == null || foo.bar !== undeclaredVar; + `, + 'foo == null || foo.bar != undeclaredVar;', 'foo == null || foo.bar != null;', 'foo == null || foo.bar != undefined;', 'foo == null || foo.bar === 0;', @@ -2186,15 +1835,15 @@ describe('chain ending with comparison', () => { 'foo == null || foo.bar === false;', 'foo == null || foo.bar === true;', 'foo == null || foo.bar === null;', - 'foo == null || foo.bar === x;', + 'foo == null || foo.bar === undeclaredVar;', 'foo == null || foo.bar == 0;', 'foo == null || foo.bar == 1;', "foo == null || foo.bar == '123';", 'foo == null || foo.bar == {};', 'foo == null || foo.bar == false;', 'foo == null || foo.bar == true;', - 'foo == null || foo.bar == x;', - 'foo == null || foo.bar !== x;', + 'foo == null || foo.bar == undeclaredVar;', + 'foo == null || foo.bar !== undeclaredVar;', 'foo == null || foo.bar !== undefined;', 'foo || foo.bar != 0;', 'foo || foo.bar != 1;', @@ -2228,6 +1877,14 @@ describe('chain ending with comparison', () => { 'foo != null || foo.bar !== false;', 'foo != null || foo.bar !== true;', 'foo != null || foo.bar !== null;', + ` + declare const record: Record; + record['key'] && record['key'].kind !== '1'; + `, + ` + declare const array: { b?: string }[]; + !array[1] || array[1].b === 'foo'; + `, ], }); }); @@ -3489,7 +3146,6 @@ describe('base cases', () => { mutateCode: c => c.replaceAll('&&', '!== null &&'), mutateOutput: identity, operator: '&&', - skipIds: [20, 26], }), // but if the type is just `| null` - then it covers the cases and is // a valid conversion @@ -3501,45 +3157,6 @@ describe('base cases', () => { operator: '&&', useSuggestionFixer: true, }), - { - code: ` - declare const foo: { - bar: () => - | { baz: { buzz: (() => number) | null | undefined } | null | undefined } - | null - | undefined; - }; - foo.bar !== null && - foo.bar() !== null && - foo.bar().baz !== null && - foo.bar().baz.buzz !== null && - foo.bar().baz.buzz(); - `, - errors: [{ messageId: 'preferOptionalChain' }], - output: ` - declare const foo: { - bar: () => - | { baz: { buzz: (() => number) | null | undefined } | null | undefined } - | null - | undefined; - }; - foo.bar?.() !== null && - foo.bar().baz !== null && - foo.bar().baz.buzz !== null && - foo.bar().baz.buzz(); - `, - }, - { - code: ` - declare const foo: { bar: () => { baz: number } | null | undefined }; - foo.bar !== null && foo.bar?.() !== null && foo.bar?.().baz; - `, - errors: [{ messageId: 'preferOptionalChain' }], - output: ` - declare const foo: { bar: () => { baz: number } | null | undefined }; - foo.bar?.() !== null && foo.bar?.().baz; - `, - }, ], }); }); @@ -3654,7 +3271,6 @@ describe('base cases', () => { mutateCode: c => c.replaceAll('||', '=== null ||'), mutateOutput: identity, operator: '||', - skipIds: [20, 26], }), // but if the type is just `| null` - then it covers the cases and is // a valid conversion @@ -3671,45 +3287,6 @@ describe('base cases', () => { operator: '||', useSuggestionFixer: true, }), - { - code: ` - declare const foo: { - bar: () => - | { baz: { buzz: (() => number) | null | undefined } | null | undefined } - | null - | undefined; - }; - foo.bar === null || - foo.bar() === null || - foo.bar().baz === null || - foo.bar().baz.buzz === null || - foo.bar().baz.buzz(); - `, - errors: [{ messageId: 'preferOptionalChain' }], - output: ` - declare const foo: { - bar: () => - | { baz: { buzz: (() => number) | null | undefined } | null | undefined } - | null - | undefined; - }; - foo.bar?.() === null || - foo.bar().baz === null || - foo.bar().baz.buzz === null || - foo.bar().baz.buzz(); - `, - }, - { - code: ` - declare const foo: { bar: () => { baz: number } | null | undefined }; - foo.bar === null || foo.bar?.() === null || foo.bar?.().baz; - `, - errors: [{ messageId: 'preferOptionalChain' }], - output: ` - declare const foo: { bar: () => { baz: number } | null | undefined }; - foo.bar?.() === null || foo.bar?.().baz; - `, - }, ], }); }); From 13a8ab32a6a5174ddfee7b2c312fdadedb1633cd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 11:31:56 -0400 Subject: [PATCH 260/283] chore(deps): update dependency knip to v5.65.0 (#11709) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index e9f3ec2ffc1c..c3813a7de5de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13177,8 +13177,8 @@ __metadata: linkType: hard "knip@npm:^5.41.1": - version: 5.64.1 - resolution: "knip@npm:5.64.1" + version: 5.66.1 + resolution: "knip@npm:5.66.1" dependencies: "@nodelib/fs.walk": ^1.2.3 fast-glob: ^3.3.3 @@ -13198,7 +13198,7 @@ __metadata: bin: knip: bin/knip.js knip-bun: bin/knip-bun.js - checksum: b56970725cc6949ce4b0c8922fa9e89408f4b6ad92f29af561e011f533bced83b9ec30e282a25a2b5c0de4206673f3317f09151df3c6f39a2423efe95514dfcc + checksum: 27fbd27e2ab36d06ac07431cb6b70c9080d18e7cacb57f8a7c0a00afce8cf15eea3a2199ca13e8c2a9ac039267a8df68b41bc95a7ff3f951aad58ac9a439d6bf languageName: node linkType: hard From 4eda303cd6155bb267882c015da82601c558cd1c Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 20 Oct 2025 23:37:21 +0800 Subject: [PATCH 261/283] fix(typescript-estree): forbid invalid modifiers in object methods (#11689) * fix(typescript-estree): forbid invalid modifiers in object methods and properties * Test * Remove properties * getters * setter * property * Snapshots --- .../getter-modifier-abstract/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 7 ++ .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/getter-modifier-async/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 7 ++ .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 2 +- .../getter-modifier-declare/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/getter-modifier-export/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../getter-modifier-override/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../getter-modifier-private/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../getter-modifier-protected/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/getter-modifier-public/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/getter-modifier-static/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../fixture.ts | 0 .../snapshots/1-TSESTree-Error.shot | 2 +- .../snapshots/2-Babel-Error.shot | 2 +- .../snapshots/3-Alignment-Error.shot | 4 + .../method-modifier-declare/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 7 ++ .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/method-modifier-export/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 7 ++ .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../method-modifier-override/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 7 ++ .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../method-modifier-private/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 7 ++ .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../method-modifier-protected/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 7 ++ .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/method-modifier-public/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 7 ++ .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/method-modifier-static/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 7 ++ .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../property-modifier-abstract/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../property-modifier-async/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../property-modifier-declare/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../property-modifier-export/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../property-modifier-override/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../property-modifier-private/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../property-modifier-protected/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../property-modifier-public/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../property-modifier-static/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../setter-modifier-abstract/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 7 ++ .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/setter-modifier-async/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 7 ++ .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../setter-modifier-declare/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/setter-modifier-export/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../setter-modifier-override/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../setter-modifier-private/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../setter-modifier-protected/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/setter-modifier-public/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/setter-modifier-static/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 4 + .../snapshots/2-Babel-Error.shot | 8 ++ .../snapshots/3-Alignment-Error.shot | 4 + .../fixtures/method-modifier-async/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 83 +++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 112 ++++++++++++++++++ .../snapshots/3-Babel-AST.shot | 83 +++++++++++++ .../snapshots/4-Babel-Tokens.shot | 112 ++++++++++++++++++ .../fixtures-with-differences-errors.shot | 23 ++++ .../typescript-estree/src/check-modifiers.ts | 2 +- 147 files changed, 1029 insertions(+), 4 deletions(-) create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/2-Babel-Error.shot rename packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/{abstract-method => getter-modifier-async}/snapshots/3-Alignment-Error.shot (76%) create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/3-Alignment-Error.shot rename packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/{abstract-method => method-modifier-abstract}/fixture.ts (100%) rename packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/{abstract-method => method-modifier-abstract}/snapshots/1-TSESTree-Error.shot (82%) rename packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/{abstract-method => method-modifier-abstract}/snapshots/2-Babel-Error.shot (83%) create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/fixture.ts create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/4-Babel-Tokens.shot diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/fixture.ts new file mode 100644 index 000000000000..7da365aa96dc --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/fixture.ts @@ -0,0 +1 @@ +({abstract get getter(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..c6b3818e424f --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-abstract > TSESTree - Error`] +TSError +> 1 | ({abstract get getter(){}}) + | ^^^^^^ An abstract accessor cannot have an implementation. + 2 | diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..8c1fc8d18638 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-abstract > Babel - Error`] +BabelError +> 1 | ({abstract get getter(){}}) + | ^ Unexpected token, expected "," (1:11) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..f5385a54f496 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-abstract > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/fixture.ts new file mode 100644 index 000000000000..503e02f960ae --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/fixture.ts @@ -0,0 +1 @@ +({async get getter(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..469f62b8e05e --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-async > TSESTree - Error`] +TSError +> 1 | ({async get getter(){}}) + | ^^^^^ 'async' modifier cannot be used here. + 2 | diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..21344f041c47 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-async > Babel - Error`] +BabelError +> 1 | ({async get getter(){}}) + | ^ Unexpected token, expected "(" (1:12) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/3-Alignment-Error.shot similarity index 76% rename from packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/3-Alignment-Error.shot rename to packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/3-Alignment-Error.shot index 2285aeb1e136..f37cf0b5cb71 100644 --- a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`AST Fixtures > expression > ObjectExpression > _error_ > abstract-method > Error Alignment`] +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-async > Error Alignment`] Both errored diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/fixture.ts new file mode 100644 index 000000000000..c4665dca5599 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/fixture.ts @@ -0,0 +1 @@ +({declare get getter(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..3be473c2e955 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-declare > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..89aa85c1528a --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-declare > Babel - Error`] +BabelError +> 1 | ({declare get getter(){}}) + | ^ Unexpected token, expected "," (1:10) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..fe62478d60e3 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-declare > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/fixture.ts new file mode 100644 index 000000000000..49c45b221289 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/fixture.ts @@ -0,0 +1 @@ +({export get getter(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..04a140d4a86a --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-export > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..43fd96f8211f --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-export > Babel - Error`] +BabelError +> 1 | ({export get getter(){}}) + | ^ Unexpected keyword 'export'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..2630e9395407 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-export > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/fixture.ts new file mode 100644 index 000000000000..9c38112689a7 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/fixture.ts @@ -0,0 +1 @@ +({override get getter(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..bd0dd27042de --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-override > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..3cd034d0f848 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-override > Babel - Error`] +BabelError +> 1 | ({override get getter(){}}) + | ^ Unexpected token, expected "," (1:11) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..67072b96a25f --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-override > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/fixture.ts new file mode 100644 index 000000000000..8c3c3f387734 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/fixture.ts @@ -0,0 +1 @@ +({private get getter(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..2a95a795d410 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-private > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..ad8f34751b30 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-private > Babel - Error`] +BabelError +> 1 | ({private get getter(){}}) + | ^ Unexpected reserved word 'private'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..e5449cb3d436 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-private > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/fixture.ts new file mode 100644 index 000000000000..f6182886cf4b --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/fixture.ts @@ -0,0 +1 @@ +({protected get getter(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..5a842187ab8b --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-protected > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..f50ad9df0644 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-protected > Babel - Error`] +BabelError +> 1 | ({protected get getter(){}}) + | ^ Unexpected reserved word 'protected'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..d3a451a6f34a --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-protected > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/fixture.ts new file mode 100644 index 000000000000..d168f83f4877 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/fixture.ts @@ -0,0 +1 @@ +({public get getter(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..c77a8e8fcb1f --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-public > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..a0bfd54c27b9 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-public > Babel - Error`] +BabelError +> 1 | ({public get getter(){}}) + | ^ Unexpected reserved word 'public'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..b9cf0e7bb818 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-public > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/fixture.ts new file mode 100644 index 000000000000..f783949c9c17 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/fixture.ts @@ -0,0 +1 @@ +({static get getter(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..e119aa3d2ea1 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-static > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..7a4f79268aa6 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-static > Babel - Error`] +BabelError +> 1 | ({static get getter(){}}) + | ^ Unexpected reserved word 'static'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..dbd2ec6c9b39 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-static > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/fixture.ts similarity index 100% rename from packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/fixture.ts rename to packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/fixture.ts diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/1-TSESTree-Error.shot similarity index 82% rename from packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/1-TSESTree-Error.shot rename to packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/1-TSESTree-Error.shot index dc431453e57a..2a9157795088 100644 --- a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/1-TSESTree-Error.shot @@ -1,6 +1,6 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`AST Fixtures > expression > ObjectExpression > _error_ > abstract-method > TSESTree - Error`] +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-abstract > TSESTree - Error`] TSError > 1 | ({abstract method(){}}) | ^^^^^^^^ 'abstract' modifier cannot be used here. diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/2-Babel-Error.shot similarity index 83% rename from packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/2-Babel-Error.shot rename to packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/2-Babel-Error.shot index b186e7ceed16..36577e2c3b93 100644 --- a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/abstract-method/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/2-Babel-Error.shot @@ -1,6 +1,6 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`AST Fixtures > expression > ObjectExpression > _error_ > abstract-method > Babel - Error`] +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-abstract > Babel - Error`] BabelError > 1 | ({abstract method(){}}) | ^ Unexpected token, expected "," (1:11) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..69159de758f3 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-abstract > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/fixture.ts new file mode 100644 index 000000000000..d04b737ea44c --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/fixture.ts @@ -0,0 +1 @@ +({declare method(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..98198fa601fb --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-declare > TSESTree - Error`] +TSError +> 1 | ({declare method(){}}) + | ^^^^^^^ 'declare' modifier cannot be used here. + 2 | diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..8a265181dc1b --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-declare > Babel - Error`] +BabelError +> 1 | ({declare method(){}}) + | ^ Unexpected token, expected "," (1:10) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..cb8d4e5a8d3e --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-declare > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/fixture.ts new file mode 100644 index 000000000000..53ce4bbc923f --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/fixture.ts @@ -0,0 +1 @@ +({export method(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..f5c77f873fcf --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-export > TSESTree - Error`] +TSError +> 1 | ({export method(){}}) + | ^^^^^^ 'export' modifier cannot be used here. + 2 | diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..40acbd491c03 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-export > Babel - Error`] +BabelError +> 1 | ({export method(){}}) + | ^ Unexpected keyword 'export'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..2af6c62d78e0 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-export > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/fixture.ts new file mode 100644 index 000000000000..f4a1f8044de5 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/fixture.ts @@ -0,0 +1 @@ +({override method(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..9132d6be3aa1 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-override > TSESTree - Error`] +TSError +> 1 | ({override method(){}}) + | ^^^^^^^^ 'override' modifier cannot be used here. + 2 | diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..dc144f96e410 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-override > Babel - Error`] +BabelError +> 1 | ({override method(){}}) + | ^ Unexpected token, expected "," (1:11) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..740638b17ca9 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-override > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/fixture.ts new file mode 100644 index 000000000000..17216fafa6ba --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/fixture.ts @@ -0,0 +1 @@ +({private method(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..94c0b2b78538 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-private > TSESTree - Error`] +TSError +> 1 | ({private method(){}}) + | ^^^^^^^ 'private' modifier cannot be used here. + 2 | diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..efc040b8e2b4 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-private > Babel - Error`] +BabelError +> 1 | ({private method(){}}) + | ^ Unexpected reserved word 'private'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..bf509a674a8c --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-private > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/fixture.ts new file mode 100644 index 000000000000..d0b475ae7b53 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/fixture.ts @@ -0,0 +1 @@ +({protected method(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..537e86f8b7e8 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-protected > TSESTree - Error`] +TSError +> 1 | ({protected method(){}}) + | ^^^^^^^^^ 'protected' modifier cannot be used here. + 2 | diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..1ada22fc7d6c --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-protected > Babel - Error`] +BabelError +> 1 | ({protected method(){}}) + | ^ Unexpected reserved word 'protected'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..756b258562c3 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-protected > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/fixture.ts new file mode 100644 index 000000000000..71ae66b69227 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/fixture.ts @@ -0,0 +1 @@ +({public method(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..3b0a6228b3bf --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-public > TSESTree - Error`] +TSError +> 1 | ({public method(){}}) + | ^^^^^^ 'public' modifier cannot be used here. + 2 | diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..0e7d870a4cdb --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-public > Babel - Error`] +BabelError +> 1 | ({public method(){}}) + | ^ Unexpected reserved word 'public'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..c4b3fe4fd6df --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-public > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/fixture.ts new file mode 100644 index 000000000000..4327f0fc0277 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/fixture.ts @@ -0,0 +1 @@ +({static method(){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..462a18ebf56e --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-static > TSESTree - Error`] +TSError +> 1 | ({static method(){}}) + | ^^^^^^ 'static' modifier cannot be used here. + 2 | diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..ab26c91ba108 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-static > Babel - Error`] +BabelError +> 1 | ({static method(){}}) + | ^ Unexpected reserved word 'static'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..901470979766 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-static > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/fixture.ts new file mode 100644 index 000000000000..5a91f9a97b8c --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/fixture.ts @@ -0,0 +1 @@ +({abstract property: 1}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..3fde78482148 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-abstract > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..7a92a736eb21 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-abstract > Babel - Error`] +BabelError +> 1 | ({abstract property: 1}) + | ^ Unexpected token, expected "," (1:11) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..7e13c1111604 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-abstract > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/fixture.ts new file mode 100644 index 000000000000..9b6990e1578c --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/fixture.ts @@ -0,0 +1 @@ +({async property: 1}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..083a82058ab1 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-async > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..6e65e9380954 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-async > Babel - Error`] +BabelError +> 1 | ({async property: 1}) + | ^ Unexpected token, expected "(" (1:16) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..210d506718ef --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-async > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/fixture.ts new file mode 100644 index 000000000000..ab759d58ee6b --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/fixture.ts @@ -0,0 +1 @@ +({declare property: 1}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..db7a3ac5dc66 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-declare > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..1566801a28d7 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-declare > Babel - Error`] +BabelError +> 1 | ({declare property: 1}) + | ^ Unexpected token, expected "," (1:10) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..6c5dc1bac93d --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-declare > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/fixture.ts new file mode 100644 index 000000000000..de0b9ac7be0e --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/fixture.ts @@ -0,0 +1 @@ +({export property: 1}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..1763adeb0c88 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-export > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..791277f74ff2 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-export > Babel - Error`] +BabelError +> 1 | ({export property: 1}) + | ^ Unexpected keyword 'export'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..042904f5eb84 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-export > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/fixture.ts new file mode 100644 index 000000000000..c31d3bf6e27a --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/fixture.ts @@ -0,0 +1 @@ +({override property: 1}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..1e13125b9002 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-override > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..1e14511997de --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-override > Babel - Error`] +BabelError +> 1 | ({override property: 1}) + | ^ Unexpected token, expected "," (1:11) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..ad900508147d --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-override > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/fixture.ts new file mode 100644 index 000000000000..463b7c4ab593 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/fixture.ts @@ -0,0 +1 @@ +({private property: 1}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..3dfdac48c91f --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-private > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..490659356138 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-private > Babel - Error`] +BabelError +> 1 | ({private property: 1}) + | ^ Unexpected reserved word 'private'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..ac6b919842ba --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-private > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/fixture.ts new file mode 100644 index 000000000000..bcffd32f4654 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/fixture.ts @@ -0,0 +1 @@ +({protected property: 1}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..22fe1acfb0cb --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-protected > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..d3c7faa9ff5c --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-protected > Babel - Error`] +BabelError +> 1 | ({protected property: 1}) + | ^ Unexpected reserved word 'protected'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..d9b57268bc1f --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-protected > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/fixture.ts new file mode 100644 index 000000000000..d0bdb34d9222 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/fixture.ts @@ -0,0 +1 @@ +({public property: 1}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..ea015d3e6ff5 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-public > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..5bfdabbf290e --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-public > Babel - Error`] +BabelError +> 1 | ({public property: 1}) + | ^ Unexpected reserved word 'public'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..37db719aafbe --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-public > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/fixture.ts new file mode 100644 index 000000000000..7b8844223f9d --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/fixture.ts @@ -0,0 +1 @@ +({static property: 1}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..9cddb615c99a --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-static > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..9f748a2d8d56 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-static > Babel - Error`] +BabelError +> 1 | ({static property: 1}) + | ^ Unexpected reserved word 'static'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..04df46c94c5c --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-static > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/fixture.ts new file mode 100644 index 000000000000..b6ab4dcdf39b --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/fixture.ts @@ -0,0 +1 @@ +({abstract set setter(v){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..a8576b829681 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-abstract > TSESTree - Error`] +TSError +> 1 | ({abstract set setter(v){}}) + | ^^^^^^ An abstract accessor cannot have an implementation. + 2 | diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..aa2f22b8ab88 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-abstract > Babel - Error`] +BabelError +> 1 | ({abstract set setter(v){}}) + | ^ Unexpected token, expected "," (1:11) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..555eb1dcb596 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-abstract > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/fixture.ts new file mode 100644 index 000000000000..b7d58fc71cc9 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/fixture.ts @@ -0,0 +1 @@ +({async set setter(v){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..5040e61ae271 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-async > TSESTree - Error`] +TSError +> 1 | ({async set setter(v){}}) + | ^^^^^ 'async' modifier cannot be used here. + 2 | diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..1ea7c6ed8f91 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-async > Babel - Error`] +BabelError +> 1 | ({async set setter(v){}}) + | ^ Unexpected token, expected "(" (1:12) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..3e5b8ccf4efc --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-async > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/fixture.ts new file mode 100644 index 000000000000..6bcb875be849 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/fixture.ts @@ -0,0 +1 @@ +({declare set setter(v){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..cf76a53db090 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-declare > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..067419e5adbb --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-declare > Babel - Error`] +BabelError +> 1 | ({declare set setter(v){}}) + | ^ Unexpected token, expected "," (1:10) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..48b461cd66d9 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-declare > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/fixture.ts new file mode 100644 index 000000000000..f7d4ca9236af --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/fixture.ts @@ -0,0 +1 @@ +({export set setter(v){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..0683934ea344 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-export > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..6cc5ed90ad4e --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-export > Babel - Error`] +BabelError +> 1 | ({export set setter(v){}}) + | ^ Unexpected keyword 'export'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..3f52b9168036 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-export > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/fixture.ts new file mode 100644 index 000000000000..eeafc1fea1ad --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/fixture.ts @@ -0,0 +1 @@ +({override set setter(v){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..ab027e28bbfd --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-override > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..f40423fb0984 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-override > Babel - Error`] +BabelError +> 1 | ({override set setter(v){}}) + | ^ Unexpected token, expected "," (1:11) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..3c28691efdd0 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-override > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/fixture.ts new file mode 100644 index 000000000000..f81f8fa55022 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/fixture.ts @@ -0,0 +1 @@ +({private set setter(v){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..bad8df2cd939 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-private > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..65345de45e99 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-private > Babel - Error`] +BabelError +> 1 | ({private set setter(v){}}) + | ^ Unexpected reserved word 'private'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..5601896eea99 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-private > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/fixture.ts new file mode 100644 index 000000000000..32b267e2189a --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/fixture.ts @@ -0,0 +1 @@ +({protected set setter(v){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..5e6e7e168fe2 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-protected > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..82cf31f6cf35 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-protected > Babel - Error`] +BabelError +> 1 | ({protected set setter(v){}}) + | ^ Unexpected reserved word 'protected'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..5085cb1873b3 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-protected > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/fixture.ts new file mode 100644 index 000000000000..7949d3875d67 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/fixture.ts @@ -0,0 +1 @@ +({public set setter(v){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..efd2d846400f --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-public > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..6be782e5749f --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-public > Babel - Error`] +BabelError +> 1 | ({public set setter(v){}}) + | ^ Unexpected reserved word 'public'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..48db772cb684 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-public > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/fixture.ts new file mode 100644 index 000000000000..df98c494c04d --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/fixture.ts @@ -0,0 +1 @@ +({static set setter(v){}}) diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..9c69f633480d --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-static > TSESTree - Error`] +NO ERROR diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..98ec583edf82 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-static > Babel - Error`] +BabelError +> 1 | ({static set setter(v){}}) + | ^ Unexpected reserved word 'static'. (1:2) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..75f0064be033 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-static > Error Alignment`] +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/fixture.ts new file mode 100644 index 000000000000..29ec8ac274e0 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/fixture.ts @@ -0,0 +1 @@ +({ async method() {} }); diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c6ed369c1008 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,83 @@ +Program { + type: "Program", + body: [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ObjectExpression { + type: "ObjectExpression", + properties: [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "method", + optional: false, + + range: [9, 15], + loc: { + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + kind: "init", + method: true, + optional: false, + shorthand: false, + value: FunctionExpression { + type: "FunctionExpression", + async: true, + body: BlockStatement { + type: "BlockStatement", + body: [], + + range: [18, 20], + loc: { + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + declare: false, + expression: false, + generator: false, + id: null, + params: [], + + range: [15, 20], + loc: { + start: { column: 15, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + + range: [3, 20], + loc: { + start: { column: 3, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + ], + + range: [1, 22], + loc: { + start: { column: 1, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..99aed7b8b364 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,112 @@ +[ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "async", + + range: [3, 8], + loc: { + start: { column: 3, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "method", + + range: [9, 15], + loc: { + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..c6ed369c1008 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/3-Babel-AST.shot @@ -0,0 +1,83 @@ +Program { + type: "Program", + body: [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ObjectExpression { + type: "ObjectExpression", + properties: [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "method", + optional: false, + + range: [9, 15], + loc: { + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + kind: "init", + method: true, + optional: false, + shorthand: false, + value: FunctionExpression { + type: "FunctionExpression", + async: true, + body: BlockStatement { + type: "BlockStatement", + body: [], + + range: [18, 20], + loc: { + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + declare: false, + expression: false, + generator: false, + id: null, + params: [], + + range: [15, 20], + loc: { + start: { column: 15, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + + range: [3, 20], + loc: { + start: { column: 3, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + ], + + range: [1, 22], + loc: { + start: { column: 1, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..99aed7b8b364 --- /dev/null +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,112 @@ +[ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "async", + + range: [3, 8], + loc: { + start: { column: 3, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "method", + + range: [9, 15], + loc: { + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index 303daa8ed915..cb157b9d2bb9 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -16,6 +16,29 @@ exports[`AST Fixtures > List fixtures with Error differences`] "declaration/VariableDeclaration/fixtures/_error_/var-destructure-no-init/fixture.ts", "declaration/VariableDeclaration/fixtures/_error_/var-destructure-type-no-init/fixture.ts", "element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/getter-modifier-export/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/getter-modifier-override/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/getter-modifier-private/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/getter-modifier-public/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/getter-modifier-static/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/property-modifier-async/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/property-modifier-declare/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/property-modifier-export/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/property-modifier-override/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/property-modifier-private/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/property-modifier-protected/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/property-modifier-public/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/property-modifier-static/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/setter-modifier-export/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/setter-modifier-override/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/setter-modifier-private/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/setter-modifier-public/fixture.ts", + "expression/ObjectExpression/fixtures/_error_/setter-modifier-static/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/await-without-async-function/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/fixture.ts", diff --git a/packages/typescript-estree/src/check-modifiers.ts b/packages/typescript-estree/src/check-modifiers.ts index b25956b8064f..423604a70e01 100644 --- a/packages/typescript-estree/src/check-modifiers.ts +++ b/packages/typescript-estree/src/check-modifiers.ts @@ -375,7 +375,7 @@ export function checkModifiers(node: ts.Node): void { // There are more cases in `checkGrammarObjectLiteralExpression` in TypeScript. // We may add more validations for them here in the future. if ( - modifier.kind === SyntaxKind.AbstractKeyword && + modifier.kind !== SyntaxKind.AsyncKeyword && node.kind === SyntaxKind.MethodDeclaration && node.parent.kind === SyntaxKind.ObjectLiteralExpression ) { From 1ddaaa3989a25233435fdb88b0976a067e7b3a62 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 11:38:24 -0400 Subject: [PATCH 262/283] chore(deps): update dependency monaco-editor to ~0.54.0 (#11698) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Josh Goldberg --- packages/website/package.json | 2 +- yarn.lock | 36 ++++++++++++++++++++++------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/packages/website/package.json b/packages/website/package.json index 47c5a93a6204..91c2467d7f8e 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -73,7 +73,7 @@ "make-dir": "*", "mdast-util-from-markdown": "^2.0.1", "mdast-util-mdx": "^3.0.0", - "monaco-editor": "~0.53.0", + "monaco-editor": "~0.54.0", "raw-loader": "^4.0.2", "rimraf": "*", "stylelint": "^16.3.1", diff --git a/yarn.lock b/yarn.lock index c3813a7de5de..f73e2800292b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5817,13 +5817,6 @@ __metadata: languageName: node linkType: hard -"@types/trusted-types@npm:^1.0.6": - version: 1.0.6 - resolution: "@types/trusted-types@npm:1.0.6" - checksum: 22b8efcb6116ab80d07542047135618ee282f2060c481e472126604d838c09e7dad33c9462d88c130aef2c3133aece516f00d6af7ff814f0612f7d19db720e6d - languageName: node - linkType: hard - "@types/trusted-types@npm:^2.0.2": version: 2.0.2 resolution: "@types/trusted-types@npm:2.0.2" @@ -9340,6 +9333,13 @@ __metadata: languageName: node linkType: hard +"dompurify@npm:3.1.7": + version: 3.1.7 + resolution: "dompurify@npm:3.1.7" + checksum: 0a9b811bbc94f3dba60cf6486962362b0f1a5b4ab789f5e1cbd4749b6ba1a1fad190a677a962dc8850ce28764424765fe425e9d6508e4e93ba648ef15d54bc24 + languageName: node + linkType: hard + "domutils@npm:^2.5.2, domutils@npm:^2.6.0": version: 2.8.0 resolution: "domutils@npm:2.8.0" @@ -13714,6 +13714,15 @@ __metadata: languageName: node linkType: hard +"marked@npm:14.0.0": + version: 14.0.0 + resolution: "marked@npm:14.0.0" + bin: + marked: bin/marked.js + checksum: 965405cde11d180e5da78cf51074b1947f1e5483ed99691d3ec990a078aa6ca9113cf19bbd44da45473d0e7eec7298255e7d860a650dd5e7aed78ca5a8e0161b + languageName: node + linkType: hard + "marked@npm:^15.0.0": version: 15.0.11 resolution: "marked@npm:15.0.11" @@ -14886,12 +14895,13 @@ __metadata: languageName: node linkType: hard -"monaco-editor@npm:~0.53.0": - version: 0.53.0 - resolution: "monaco-editor@npm:0.53.0" +"monaco-editor@npm:~0.54.0": + version: 0.54.0 + resolution: "monaco-editor@npm:0.54.0" dependencies: - "@types/trusted-types": ^1.0.6 - checksum: 353eca219334b62bdf825f4602aa2b98570c60e7059d257b0567da63fbb79b8eee8bea8448a597e297d0c96c9da3be9eb5153c1e8f279e5450d31c83f02125aa + dompurify: 3.1.7 + marked: 14.0.0 + checksum: 27bda0afafe5bbce693be9c72531e772bf71cfce6362a8358acd28815ddb95113cc1738ddccb28359a9d9def00da4dd928c1f32514dc0d1611ba0251758c3e2a languageName: node linkType: hard @@ -20462,7 +20472,7 @@ __metadata: make-dir: "*" mdast-util-from-markdown: ^2.0.1 mdast-util-mdx: ^3.0.0 - monaco-editor: ~0.53.0 + monaco-editor: ~0.54.0 prettier: 3.6.2 prism-react-renderer: ^2.3.1 raw-loader: ^4.0.2 From 9185484ce448e56150e31055eeea0dc6e7f0d648 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 11:39:06 -0400 Subject: [PATCH 263/283] chore(deps): update dependency stylelint to v16.25.0 (#11690) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Josh Goldberg --- yarn.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/yarn.lock b/yarn.lock index f73e2800292b..9436391c1844 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3292,10 +3292,10 @@ __metadata: languageName: node linkType: hard -"@dual-bundle/import-meta-resolve@npm:^4.1.0": - version: 4.1.0 - resolution: "@dual-bundle/import-meta-resolve@npm:4.1.0" - checksum: 8a79576624d66f3ee578cb4cd7f7dac9282dc4c6f757c7c1f4c364fdbabc99584e1407e49e1ef00c0b42dab01d1f8490ec1d08a02c1238bad657a7335303d462 +"@dual-bundle/import-meta-resolve@npm:^4.2.1": + version: 4.2.1 + resolution: "@dual-bundle/import-meta-resolve@npm:4.2.1" + checksum: ac1021d2200fe67234d7916a25cd525c2fa323a7bc535d22b7917521f53c4cea70c50e0aeea3bdafb796824281c03f83bea017454b4623a0a0b048ca82161067 languageName: node linkType: hard @@ -9004,15 +9004,15 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.4.0, debug@npm:^4.4.1": - version: 4.4.1 - resolution: "debug@npm:4.4.1" +"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.4.0, debug@npm:^4.4.1, debug@npm:^4.4.3": + version: 4.4.3 + resolution: "debug@npm:4.4.3" dependencies: ms: ^2.1.3 peerDependenciesMeta: supports-color: optional: true - checksum: a43826a01cda685ee4cec00fb2d3322eaa90ccadbef60d9287debc2a886be3e835d9199c80070ede75a409ee57828c4c6cd80e4b154f2843f0dc95a570dc0729 + checksum: 4805abd570e601acdca85b6aa3757186084a45cff9b2fa6eee1f3b173caa776b45f478b2a71a572d616d2010cea9211d0ac4a02a610e4c18ac4324bde3760834 languageName: node linkType: hard @@ -19073,20 +19073,20 @@ __metadata: linkType: hard "stylelint@npm:^16.3.1": - version: 16.24.0 - resolution: "stylelint@npm:16.24.0" + version: 16.25.0 + resolution: "stylelint@npm:16.25.0" dependencies: "@csstools/css-parser-algorithms": ^3.0.5 "@csstools/css-tokenizer": ^3.0.4 "@csstools/media-query-list-parser": ^4.0.3 "@csstools/selector-specificity": ^5.0.0 - "@dual-bundle/import-meta-resolve": ^4.1.0 + "@dual-bundle/import-meta-resolve": ^4.2.1 balanced-match: ^2.0.0 colord: ^2.9.3 cosmiconfig: ^9.0.0 css-functions-list: ^3.2.3 css-tree: ^3.1.0 - debug: ^4.4.1 + debug: ^4.4.3 fast-glob: ^3.3.3 fastest-levenshtein: ^1.0.16 file-entry-cache: ^10.1.4 @@ -19116,7 +19116,7 @@ __metadata: write-file-atomic: ^5.0.1 bin: stylelint: bin/stylelint.mjs - checksum: b9a2926b4f1635c050d13c266cd017a3f7994b4b76aa22532b896ec600143a37d17d6d629c0a27b50a97ee0c62c2fad8b5796c643bbe612c5a473ed1b79deaa3 + checksum: 0b36fead063f8903522afd04a350b021670348a0218f580aa895100cc59634179742ff844037d482bbeaff234f3411fc331f2ce59419c807c341ea3e0355d1cc languageName: node linkType: hard From 55ca033ee88cc95cfac4ad6dea2257fbeb1d4657 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 20 Oct 2025 17:04:37 +0000 Subject: [PATCH 264/283] chore(release): publish 8.46.2 --- CHANGELOG.md | 14 +++ packages/ast-spec/CHANGELOG.md | 12 +++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 12 +++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 12 +++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 216 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08cea6d1ebac..70d0cd80f691 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## 8.46.2 (2025-10-20) + +### 🩹 Fixes + +- **eslint-plugin:** [prefer-optional-chain] skip optional chaining when it could change the result ([#11702](https://github.com/typescript-eslint/typescript-eslint/pull/11702)) +- **typescript-estree:** forbid invalid modifiers in object methods ([#11689](https://github.com/typescript-eslint/typescript-eslint/pull/11689)) + +### ❤️ Thank You + +- fisker Cheung @fisker +- mdm317 + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) ### 🩹 Fixes diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 219f836785a8..9a06d637de6b 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.46.2 (2025-10-20) + +### 🩹 Fixes + +- **typescript-estree:** forbid invalid modifiers in object methods ([#11689](https://github.com/typescript-eslint/typescript-eslint/pull/11689)) + +### ❤️ Thank You + +- fisker Cheung @fisker + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) ### 🩹 Fixes diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index e43f80e01f69..8600476d5d93 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.46.1", + "version": "8.46.2", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 9e06dbd0a427..5f8478af51cb 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.46.2 (2025-10-20) + +### 🩹 Fixes + +- **eslint-plugin:** [prefer-optional-chain] skip optional chaining when it could change the result ([#11702](https://github.com/typescript-eslint/typescript-eslint/pull/11702)) + +### ❤️ Thank You + +- mdm317 + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) ### 🩹 Fixes diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 3e6ccd98b9a2..e9db228397fc 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.46.1", + "version": "8.46.2", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.46.1", - "@typescript-eslint/type-utils": "8.46.1", - "@typescript-eslint/utils": "8.46.1", - "@typescript-eslint/visitor-keys": "8.46.1", + "@typescript-eslint/scope-manager": "8.46.2", + "@typescript-eslint/type-utils": "8.46.2", + "@typescript-eslint/utils": "8.46.2", + "@typescript-eslint/visitor-keys": "8.46.2", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.46.1", - "@typescript-eslint/rule-tester": "8.46.1", + "@typescript-eslint/rule-schema-to-typescript-types": "8.46.2", + "@typescript-eslint/rule-tester": "8.46.2", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.46.1", + "@typescript-eslint/parser": "^8.46.2", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 1093507356f5..ec736fe1895d 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.2 (2025-10-20) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 1da67fef90bd..b9ffd9a0f414 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.46.1", + "version": "8.46.2", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.46.1", - "@typescript-eslint/types": "8.46.1", - "@typescript-eslint/typescript-estree": "8.46.1", - "@typescript-eslint/visitor-keys": "8.46.1", + "@typescript-eslint/scope-manager": "8.46.2", + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/typescript-estree": "8.46.2", + "@typescript-eslint/visitor-keys": "8.46.2", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 3b10c4596cbc..39d8edafc1f1 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.2 (2025-10-20) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 78212eb7ec89..25d5ec63d411 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.46.1", + "version": "8.46.2", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.46.1", - "@typescript-eslint/types": "^8.46.1", + "@typescript-eslint/tsconfig-utils": "^8.46.2", + "@typescript-eslint/types": "^8.46.2", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 45091e92496a..9d3ac0d4e6b9 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.2 (2025-10-20) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 31da5b8086b6..1c00582f8289 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.46.1", + "version": "8.46.2", "description": "Converts ESLint rule schemas to equivalent TypeScript type strings.", "type": "module", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.46.1", - "@typescript-eslint/utils": "8.46.1", + "@typescript-eslint/type-utils": "8.46.2", + "@typescript-eslint/utils": "8.46.2", "natural-compare": "^1.4.0" }, "devDependencies": { diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 10762eb60663..b9403187bad2 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.2 (2025-10-20) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index d94d3b565be6..a82b4e90ed7d 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.46.1", + "version": "8.46.2", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.46.1", - "@typescript-eslint/typescript-estree": "8.46.1", - "@typescript-eslint/utils": "8.46.1", + "@typescript-eslint/parser": "8.46.2", + "@typescript-eslint/typescript-estree": "8.46.2", + "@typescript-eslint/utils": "8.46.2", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 5c73caa90084..010cca475467 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.2 (2025-10-20) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 32669b55bcd3..e68de2ed85b5 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.46.1", + "version": "8.46.2", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.46.1", - "@typescript-eslint/visitor-keys": "8.46.1" + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/visitor-keys": "8.46.2" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.46.1", + "@typescript-eslint/typescript-estree": "8.46.2", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index ff51316e6f78..73b59c839a4c 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.2 (2025-10-20) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 970065ac322f..4edfcd5f79c3 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.46.1", + "version": "8.46.2", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index c46cf6e734e4..08911590278c 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.2 (2025-10-20) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 3adbe12ab697..1af3ef5db3e4 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.46.1", + "version": "8.46.2", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.46.1", - "@typescript-eslint/typescript-estree": "8.46.1", - "@typescript-eslint/utils": "8.46.1", + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/typescript-estree": "8.46.2", + "@typescript-eslint/utils": "8.46.2", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.46.1", + "@typescript-eslint/parser": "8.46.2", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 93ac7964f418..f71486b1b87f 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.2 (2025-10-20) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 3c25f4b1db49..19cc6743628b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.46.1", + "version": "8.46.2", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index aa8169b2ec5c..0d1d8a72af21 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.2 (2025-10-20) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 8563c8a0cde6..c8d4e1fabb50 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.46.1", + "version": "8.46.2", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.46.1", - "@typescript-eslint/parser": "8.46.1", - "@typescript-eslint/typescript-estree": "8.46.1", - "@typescript-eslint/utils": "8.46.1" + "@typescript-eslint/eslint-plugin": "8.46.2", + "@typescript-eslint/parser": "8.46.2", + "@typescript-eslint/typescript-estree": "8.46.2", + "@typescript-eslint/utils": "8.46.2" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 41aa41f43b2f..e26dbab2f234 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.46.2 (2025-10-20) + +### 🩹 Fixes + +- **typescript-estree:** forbid invalid modifiers in object methods ([#11689](https://github.com/typescript-eslint/typescript-eslint/pull/11689)) + +### ❤️ Thank You + +- fisker Cheung @fisker + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) This was a version bump only for typescript-estree to align it with other projects, there were no code changes. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index a734ec40bfc3..34bbf0151832 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.46.1", + "version": "8.46.2", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.46.1", - "@typescript-eslint/tsconfig-utils": "8.46.1", - "@typescript-eslint/types": "8.46.1", - "@typescript-eslint/visitor-keys": "8.46.1", + "@typescript-eslint/project-service": "8.46.2", + "@typescript-eslint/tsconfig-utils": "8.46.2", + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/visitor-keys": "8.46.2", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 19eb831f87e7..dc2decc40f6e 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.2 (2025-10-20) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index 4cec4b04e2bd..e0b957631759 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.46.1", + "version": "8.46.2", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.46.1", - "@typescript-eslint/types": "8.46.1", - "@typescript-eslint/typescript-estree": "8.46.1" + "@typescript-eslint/scope-manager": "8.46.2", + "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/typescript-estree": "8.46.2" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index fd4d06aadeb2..594003fc0d7b 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.2 (2025-10-20) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.1 (2025-10-13) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 653f7dc4c6ca..0c8ef51d174b 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.46.1", + "version": "8.46.2", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.46.1", + "@typescript-eslint/types": "8.46.2", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 9436391c1844..1d2f40303570 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5903,19 +5903,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.46.1, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.46.2, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.46.1 - "@typescript-eslint/rule-tester": 8.46.1 - "@typescript-eslint/scope-manager": 8.46.1 - "@typescript-eslint/type-utils": 8.46.1 - "@typescript-eslint/utils": 8.46.1 - "@typescript-eslint/visitor-keys": 8.46.1 + "@typescript-eslint/rule-schema-to-typescript-types": 8.46.2 + "@typescript-eslint/rule-tester": 8.46.2 + "@typescript-eslint/scope-manager": 8.46.2 + "@typescript-eslint/type-utils": 8.46.2 + "@typescript-eslint/utils": 8.46.2 + "@typescript-eslint/visitor-keys": 8.46.2 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5938,7 +5938,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.46.1 + "@typescript-eslint/parser": ^8.46.2 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -5954,14 +5954,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.46.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.46.2, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.46.1 - "@typescript-eslint/types": 8.46.1 - "@typescript-eslint/typescript-estree": 8.46.1 - "@typescript-eslint/visitor-keys": 8.46.1 + "@typescript-eslint/scope-manager": 8.46.2 + "@typescript-eslint/types": 8.46.2 + "@typescript-eslint/typescript-estree": 8.46.2 + "@typescript-eslint/visitor-keys": 8.46.2 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -5975,12 +5975,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.46.1, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.46.2, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.46.1 - "@typescript-eslint/types": ^8.46.1 + "@typescript-eslint/tsconfig-utils": ^8.46.2 + "@typescript-eslint/types": ^8.46.2 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -5991,12 +5991,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.46.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.46.2, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.46.1 - "@typescript-eslint/utils": 8.46.1 + "@typescript-eslint/type-utils": 8.46.2 + "@typescript-eslint/utils": 8.46.2 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -6006,15 +6006,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.46.1, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.46.2, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.46.1 - "@typescript-eslint/typescript-estree": 8.46.1 - "@typescript-eslint/utils": 8.46.1 + "@typescript-eslint/parser": 8.46.2 + "@typescript-eslint/typescript-estree": 8.46.2 + "@typescript-eslint/utils": 8.46.2 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -6029,13 +6029,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.46.1, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.46.2, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.46.1 - "@typescript-eslint/typescript-estree": 8.46.1 - "@typescript-eslint/visitor-keys": 8.46.1 + "@typescript-eslint/types": 8.46.2 + "@typescript-eslint/typescript-estree": 8.46.2 + "@typescript-eslint/visitor-keys": 8.46.2 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -6046,7 +6046,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.46.1, @typescript-eslint/tsconfig-utils@^8.46.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.46.2, @typescript-eslint/tsconfig-utils@^8.46.2, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -6059,14 +6059,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.46.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.46.2, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.46.1 - "@typescript-eslint/types": 8.46.1 - "@typescript-eslint/typescript-estree": 8.46.1 - "@typescript-eslint/utils": 8.46.1 + "@typescript-eslint/parser": 8.46.2 + "@typescript-eslint/types": 8.46.2 + "@typescript-eslint/typescript-estree": 8.46.2 + "@typescript-eslint/utils": 8.46.2 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6081,7 +6081,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.46.1, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.46.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.46.2, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.46.2, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6155,15 +6155,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.46.1, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.46.2, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.46.1 - "@typescript-eslint/tsconfig-utils": 8.46.1 - "@typescript-eslint/types": 8.46.1 - "@typescript-eslint/visitor-keys": 8.46.1 + "@typescript-eslint/project-service": 8.46.2 + "@typescript-eslint/tsconfig-utils": 8.46.2 + "@typescript-eslint/types": 8.46.2 + "@typescript-eslint/visitor-keys": 8.46.2 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6181,14 +6181,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.46.1, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.46.2, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.46.1 - "@typescript-eslint/types": 8.46.1 - "@typescript-eslint/typescript-estree": 8.46.1 + "@typescript-eslint/scope-manager": 8.46.2 + "@typescript-eslint/types": 8.46.2 + "@typescript-eslint/typescript-estree": 8.46.2 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6200,11 +6200,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.46.1, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.46.2, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.46.1 + "@typescript-eslint/types": 8.46.2 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19679,10 +19679,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.46.1 - "@typescript-eslint/parser": 8.46.1 - "@typescript-eslint/typescript-estree": 8.46.1 - "@typescript-eslint/utils": 8.46.1 + "@typescript-eslint/eslint-plugin": 8.46.2 + "@typescript-eslint/parser": 8.46.2 + "@typescript-eslint/typescript-estree": 8.46.2 + "@typescript-eslint/utils": 8.46.2 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From bb451a1d342f169bc9b697ad97db5dfe2eb288c3 Mon Sep 17 00:00:00 2001 From: Ayomide Bamigbade Date: Fri, 31 Oct 2025 17:52:30 +0000 Subject: [PATCH 265/283] docs: fix dead link in defineConfig migration section (#11726) reroute broken 'shared configs" link --- docs/packages/TypeScript_ESLint.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/packages/TypeScript_ESLint.mdx b/docs/packages/TypeScript_ESLint.mdx index c1e5966d80fd..9533048caf83 100644 --- a/docs/packages/TypeScript_ESLint.mdx +++ b/docs/packages/TypeScript_ESLint.mdx @@ -245,7 +245,7 @@ At the time of writing there are a small number of known edge cases in which the ### Manual usage -[typescript-eslint's recommended and stylistic configurations](../users/configs) specify typescript-eslint `parser` and `plugin` options for you, so there is no need to manually provide those. +[typescript-eslint's recommended and stylistic configurations](../users/Shared_Configurations.mdx) specify typescript-eslint `parser` and `plugin` options for you, so there is no need to manually provide those. However, in complex ESLint configurations, you may find yourself manually specifying those options yourself. #### Manually configuring our plugin and parser From b8219d13dafd6bc5e425b51ad96810df1156b871 Mon Sep 17 00:00:00 2001 From: tao <2471314@gmail.com> Date: Tue, 4 Nov 2025 00:52:42 +0800 Subject: [PATCH 266/283] fix(eslint-plugin): [no-misused-promises] expand union type to retrieve target property (#11706) fix union type case --- .../src/rules/no-misused-promises.ts | 8 ++++---- .../tests/rules/no-misused-promises.test.ts | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-misused-promises.ts b/packages/eslint-plugin/src/rules/no-misused-promises.ts index b791fe150584..74f0690a5174 100644 --- a/packages/eslint-plugin/src/rules/no-misused-promises.ts +++ b/packages/eslint-plugin/src/rules/no-misused-promises.ts @@ -502,10 +502,10 @@ export default createRule({ if (objType == null) { return; } - const propertySymbol = checker.getPropertyOfType( - objType, - tsNode.name.text, - ); + const propertySymbol = tsutils + .unionConstituents(objType) + .map(t => checker.getPropertyOfType(t, tsNode.name.getText())) + .find(p => p); if (propertySymbol == null) { return; } diff --git a/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts b/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts index dc671e8869d6..fd908d416c08 100644 --- a/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts +++ b/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts @@ -2653,5 +2653,22 @@ const obj: O = { }, ], }, + { + code: ` +type A = { f: () => void } | undefined; +const a: A = { + async f() {}, +}; + `, + errors: [ + { + column: 3, + endColumn: 10, + endLine: 4, + line: 4, + messageId: 'voidReturnProperty', + }, + ], + }, ], }); From 897a2de4ad5a7946b18047bc9d082a267ea56ed8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 11:53:50 -0500 Subject: [PATCH 267/283] chore(deps): update dependency vite to v6.4.1 (#11712) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 269 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 172 insertions(+), 97 deletions(-) diff --git a/yarn.lock b/yarn.lock index 1d2f40303570..49ee444b24b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4611,142 +4611,156 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.46.3" +"@rollup/rollup-android-arm-eabi@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.52.5" conditions: os=android & cpu=arm languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-android-arm64@npm:4.46.3" +"@rollup/rollup-android-arm64@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-android-arm64@npm:4.52.5" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-darwin-arm64@npm:4.46.3" +"@rollup/rollup-darwin-arm64@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-darwin-arm64@npm:4.52.5" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-darwin-x64@npm:4.46.3" +"@rollup/rollup-darwin-x64@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-darwin-x64@npm:4.52.5" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-freebsd-arm64@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-freebsd-arm64@npm:4.46.3" +"@rollup/rollup-freebsd-arm64@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-freebsd-arm64@npm:4.52.5" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-freebsd-x64@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-freebsd-x64@npm:4.46.3" +"@rollup/rollup-freebsd-x64@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-freebsd-x64@npm:4.52.5" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.46.3" +"@rollup/rollup-linux-arm-gnueabihf@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.52.5" conditions: os=linux & cpu=arm & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.46.3" +"@rollup/rollup-linux-arm-musleabihf@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.52.5" conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.46.3" +"@rollup/rollup-linux-arm64-gnu@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.52.5" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.46.3" +"@rollup/rollup-linux-arm64-musl@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.52.5" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-loongarch64-gnu@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.46.3" +"@rollup/rollup-linux-loong64-gnu@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-linux-loong64-gnu@npm:4.52.5" conditions: os=linux & cpu=loong64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-ppc64-gnu@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.46.3" +"@rollup/rollup-linux-ppc64-gnu@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.52.5" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.46.3" +"@rollup/rollup-linux-riscv64-gnu@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.52.5" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-musl@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.46.3" +"@rollup/rollup-linux-riscv64-musl@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.52.5" conditions: os=linux & cpu=riscv64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.46.3" +"@rollup/rollup-linux-s390x-gnu@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.52.5" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.46.3" +"@rollup/rollup-linux-x64-gnu@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.52.5" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.46.3" +"@rollup/rollup-linux-x64-musl@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.52.5" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.46.3" +"@rollup/rollup-openharmony-arm64@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-openharmony-arm64@npm:4.52.5" + conditions: os=openharmony & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-arm64-msvc@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.52.5" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.46.3" +"@rollup/rollup-win32-ia32-msvc@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.52.5" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.46.3": - version: 4.46.3 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.46.3" +"@rollup/rollup-win32-x64-gnu@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-win32-x64-gnu@npm:4.52.5" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-x64-msvc@npm:4.52.5": + version: 4.52.5 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.52.5" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -10637,7 +10651,7 @@ __metadata: languageName: node linkType: hard -"fdir@npm:^6.4.4": +"fdir@npm:^6.4.4, fdir@npm:^6.5.0": version: 6.5.0 resolution: "fdir@npm:6.5.0" peerDependencies: @@ -17874,30 +17888,32 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^4.34.9": - version: 4.46.3 - resolution: "rollup@npm:4.46.3" - dependencies: - "@rollup/rollup-android-arm-eabi": 4.46.3 - "@rollup/rollup-android-arm64": 4.46.3 - "@rollup/rollup-darwin-arm64": 4.46.3 - "@rollup/rollup-darwin-x64": 4.46.3 - "@rollup/rollup-freebsd-arm64": 4.46.3 - "@rollup/rollup-freebsd-x64": 4.46.3 - "@rollup/rollup-linux-arm-gnueabihf": 4.46.3 - "@rollup/rollup-linux-arm-musleabihf": 4.46.3 - "@rollup/rollup-linux-arm64-gnu": 4.46.3 - "@rollup/rollup-linux-arm64-musl": 4.46.3 - "@rollup/rollup-linux-loongarch64-gnu": 4.46.3 - "@rollup/rollup-linux-ppc64-gnu": 4.46.3 - "@rollup/rollup-linux-riscv64-gnu": 4.46.3 - "@rollup/rollup-linux-riscv64-musl": 4.46.3 - "@rollup/rollup-linux-s390x-gnu": 4.46.3 - "@rollup/rollup-linux-x64-gnu": 4.46.3 - "@rollup/rollup-linux-x64-musl": 4.46.3 - "@rollup/rollup-win32-arm64-msvc": 4.46.3 - "@rollup/rollup-win32-ia32-msvc": 4.46.3 - "@rollup/rollup-win32-x64-msvc": 4.46.3 +"rollup@npm:^4.34.9, rollup@npm:^4.43.0": + version: 4.52.5 + resolution: "rollup@npm:4.52.5" + dependencies: + "@rollup/rollup-android-arm-eabi": 4.52.5 + "@rollup/rollup-android-arm64": 4.52.5 + "@rollup/rollup-darwin-arm64": 4.52.5 + "@rollup/rollup-darwin-x64": 4.52.5 + "@rollup/rollup-freebsd-arm64": 4.52.5 + "@rollup/rollup-freebsd-x64": 4.52.5 + "@rollup/rollup-linux-arm-gnueabihf": 4.52.5 + "@rollup/rollup-linux-arm-musleabihf": 4.52.5 + "@rollup/rollup-linux-arm64-gnu": 4.52.5 + "@rollup/rollup-linux-arm64-musl": 4.52.5 + "@rollup/rollup-linux-loong64-gnu": 4.52.5 + "@rollup/rollup-linux-ppc64-gnu": 4.52.5 + "@rollup/rollup-linux-riscv64-gnu": 4.52.5 + "@rollup/rollup-linux-riscv64-musl": 4.52.5 + "@rollup/rollup-linux-s390x-gnu": 4.52.5 + "@rollup/rollup-linux-x64-gnu": 4.52.5 + "@rollup/rollup-linux-x64-musl": 4.52.5 + "@rollup/rollup-openharmony-arm64": 4.52.5 + "@rollup/rollup-win32-arm64-msvc": 4.52.5 + "@rollup/rollup-win32-ia32-msvc": 4.52.5 + "@rollup/rollup-win32-x64-gnu": 4.52.5 + "@rollup/rollup-win32-x64-msvc": 4.52.5 "@types/estree": 1.0.8 fsevents: ~2.3.2 dependenciesMeta: @@ -17921,7 +17937,7 @@ __metadata: optional: true "@rollup/rollup-linux-arm64-musl": optional: true - "@rollup/rollup-linux-loongarch64-gnu": + "@rollup/rollup-linux-loong64-gnu": optional: true "@rollup/rollup-linux-ppc64-gnu": optional: true @@ -17935,17 +17951,21 @@ __metadata: optional: true "@rollup/rollup-linux-x64-musl": optional: true + "@rollup/rollup-openharmony-arm64": + optional: true "@rollup/rollup-win32-arm64-msvc": optional: true "@rollup/rollup-win32-ia32-msvc": optional: true + "@rollup/rollup-win32-x64-gnu": + optional: true "@rollup/rollup-win32-x64-msvc": optional: true fsevents: optional: true bin: rollup: dist/bin/rollup - checksum: 8f99bdc4488c0af462c7cbebd042934d114c5232c45f427c8ef1b57d0127900b3fef6e1cf9c78f9c908adde9ebdc5b8166c026d3cf69c4f747d047126e52d245 + checksum: 7d641f8131e5b75c35eb4c11a03aff161183fcb4848c446b660959043aee4ac90c524388290f7ab9ef43e9e33add7d5d57d11135597c7a744df5905e487e198d languageName: node linkType: hard @@ -19348,13 +19368,13 @@ __metadata: languageName: node linkType: hard -"tinyglobby@npm:^0.2.12, tinyglobby@npm:^0.2.13, tinyglobby@npm:^0.2.14": - version: 0.2.14 - resolution: "tinyglobby@npm:0.2.14" +"tinyglobby@npm:^0.2.12, tinyglobby@npm:^0.2.13, tinyglobby@npm:^0.2.14, tinyglobby@npm:^0.2.15": + version: 0.2.15 + resolution: "tinyglobby@npm:0.2.15" dependencies: - fdir: ^6.4.4 - picomatch: ^4.0.2 - checksum: 261e986e3f2062dec3a582303bad2ce31b4634b9348648b46828c000d464b012cf474e38f503312367d4117c3f2f18611992738fca684040758bba44c24de522 + fdir: ^6.5.0 + picomatch: ^4.0.3 + checksum: 0e33b8babff966c6ab86e9b825a350a6a98a63700fa0bb7ae6cf36a7770a508892383adc272f7f9d17aaf46a9d622b455e775b9949a3f951eaaf5dfb26331d44 languageName: node linkType: hard @@ -20085,9 +20105,64 @@ __metadata: languageName: node linkType: hard -"vite@npm:^5.0.0 || ^6.0.0 || ^7.0.0-0, vite@npm:^6.3.5": - version: 6.3.5 - resolution: "vite@npm:6.3.5" +"vite@npm:^5.0.0 || ^6.0.0 || ^7.0.0-0": + version: 7.1.12 + resolution: "vite@npm:7.1.12" + dependencies: + esbuild: ^0.25.0 + fdir: ^6.5.0 + fsevents: ~2.3.3 + picomatch: ^4.0.3 + postcss: ^8.5.6 + rollup: ^4.43.0 + tinyglobby: ^0.2.15 + peerDependencies: + "@types/node": ^20.19.0 || >=22.12.0 + jiti: ">=1.21.0" + less: ^4.0.0 + lightningcss: ^1.21.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: ">=0.54.8" + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + dependenciesMeta: + fsevents: + optional: true + peerDependenciesMeta: + "@types/node": + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + bin: + vite: bin/vite.js + checksum: 4be31af222b94aeaf627443b37e13239ca81bedcf29fb952580272098b966314a5136edf65fbd5b66bbcc84cc1c48403fcadb79d858da4bad455fc9a0da263b7 + languageName: node + linkType: hard + +"vite@npm:^6.3.5": + version: 6.4.1 + resolution: "vite@npm:6.4.1" dependencies: esbuild: ^0.25.0 fdir: ^6.4.4 @@ -20136,7 +20211,7 @@ __metadata: optional: true bin: vite: bin/vite.js - checksum: b7f1ebaae483090441f17ca09ea2c9b803688d2a2ed9860fbd8b72271918776ea3ceca643e807a5ee00628d65b79656d32529a4b8dd388aa33e41bc3f38732d0 + checksum: 7a939dbd6569ba829a7c21a18f8eca395a3a13cb93ce0fec02e8aa462e127a8daac81d00f684086648d905786056bba1ad931f51d88f06835d3b972bc9fbddda languageName: node linkType: hard From 26a9f9485faa45d269fd701b5fb8b11c97d75144 Mon Sep 17 00:00:00 2001 From: Evgeny Stepanovych Date: Mon, 3 Nov 2025 17:59:34 +0100 Subject: [PATCH 268/283] fix(eslint-plugin): [no-duplicate-enum-values] support signed numbers (#11722) (#11723) * fix(eslint-plugin): [no-duplicate-enum-values] support explicitly signed numbers (#11722) * fix(eslint-plugin): [no-duplicate-enum-values] support explicitly signed numbers (#11722) * fix(eslint-plugin): [no-duplicate-enum-values] support explicitly signed numbers (#11722) --- .../src/rules/no-duplicate-enum-values.ts | 50 +++- .../rules/no-duplicate-enum-values.test.ts | 244 ++++++++++++++++++ 2 files changed, 282 insertions(+), 12 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts b/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts index c5a858dbdcaa..b9c6fe08d6e6 100644 --- a/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts +++ b/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts @@ -36,6 +36,15 @@ export default createRule({ ); } + function isSupportedUnary( + node: TSESTree.Expression, + ): node is TSESTree.UnaryExpression { + return ( + node.type === AST_NODE_TYPES.UnaryExpression && + ['-', '+'].includes(node.operator) + ); + } + function isStaticTemplateLiteral( node: TSESTree.Expression, ): node is TSESTree.TemplateLiteral { @@ -46,30 +55,47 @@ export default createRule({ ); } + function getMemberValue( + initializer: TSESTree.Expression, + ): number | string | undefined { + switch (true) { + case isStringLiteral(initializer): + case isNumberLiteral(initializer): + return initializer.value; + case isSupportedUnary(initializer): { + const inner = Number(getMemberValue(initializer.argument)); + if (Number.isNaN(inner)) { + return undefined; + } + + return initializer.operator === '-' ? -inner : inner; + } + case isStaticTemplateLiteral(initializer): + return initializer.quasis[0].value.cooked; + default: + return undefined; + } + } + return { TSEnumDeclaration(node: TSESTree.TSEnumDeclaration): void { const enumMembers = node.body.members; - const seenValues = new Set(); + const seenValues: (number | string)[] = []; enumMembers.forEach(member => { if (member.initializer == null) { return; } - let value: number | string | undefined; - if (isStringLiteral(member.initializer)) { - value = member.initializer.value; - } else if (isNumberLiteral(member.initializer)) { - value = member.initializer.value; - } else if (isStaticTemplateLiteral(member.initializer)) { - value = member.initializer.quasis[0].value.cooked; - } - + const value = getMemberValue(member.initializer); if (value == null) { return; } - if (seenValues.has(value)) { + const isAlreadyPresent = seenValues.some(seenValue => + Object.is(seenValue, value), + ); + if (isAlreadyPresent) { context.report({ node: member, messageId: 'duplicateValue', @@ -78,7 +104,7 @@ export default createRule({ }, }); } else { - seenValues.add(value); + seenValues.push(value); } }); }, diff --git a/packages/eslint-plugin/tests/rules/no-duplicate-enum-values.test.ts b/packages/eslint-plugin/tests/rules/no-duplicate-enum-values.test.ts index a2e00872bd7c..81840e8cfcb8 100644 --- a/packages/eslint-plugin/tests/rules/no-duplicate-enum-values.test.ts +++ b/packages/eslint-plugin/tests/rules/no-duplicate-enum-values.test.ts @@ -25,6 +25,54 @@ enum E { } `, ` +enum E { + A = -1, + B = -2, +} + `, + ` +enum E { + A = +1, + B = +2, +} + `, + ` +enum E { + A = +1, + B = -1, +} + `, + ` +enum E { + A = 1, + B = -1, +} + `, + ` +enum E { + A = -0, + B = +0, +} + `, + ` +enum E { + A = -0, + B = 0, +} + `, + ` +enum E { + A = 1, + B = '1', +} + `, + ` +enum E { + A = -1, + B = '-1', +} + `, + ` enum E { A = 'A', B = 'B', @@ -74,6 +122,42 @@ enum E { } `, ` +enum E { + A = NaN, + B = NaN, +} + `, + ` +enum E { + A = NaN, + B = -NaN, +} + `, + ` +enum E { + A = 'NaN', + B = NaN, +} + `, + ` +enum E { + A = -+-0, + B = +-+0, +} + `, + ` +enum E { + A = -'', + B = 0, +} + `, + ` +enum E { + A = Infinity, + B = Infinity, +} + `, + ` const A = 'A'; enum E { A = 'A', @@ -100,6 +184,166 @@ enum E { }, { code: ` +enum E { + A = -1, + B = -1, +} + `, + errors: [ + { + column: 3, + data: { value: -1 }, + line: 4, + messageId: 'duplicateValue', + }, + ], + }, + { + code: ` +enum E { + A = +1, + B = +1, +} + `, + errors: [ + { + column: 3, + data: { value: 1 }, + line: 4, + messageId: 'duplicateValue', + }, + ], + }, + { + code: ` +enum E { + A = +0, + B = 0, +} + `, + errors: [ + { + column: 3, + data: { value: 0 }, + line: 4, + messageId: 'duplicateValue', + }, + ], + }, + { + code: ` +enum E { + A = -0, + B = -0, +} + `, + errors: [ + { + column: 3, + data: { value: -0 }, + line: 4, + messageId: 'duplicateValue', + }, + ], + }, + { + code: ` +enum E { + A = +'0', + B = 0, +} + `, + errors: [ + { + column: 3, + data: { value: 0 }, + line: 4, + messageId: 'duplicateValue', + }, + ], + }, + { + code: ` +enum E { + A = 0x10, + B = 16, +} + `, + errors: [ + { + column: 3, + data: { value: 0x10 }, + line: 4, + messageId: 'duplicateValue', + }, + ], + }, + { + code: ` +enum E { + A = +'1e2', + B = 100, +} + `, + errors: [ + { + column: 3, + data: { value: 1e2 }, + line: 4, + messageId: 'duplicateValue', + }, + ], + }, + { + code: ` +enum E { + A = +'', + B = 0, +} + `, + errors: [ + { + column: 3, + data: { value: 0 }, + line: 4, + messageId: 'duplicateValue', + }, + ], + }, + { + code: ` +enum E { + A = -+1, + B = +-1, +} + `, + errors: [ + { + column: 3, + data: { value: -1 }, + line: 4, + messageId: 'duplicateValue', + }, + ], + }, + { + code: ` +enum E { + A = -\`0\`, + B = -0, +} + `, + errors: [ + { + column: 3, + data: { value: -0 }, + line: 4, + messageId: 'duplicateValue', + }, + ], + }, + { + code: ` enum E { A = 'A', B = 'A', From d9f3497dfb72e90fd7dc977c77d41b0eb9df4909 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 3 Nov 2025 17:04:40 +0000 Subject: [PATCH 269/283] chore(release): publish 8.46.3 --- CHANGELOG.md | 14 +++ packages/ast-spec/CHANGELOG.md | 6 ++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 14 +++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 6 ++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 206 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70d0cd80f691..02528e3e3502 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## 8.46.3 (2025-11-03) + +### 🩹 Fixes + +- **eslint-plugin:** [no-misused-promises] expand union type to retrieve target property ([#11706](https://github.com/typescript-eslint/typescript-eslint/pull/11706)) +- **eslint-plugin:** [no-duplicate-enum-values] support signed numbers ([#11722](https://github.com/typescript-eslint/typescript-eslint/pull/11722), [#11723](https://github.com/typescript-eslint/typescript-eslint/pull/11723)) + +### ❤️ Thank You + +- Evgeny Stepanovych @undsoft +- tao + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) ### 🩹 Fixes diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 9a06d637de6b..664353c89248 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.3 (2025-11-03) + +This was a version bump only for ast-spec to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) ### 🩹 Fixes diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 8600476d5d93..9805ddca37f3 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.46.2", + "version": "8.46.3", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 5f8478af51cb..b2eeaa6446c5 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,17 @@ +## 8.46.3 (2025-11-03) + +### 🩹 Fixes + +- **eslint-plugin:** [no-duplicate-enum-values] support signed numbers ([#11722](https://github.com/typescript-eslint/typescript-eslint/pull/11722), [#11723](https://github.com/typescript-eslint/typescript-eslint/pull/11723)) +- **eslint-plugin:** [no-misused-promises] expand union type to retrieve target property ([#11706](https://github.com/typescript-eslint/typescript-eslint/pull/11706)) + +### ❤️ Thank You + +- Evgeny Stepanovych @undsoft +- tao + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) ### 🩹 Fixes diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index e9db228397fc..982d297e6530 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.46.2", + "version": "8.46.3", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.46.2", - "@typescript-eslint/type-utils": "8.46.2", - "@typescript-eslint/utils": "8.46.2", - "@typescript-eslint/visitor-keys": "8.46.2", + "@typescript-eslint/scope-manager": "8.46.3", + "@typescript-eslint/type-utils": "8.46.3", + "@typescript-eslint/utils": "8.46.3", + "@typescript-eslint/visitor-keys": "8.46.3", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.46.2", - "@typescript-eslint/rule-tester": "8.46.2", + "@typescript-eslint/rule-schema-to-typescript-types": "8.46.3", + "@typescript-eslint/rule-tester": "8.46.3", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.46.2", + "@typescript-eslint/parser": "^8.46.3", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index ec736fe1895d..7448bd8b8802 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.3 (2025-11-03) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index b9ffd9a0f414..2b35f484c596 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.46.2", + "version": "8.46.3", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.46.2", - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/typescript-estree": "8.46.2", - "@typescript-eslint/visitor-keys": "8.46.2", + "@typescript-eslint/scope-manager": "8.46.3", + "@typescript-eslint/types": "8.46.3", + "@typescript-eslint/typescript-estree": "8.46.3", + "@typescript-eslint/visitor-keys": "8.46.3", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 39d8edafc1f1..23b3efe4f184 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.3 (2025-11-03) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 25d5ec63d411..9420e463ce68 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.46.2", + "version": "8.46.3", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.46.2", - "@typescript-eslint/types": "^8.46.2", + "@typescript-eslint/tsconfig-utils": "^8.46.3", + "@typescript-eslint/types": "^8.46.3", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 9d3ac0d4e6b9..495cb12421ff 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.3 (2025-11-03) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 1c00582f8289..00d24a03ffd5 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.46.2", + "version": "8.46.3", "description": "Converts ESLint rule schemas to equivalent TypeScript type strings.", "type": "module", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.46.2", - "@typescript-eslint/utils": "8.46.2", + "@typescript-eslint/type-utils": "8.46.3", + "@typescript-eslint/utils": "8.46.3", "natural-compare": "^1.4.0" }, "devDependencies": { diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index b9403187bad2..de5cc90b783a 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.3 (2025-11-03) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index a82b4e90ed7d..0e36a8bde631 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.46.2", + "version": "8.46.3", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.46.2", - "@typescript-eslint/typescript-estree": "8.46.2", - "@typescript-eslint/utils": "8.46.2", + "@typescript-eslint/parser": "8.46.3", + "@typescript-eslint/typescript-estree": "8.46.3", + "@typescript-eslint/utils": "8.46.3", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 010cca475467..4950003089e4 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.3 (2025-11-03) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index e68de2ed85b5..59d80db0aa18 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.46.2", + "version": "8.46.3", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/visitor-keys": "8.46.2" + "@typescript-eslint/types": "8.46.3", + "@typescript-eslint/visitor-keys": "8.46.3" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.46.2", + "@typescript-eslint/typescript-estree": "8.46.3", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 73b59c839a4c..a729dbd0a67d 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.3 (2025-11-03) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 4edfcd5f79c3..daba953fdc62 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.46.2", + "version": "8.46.3", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 08911590278c..572180a845c8 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.3 (2025-11-03) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 1af3ef5db3e4..a39c7b64f632 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.46.2", + "version": "8.46.3", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/typescript-estree": "8.46.2", - "@typescript-eslint/utils": "8.46.2", + "@typescript-eslint/types": "8.46.3", + "@typescript-eslint/typescript-estree": "8.46.3", + "@typescript-eslint/utils": "8.46.3", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.46.2", + "@typescript-eslint/parser": "8.46.3", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index f71486b1b87f..f1b0380e1768 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.3 (2025-11-03) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 19cc6743628b..ee49cc9f573d 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.46.2", + "version": "8.46.3", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 0d1d8a72af21..c7c367d81489 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.3 (2025-11-03) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index c8d4e1fabb50..428942c4ade8 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.46.2", + "version": "8.46.3", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.46.2", - "@typescript-eslint/parser": "8.46.2", - "@typescript-eslint/typescript-estree": "8.46.2", - "@typescript-eslint/utils": "8.46.2" + "@typescript-eslint/eslint-plugin": "8.46.3", + "@typescript-eslint/parser": "8.46.3", + "@typescript-eslint/typescript-estree": "8.46.3", + "@typescript-eslint/utils": "8.46.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index e26dbab2f234..f374d1e9361d 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.3 (2025-11-03) + +This was a version bump only for typescript-estree to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) ### 🩹 Fixes diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 34bbf0151832..79bbc5c51f21 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.46.2", + "version": "8.46.3", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.46.2", - "@typescript-eslint/tsconfig-utils": "8.46.2", - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/visitor-keys": "8.46.2", + "@typescript-eslint/project-service": "8.46.3", + "@typescript-eslint/tsconfig-utils": "8.46.3", + "@typescript-eslint/types": "8.46.3", + "@typescript-eslint/visitor-keys": "8.46.3", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index dc2decc40f6e..35b26eff87f1 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.3 (2025-11-03) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index e0b957631759..40fa08156694 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.46.2", + "version": "8.46.3", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.46.2", - "@typescript-eslint/types": "8.46.2", - "@typescript-eslint/typescript-estree": "8.46.2" + "@typescript-eslint/scope-manager": "8.46.3", + "@typescript-eslint/types": "8.46.3", + "@typescript-eslint/typescript-estree": "8.46.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 594003fc0d7b..fd0275ccab35 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.3 (2025-11-03) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.2 (2025-10-20) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 0c8ef51d174b..5730b8f6b4de 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.46.2", + "version": "8.46.3", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.46.2", + "@typescript-eslint/types": "8.46.3", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 49ee444b24b6..e8b9d112cb4f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5917,19 +5917,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.46.2, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.46.3, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.46.2 - "@typescript-eslint/rule-tester": 8.46.2 - "@typescript-eslint/scope-manager": 8.46.2 - "@typescript-eslint/type-utils": 8.46.2 - "@typescript-eslint/utils": 8.46.2 - "@typescript-eslint/visitor-keys": 8.46.2 + "@typescript-eslint/rule-schema-to-typescript-types": 8.46.3 + "@typescript-eslint/rule-tester": 8.46.3 + "@typescript-eslint/scope-manager": 8.46.3 + "@typescript-eslint/type-utils": 8.46.3 + "@typescript-eslint/utils": 8.46.3 + "@typescript-eslint/visitor-keys": 8.46.3 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5952,7 +5952,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.46.2 + "@typescript-eslint/parser": ^8.46.3 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -5968,14 +5968,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.46.2, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.46.3, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.46.2 - "@typescript-eslint/types": 8.46.2 - "@typescript-eslint/typescript-estree": 8.46.2 - "@typescript-eslint/visitor-keys": 8.46.2 + "@typescript-eslint/scope-manager": 8.46.3 + "@typescript-eslint/types": 8.46.3 + "@typescript-eslint/typescript-estree": 8.46.3 + "@typescript-eslint/visitor-keys": 8.46.3 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -5989,12 +5989,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.46.2, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.46.3, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.46.2 - "@typescript-eslint/types": ^8.46.2 + "@typescript-eslint/tsconfig-utils": ^8.46.3 + "@typescript-eslint/types": ^8.46.3 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -6005,12 +6005,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.46.2, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.46.3, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.46.2 - "@typescript-eslint/utils": 8.46.2 + "@typescript-eslint/type-utils": 8.46.3 + "@typescript-eslint/utils": 8.46.3 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -6020,15 +6020,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.46.2, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.46.3, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.46.2 - "@typescript-eslint/typescript-estree": 8.46.2 - "@typescript-eslint/utils": 8.46.2 + "@typescript-eslint/parser": 8.46.3 + "@typescript-eslint/typescript-estree": 8.46.3 + "@typescript-eslint/utils": 8.46.3 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -6043,13 +6043,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.46.2, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.46.3, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.46.2 - "@typescript-eslint/typescript-estree": 8.46.2 - "@typescript-eslint/visitor-keys": 8.46.2 + "@typescript-eslint/types": 8.46.3 + "@typescript-eslint/typescript-estree": 8.46.3 + "@typescript-eslint/visitor-keys": 8.46.3 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -6060,7 +6060,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.46.2, @typescript-eslint/tsconfig-utils@^8.46.2, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.46.3, @typescript-eslint/tsconfig-utils@^8.46.3, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -6073,14 +6073,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.46.2, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.46.3, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.46.2 - "@typescript-eslint/types": 8.46.2 - "@typescript-eslint/typescript-estree": 8.46.2 - "@typescript-eslint/utils": 8.46.2 + "@typescript-eslint/parser": 8.46.3 + "@typescript-eslint/types": 8.46.3 + "@typescript-eslint/typescript-estree": 8.46.3 + "@typescript-eslint/utils": 8.46.3 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6095,7 +6095,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.46.2, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.46.2, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.46.3, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.46.3, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6169,15 +6169,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.46.2, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.46.3, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.46.2 - "@typescript-eslint/tsconfig-utils": 8.46.2 - "@typescript-eslint/types": 8.46.2 - "@typescript-eslint/visitor-keys": 8.46.2 + "@typescript-eslint/project-service": 8.46.3 + "@typescript-eslint/tsconfig-utils": 8.46.3 + "@typescript-eslint/types": 8.46.3 + "@typescript-eslint/visitor-keys": 8.46.3 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6195,14 +6195,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.46.2, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.46.3, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.46.2 - "@typescript-eslint/types": 8.46.2 - "@typescript-eslint/typescript-estree": 8.46.2 + "@typescript-eslint/scope-manager": 8.46.3 + "@typescript-eslint/types": 8.46.3 + "@typescript-eslint/typescript-estree": 8.46.3 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6214,11 +6214,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.46.2, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.46.3, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.46.2 + "@typescript-eslint/types": 8.46.3 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19699,10 +19699,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.46.2 - "@typescript-eslint/parser": 8.46.2 - "@typescript-eslint/typescript-estree": 8.46.2 - "@typescript-eslint/utils": 8.46.2 + "@typescript-eslint/eslint-plugin": 8.46.3 + "@typescript-eslint/parser": 8.46.3 + "@typescript-eslint/typescript-estree": 8.46.3 + "@typescript-eslint/utils": 8.46.3 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From 2d166a369b285ed5debb65a9d09eb1500f4fb71c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Mon, 3 Nov 2025 12:42:42 -0500 Subject: [PATCH 270/283] chore: correct vue-sfc snapshot availableUntil values (#11739) --- .../tests/__snapshots__/vue-sfc.test.ts.snap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 bc5a5421f36f..47834e83db29 100644 --- a/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap @@ -61,7 +61,7 @@ export default Vue.extend({ "usedDeprecatedRules": [ { "info": { - "availableUntil": "10.0.0", + "availableUntil": "11.0.0", "deprecatedSince": "8.53.0", "message": "Formatting rules are being moved out of ESLint core.", "replacedBy": [ @@ -123,7 +123,7 @@ export default class Utility { "usedDeprecatedRules": [ { "info": { - "availableUntil": "10.0.0", + "availableUntil": "11.0.0", "deprecatedSince": "8.53.0", "message": "Formatting rules are being moved out of ESLint core.", "replacedBy": [ @@ -202,7 +202,7 @@ export default Vue.extend({ "usedDeprecatedRules": [ { "info": { - "availableUntil": "10.0.0", + "availableUntil": "11.0.0", "deprecatedSince": "8.53.0", "message": "Formatting rules are being moved out of ESLint core.", "replacedBy": [ From ea2ee6b65a2f14dd2c3fc8d12be969cbeaef80a8 Mon Sep 17 00:00:00 2001 From: Ulrich Stark Date: Mon, 3 Nov 2025 20:00:20 +0100 Subject: [PATCH 271/283] chore(eslint-plugin): use correct type for return type of `createValidator` (#11721) refactor(eslint-plugin): use correct type for return type of `createValidator` --- .../src/rules/naming-convention-utils/validator.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts index 83bf51a0ecfb..669f44e12f86 100644 --- a/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts +++ b/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts @@ -4,7 +4,7 @@ import type * as ts from 'typescript'; import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import type { SelectorsString } from './enums'; -import type { Context, NormalizedSelector } from './types'; +import type { Context, NormalizedSelector, ValidatorFunction } from './types'; import { getParserServices } from '../../util'; import { @@ -26,9 +26,7 @@ export function createValidator( type: SelectorsString, context: Context, allConfigs: NormalizedSelector[], -): ( - node: TSESTree.Identifier | TSESTree.Literal | TSESTree.PrivateIdentifier, -) => void { +): ValidatorFunction { // make sure the "highest priority" configs are checked first const selectorType = Selectors[type]; const configs = allConfigs @@ -72,10 +70,7 @@ export function createValidator( return b.selector - a.selector; }); - return ( - node: TSESTree.Identifier | TSESTree.Literal | TSESTree.PrivateIdentifier, - modifiers: Set = new Set(), - ): void => { + return (node, modifiers = new Set()): void => { const originalName = node.type === AST_NODE_TYPES.Identifier || node.type === AST_NODE_TYPES.PrivateIdentifier From c779f3cd80c41ecfc279fd9c66651314b97d843e Mon Sep 17 00:00:00 2001 From: Evgeny Stepanovych Date: Fri, 7 Nov 2025 18:59:24 +0100 Subject: [PATCH 272/283] fix(eslint-plugin): [no-deprecated] fix double-report on computed literal identifiers (#11006) * fix(eslint-plugin): [no-deprecated] adds support for string literal member access (#10958) * fix(eslint-plugin): [no-deprecated] adds support for computed member access (#10958) * fix(eslint-plugin): [no-deprecated] adds support for computed member access (#10958) * fix(eslint-plugin): [no-deprecated] adds support for computed member access (#10958) * fix(eslint-plugin): [no-deprecated] adds support for computed member access (#10958) * Unified branches of logic * git checkout main -- .vscode/launch.json * Update packages/eslint-plugin/tests/rules/no-deprecated.test.ts Co-authored-by: Ronen Amiel * Remove remaining unnecessary console.logs * Literal test for numbers * Retarget to just the computed identifier * Remove change noise --------- Co-authored-by: Josh Goldberg Co-authored-by: Ronen Amiel --- .../eslint-plugin/src/rules/no-deprecated.ts | 9 + .../tests/rules/no-deprecated.test.ts | 788 ++++++++++++++++-- 2 files changed, 744 insertions(+), 53 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-deprecated.ts b/packages/eslint-plugin/src/rules/no-deprecated.ts index f186feec02ae..cc6bb70be9c4 100644 --- a/packages/eslint-plugin/src/rules/no-deprecated.ts +++ b/packages/eslint-plugin/src/rules/no-deprecated.ts @@ -455,6 +455,15 @@ export default createRule({ return; } + // Computed identifier expressions are handled by checkMemberExpression + if ( + parent.type === AST_NODE_TYPES.MemberExpression && + parent.computed && + parent.property === node + ) { + return; + } + if (parent.type === AST_NODE_TYPES.ExportSpecifier) { // only deal with the alias (exported) side, not the local binding if (parent.exported !== node) { diff --git a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts index 6a643ab704c8..b40eb26fb978 100644 --- a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts +++ b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts @@ -45,8 +45,42 @@ ruleTester.run('no-deprecated', rule, { /** @deprecated */ c: 2, }; + a['b']; + `, + ` + const a = { + b: 1, + /** @deprecated */ c: 2, + }; + + a['b' + 'c']; + `, + ` + const a = { + b: 1, + /** @deprecated */ c: 2, + }; + + const key = 'b'; + + a[key]; + `, + ` + const a = { + b: 1, + /** @deprecated */ c: 2, + }; + a?.b; `, + ` + const a = { + b: 1, + /** @deprecated */ c: 2, + }; + + a?.['b']; + `, ` declare const a: { b: 1; @@ -55,6 +89,52 @@ ruleTester.run('no-deprecated', rule, { a.b; `, + ` + declare const a: { + b: 1; + /** @deprecated */ c: 2; + }; + + a['b']; + `, + ` + declare const a: { + b: 1; + /** @deprecated */ c: 2; + }; + + a[\`\${'b'}\`]; + `, + ` + declare const a: { + b: 1; + /** @deprecated */ c: 2; + }; + + const key = 'b'; + + a[\`\${key}\`]; + `, + ` + declare const a: { + /** @deprecated */ c: 1; + cc: 2; + }; + + const key = 'c'; + + a[\`\${key + key}\`]; + `, + ` + declare const a: { + /** @deprecated */ c: 1; + cc: 2; + }; + + const key = 'c'; + + a[\`\${key}\${key}\`]; + `, ` class A { b: 1; @@ -63,6 +143,41 @@ ruleTester.run('no-deprecated', rule, { new A().b; `, + ` + class A { + b: 1; + /** @deprecated */ c: 2; + } + + new A()['b']; + `, + ` + class A { + b: 1; + /** @deprecated */ c: 2; + } + const key = 'b'; + + new A()[b]; + `, + ` + class A { + c: 1; + } + class B { + /** @deprecated */ c: 2; + } + + new A()['c']; + `, + ` + class A { + b: () => {}; + /** @deprecated */ c: () => {}; + } + + new A()['b'](); + `, ` class A { accessor b: 1; @@ -71,6 +186,14 @@ ruleTester.run('no-deprecated', rule, { new A().b; `, + ` + class A { + accessor b: 1; + /** @deprecated */ accessor c: 2; + } + + new A()['b']; + `, ` declare class A { /** @deprecated */ @@ -80,6 +203,15 @@ ruleTester.run('no-deprecated', rule, { A.c; `, + ` + declare class A { + /** @deprecated */ + static b: string; + static c: string; + } + + A['c']; + `, ` declare class A { /** @deprecated */ @@ -89,6 +221,15 @@ ruleTester.run('no-deprecated', rule, { A.c; `, + ` + declare class A { + /** @deprecated */ + static accessor b: string; + static accessor c: string; + } + + A['c']; + `, ` namespace A { /** @deprecated */ @@ -98,6 +239,15 @@ ruleTester.run('no-deprecated', rule, { A.c; `, + ` + namespace A { + /** @deprecated */ + export const b = ''; + export const c = ''; + } + + A['c']; + `, ` enum A { /** @deprecated */ @@ -107,6 +257,15 @@ ruleTester.run('no-deprecated', rule, { A.c; `, + ` + enum A { + /** @deprecated */ + b = 'b', + c = 'c', + } + + A['c']; + `, ` function a(value: 'b' | undefined): void; /** @deprecated */ @@ -476,30 +635,6 @@ exists('/foo'); const c = a['b']; `, - { - code: ` - interface AllowedType { - /** @deprecated */ - prop: string; - } - - const obj: AllowedType = { - prop: 'test', - }; - - const value = obj['prop']; - `, - options: [ - { - allow: [ - { - from: 'file', - name: 'AllowedType', - }, - ], - }, - ], - }, ` const a = { /** @deprecated */ @@ -755,13 +890,13 @@ exists('/foo'); { code: ` /** @deprecated */ const a = { b: 1 }; - console.log(a); + a; `, errors: [ { - column: 21, + column: 9, data: { name: 'a' }, - endColumn: 22, + endColumn: 10, endLine: 3, line: 3, messageId: 'deprecated', @@ -806,13 +941,13 @@ exists('/foo'); { code: ` /** @deprecated */ const a = { b: 1 }; - console.log(a.b); + a.b; `, errors: [ { - column: 21, + column: 9, data: { name: 'a' }, - endColumn: 22, + endColumn: 10, endLine: 3, line: 3, messageId: 'deprecated', @@ -822,13 +957,45 @@ exists('/foo'); { code: ` /** @deprecated */ const a = { b: 1 }; - console.log(a?.b); + a['b']; `, errors: [ { - column: 21, + column: 9, data: { name: 'a' }, - endColumn: 22, + endColumn: 10, + endLine: 3, + line: 3, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + /** @deprecated */ const a = { b: 1 }; + a?.b; + `, + errors: [ + { + column: 9, + data: { name: 'a' }, + endColumn: 10, + endLine: 3, + line: 3, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + /** @deprecated */ const a = { b: 1 }; + a?.['b']; + `, + errors: [ + { + column: 9, + data: { name: 'a' }, + endColumn: 10, endLine: 3, line: 3, messageId: 'deprecated', @@ -883,6 +1050,22 @@ exists('/foo'); }, ], }, + { + code: ` + /** @deprecated */ const a = { b: { c: 1 } }; + a?.['b']?.['c']; + `, + errors: [ + { + column: 9, + data: { name: 'a' }, + endColumn: 10, + endLine: 3, + line: 3, + messageId: 'deprecated', + }, + ], + }, { code: ` const a = { @@ -901,6 +1084,43 @@ exists('/foo'); }, ], }, + { + code: ` + const a = { + /** @deprecated */ b: 1, + }; + const key = 'b'; + a[key]; + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 14, + endLine: 6, + line: 6, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + const a = { + /** @deprecated */ b: { c: 1 }, + }; + a['b']['c']; + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 14, + endLine: 5, + line: 5, + messageId: 'deprecated', + }, + ], + }, { code: ` declare const a: { @@ -1212,13 +1432,238 @@ exists('/foo'); declare const a: A; - const { b } = a; + const { b } = a; + `, + errors: [ + { + column: 17, + data: { name: 'b' }, + endColumn: 18, + endLine: 9, + line: 9, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + declare class A { + /** @deprecated */ + b(): string; + } + + declare const a: A; + + a.b; + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 12, + endLine: 9, + line: 9, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + declare class A { + /** @deprecated */ + b(): string; + } + + declare const a: A; + const key = 'b'; + + a[key]; + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 14, + endLine: 10, + line: 10, + messageId: 'deprecated', + }, + ], + }, + { + // only: true, + code: ` + declare class A { + /** @deprecated */ + b(): string; + } + + declare const a: A; + const key = 'b'; + + a[key](); + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 14, + endLine: 10, + line: 10, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + declare class A { + /** @deprecated */ + b(): string; + } + + declare const a: A; + + a.b(); + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 12, + endLine: 9, + line: 9, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + declare class A { + /** @deprecated */ + b: () => string; + } + + declare const a: A; + + a.b; + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 12, + endLine: 9, + line: 9, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + declare class A { + /** @deprecated */ + b: () => string; + } + + declare const a: A; + + a['b']; + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 14, + endLine: 9, + line: 9, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + declare class A { + /** @deprecated */ + b(): string; + } + + declare const a: A; + const key = 'b'; + + a[\`\${key}\`]; + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 19, + endLine: 10, + line: 10, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + declare class A { + /** @deprecated */ + computed(): string; + } + + declare const a: A; + const k1 = 'comp'; + const k2 = 'uted'; + + a[\`\${k1}\${k2}\`]; + `, + errors: [ + { + column: 11, + data: { name: 'computed' }, + endColumn: 23, + endLine: 11, + line: 11, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + declare class A { + /** @deprecated */ + b(): string; + } + + declare const a: A; + const c = \`\${a.b}\`; + `, + errors: [ + { + column: 24, + data: { name: 'b' }, + endColumn: 25, + endLine: 8, + line: 8, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + declare class A { + /** @deprecated */ + b: () => string; + } + + declare const a: A; + + a.b(); `, errors: [ { - column: 17, + column: 11, data: { name: 'b' }, - endColumn: 18, + endColumn: 12, endLine: 9, line: 9, messageId: 'deprecated', @@ -1229,18 +1674,18 @@ exists('/foo'); code: ` declare class A { /** @deprecated */ - b(): string; + b: () => string; } declare const a: A; - a.b; + a['b'](); `, errors: [ { column: 11, data: { name: 'b' }, - endColumn: 12, + endColumn: 14, endLine: 9, line: 9, messageId: 'deprecated', @@ -1249,9 +1694,9 @@ exists('/foo'); }, { code: ` - declare class A { + interface A { /** @deprecated */ - b(): string; + b: () => string; } declare const a: A; @@ -1271,44 +1716,46 @@ exists('/foo'); }, { code: ` - declare class A { + interface A { /** @deprecated */ b: () => string; } declare const a: A; + const key = 'b'; - a.b; + a[key]; `, errors: [ { column: 11, data: { name: 'b' }, - endColumn: 12, - endLine: 9, - line: 9, + endColumn: 14, + endLine: 10, + line: 10, messageId: 'deprecated', }, ], }, { code: ` - declare class A { + interface A { /** @deprecated */ b: () => string; } declare const a: A; + const key = 'b'; - a.b(); + a[key](); `, errors: [ { column: 11, data: { name: 'b' }, - endColumn: 12, - endLine: 9, - line: 9, + endColumn: 14, + endLine: 10, + line: 10, messageId: 'deprecated', }, ], @@ -1322,13 +1769,13 @@ exists('/foo'); declare const a: A; - a.b(); + a['b'](); `, errors: [ { column: 11, data: { name: 'b' }, - endColumn: 12, + endColumn: 14, endLine: 9, line: 9, messageId: 'deprecated', @@ -1402,6 +1849,26 @@ exists('/foo'); }, ], }, + { + code: ` + declare class A { + /** @deprecated */ + static b: string; + } + + A['b']; + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 14, + endLine: 7, + line: 7, + messageId: 'deprecated', + }, + ], + }, { code: ` declare const a: { @@ -1422,6 +1889,26 @@ exists('/foo'); }, ], }, + { + code: ` + declare const a: { + /** @deprecated */ + b: string; + }; + + a['b']; + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 14, + endLine: 7, + line: 7, + messageId: 'deprecated', + }, + ], + }, { code: ` interface A { @@ -1594,6 +2081,26 @@ exists('/foo'); }, ], }, + { + code: ` + namespace A { + /** @deprecated */ + export const b = ''; + } + + A['b']; + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 14, + endLine: 7, + line: 7, + messageId: 'deprecated', + }, + ], + }, { code: ` export namespace A { @@ -1634,6 +2141,26 @@ exists('/foo'); }, ], }, + { + code: ` + namespace A { + /** @deprecated */ + export function b() {} + } + + A['b'](); + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 14, + endLine: 7, + line: 7, + messageId: 'deprecated', + }, + ], + }, { code: ` namespace assert { @@ -1720,6 +2247,48 @@ exists('/foo'); }, ], }, + { + code: ` + enum A { + /** @deprecated */ + a, + } + + const key = 'a'; + + A[key]; + `, + errors: [ + { + column: 11, + data: { name: 'a' }, + endColumn: 14, + endLine: 9, + line: 9, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + enum A { + /** @deprecated */ + a, + } + + A['a']; + `, + errors: [ + { + column: 11, + data: { name: 'a' }, + endColumn: 14, + endLine: 7, + line: 7, + messageId: 'deprecated', + }, + ], + }, { code: ` /** @deprecated */ @@ -3074,6 +3643,28 @@ exists('/foo'); declare const a: A; + a['b']; + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 14, + endLine: 9, + line: 9, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + declare class A { + /** @deprecated */ + accessor b: () => string; + } + + declare const a: A; + a.b(); `, errors: [ @@ -3087,6 +3678,28 @@ exists('/foo'); }, ], }, + { + code: ` + declare class A { + /** @deprecated */ + accessor b: () => string; + } + + declare const a: A; + + a['b'](); + `, + errors: [ + { + column: 11, + data: { name: 'b' }, + endColumn: 14, + endLine: 9, + line: 9, + messageId: 'deprecated', + }, + ], + }, { code: ` class A { @@ -3260,6 +3873,31 @@ exists('/foo'); }, ], }, + { + code: ` + declare const Keys: { + a: 1; + }; + + const a = { + /** @deprecated reason for deprecation */ + [1]: 'string', + }; + + const key = Keys.a; + const c = a[key]; + `, + errors: [ + { + column: 21, + data: { name: '1', reason: 'reason for deprecation' }, + endColumn: 24, + endLine: 12, + line: 12, + messageId: 'deprecatedWithReason', + }, + ], + }, { code: ` const a = { @@ -3301,6 +3939,50 @@ exists('/foo'); }, ], }, + { + code: ` + declare function x(): 'b'; + + const a = { + /** @deprecated */ + b: 'string', + }; + + const c = a[x()]; + `, + errors: [ + { + column: 21, + data: { name: 'b' }, + endColumn: 24, + endLine: 9, + line: 9, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + declare const x: { y: 'b' }; + + const a = { + /** @deprecated */ + b: 'string', + }; + + const c = a[x.y]; + `, + errors: [ + { + column: 21, + data: { name: 'b' }, + endColumn: 24, + endLine: 9, + line: 9, + messageId: 'deprecated', + }, + ], + }, { code: ` import { deprecatedFunction } from './deprecated'; From 32058d1ac4b49f6b7d7f7e9c1e5ac78ae72e09db Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Fri, 7 Nov 2025 12:59:53 -0500 Subject: [PATCH 273/283] docs: add note about "only: true" (#11679) * docs: add note about "only: true" * Update Local_Development.mdx --- docs/contributing/Local_Development.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/contributing/Local_Development.mdx b/docs/contributing/Local_Development.mdx index 19b883286fab..705c95f8b2bf 100644 --- a/docs/contributing/Local_Development.mdx +++ b/docs/contributing/Local_Development.mdx @@ -59,7 +59,9 @@ Changes must pass two linters for documentation and naming, the commands for whi All code changes should ideally be unit tested if possible. You can run `yarn test` in any package to run its tests. -> [VS Code launch tasks](https://code.visualstudio.com/docs/editor/tasks) tasks are provided that allow [visual debugging](https://code.visualstudio.com/docs/editor/debugging) tests. +Oftentimes, you will only want to run one specific test related to the bug you are fixing or the feature you are implementing. To do this, you can add `only: true` to the test object definition. (Doing this will cause a new lint error for `eslint-plugin/no-only-tests`, but just ignore it while you work. The lint rule is only there so that you remember to delete the `only: true` once it comes time to make a pull request.) + +> The repository has [Visual Studio Code launch tasks](https://code.visualstudio.com/docs/editor/tasks) that allow for [visually debugging tests](https://code.visualstudio.com/docs/editor/debugging). ### Type Checking From 189a7f76fc85661e0bebdedebd24a60c255e920d Mon Sep 17 00:00:00 2001 From: Kentaro Suzuki <71284054+sushichan044@users.noreply.github.com> Date: Sat, 8 Nov 2025 03:00:31 +0900 Subject: [PATCH 274/283] fix(eslint-plugin): handle override modifier in promise-function-async fixer (#11730) * fix(eslint-plugin): handle override modifier in promise-function-async fixer * fill issue number --- .../src/rules/promise-function-async.ts | 8 +- .../rules/promise-function-async.test.ts | 77 +++++++++++++++++++ 2 files changed, 82 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin/src/rules/promise-function-async.ts b/packages/eslint-plugin/src/rules/promise-function-async.ts index 1739e1508937..aca8a2f924f7 100644 --- a/packages/eslint-plugin/src/rules/promise-function-async.ts +++ b/packages/eslint-plugin/src/rules/promise-function-async.ts @@ -208,14 +208,16 @@ export default createRule({ ); } - // if current token is a keyword like `static` or `public` then skip it + // if current token is a keyword like `static` or `public`, or the `override` modifier, then skip it while ( - keyToken.type === AST_TOKEN_TYPES.Keyword && + (keyToken.type === AST_TOKEN_TYPES.Keyword || + (keyToken.type === AST_TOKEN_TYPES.Identifier && + keyToken.value === 'override')) && keyToken.range[0] < method.key.range[0] ) { keyToken = nullThrows( context.sourceCode.getTokenAfter(keyToken), - NullThrowsReasons.MissingToken('token', 'keyword'), + NullThrowsReasons.MissingToken('token', 'modifier keyword'), ); } diff --git a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts index 587445eba9b9..4807d8a1c970 100644 --- a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts +++ b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts @@ -222,6 +222,26 @@ function overloadingThatIncludeAny(a?: boolean): any | number { `, options: [{ allowAny: true }], }, + ` +class Base { + async foo() { + return Promise.resolve(42); + } +} + +class Derived extends Base { + override async foo() { + return Promise.resolve(2000); + } +} + `, + ` +class Test { + public override async method() { + return Promise.resolve(1); + } +} + `, ], invalid: [ { @@ -942,5 +962,62 @@ function overloadingThatIncludeUnknown(a?: boolean): unknown | number { ], options: [{ allowAny: false }], }, + // https://github.com/typescript-eslint/typescript-eslint/issues/11729 + { + code: ` +class Base { + async foo() { + return Promise.resolve(42); + } +} + +class Derived extends Base { + override foo() { + return Promise.resolve(2000); + } +} + `, + errors: [ + { + line: 9, + messageId: 'missingAsync', + }, + ], + output: ` +class Base { + async foo() { + return Promise.resolve(42); + } +} + +class Derived extends Base { + override async foo() { + return Promise.resolve(2000); + } +} + `, + }, + { + code: ` +class Test { + public override method() { + return Promise.resolve(1); + } +} + `, + errors: [ + { + line: 3, + messageId: 'missingAsync', + }, + ], + output: ` +class Test { + public override async method() { + return Promise.resolve(1); + } +} + `, + }, ], }); From d1a7348c48d84bf735fdc7e67f2052dc4e73c9b1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 09:27:20 -0500 Subject: [PATCH 275/283] chore(deps): update dependency globals to v16.5.0 (#11746) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index e8b9d112cb4f..4f6d1db6495b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11334,9 +11334,9 @@ __metadata: linkType: hard "globals@npm:^16.0.0": - version: 16.4.0 - resolution: "globals@npm:16.4.0" - checksum: 934180f5c6cbb26f8b2832caa255050fface970eee45bde8757fabba384807c85640a12716aa5bcc47d781807839fee470c8c1f6159c6b8dc877668c56103880 + version: 16.5.0 + resolution: "globals@npm:16.5.0" + checksum: e0363245cfc6e36ac6bf940415160a05d66e7985fa3856d5383ad49292b6d249d80fd03759e09d6491109648a121849b23b77c7391a11862923e6995268a7cd6 languageName: node linkType: hard From e93cf7d5b3cacd54c0bd64749817c73514aa940f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 09:30:59 -0500 Subject: [PATCH 276/283] chore(deps): update dependency @vitest/eslint-plugin to v1.4.0 (#11743) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4f6d1db6495b..cb0b288a665b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6043,7 +6043,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.46.3, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.46.3, @typescript-eslint/scope-manager@^8.46.1, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: @@ -6195,7 +6195,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.46.3, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.46.3, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@^8.46.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: @@ -6294,21 +6294,21 @@ __metadata: linkType: hard "@vitest/eslint-plugin@npm:^1.3.9": - version: 1.3.9 - resolution: "@vitest/eslint-plugin@npm:1.3.9" + version: 1.4.1 + resolution: "@vitest/eslint-plugin@npm:1.4.1" dependencies: - "@typescript-eslint/scope-manager": ^8.41.0 - "@typescript-eslint/utils": ^8.24.1 + "@typescript-eslint/scope-manager": ^8.46.1 + "@typescript-eslint/utils": ^8.46.1 peerDependencies: - eslint: ">= 8.57.0" - typescript: ">= 5.0.0" + eslint: ">=8.57.0" + typescript: ">=5.0.0" vitest: "*" peerDependenciesMeta: typescript: optional: true vitest: optional: true - checksum: 8d54a2026715c5966f9ff285b11ed3aad4873870ea9d3bc9a3d87b69cbf1725fdade2ddae489c20662f436c0de48019d79b5346391c642ecb3335470e9034448 + checksum: 142a1c166d4223773478620974b86d7783012d27149318c4c60cddab9b9b11f7721a6ff3b2bc2491f47d53444020f2a330c7e633040968ba7c0f65d6a1e039b3 languageName: node linkType: hard From 98de407621001f205f2e87cf3af1cc1cdd75c5d9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 09:31:10 -0500 Subject: [PATCH 277/283] chore(deps): update dependency @microsoft/api-extractor to v7.53.1 (#11692) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Josh Goldberg ✨ --- yarn.lock | 97 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 55 insertions(+), 42 deletions(-) diff --git a/yarn.lock b/yarn.lock index cb0b288a665b..3f89e33a724e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4067,37 +4067,37 @@ __metadata: languageName: node linkType: hard -"@microsoft/api-extractor-model@npm:7.30.6": - version: 7.30.6 - resolution: "@microsoft/api-extractor-model@npm:7.30.6" +"@microsoft/api-extractor-model@npm:7.31.1": + version: 7.31.1 + resolution: "@microsoft/api-extractor-model@npm:7.31.1" dependencies: "@microsoft/tsdoc": ~0.15.1 "@microsoft/tsdoc-config": ~0.17.1 - "@rushstack/node-core-library": 5.13.1 - checksum: a32873a942bab369aa3e7ee8842df8d91285f1a73e78278b650d7c23fb6edcf2cd067b7ff75cc79e873d6c09fff9cf3f144a69e967c053d93ae2da36026c2d77 + "@rushstack/node-core-library": 5.17.0 + checksum: 8d70dbc73822c97bf678686b40ce7fb2dd2e2a5151e4a96a5fe59bc33b3b4e53c43fb1543bd7af1ab8157ee81bb069554d37849916842fde355e22b02a514194 languageName: node linkType: hard "@microsoft/api-extractor@npm:^7.47.11": - version: 7.52.7 - resolution: "@microsoft/api-extractor@npm:7.52.7" + version: 7.53.1 + resolution: "@microsoft/api-extractor@npm:7.53.1" dependencies: - "@microsoft/api-extractor-model": 7.30.6 + "@microsoft/api-extractor-model": 7.31.1 "@microsoft/tsdoc": ~0.15.1 "@microsoft/tsdoc-config": ~0.17.1 - "@rushstack/node-core-library": 5.13.1 - "@rushstack/rig-package": 0.5.3 - "@rushstack/terminal": 0.15.3 - "@rushstack/ts-command-line": 5.0.1 + "@rushstack/node-core-library": 5.17.0 + "@rushstack/rig-package": 0.6.0 + "@rushstack/terminal": 0.19.1 + "@rushstack/ts-command-line": 5.1.1 lodash: ~4.17.15 - minimatch: ~3.0.3 + minimatch: 10.0.3 resolve: ~1.22.1 semver: ~7.5.4 source-map: ~0.6.1 typescript: 5.8.2 bin: api-extractor: bin/api-extractor - checksum: 1daf0d72e471f5934385b2f656016b23e3a9ca93287c1159d3422cdd9e9af5f4ffaf1f122cd77fa7622eff5d520f35e7426cb8f2430def1ad4cd88ecf52475d8 + checksum: 6111b26fd9340876eafaaf45f8676530de96e98b0a27adba7fc2818574244b8299519c7197f57f31340d750c784fa40bf6ec39741798c696b0a49de7caf6ea6f languageName: node linkType: hard @@ -4772,9 +4772,9 @@ __metadata: languageName: node linkType: hard -"@rushstack/node-core-library@npm:5.13.1": - version: 5.13.1 - resolution: "@rushstack/node-core-library@npm:5.13.1" +"@rushstack/node-core-library@npm:5.17.0": + version: 5.17.0 + resolution: "@rushstack/node-core-library@npm:5.17.0" dependencies: ajv: ~8.13.0 ajv-draft-04: ~1.0.0 @@ -4789,44 +4789,57 @@ __metadata: peerDependenciesMeta: "@types/node": optional: true - checksum: 14ff5ddd4a43deeadfbcd5ec7288f2b5d2c56a17ca3ef1e94d0cad2095955294ca237c684f3f5d5a479885431601a79a865a04d51cbf6c09061dfc0db08a698d + checksum: 375c07898cc4684b2232119e4aa06924df5ce990a6a835915acc1310f047535f583a96d025c6fddb865c71ab8e5e3610b96c393cff0b3ec83058f06ff4113592 languageName: node linkType: hard -"@rushstack/rig-package@npm:0.5.3": - version: 0.5.3 - resolution: "@rushstack/rig-package@npm:0.5.3" +"@rushstack/problem-matcher@npm:0.1.1": + version: 0.1.1 + resolution: "@rushstack/problem-matcher@npm:0.1.1" + peerDependencies: + "@types/node": "*" + peerDependenciesMeta: + "@types/node": + optional: true + checksum: 0e4a6ec4e7fecb8942ca3bc513732cb0d18a1b24dc2017a39a284c7f065542133a17d86a8b9caf40035fca5d8eef2b22c4bee7b3da117ae48783c44456fef012 + languageName: node + linkType: hard + +"@rushstack/rig-package@npm:0.6.0": + version: 0.6.0 + resolution: "@rushstack/rig-package@npm:0.6.0" dependencies: resolve: ~1.22.1 strip-json-comments: ~3.1.1 - checksum: bf3eadfc434bff273893efd22b319fe159d0e3b95729cb32ce3ad9f4ab4b6fabe3c4dd7f03ee0ddc7b480f0d989e908349eae6d6dce3500f896728a085af7aab + checksum: ba3c860fc749a847ce50f18a83cdef50909f84c4e945306978bab22eae79e57d47411ab3f46835bd9fb55591d20773b4d1a438489897a3071e0f583633b624c6 languageName: node linkType: hard -"@rushstack/terminal@npm:0.15.3": - version: 0.15.3 - resolution: "@rushstack/terminal@npm:0.15.3" +"@rushstack/terminal@npm:0.19.1": + version: 0.19.1 + resolution: "@rushstack/terminal@npm:0.19.1" dependencies: - "@rushstack/node-core-library": 5.13.1 + "@rushstack/node-core-library": 5.17.0 + "@rushstack/problem-matcher": 0.1.1 supports-color: ~8.1.1 peerDependencies: "@types/node": "*" peerDependenciesMeta: "@types/node": optional: true - checksum: a87960058965cb6941120ae5a1e4efa0373fdbcb724ba8beddfb584d6c972baf917485f3bc25e3280fb283f0e80d857293cbf5a9c6d15475ec8dcb086ff0be48 + checksum: 106a55eef7336e74f2e98b0e4f7e04792e6ba03f263f9da9ee9fc9552926dd390947a29313e49d2162fd5617ea7f7e49fdf0394e4ea65727c7e9ac2cc537d408 languageName: node linkType: hard -"@rushstack/ts-command-line@npm:5.0.1": - version: 5.0.1 - resolution: "@rushstack/ts-command-line@npm:5.0.1" +"@rushstack/ts-command-line@npm:5.1.1": + version: 5.1.1 + resolution: "@rushstack/ts-command-line@npm:5.1.1" dependencies: - "@rushstack/terminal": 0.15.3 + "@rushstack/terminal": 0.19.1 "@types/argparse": 1.0.38 argparse: ~1.0.9 string-argv: ~0.3.1 - checksum: dd9fea3e0635b37736e424ab4b757214fcf8dd573064faa3e6ca889d90cff6ac57ca9c23c3834a6f56748b94d8ad336098e7911ead22148a9290dfa64f90f6ad + checksum: 7298df112849dd9c4da0b1363416d0a14908ff346205093f38be0bf1b38e5c0d94ec5f57912744bd3062f1958c86cb308c8acbe4c7829f47e42b65744416b478 languageName: node linkType: hard @@ -14739,7 +14752,16 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:3.0.4, minimatch@npm:~3.0.3": +"minimatch@npm:10.0.3, minimatch@npm:^10.0.3, minimatch@npm:~10.0.1": + version: 10.0.3 + resolution: "minimatch@npm:10.0.3" + dependencies: + "@isaacs/brace-expansion": ^5.0.0 + checksum: 20bfb708095a321cb43c20b78254e484cb7d23aad992e15ca3234a3331a70fa9cd7a50bc1a7c7b2b9c9890c37ff0685f8380028fcc28ea5e6de75b1d4f9374aa + languageName: node + linkType: hard + +"minimatch@npm:3.0.4": version: 3.0.4 resolution: "minimatch@npm:3.0.4" dependencies: @@ -14766,15 +14788,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^10.0.3, minimatch@npm:~10.0.1": - version: 10.0.3 - resolution: "minimatch@npm:10.0.3" - dependencies: - "@isaacs/brace-expansion": ^5.0.0 - checksum: 20bfb708095a321cb43c20b78254e484cb7d23aad992e15ca3234a3331a70fa9cd7a50bc1a7c7b2b9c9890c37ff0685f8380028fcc28ea5e6de75b1d4f9374aa - languageName: node - linkType: hard - "minimatch@npm:^5.0.1": version: 5.1.6 resolution: "minimatch@npm:5.1.6" From 1a71f6e3cb4807e80b7a91001689161e1ca78f76 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 09:31:17 -0500 Subject: [PATCH 278/283] chore(deps): update dependency @swc/core to v1.14.0 (#11741) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 98 +++++++++++++++++++++++++++---------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3f89e33a724e..6295c90a9725 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5118,92 +5118,92 @@ __metadata: languageName: node linkType: hard -"@swc/core-darwin-arm64@npm:1.13.3": - version: 1.13.3 - resolution: "@swc/core-darwin-arm64@npm:1.13.3" +"@swc/core-darwin-arm64@npm:1.15.0": + version: 1.15.0 + resolution: "@swc/core-darwin-arm64@npm:1.15.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@swc/core-darwin-x64@npm:1.13.3": - version: 1.13.3 - resolution: "@swc/core-darwin-x64@npm:1.13.3" +"@swc/core-darwin-x64@npm:1.15.0": + version: 1.15.0 + resolution: "@swc/core-darwin-x64@npm:1.15.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@swc/core-linux-arm-gnueabihf@npm:1.13.3": - version: 1.13.3 - resolution: "@swc/core-linux-arm-gnueabihf@npm:1.13.3" +"@swc/core-linux-arm-gnueabihf@npm:1.15.0": + version: 1.15.0 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.15.0" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@swc/core-linux-arm64-gnu@npm:1.13.3": - version: 1.13.3 - resolution: "@swc/core-linux-arm64-gnu@npm:1.13.3" +"@swc/core-linux-arm64-gnu@npm:1.15.0": + version: 1.15.0 + resolution: "@swc/core-linux-arm64-gnu@npm:1.15.0" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-arm64-musl@npm:1.13.3": - version: 1.13.3 - resolution: "@swc/core-linux-arm64-musl@npm:1.13.3" +"@swc/core-linux-arm64-musl@npm:1.15.0": + version: 1.15.0 + resolution: "@swc/core-linux-arm64-musl@npm:1.15.0" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@swc/core-linux-x64-gnu@npm:1.13.3": - version: 1.13.3 - resolution: "@swc/core-linux-x64-gnu@npm:1.13.3" +"@swc/core-linux-x64-gnu@npm:1.15.0": + version: 1.15.0 + resolution: "@swc/core-linux-x64-gnu@npm:1.15.0" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-x64-musl@npm:1.13.3": - version: 1.13.3 - resolution: "@swc/core-linux-x64-musl@npm:1.13.3" +"@swc/core-linux-x64-musl@npm:1.15.0": + version: 1.15.0 + resolution: "@swc/core-linux-x64-musl@npm:1.15.0" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@swc/core-win32-arm64-msvc@npm:1.13.3": - version: 1.13.3 - resolution: "@swc/core-win32-arm64-msvc@npm:1.13.3" +"@swc/core-win32-arm64-msvc@npm:1.15.0": + version: 1.15.0 + resolution: "@swc/core-win32-arm64-msvc@npm:1.15.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@swc/core-win32-ia32-msvc@npm:1.13.3": - version: 1.13.3 - resolution: "@swc/core-win32-ia32-msvc@npm:1.13.3" +"@swc/core-win32-ia32-msvc@npm:1.15.0": + version: 1.15.0 + resolution: "@swc/core-win32-ia32-msvc@npm:1.15.0" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@swc/core-win32-x64-msvc@npm:1.13.3": - version: 1.13.3 - resolution: "@swc/core-win32-x64-msvc@npm:1.13.3" +"@swc/core-win32-x64-msvc@npm:1.15.0": + version: 1.15.0 + resolution: "@swc/core-win32-x64-msvc@npm:1.15.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard "@swc/core@npm:^1.4.12": - version: 1.13.3 - resolution: "@swc/core@npm:1.13.3" - dependencies: - "@swc/core-darwin-arm64": 1.13.3 - "@swc/core-darwin-x64": 1.13.3 - "@swc/core-linux-arm-gnueabihf": 1.13.3 - "@swc/core-linux-arm64-gnu": 1.13.3 - "@swc/core-linux-arm64-musl": 1.13.3 - "@swc/core-linux-x64-gnu": 1.13.3 - "@swc/core-linux-x64-musl": 1.13.3 - "@swc/core-win32-arm64-msvc": 1.13.3 - "@swc/core-win32-ia32-msvc": 1.13.3 - "@swc/core-win32-x64-msvc": 1.13.3 + version: 1.15.0 + resolution: "@swc/core@npm:1.15.0" + dependencies: + "@swc/core-darwin-arm64": 1.15.0 + "@swc/core-darwin-x64": 1.15.0 + "@swc/core-linux-arm-gnueabihf": 1.15.0 + "@swc/core-linux-arm64-gnu": 1.15.0 + "@swc/core-linux-arm64-musl": 1.15.0 + "@swc/core-linux-x64-gnu": 1.15.0 + "@swc/core-linux-x64-musl": 1.15.0 + "@swc/core-win32-arm64-msvc": 1.15.0 + "@swc/core-win32-ia32-msvc": 1.15.0 + "@swc/core-win32-x64-msvc": 1.15.0 "@swc/counter": ^0.1.3 - "@swc/types": ^0.1.23 + "@swc/types": ^0.1.25 peerDependencies: "@swc/helpers": ">=0.5.17" dependenciesMeta: @@ -5230,7 +5230,7 @@ __metadata: peerDependenciesMeta: "@swc/helpers": optional: true - checksum: 2f6a1cf1241db40b11c3fa7452da099325b4ee4419e658950221f357a12ea967390414243d51e81fa52d4fcc002f7ae477311b0602d4524a70f95e569902f229 + checksum: eeb25e554526e8d19c509aa541c773f6eedfdc6a290b7bf0769b2847b4a35a4cc8a6dd31cc5b4153a2cfbcb40bd507ca902143528c3e453b236c19b52af03fa9 languageName: node linkType: hard @@ -5241,12 +5241,12 @@ __metadata: languageName: node linkType: hard -"@swc/types@npm:^0.1.23": - version: 0.1.24 - resolution: "@swc/types@npm:0.1.24" +"@swc/types@npm:^0.1.25": + version: 0.1.25 + resolution: "@swc/types@npm:0.1.25" dependencies: "@swc/counter": ^0.1.3 - checksum: b9f186237d082ca9f47457dd46bd294612fbee401b4f181a9afc6f8f802fab161d50ff7024e7bc0d9c4e0ceb9a46a06ea2e5bf14a05412c9e8b7d7e07906d6ec + checksum: 8e8ec73913aa42ee574c2a5a95fb6a95f19c5f011e66ed3faf773aa26f731e3f9a8b8e4d9e1887124166504253ee9e16d87f292e0ea1411d6170a4d1b327ba25 languageName: node linkType: hard From 7c6944e74b29a3310515a9de9333e20116165b58 Mon Sep 17 00:00:00 2001 From: Evgeny Stepanovych Date: Mon, 10 Nov 2025 15:41:20 +0100 Subject: [PATCH 279/283] chore: fix typos (#11744) --- .../src/rules/plugin-test-formatting.ts | 6 +++--- .../src/rules/explicit-member-accessibility.ts | 6 +++--- packages/eslint-plugin/src/rules/no-misused-promises.ts | 2 +- packages/eslint-plugin/src/rules/no-misused-spread.ts | 4 ++-- .../src/rules/no-unnecessary-template-expression.ts | 4 ++-- .../src/rules/no-unnecessary-type-arguments.ts | 4 ++-- packages/eslint-plugin/src/rules/return-await.ts | 4 ++-- packages/eslint-plugin/src/util/collectUnusedVariables.ts | 8 ++++---- .../docs-eslint-output-snapshots/no-misused-promises.shot | 4 ++-- .../eslint-plugin/tests/rules/init-declarations.test.ts | 2 +- .../rules/naming-convention/naming-convention.test.ts | 2 +- .../eslint-plugin/tests/rules/no-misused-promises.test.ts | 2 +- packages/eslint-plugin/tests/util/misc.test.ts | 2 +- packages/rule-tester/tests/RuleTester.test.ts | 6 +++--- .../tests/eslint-scope/es6-block-scope.test.ts | 2 +- .../tests/eslint-scope/global-return.test.ts | 2 +- packages/type-utils/tests/requiresQuoting.test.ts | 4 ++-- packages/typescript-eslint/src/index.ts | 2 +- .../tests/lib/semanticInfo-singleRun.test.ts | 2 +- 19 files changed, 34 insertions(+), 34 deletions(-) diff --git a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts index 9ca6bd0b6311..aaf4296ca3bf 100644 --- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts +++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts @@ -419,7 +419,7 @@ export default createRule({ if (isNoFormatTagged) { if (literal.parent.type === AST_NODE_TYPES.TaggedTemplateExpression) { - checkForUnnecesaryNoFormat(code, literal.parent); + checkForUnnecessaryNoFormat(code, literal.parent); } return; } @@ -455,7 +455,7 @@ export default createRule({ return tag.type === AST_NODE_TYPES.Identifier && tag.name === 'noFormat'; } - function checkForUnnecesaryNoFormat( + function checkForUnnecessaryNoFormat( text: string, expr: TSESTree.TaggedTemplateExpression, ): void { @@ -480,7 +480,7 @@ export default createRule({ ): void { if (isNoFormatTemplateTag(expr.tag)) { const { cooked } = expr.quasi.quasis[0].value; - checkForUnnecesaryNoFormat(cooked, expr); + checkForUnnecessaryNoFormat(cooked, expr); } else { return; } diff --git a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts index 7fc724bb1e25..d1b6f8ea3422 100644 --- a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts +++ b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts @@ -232,14 +232,14 @@ export default createRule({ token.value === 'public' ) { keywordRange = structuredClone(token.range); - const commensAfterPublicKeyword = + const commentsAfterPublicKeyword = context.sourceCode.getCommentsAfter(token); - if (commensAfterPublicKeyword.length) { + if (commentsAfterPublicKeyword.length) { // public /* Hi there! */ static foo() // ^^^^^^^ rangeToRemove = [ token.range[0], - commensAfterPublicKeyword[0].range[0], + commentsAfterPublicKeyword[0].range[0], ]; break; } else { diff --git a/packages/eslint-plugin/src/rules/no-misused-promises.ts b/packages/eslint-plugin/src/rules/no-misused-promises.ts index 74f0690a5174..d491da6227d4 100644 --- a/packages/eslint-plugin/src/rules/no-misused-promises.ts +++ b/packages/eslint-plugin/src/rules/no-misused-promises.ts @@ -88,7 +88,7 @@ export default createRule({ messages: { conditional: 'Expected non-Promise value in a boolean conditional.', predicate: 'Expected a non-Promise value to be returned.', - spread: 'Expected a non-Promise value to be spreaded in an object.', + spread: 'Expected a non-Promise value to be spread in an object.', voidReturnArgument: 'Promise returned in function argument where a void return was expected.', voidReturnAttribute: diff --git a/packages/eslint-plugin/src/rules/no-misused-spread.ts b/packages/eslint-plugin/src/rules/no-misused-spread.ts index fab84902e9e1..34ce3fa9db52 100644 --- a/packages/eslint-plugin/src/rules/no-misused-spread.ts +++ b/packages/eslint-plugin/src/rules/no-misused-spread.ts @@ -154,7 +154,7 @@ export default createRule({ function getPromiseSpreadSuggestions( node: TSESTree.Expression, ): TSESLint.ReportSuggestionArray { - const isHighPrecendence = isHigherPrecedenceThanAwait( + const isHighPrecedence = isHigherPrecedenceThanAwait( services.esTreeNodeToTSNodeMap.get(node), ); @@ -162,7 +162,7 @@ export default createRule({ { messageId: 'addAwait', fix: fixer => - isHighPrecendence + isHighPrecedence ? fixer.insertTextBefore(node, 'await ') : [ fixer.insertTextBefore(node, 'await ('), diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts b/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts index 4f184af39f15..361300e1e3a1 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts @@ -193,7 +193,7 @@ export default createRule<[], MessageId>({ }); } - function isUnncessaryValueInterpolation({ + function isUnnecessaryValueInterpolation({ interpolation, nextQuasi, prevQuasi, @@ -432,7 +432,7 @@ export default createRule<[], MessageId>({ } const infos = getInterpolationInfos(node).filter( - isUnncessaryValueInterpolation, + isUnnecessaryValueInterpolation, ); for (const reportDescriptor of getReportDescriptors(infos)) { diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts index 945614ae618f..708879be502f 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts @@ -169,11 +169,11 @@ function getTypeParametersFromType( return undefined; } - const sortedDeclaraions = sortDeclarationsByTypeValueContext( + const sortedDeclarations = sortDeclarationsByTypeValueContext( node, declarations, ); - return findFirstResult(sortedDeclaraions, decl => { + return findFirstResult(sortedDeclarations, decl => { if ( ts.isTypeAliasDeclaration(decl) || ts.isInterfaceDeclaration(decl) || diff --git a/packages/eslint-plugin/src/rules/return-await.ts b/packages/eslint-plugin/src/rules/return-await.ts index 0ee20eea92a8..f1312c9915f5 100644 --- a/packages/eslint-plugin/src/rules/return-await.ts +++ b/packages/eslint-plugin/src/rules/return-await.ts @@ -267,9 +267,9 @@ export default createRule({ function insertAwait( fixer: TSESLint.RuleFixer, node: TSESTree.Expression, - isHighPrecendence: boolean, + isHighPrecedence: boolean, ): TSESLint.RuleFix | TSESLint.RuleFix[] { - if (isHighPrecendence) { + if (isHighPrecedence) { return fixer.insertTextBefore(node, 'await '); } return [ diff --git a/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/packages/eslint-plugin/src/util/collectUnusedVariables.ts index 3e7172e2ca45..c98529f68a63 100644 --- a/packages/eslint-plugin/src/util/collectUnusedVariables.ts +++ b/packages/eslint-plugin/src/util/collectUnusedVariables.ts @@ -188,7 +188,7 @@ class UnusedVarsVisitor extends Visitor { // basic exported variables isExported(variable) || // variables implicitly exported via a merged declaration - isMergableExported(variable) || + isMergeableExported(variable) || // used variables isUsedVariable(variable) ) { @@ -415,7 +415,7 @@ function isSelfReference( return false; } -const MERGABLE_TYPES = new Set([ +const MERGEABLE_TYPES = new Set([ AST_NODE_TYPES.ClassDeclaration, AST_NODE_TYPES.FunctionDeclaration, AST_NODE_TYPES.TSInterfaceDeclaration, @@ -426,7 +426,7 @@ const MERGABLE_TYPES = new Set([ * Determine if the variable is directly exported * @param variable the variable to check */ -function isMergableExported(variable: ScopeVariable): boolean { +function isMergeableExported(variable: ScopeVariable): boolean { // If all of the merged things are of the same type, TS will error if not all of them are exported - so we only need to find one for (const def of variable.defs) { // parameters can never be exported. @@ -437,7 +437,7 @@ function isMergableExported(variable: ScopeVariable): boolean { } if ( - (MERGABLE_TYPES.has(def.node.type) && + (MERGEABLE_TYPES.has(def.node.type) && def.node.parent.type === AST_NODE_TYPES.ExportNamedDeclaration) || def.node.parent.type === AST_NODE_TYPES.ExportDefaultDeclaration ) { diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-promises.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-promises.shot index 3d0a679af53c..4eca533783eb 100644 --- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-promises.shot +++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-promises.shot @@ -130,14 +130,14 @@ Options: { "checksSpreads": true } const getData = () => fetch('/'); console.log({ foo: 42, ...getData() }); - ~~~~~~~~~ Expected a non-Promise value to be spreaded in an object. + ~~~~~~~~~ Expected a non-Promise value to be spread in an object. const awaitData = async () => { await fetch('/'); }; console.log({ foo: 42, ...awaitData() }); - ~~~~~~~~~~~ Expected a non-Promise value to be spreaded in an object. + ~~~~~~~~~~~ Expected a non-Promise value to be spread in an object. Correct Options: { "checksSpreads": true } diff --git a/packages/eslint-plugin/tests/rules/init-declarations.test.ts b/packages/eslint-plugin/tests/rules/init-declarations.test.ts index 3d02f77a2f18..276ba3e9f2bd 100644 --- a/packages/eslint-plugin/tests/rules/init-declarations.test.ts +++ b/packages/eslint-plugin/tests/rules/init-declarations.test.ts @@ -251,7 +251,7 @@ var bar: string = function (): string { }, { code: ` -var bar: string = function (arg1: stirng): string { +var bar: string = function (arg1: string): string { return 'string'; }; `, diff --git a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts index 076534645409..c92479e409b3 100644 --- a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts +++ b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts @@ -2058,7 +2058,7 @@ ruleTester.run('naming-convention', rule, { 'enumMember', ], }, - // making sure the `requoresQuotes` modifier appropriately overrides this + // making sure the `requiresQuotes` modifier appropriately overrides this { format: ['PascalCase'], selector: [ diff --git a/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts b/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts index fd908d416c08..fc9d0fb08374 100644 --- a/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts +++ b/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts @@ -146,7 +146,7 @@ if (returnsPromise?.call()) { `, 'Promise.resolve() ?? false;', ` -function test(a: Promise | undefinded) { +function test(a: Promise | undefined) { const foo = a ?? Promise.reject(); } `, diff --git a/packages/eslint-plugin/tests/util/misc.test.ts b/packages/eslint-plugin/tests/util/misc.test.ts index 19867077e2fb..e94bca7d05f4 100644 --- a/packages/eslint-plugin/tests/util/misc.test.ts +++ b/packages/eslint-plugin/tests/util/misc.test.ts @@ -65,7 +65,7 @@ describe(misc.findLastIndex, () => { expect(misc.findLastIndex([1, 2, 3], () => true)).toBe(2); }); - it('returns the index of the last occurance of a duplicate element', () => { + it('returns the index of the last occurrence of a duplicate element', () => { expect(misc.findLastIndex([1, 2, 3, 3, 5], n => n === 3)).toBe(3); }); }); diff --git a/packages/rule-tester/tests/RuleTester.test.ts b/packages/rule-tester/tests/RuleTester.test.ts index b7a276c69e4c..83d57fd3eb32 100644 --- a/packages/rule-tester/tests/RuleTester.test.ts +++ b/packages/rule-tester/tests/RuleTester.test.ts @@ -965,7 +965,7 @@ describe(RuleTester, () => { }); describe('constructor constraints', () => { - it('skips all tests if a constructor constraint is not satisifed', () => { + it('skips all tests if a constructor constraint is not satisfied', () => { satisfiesAllDependencyConstraintsMock.mockReturnValueOnce(false); const ruleTester = new RuleTester({ dependencyConstraints: { @@ -998,7 +998,7 @@ describe(RuleTester, () => { `); }); - it('does not skip all tests if a constructor constraint is satisifed', () => { + it('does not skip all tests if a constructor constraint is satisfied', () => { satisfiesAllDependencyConstraintsMock.mockReturnValueOnce(true); const ruleTester = new RuleTester({ dependencyConstraints: { @@ -1646,7 +1646,7 @@ describe('RuleTester - run types', () => { }; describe('infer from `rule` parameter', () => { - it('should correctly infer `options` or `messageIds` types from the `rule` paramter', () => { + it('should correctly infer `options` or `messageIds` types from the `rule` parameter', () => { expect(() => ruleTester.run('my-rule', ruleModule, { invalid: [], diff --git a/packages/scope-manager/tests/eslint-scope/es6-block-scope.test.ts b/packages/scope-manager/tests/eslint-scope/es6-block-scope.test.ts index fae666eae759..e3aabdfdcfc6 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-block-scope.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-block-scope.test.ts @@ -27,7 +27,7 @@ describe('ES6 block scope', () => { expect(scope.references[1].identifier.name).toBe('i'); }); - it('function delaration is materialized in ES6 block scope', () => { + it('function declaration is materialized in ES6 block scope', () => { const { scopeManager } = parseAndAnalyze(` { function test() { diff --git a/packages/scope-manager/tests/eslint-scope/global-return.test.ts b/packages/scope-manager/tests/eslint-scope/global-return.test.ts index 6125d4ccf1e8..4c04f61a63b8 100644 --- a/packages/scope-manager/tests/eslint-scope/global-return.test.ts +++ b/packages/scope-manager/tests/eslint-scope/global-return.test.ts @@ -3,7 +3,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; import { DefinitionType, ScopeType } from '../../src/index.js'; import { getRealVariables, parseAndAnalyze } from '../test-utils/index.js'; -describe('gloablReturn option', () => { +describe('globalReturn option', () => { it('creates a function scope following the global scope immediately', () => { const { scopeManager } = parseAndAnalyze( ` diff --git a/packages/type-utils/tests/requiresQuoting.test.ts b/packages/type-utils/tests/requiresQuoting.test.ts index ce7c7c0cdcc3..2c71ebf51352 100644 --- a/packages/type-utils/tests/requiresQuoting.test.ts +++ b/packages/type-utils/tests/requiresQuoting.test.ts @@ -14,12 +14,12 @@ describe(requiresQuoting, () => { expect(result).toBe(false); }); - it('start with dollorSign', () => { + it('start with dollarSign', () => { const name = '$bar'; const result = requiresQuoting(name); expect(result).toBe(false); }); - it('include dollorSign not start position', () => { + it('include dollarSign not start position', () => { const name = 'foo$bar'; const result = requiresQuoting(name); expect(result).toBe(false); diff --git a/packages/typescript-eslint/src/index.ts b/packages/typescript-eslint/src/index.ts index 3f5f47da4b33..04ec5b3094cc 100644 --- a/packages/typescript-eslint/src/index.ts +++ b/packages/typescript-eslint/src/index.ts @@ -30,7 +30,7 @@ require('typescript-eslint').plugin !== require('@typescript-eslint/eslint-plugi This is bad because it means that 3rd party configs would be required to use `typescript-eslint` or else they would break a user's config if the user either -used `tseslint.configs.recomended` et al or +used `tseslint.configs.recommended` et al or ``` { plugins: { diff --git a/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts b/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts index 69789fa2dc3e..47bcf87bf54d 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts @@ -128,7 +128,7 @@ describe('semanticInfo - singleRun', () => { expect(createProgramFromConfigFile).not.toHaveBeenCalled(); }); - it('should not create any programs ahead of time when when TSESTREE_SINGLE_RUN=false, even if other inferrence criteria apply', () => { + it('should not create any programs ahead of time when when TSESTREE_SINGLE_RUN=false, even if other inference criteria apply', () => { vi.stubEnv('TSESTREE_SINGLE_RUN', 'false'); // Normally CI=true would be used to infer singleRun=true, but TSESTREE_SINGLE_RUN is explicitly set to false From 997e0c005d2d80a726249cafb7cbdf4ec287aea3 Mon Sep 17 00:00:00 2001 From: Maria Solano Date: Mon, 10 Nov 2025 07:17:29 -0800 Subject: [PATCH 280/283] fix(parser): error when both `projectService` and `project` are set (#11333) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(parser): error when both `projectService` and `project` are set * more env stubbing in semanticInfo.test.ts * Consolidated typed testing and env checks with getTypedRuleTester * More fixes, for now * Progress * More. * Move the defaulting logic into createRuleTesterWithTypes * Further streamlining * Streamlined inside createRuleTesterWithTypes * Fall back to project: true --------- Co-authored-by: Josh Goldberg ✨ --- .../rules/no-poorly-typed-ts-props.test.ts | 1 + .../rules/plugin-test-formatting.test.ts | 1 + packages/eslint-plugin/tests/RuleTester.ts | 32 +++++++++++++++++++ packages/eslint-plugin/tests/docs.test.mts | 1 + .../tests/rules/await-thenable.test.ts | 15 ++------- .../tests/rules/consistent-return.test.ts | 14 ++------ .../rules/consistent-type-exports.test.ts | 15 +++------ .../tests/rules/dot-notation.test.ts | 22 ++++--------- .../naming-convention.test.ts | 1 + .../tests/rules/no-array-delete.test.ts | 15 ++------- .../tests/rules/no-base-to-string.test.ts | 17 ++++------ .../no-confusing-void-expression.test.ts | 14 ++------ .../tests/rules/no-deprecated.test.ts | 17 +++------- .../no-duplicate-type-constituents.test.ts | 15 ++------- .../tests/rules/no-dynamic-delete.test.ts | 15 ++------- .../tests/rules/no-floating-promises.test.ts | 13 ++------ .../tests/rules/no-for-in-array.test.ts | 13 ++------ .../tests/rules/no-implied-eval.test.ts | 16 ++-------- .../no-meaningless-void-operator.test.ts | 15 ++------- .../tests/rules/no-misused-promises.test.ts | 15 ++------- .../tests/rules/no-misused-spread.test.ts | 15 +++------ .../tests/rules/no-mixed-enums.test.ts | 14 ++------ .../no-redundant-type-constituents.test.ts | 14 ++------ ...nnecessary-boolean-literal-compare.test.ts | 13 ++------ .../rules/no-unnecessary-condition.test.ts | 25 ++++++--------- .../rules/no-unnecessary-qualifier.test.ts | 15 ++------- ...no-unnecessary-template-expression.test.ts | 15 ++------- .../no-unnecessary-type-arguments.test.ts | 15 ++------- .../no-unnecessary-type-assertion.test.ts | 17 ++++------ .../no-unnecessary-type-conversion.test.ts | 15 ++------- .../no-unnecessary-type-parameters.test.ts | 15 ++------- .../tests/rules/no-unsafe-argument.test.ts | 13 ++------ .../tests/rules/no-unsafe-assignment.test.ts | 14 +++----- .../tests/rules/no-unsafe-call.test.ts | 14 +++----- .../no-unsafe-declaration-merging.test.ts | 15 ++------- .../rules/no-unsafe-enum-comparison.test.ts | 15 ++------- .../rules/no-unsafe-type-assertion.test.ts | 15 ++------- .../tests/rules/no-unsafe-unary-minus.test.ts | 14 ++------ .../non-nullable-type-assertion-style.test.ts | 24 +++----------- .../tests/rules/only-throw-error.test.ts | 13 ++------ .../tests/rules/prefer-destructuring.test.ts | 15 ++------- .../tests/rules/prefer-find.test.ts | 15 ++------- .../tests/rules/prefer-includes.test.ts | 15 ++------- .../rules/prefer-nullish-coalescing.test.ts | 18 +++-------- .../prefer-optional-chain.test.ts | 13 ++------ .../prefer-promise-reject-errors.test.ts | 14 ++------ .../prefer-readonly-parameter-types.test.ts | 15 ++------- .../tests/rules/prefer-readonly.test.ts | 14 ++------ .../prefer-reduce-type-parameter.test.ts | 15 ++------- .../tests/rules/prefer-regexp-exec.test.ts | 15 ++------- .../rules/prefer-return-this-type.test.ts | 15 ++------- .../prefer-string-starts-ends-with.test.ts | 15 ++------- .../rules/promise-function-async.test.ts | 15 ++------- .../rules/related-getter-setter-pairs.test.ts | 14 ++------ .../rules/require-array-sort-compare.test.ts | 15 ++------- .../tests/rules/require-await.test.ts | 15 ++------- .../rules/restrict-plus-operands.test.ts | 15 ++------- .../restrict-template-expressions.test.ts | 15 ++------- .../tests/rules/return-await.test.ts | 15 ++------- .../rules/strict-boolean-expressions.test.ts | 19 ++++------- .../rules/switch-exhaustiveness-check.test.ts | 22 ++++--------- .../eslint-plugin/tests/rules/typedef.test.ts | 14 ++------ .../tests/rules/unbound-method.test.ts | 15 ++------- ...unknown-in-catch-callback-variable.test.ts | 15 ++------- .../tests/util/getConstraintInfo.test.ts | 1 + .../tests/util/getWrappedCode.test.ts | 13 ++------ .../tests/util/getWrappingFixer.test.ts | 14 ++------ .../tests/util/isNodeEqual.test.ts | 14 ++------ .../src/parseSettings/createParseSettings.ts | 13 ++++++++ .../tests/lib/createParseSettings.test.ts | 15 +++++++++ .../typescript-estree/tests/lib/parse.test.ts | 4 +++ .../tests/lib/persistentParse.test.ts | 7 ++++ .../tests/lib/semanticInfo-singleRun.test.ts | 5 +++ .../tests/lib/semanticInfo.test.ts | 9 ++++++ 74 files changed, 279 insertions(+), 761 deletions(-) diff --git a/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts b/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts index cd43599c85b6..3a70101eb7d5 100644 --- a/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts @@ -8,6 +8,7 @@ const ruleTester = new RuleTester({ languageOptions: { parserOptions: { project: './tsconfig.json', + projectService: false, tsconfigRootDir: getFixturesRootDir(), }, }, diff --git a/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts b/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts index 6ec2ce42a6a3..084eadd9b6c0 100644 --- a/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts @@ -7,6 +7,7 @@ const ruleTester = new RuleTester({ languageOptions: { parserOptions: { project: './tsconfig.json', + projectService: false, tsconfigRootDir: getFixturesRootDir(), }, }, diff --git a/packages/eslint-plugin/tests/RuleTester.ts b/packages/eslint-plugin/tests/RuleTester.ts index 4cb13dad0dcb..c2e314860ae3 100644 --- a/packages/eslint-plugin/tests/RuleTester.ts +++ b/packages/eslint-plugin/tests/RuleTester.ts @@ -1,5 +1,37 @@ +import type { ParserOptions } from '@typescript-eslint/utils/ts-eslint'; + +import { RuleTester } from '@typescript-eslint/rule-tester'; import * as path from 'node:path'; +export function createRuleTesterWithTypes( + providedParserOptions: ParserOptions | undefined = {}, +): RuleTester { + const parserOptions = { + ...providedParserOptions, + tsconfigRootDir: + providedParserOptions.tsconfigRootDir ?? getFixturesRootDir(), + }; + + // If the test has requested a specific project, disable projectService + // (regardless of whether it's being switched to by TYPESCRIPT_ESLINT_PROJECT_SERVICE) + if (parserOptions.project) { + parserOptions.projectService = false; + } + // Otherwise, use the project service for types if requested in the env + else if (process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE) { + parserOptions.projectService = true; + } + // Finally, default to project: true as the standard (legacy) behavior + // See: https://github.com/typescript-eslint/typescript-eslint/issues/11676 + else { + parserOptions.project = true; + } + + return new RuleTester({ + languageOptions: { parserOptions }, + }); +} + export function getFixturesRootDir(): string { return path.join(__dirname, 'fixtures'); } diff --git a/packages/eslint-plugin/tests/docs.test.mts b/packages/eslint-plugin/tests/docs.test.mts index ea12c3e02179..20693dd21762 100644 --- a/packages/eslint-plugin/tests/docs.test.mts +++ b/packages/eslint-plugin/tests/docs.test.mts @@ -428,6 +428,7 @@ describe('Validating rule docs', () => { parserOptions: { disallowAutomaticSingleRunInference: true, project: './tsconfig.json', + projectService: false, tsconfigRootDir: FIXTURES_DIR, }, rules: Object.fromEntries(ruleEntries), diff --git a/packages/eslint-plugin/tests/rules/await-thenable.test.ts b/packages/eslint-plugin/tests/rules/await-thenable.test.ts index 0556ce4803de..f0dca2e02f5f 100644 --- a/packages/eslint-plugin/tests/rules/await-thenable.test.ts +++ b/packages/eslint-plugin/tests/rules/await-thenable.test.ts @@ -1,18 +1,9 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/await-thenable'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('await-thenable', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/consistent-return.test.ts b/packages/eslint-plugin/tests/rules/consistent-return.test.ts index 89574197c9fd..0ee2908ef5b0 100644 --- a/packages/eslint-plugin/tests/rules/consistent-return.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-return.test.ts @@ -1,17 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/consistent-return'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('consistent-return', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts index b513411d676d..6226405f4ebb 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts @@ -1,18 +1,11 @@ /* eslint-disable @typescript-eslint/internal/plugin-test-formatting -- Prettier doesn't yet support TS 5.6 string literal module identifiers */ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/consistent-type-exports'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, +const ruleTester = createRuleTesterWithTypes({ + project: './tsconfig.json', }); ruleTester.run('consistent-type-exports', rule, { diff --git a/packages/eslint-plugin/tests/rules/dot-notation.test.ts b/packages/eslint-plugin/tests/rules/dot-notation.test.ts index 0a14e1036383..1a077b1b0527 100644 --- a/packages/eslint-plugin/tests/rules/dot-notation.test.ts +++ b/packages/eslint-plugin/tests/rules/dot-notation.test.ts @@ -1,18 +1,10 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/dot-notation'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes, getFixturesRootDir } from '../RuleTester'; -const rootPath = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const rootDir = getFixturesRootDir(); +const ruleTester = createRuleTesterWithTypes(); /** * Quote a string in "double quotes" because it’s painful @@ -163,7 +155,7 @@ foo['key_baz']; parserOptions: { project: './tsconfig.noPropertyAccessFromIndexSignature.json', projectService: false, - tsconfigRootDir: rootPath, + tsconfigRootDir: rootDir, }, }, }, @@ -181,7 +173,7 @@ foo['bar']; parserOptions: { project: './tsconfig.noPropertyAccessFromIndexSignature.json', projectService: false, - tsconfigRootDir: rootPath, + tsconfigRootDir: rootDir, }, }, }, @@ -202,7 +194,7 @@ function f(x: T) { parserOptions: { project: './tsconfig.noPropertyAccessFromIndexSignature.json', projectService: false, - tsconfigRootDir: rootPath, + tsconfigRootDir: rootDir, }, }, }, diff --git a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts index c92479e409b3..5c4391b20ca6 100644 --- a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts +++ b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts @@ -11,6 +11,7 @@ const ruleTester = new RuleTester(); const rootDir = getFixturesRootDir(); const parserOptions = { project: './tsconfig.json', + projectService: false, tsconfigRootDir: rootDir, }; diff --git a/packages/eslint-plugin/tests/rules/no-array-delete.test.ts b/packages/eslint-plugin/tests/rules/no-array-delete.test.ts index be9700385a91..c8d25e7ebf84 100644 --- a/packages/eslint-plugin/tests/rules/no-array-delete.test.ts +++ b/packages/eslint-plugin/tests/rules/no-array-delete.test.ts @@ -1,18 +1,9 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/no-array-delete'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootPath = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-array-delete', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts index a75e9130b921..cab11e9ce5ec 100644 --- a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts +++ b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts @@ -1,17 +1,8 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-base-to-string'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes, getFixturesRootDir } from '../RuleTester'; const rootDir = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); /** * ref: https://github.com/typescript-eslint/typescript-eslint/issues/11043 @@ -1382,6 +1373,7 @@ declare const foo: Bar & Foo; languageOptions: { parserOptions: { project: './tsconfig.noUncheckedIndexedAccess.json', + projectService: false, tsconfigRootDir: rootDir, }, }, @@ -1632,6 +1624,7 @@ declare const foo: Bar & Foo; languageOptions: { parserOptions: { project: './tsconfig.noUncheckedIndexedAccess.json', + projectService: false, tsconfigRootDir: rootDir, }, }, @@ -1882,6 +1875,7 @@ declare const foo: Bar & Foo; languageOptions: { parserOptions: { project: './tsconfig.noUncheckedIndexedAccess.json', + projectService: false, tsconfigRootDir: rootDir, }, }, @@ -2132,6 +2126,7 @@ declare const foo: Bar & Foo; languageOptions: { parserOptions: { project: './tsconfig.noUncheckedIndexedAccess.json', + projectService: false, tsconfigRootDir: rootDir, }, }, diff --git a/packages/eslint-plugin/tests/rules/no-confusing-void-expression.test.ts b/packages/eslint-plugin/tests/rules/no-confusing-void-expression.test.ts index 9adc9e2403b6..6e63c73be460 100644 --- a/packages/eslint-plugin/tests/rules/no-confusing-void-expression.test.ts +++ b/packages/eslint-plugin/tests/rules/no-confusing-void-expression.test.ts @@ -1,17 +1,9 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/no-confusing-void-expression'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootPath = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-confusing-void-expression', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts index b40eb26fb978..529d6e999cfa 100644 --- a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts +++ b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts @@ -1,19 +1,12 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-deprecated'; -import { getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, createRuleTesterWithTypes } from '../RuleTester'; const rootDir = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - ecmaFeatures: { - jsx: true, - }, - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, +const ruleTester = createRuleTesterWithTypes({ + ecmaFeatures: { + jsx: true, }, + project: './tsconfig.json', }); ruleTester.run('no-deprecated', rule, { diff --git a/packages/eslint-plugin/tests/rules/no-duplicate-type-constituents.test.ts b/packages/eslint-plugin/tests/rules/no-duplicate-type-constituents.test.ts index 90d32bf0010f..7cbae0db756a 100644 --- a/packages/eslint-plugin/tests/rules/no-duplicate-type-constituents.test.ts +++ b/packages/eslint-plugin/tests/rules/no-duplicate-type-constituents.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-duplicate-type-constituents'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-duplicate-type-constituents', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts b/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts index 09fc5af480d5..00e32626e2bb 100644 --- a/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts +++ b/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-dynamic-delete'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-dynamic-delete', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts index 87ead2f2b19d..0ed85d5b7cef 100644 --- a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts +++ b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts @@ -1,19 +1,10 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; import * as path from 'node:path'; import rule from '../../src/rules/no-floating-promises'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes, getFixturesRootDir } from '../RuleTester'; const rootDir = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-floating-promises', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts b/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts index 7721006b1d75..f781d049ebf2 100644 --- a/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts +++ b/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts @@ -1,17 +1,10 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/no-for-in-array'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes, getFixturesRootDir } from '../RuleTester'; const rootDir = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-for-in-array', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-implied-eval.test.ts b/packages/eslint-plugin/tests/rules/no-implied-eval.test.ts index 5ba0001aaa79..19cb5297a85a 100644 --- a/packages/eslint-plugin/tests/rules/no-implied-eval.test.ts +++ b/packages/eslint-plugin/tests/rules/no-implied-eval.test.ts @@ -1,17 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-implied-eval'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootDir = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +import { createRuleTesterWithTypes } from '../RuleTester'; + +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-implied-eval', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-meaningless-void-operator.test.ts b/packages/eslint-plugin/tests/rules/no-meaningless-void-operator.test.ts index 38c5a239740a..15c6d69a34d8 100644 --- a/packages/eslint-plugin/tests/rules/no-meaningless-void-operator.test.ts +++ b/packages/eslint-plugin/tests/rules/no-meaningless-void-operator.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-meaningless-void-operator'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootDir = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-meaningless-void-operator', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts b/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts index fc9d0fb08374..089a28c9004c 100644 --- a/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts +++ b/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-misused-promises'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootDir = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-misused-promises', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-misused-spread.test.ts b/packages/eslint-plugin/tests/rules/no-misused-spread.test.ts index e187a85a1975..3a7f950fd8e6 100644 --- a/packages/eslint-plugin/tests/rules/no-misused-spread.test.ts +++ b/packages/eslint-plugin/tests/rules/no-misused-spread.test.ts @@ -1,17 +1,10 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/no-misused-spread'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootPath = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig-with-dom.json', - tsconfigRootDir: rootPath, - }, - }, +const ruleTester = createRuleTesterWithTypes({ + project: './tsconfig-with-dom.json', }); ruleTester.run('no-misused-spread', rule, { diff --git a/packages/eslint-plugin/tests/rules/no-mixed-enums.test.ts b/packages/eslint-plugin/tests/rules/no-mixed-enums.test.ts index 603afa4fc0d5..4bd17db5e284 100644 --- a/packages/eslint-plugin/tests/rules/no-mixed-enums.test.ts +++ b/packages/eslint-plugin/tests/rules/no-mixed-enums.test.ts @@ -1,17 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-mixed-enums'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-mixed-enums', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-redundant-type-constituents.test.ts b/packages/eslint-plugin/tests/rules/no-redundant-type-constituents.test.ts index 96afce33ac4e..ce51eb308044 100644 --- a/packages/eslint-plugin/tests/rules/no-redundant-type-constituents.test.ts +++ b/packages/eslint-plugin/tests/rules/no-redundant-type-constituents.test.ts @@ -1,17 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-redundant-type-constituents'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-redundant-type-constituents', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-boolean-literal-compare.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-boolean-literal-compare.test.ts index ef3107357a77..5f27869ee7a0 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-boolean-literal-compare.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-boolean-literal-compare.test.ts @@ -1,18 +1,11 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import * as path from 'node:path'; import rule from '../../src/rules/no-unnecessary-boolean-literal-compare'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes, getFixturesRootDir } from '../RuleTester'; const rootDir = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-unnecessary-boolean-literal-compare', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts index 22bb2f46c152..80d81bce079c 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts @@ -1,6 +1,6 @@ import type { InvalidTestCase } from '@typescript-eslint/rule-tester'; -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import * as path from 'node:path'; import type { @@ -9,28 +9,21 @@ import type { } from '../../src/rules/no-unnecessary-condition'; import rule from '../../src/rules/no-unnecessary-condition'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes, getFixturesRootDir } from '../RuleTester'; -const rootPath = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const rootDir = getFixturesRootDir(); +const ruleTester = createRuleTesterWithTypes(); const optionsWithExactOptionalPropertyTypes = { project: './tsconfig.exactOptionalPropertyTypes.json', - tsconfigRootDir: rootPath, + projectService: false, + tsconfigRootDir: rootDir, }; const optionsWithNoUncheckedIndexedAccess = { project: './tsconfig.noUncheckedIndexedAccess.json', projectService: false, - tsconfigRootDir: getFixturesRootDir(), + tsconfigRootDir: rootDir, }; const necessaryConditionTest = (condition: string): string => ` @@ -883,7 +876,7 @@ if (x) { `, languageOptions: { parserOptions: { - tsconfigRootDir: path.join(rootPath, 'unstrict'), + tsconfigRootDir: path.join(rootDir, 'unstrict'), }, }, options: [ @@ -3059,7 +3052,7 @@ if (x) { ], languageOptions: { parserOptions: { - tsconfigRootDir: path.join(rootPath, 'unstrict'), + tsconfigRootDir: path.join(rootDir, 'unstrict'), }, }, }, diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts index 8bbc814fd314..27bf0da8852a 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-unnecessary-qualifier'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-unnecessary-qualifier', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-template-expression.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-template-expression.test.ts index 907cf64f7763..693d55ae6907 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-template-expression.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-template-expression.test.ts @@ -1,20 +1,11 @@ import type { InvalidTestCase } from '@typescript-eslint/rule-tester'; -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/no-unnecessary-template-expression'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootPath = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); const invalidCases = [ { diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts index 9c2ab4fe84e8..84e90c9f95f5 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-unnecessary-type-arguments'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-unnecessary-type-arguments', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts index 16bfe40b7eb2..b2ef78d4500a 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts @@ -1,17 +1,12 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; -import path from 'node:path'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/no-unnecessary-type-assertion'; +import { getFixturesRootDir, createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = path.join(__dirname, '..', 'fixtures'); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - projectService: false, - tsconfigRootDir: rootDir, - }, - }, +const rootDir = getFixturesRootDir(); + +const ruleTester = createRuleTesterWithTypes({ + project: './tsconfig.json', }); const optionsWithOnUncheckedIndexedAccess = { diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts index 71f5e56e0d1a..1bf2ae83cb1b 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-unnecessary-type-conversion'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootDir = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-unnecessary-type-conversion', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-parameters.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-parameters.test.ts index 9f8f05479c9c..0b98cbd20dd9 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-parameters.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-parameters.test.ts @@ -1,18 +1,9 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/no-unnecessary-type-parameters'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootPath = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-unnecessary-type-parameters', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-argument.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-argument.test.ts index 9669d9c3b045..46fc5f32118d 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-argument.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-argument.test.ts @@ -1,16 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-unsafe-argument'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: getFixturesRootDir(), - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-unsafe-argument', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts index e744d560218d..537ce85284e7 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts @@ -1,16 +1,10 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/no-unsafe-assignment'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.noImplicitThis.json', - projectService: false, - tsconfigRootDir: getFixturesRootDir(), - }, - }, +const ruleTester = createRuleTesterWithTypes({ + project: './tsconfig.noImplicitThis.json', }); ruleTester.run('no-unsafe-assignment', rule, { diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-call.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-call.test.ts index 279534b83f96..8522ecca83b1 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-call.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-call.test.ts @@ -1,16 +1,10 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/no-unsafe-call'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.noImplicitThis.json', - projectService: false, - tsconfigRootDir: getFixturesRootDir(), - }, - }, +const ruleTester = createRuleTesterWithTypes({ + project: './tsconfig.noImplicitThis.json', }); ruleTester.run('no-unsafe-call', rule, { diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-declaration-merging.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-declaration-merging.test.ts index fbaadb553e66..3837b38eb499 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-declaration-merging.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-declaration-merging.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-unsafe-declaration-merging'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-unsafe-declaration-merging', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts index b10f3cc6ee5f..c1e84f7c5884 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-unsafe-enum-comparison'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootDir = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-unsafe-enum-comparison', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-type-assertion.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-type-assertion.test.ts index 0c40f2996676..0b0815f37250 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-type-assertion.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-type-assertion.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-unsafe-type-assertion'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); describe('basic assertions', () => { ruleTester.run('no-unsafe-type-assertion', rule, { diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-unary-minus.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-unary-minus.test.ts index 0aea759ca375..28ab97b62b44 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-unary-minus.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-unary-minus.test.ts @@ -1,17 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/no-unsafe-unary-minus'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('no-unsafe-unary-minus', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/non-nullable-type-assertion-style.test.ts b/packages/eslint-plugin/tests/rules/non-nullable-type-assertion-style.test.ts index 500fe0e5a1db..6c02bb0b1875 100644 --- a/packages/eslint-plugin/tests/rules/non-nullable-type-assertion-style.test.ts +++ b/packages/eslint-plugin/tests/rules/non-nullable-type-assertion-style.test.ts @@ -1,16 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/non-nullable-type-assertion-style'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: getFixturesRootDir(), - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('non-nullable-type-assertion-style', rule, { valid: [ @@ -244,15 +235,8 @@ const b = (a || undefined)!; ], }); -const ruleTesterWithNoUncheckedIndexAccess = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.noUncheckedIndexedAccess.json', - projectService: false, - sourceType: 'module', - tsconfigRootDir: getFixturesRootDir(), - }, - }, +const ruleTesterWithNoUncheckedIndexAccess = createRuleTesterWithTypes({ + project: './tsconfig.noUncheckedIndexedAccess.json', }); ruleTesterWithNoUncheckedIndexAccess.run( diff --git a/packages/eslint-plugin/tests/rules/only-throw-error.test.ts b/packages/eslint-plugin/tests/rules/only-throw-error.test.ts index 500454d0a9cb..aeaf3f392220 100644 --- a/packages/eslint-plugin/tests/rules/only-throw-error.test.ts +++ b/packages/eslint-plugin/tests/rules/only-throw-error.test.ts @@ -1,16 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/only-throw-error'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: getFixturesRootDir(), - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('only-throw-error', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts b/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts index 3c4b0fa576aa..66c0097daf79 100644 --- a/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-destructuring.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/prefer-destructuring'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('prefer-destructuring', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/prefer-find.test.ts b/packages/eslint-plugin/tests/rules/prefer-find.test.ts index 0c17c69dd5f2..5c88cb62000e 100644 --- a/packages/eslint-plugin/tests/rules/prefer-find.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-find.test.ts @@ -1,18 +1,9 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/prefer-find'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('prefer-find', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/prefer-includes.test.ts b/packages/eslint-plugin/tests/rules/prefer-includes.test.ts index 35830c45ad9d..a56cd9ded45a 100644 --- a/packages/eslint-plugin/tests/rules/prefer-includes.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-includes.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/prefer-includes'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('prefer-includes', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts b/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts index e2c5f17c8e5d..26de39970467 100644 --- a/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts @@ -3,7 +3,7 @@ import type { ValidTestCase, } from '@typescript-eslint/rule-tester'; -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import * as path from 'node:path'; import type { @@ -12,18 +12,10 @@ import type { } from '../../src/rules/prefer-nullish-coalescing'; import rule from '../../src/rules/prefer-nullish-coalescing'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes, getFixturesRootDir } from '../RuleTester'; -const rootPath = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const rootDir = getFixturesRootDir(); +const ruleTester = createRuleTesterWithTypes(); const types = ['string', 'number', 'boolean', 'object']; const nullishTypes = ['null', 'undefined', 'null | undefined']; @@ -2495,7 +2487,7 @@ if (x) { ], languageOptions: { parserOptions: { - tsconfigRootDir: path.join(rootPath, 'unstrict'), + tsconfigRootDir: path.join(rootDir, 'unstrict'), }, }, output: null, diff --git a/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts b/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts index 52c59b479b68..6639951b66e4 100644 --- a/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts @@ -1,18 +1,11 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../../src/rules/prefer-optional-chain'; import { dedupeTestCases } from '../../dedupeTestCases'; -import { getFixturesRootDir } from '../../RuleTester'; +import { createRuleTesterWithTypes } from '../../RuleTester'; import { BaseCases, identity } from './base-cases'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: getFixturesRootDir(), - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); describe('|| {}', () => { ruleTester.run('prefer-optional-chain', rule, { diff --git a/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts b/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts index d8edf4fb9c48..a2ba8d12c801 100644 --- a/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-promise-reject-errors.test.ts @@ -1,17 +1,9 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/prefer-promise-reject-errors'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('prefer-promise-reject-errors', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts b/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts index 94381614160a..4cc30efb6b26 100644 --- a/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts @@ -1,20 +1,11 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import * as path from 'node:path'; import rule from '../../src/rules/prefer-readonly-parameter-types'; import { readonlynessOptionsDefaults } from '../../src/util'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootPath = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('prefer-readonly-parameter-types', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts b/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts index 1e2289d65d1e..4b85f6ae7240 100644 --- a/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts @@ -1,17 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/prefer-readonly'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('prefer-readonly', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/prefer-reduce-type-parameter.test.ts b/packages/eslint-plugin/tests/rules/prefer-reduce-type-parameter.test.ts index f26ccb53350f..a158bfa685fb 100644 --- a/packages/eslint-plugin/tests/rules/prefer-reduce-type-parameter.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-reduce-type-parameter.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/prefer-reduce-type-parameter'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('prefer-reduce-type-parameter', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/prefer-regexp-exec.test.ts b/packages/eslint-plugin/tests/rules/prefer-regexp-exec.test.ts index e107208a9a3d..c5a501f69887 100644 --- a/packages/eslint-plugin/tests/rules/prefer-regexp-exec.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-regexp-exec.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/prefer-regexp-exec'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('prefer-regexp-exec', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts b/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts index d0ed5d1a9c9b..df31a2c9f987 100644 --- a/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/prefer-return-this-type'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('prefer-return-this-type', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts b/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts index 798d26cb3916..1b6a91ea03b2 100644 --- a/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts @@ -1,18 +1,9 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/prefer-string-starts-ends-with'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootPath = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('prefer-string-starts-ends-with', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts index 4807d8a1c970..c922c0f1024f 100644 --- a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts +++ b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts @@ -1,18 +1,9 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/promise-function-async'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('promise-function-async', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/related-getter-setter-pairs.test.ts b/packages/eslint-plugin/tests/rules/related-getter-setter-pairs.test.ts index ec7e22385052..e31e9b1cde0e 100644 --- a/packages/eslint-plugin/tests/rules/related-getter-setter-pairs.test.ts +++ b/packages/eslint-plugin/tests/rules/related-getter-setter-pairs.test.ts @@ -1,17 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/related-getter-setter-pairs'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('related-getter-setter-pairs', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/require-array-sort-compare.test.ts b/packages/eslint-plugin/tests/rules/require-array-sort-compare.test.ts index d4735efe231d..786c321194f1 100644 --- a/packages/eslint-plugin/tests/rules/require-array-sort-compare.test.ts +++ b/packages/eslint-plugin/tests/rules/require-array-sort-compare.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/require-array-sort-compare'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('require-array-sort-compare', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/require-await.test.ts b/packages/eslint-plugin/tests/rules/require-await.test.ts index d9fca8c12f61..4fc229f27295 100644 --- a/packages/eslint-plugin/tests/rules/require-await.test.ts +++ b/packages/eslint-plugin/tests/rules/require-await.test.ts @@ -1,18 +1,9 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/require-await'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('require-await', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/restrict-plus-operands.test.ts b/packages/eslint-plugin/tests/rules/restrict-plus-operands.test.ts index d1bf99b34800..a60f49e09f86 100644 --- a/packages/eslint-plugin/tests/rules/restrict-plus-operands.test.ts +++ b/packages/eslint-plugin/tests/rules/restrict-plus-operands.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/restrict-plus-operands'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('restrict-plus-operands', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts b/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts index e43335aecd04..aa88c8276cdf 100644 --- a/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts @@ -1,18 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/restrict-template-expressions'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('restrict-template-expressions', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/return-await.test.ts b/packages/eslint-plugin/tests/rules/return-await.test.ts index 9a44a5954d66..33f3f330e92a 100644 --- a/packages/eslint-plugin/tests/rules/return-await.test.ts +++ b/packages/eslint-plugin/tests/rules/return-await.test.ts @@ -1,20 +1,11 @@ import type { InvalidTestCase } from '@typescript-eslint/rule-tester'; -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/return-await'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); // default rule is in-try-catch ruleTester.run('return-await', rule, { 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 77d8a00e67fb..5f451c3f07e4 100644 --- a/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts @@ -1,18 +1,11 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import * as path from 'node:path'; import rule from '../../src/rules/strict-boolean-expressions'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes, getFixturesRootDir } from '../RuleTester'; -const rootPath = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const rootDir = getFixturesRootDir(); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('strict-boolean-expressions', rule, { valid: [ @@ -385,7 +378,7 @@ if (x) { `, languageOptions: { parserOptions: { - tsconfigRootDir: path.join(rootPath, 'unstrict'), + tsconfigRootDir: path.join(rootDir, 'unstrict'), }, }, options: [ @@ -3270,7 +3263,7 @@ if (x) { ], languageOptions: { parserOptions: { - tsconfigRootDir: path.join(rootPath, 'unstrict'), + tsconfigRootDir: path.join(rootDir, 'unstrict'), }, }, output: null, diff --git a/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts b/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts index b18e91e4872a..11392f2ca353 100644 --- a/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts +++ b/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts @@ -1,18 +1,10 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; -import path from 'node:path'; +import { noFormat } from '@typescript-eslint/rule-tester'; import switchExhaustivenessCheck from '../../src/rules/switch-exhaustiveness-check'; +import { getFixturesRootDir, createRuleTesterWithTypes } from '../RuleTester'; -const rootPath = path.join(__dirname, '..', 'fixtures'); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const rootDir = getFixturesRootDir(); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('switch-exhaustiveness-check', switchExhaustivenessCheck, { valid: [ @@ -928,7 +920,7 @@ function foo(x: string[]) { parserOptions: { project: './tsconfig.noUncheckedIndexedAccess.json', projectService: false, - tsconfigRootDir: rootPath, + tsconfigRootDir: rootDir, }, }, }, @@ -951,7 +943,7 @@ function foo(x: string[], y: string | undefined) { parserOptions: { project: './tsconfig.noUncheckedIndexedAccess.json', projectService: false, - tsconfigRootDir: rootPath, + tsconfigRootDir: rootDir, }, }, }, @@ -2802,7 +2794,7 @@ function foo(x: string[]) { parserOptions: { project: './tsconfig.noUncheckedIndexedAccess.json', projectService: false, - tsconfigRootDir: rootPath, + tsconfigRootDir: rootDir, }, }, }, diff --git a/packages/eslint-plugin/tests/rules/typedef.test.ts b/packages/eslint-plugin/tests/rules/typedef.test.ts index 129fcc5320c0..152cc1beeecf 100644 --- a/packages/eslint-plugin/tests/rules/typedef.test.ts +++ b/packages/eslint-plugin/tests/rules/typedef.test.ts @@ -1,17 +1,7 @@ -import { RuleTester } from '@typescript-eslint/rule-tester'; - import rule from '../../src/rules/typedef'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('typedef', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/rules/unbound-method.test.ts b/packages/eslint-plugin/tests/rules/unbound-method.test.ts index aeca1a171d50..92fc2cc48188 100644 --- a/packages/eslint-plugin/tests/rules/unbound-method.test.ts +++ b/packages/eslint-plugin/tests/rules/unbound-method.test.ts @@ -1,22 +1,11 @@ import type { InvalidTestCase } from '@typescript-eslint/rule-tester'; -import { RuleTester } from '@typescript-eslint/rule-tester'; - import type { MessageIds, Options } from '../../src/rules/unbound-method'; import rule from '../../src/rules/unbound-method'; -import { getFixturesRootDir } from '../RuleTester'; - -const rootPath = getFixturesRootDir(); +import { createRuleTesterWithTypes } from '../RuleTester'; -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); function addContainsMethodsClass(code: string): string { return ` diff --git a/packages/eslint-plugin/tests/rules/use-unknown-in-catch-callback-variable.test.ts b/packages/eslint-plugin/tests/rules/use-unknown-in-catch-callback-variable.test.ts index 4100fba8b702..e0ba5f76d4fa 100644 --- a/packages/eslint-plugin/tests/rules/use-unknown-in-catch-callback-variable.test.ts +++ b/packages/eslint-plugin/tests/rules/use-unknown-in-catch-callback-variable.test.ts @@ -1,18 +1,9 @@ -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { noFormat } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/use-unknown-in-catch-callback-variable'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootDir = getFixturesRootDir(); - -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootDir, - }, - }, -}); +const ruleTester = createRuleTesterWithTypes(); ruleTester.run('use-unknown-in-catch-callback-variable', rule, { valid: [ diff --git a/packages/eslint-plugin/tests/util/getConstraintInfo.test.ts b/packages/eslint-plugin/tests/util/getConstraintInfo.test.ts index 332b0373c092..c491a3a1a8e3 100644 --- a/packages/eslint-plugin/tests/util/getConstraintInfo.test.ts +++ b/packages/eslint-plugin/tests/util/getConstraintInfo.test.ts @@ -14,6 +14,7 @@ const DEFAULT_PARSER_OPTIONS = { disallowAutomaticSingleRunInference: true, filePath: path.join(FIXTURES_DIR, 'file.ts'), project: './tsconfig.json', + projectService: false, tsconfigRootDir: FIXTURES_DIR, } as const satisfies ParserOptions; diff --git a/packages/eslint-plugin/tests/util/getWrappedCode.test.ts b/packages/eslint-plugin/tests/util/getWrappedCode.test.ts index c22f9f9a3216..ecfada71d23b 100644 --- a/packages/eslint-plugin/tests/util/getWrappedCode.test.ts +++ b/packages/eslint-plugin/tests/util/getWrappedCode.test.ts @@ -1,6 +1,5 @@ import type { TSESTree } from '@typescript-eslint/utils'; -import { RuleTester } from '@typescript-eslint/rule-tester'; import * as ts from 'typescript'; import { @@ -9,16 +8,10 @@ import { getParserServices, } from '../../src/util'; import { getWrappedCode } from '../../src/util/getWrappedCode'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootPath = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, +const ruleTester = createRuleTesterWithTypes({ + project: './tsconfig.json', }); const removeFunctionRule = createRule({ diff --git a/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts b/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts index 1dd7a2b929e8..e04a8725b65d 100644 --- a/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts +++ b/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts @@ -1,18 +1,10 @@ import type { TSESTree } from '@typescript-eslint/utils'; -import { RuleTester } from '@typescript-eslint/rule-tester'; - import { createRule, getWrappingFixer } from '../../src/util'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; -const rootPath = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, +const ruleTester = createRuleTesterWithTypes({ + project: './tsconfig.json', }); const voidEverythingRule = createRule({ diff --git a/packages/eslint-plugin/tests/util/isNodeEqual.test.ts b/packages/eslint-plugin/tests/util/isNodeEqual.test.ts index 1177b1ac44bb..2ff8cd2baa72 100644 --- a/packages/eslint-plugin/tests/util/isNodeEqual.test.ts +++ b/packages/eslint-plugin/tests/util/isNodeEqual.test.ts @@ -1,9 +1,7 @@ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; -import { RuleTester } from '@typescript-eslint/rule-tester'; - import { createRule, isNodeEqual } from '../../src/util'; -import { getFixturesRootDir } from '../RuleTester'; +import { createRuleTesterWithTypes } from '../RuleTester'; const rule = createRule({ create(context) { @@ -43,14 +41,8 @@ const rule = createRule({ name: 'no-useless-expression', }); -const rootPath = getFixturesRootDir(); -const ruleTester = new RuleTester({ - languageOptions: { - parserOptions: { - project: './tsconfig.json', - tsconfigRootDir: rootPath, - }, - }, +const ruleTester = createRuleTesterWithTypes({ + project: './tsconfig.json', }); ruleTester.run('isNodeEqual', rule, { diff --git a/packages/typescript-estree/src/parseSettings/createParseSettings.ts b/packages/typescript-estree/src/parseSettings/createParseSettings.ts index e393686e0afc..15bd7840a4e9 100644 --- a/packages/typescript-estree/src/parseSettings/createParseSettings.ts +++ b/packages/typescript-estree/src/parseSettings/createParseSettings.ts @@ -180,6 +180,19 @@ export function createParseSettings( tsconfigRootDir, }; + // TODO: Eventually, parse settings will be validated more thoroughly. + // https://github.com/typescript-eslint/typescript-eslint/issues/6403 + if ( + parseSettings.projectService && + tsestreeOptions.project && + process.env.TYPESCRIPT_ESLINT_IGNORE_PROJECT_AND_PROJECT_SERVICE_ERROR !== + 'true' + ) { + throw new Error( + 'Enabling "project" does nothing when "projectService" is enabled. You can remove the "project" setting.', + ); + } + // debug doesn't support multiple `enable` calls, so have to do it all at once if (parseSettings.debugLevel.size > 0) { const namespaces = []; diff --git a/packages/typescript-estree/tests/lib/createParseSettings.test.ts b/packages/typescript-estree/tests/lib/createParseSettings.test.ts index b1f33f9304d2..ddb9c17cbc2b 100644 --- a/packages/typescript-estree/tests/lib/createParseSettings.test.ts +++ b/packages/typescript-estree/tests/lib/createParseSettings.test.ts @@ -26,6 +26,10 @@ describe(createParseSettings, () => { it('is created when options.projectService is undefined, options.project is true, and process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE is true', () => { vi.stubEnv('TYPESCRIPT_ESLINT_PROJECT_SERVICE', 'true'); + vi.stubEnv( + 'TYPESCRIPT_ESLINT_IGNORE_PROJECT_AND_PROJECT_SERVICE_ERROR', + 'true', + ); const parseSettings = createParseSettings('', { project: true, @@ -35,6 +39,17 @@ describe(createParseSettings, () => { expect(parseSettings.projectService).toBe(projectService); }); + it('complains when options.projectService is true, options.project is true, and process.env.TYPESCRIPT_ESLINT_IGNORE_PROJECT_AND_PROJECT_SERVICE_ERROR is not set', () => { + expect(() => + createParseSettings('', { + project: true, + projectService: true, + }), + ).toThrowErrorMatchingInlineSnapshot( + `[Error: Enabling "project" does nothing when "projectService" is enabled. You can remove the "project" setting.]`, + ); + }); + it('is not created when options.projectService is undefined, options.project is falsy, and process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE is true', () => { vi.stubEnv('TYPESCRIPT_ESLINT_PROJECT_SERVICE', 'true'); diff --git a/packages/typescript-estree/tests/lib/parse.test.ts b/packages/typescript-estree/tests/lib/parse.test.ts index c371a6e9e7ac..421287ff182b 100644 --- a/packages/typescript-estree/tests/lib/parse.test.ts +++ b/packages/typescript-estree/tests/lib/parse.test.ts @@ -68,6 +68,10 @@ describe(parser.parseAndGenerateServices, () => { beforeEach(() => { vi.clearAllMocks(); clearGlobResolutionCache(); + vi.stubEnv( + 'TYPESCRIPT_ESLINT_IGNORE_PROJECT_AND_PROJECT_SERVICE_ERROR', + 'true', + ); }); afterAll(() => { diff --git a/packages/typescript-estree/tests/lib/persistentParse.test.ts b/packages/typescript-estree/tests/lib/persistentParse.test.ts index d7283f412330..b8916bb6eb08 100644 --- a/packages/typescript-estree/tests/lib/persistentParse.test.ts +++ b/packages/typescript-estree/tests/lib/persistentParse.test.ts @@ -38,6 +38,13 @@ afterEach(() => { process.chdir(cwdCopy); }); +beforeEach(() => { + vi.stubEnv( + 'TYPESCRIPT_ESLINT_IGNORE_PROJECT_AND_PROJECT_SERVICE_ERROR', + 'true', + ); +}); + beforeAll(async () => { await fs.mkdir(tmpDirsParentDirectory, { recursive: true, diff --git a/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts b/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts index 47bcf87bf54d..a82406b3b0b0 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts @@ -114,6 +114,11 @@ describe('semanticInfo - singleRun', () => { createProgramFromConfigFile.mockClear(); // Do not track invocations per file across tests clearParseAndGenerateServicesCalls(); + + vi.stubEnv( + 'TYPESCRIPT_ESLINT_IGNORE_PROJECT_AND_PROJECT_SERVICE_ERROR', + 'true', + ); }); it('should not create any programs ahead of time by default when there is no way to infer singleRun=true', () => { diff --git a/packages/typescript-estree/tests/lib/semanticInfo.test.ts b/packages/typescript-estree/tests/lib/semanticInfo.test.ts index 9f4aa21fbd5d..0d4285e396d0 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo.test.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo.test.ts @@ -41,8 +41,17 @@ describe('semanticInfo', async () => { clearCaches(); vi.stubEnv('TSESTREE_SINGLE_RUN', ''); + vi.stubEnv( + 'TYPESCRIPT_ESLINT_IGNORE_PROJECT_AND_PROJECT_SERVICE_ERROR', + 'true', + ); }); + vi.stubEnv( + 'TYPESCRIPT_ESLINT_IGNORE_PROJECT_AND_PROJECT_SERVICE_ERROR', + 'true', + ); + // test all AST snapshots const testCases = await Promise.all( testFiles.map(async filename => { From c6188b714f4063c39c7c45dac774088aba86aa3d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 10 Nov 2025 10:23:07 -0500 Subject: [PATCH 281/283] chore(deps): update dependency knip to v5.67.1 (#11751) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 190 ++++++++++++++++++++++++++---------------------------- 1 file changed, 90 insertions(+), 100 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6295c90a9725..d0c7c8fb3896 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4131,14 +4131,14 @@ __metadata: languageName: node linkType: hard -"@napi-rs/wasm-runtime@npm:^1.0.5": - version: 1.0.5 - resolution: "@napi-rs/wasm-runtime@npm:1.0.5" +"@napi-rs/wasm-runtime@npm:^1.0.7": + version: 1.0.7 + resolution: "@napi-rs/wasm-runtime@npm:1.0.7" dependencies: "@emnapi/core": ^1.5.0 "@emnapi/runtime": ^1.5.0 "@tybys/wasm-util": ^0.10.1 - checksum: 22005c6e9d77854938cf0c832bb630533108ea1f3617d1cf40fa814bc1351412fb98d4d4ea63099c9963bc4ca63cf691ca6e370a490adc5fd7d42721005367c5 + checksum: 9b59bd8b7310936ed163935befae0613dfffd563e7ff021d4f1b62b419fb0e3395f7206b17460a91db555bea6c471408f3472455e4e2ca9f5a0bff4468fa38d0 languageName: node linkType: hard @@ -4355,137 +4355,137 @@ __metadata: languageName: node linkType: hard -"@oxc-resolver/binding-android-arm-eabi@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-android-arm-eabi@npm:11.8.4" +"@oxc-resolver/binding-android-arm-eabi@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-android-arm-eabi@npm:11.13.1" conditions: os=android & cpu=arm languageName: node linkType: hard -"@oxc-resolver/binding-android-arm64@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-android-arm64@npm:11.8.4" +"@oxc-resolver/binding-android-arm64@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-android-arm64@npm:11.13.1" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@oxc-resolver/binding-darwin-arm64@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-darwin-arm64@npm:11.8.4" +"@oxc-resolver/binding-darwin-arm64@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-darwin-arm64@npm:11.13.1" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@oxc-resolver/binding-darwin-x64@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-darwin-x64@npm:11.8.4" +"@oxc-resolver/binding-darwin-x64@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-darwin-x64@npm:11.13.1" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@oxc-resolver/binding-freebsd-x64@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-freebsd-x64@npm:11.8.4" +"@oxc-resolver/binding-freebsd-x64@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-freebsd-x64@npm:11.13.1" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.8.4" +"@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.13.1" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm-musleabihf@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-linux-arm-musleabihf@npm:11.8.4" +"@oxc-resolver/binding-linux-arm-musleabihf@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-linux-arm-musleabihf@npm:11.13.1" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm64-gnu@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-linux-arm64-gnu@npm:11.8.4" +"@oxc-resolver/binding-linux-arm64-gnu@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-linux-arm64-gnu@npm:11.13.1" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm64-musl@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-linux-arm64-musl@npm:11.8.4" +"@oxc-resolver/binding-linux-arm64-musl@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-linux-arm64-musl@npm:11.13.1" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@oxc-resolver/binding-linux-ppc64-gnu@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-linux-ppc64-gnu@npm:11.8.4" +"@oxc-resolver/binding-linux-ppc64-gnu@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-linux-ppc64-gnu@npm:11.13.1" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-riscv64-gnu@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-linux-riscv64-gnu@npm:11.8.4" +"@oxc-resolver/binding-linux-riscv64-gnu@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-linux-riscv64-gnu@npm:11.13.1" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-riscv64-musl@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-linux-riscv64-musl@npm:11.8.4" +"@oxc-resolver/binding-linux-riscv64-musl@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-linux-riscv64-musl@npm:11.13.1" conditions: os=linux & cpu=riscv64 & libc=musl languageName: node linkType: hard -"@oxc-resolver/binding-linux-s390x-gnu@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-linux-s390x-gnu@npm:11.8.4" +"@oxc-resolver/binding-linux-s390x-gnu@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-linux-s390x-gnu@npm:11.13.1" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-x64-gnu@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-linux-x64-gnu@npm:11.8.4" +"@oxc-resolver/binding-linux-x64-gnu@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-linux-x64-gnu@npm:11.13.1" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-x64-musl@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-linux-x64-musl@npm:11.8.4" +"@oxc-resolver/binding-linux-x64-musl@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-linux-x64-musl@npm:11.13.1" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@oxc-resolver/binding-wasm32-wasi@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-wasm32-wasi@npm:11.8.4" +"@oxc-resolver/binding-wasm32-wasi@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-wasm32-wasi@npm:11.13.1" dependencies: - "@napi-rs/wasm-runtime": ^1.0.5 + "@napi-rs/wasm-runtime": ^1.0.7 conditions: cpu=wasm32 languageName: node linkType: hard -"@oxc-resolver/binding-win32-arm64-msvc@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-win32-arm64-msvc@npm:11.8.4" +"@oxc-resolver/binding-win32-arm64-msvc@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-win32-arm64-msvc@npm:11.13.1" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@oxc-resolver/binding-win32-ia32-msvc@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-win32-ia32-msvc@npm:11.8.4" +"@oxc-resolver/binding-win32-ia32-msvc@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-win32-ia32-msvc@npm:11.13.1" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@oxc-resolver/binding-win32-x64-msvc@npm:11.8.4": - version: 11.8.4 - resolution: "@oxc-resolver/binding-win32-x64-msvc@npm:11.8.4" +"@oxc-resolver/binding-win32-x64-msvc@npm:11.13.1": + version: 11.13.1 + resolution: "@oxc-resolver/binding-win32-x64-msvc@npm:11.13.1" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -13204,8 +13204,8 @@ __metadata: linkType: hard "knip@npm:^5.41.1": - version: 5.66.1 - resolution: "knip@npm:5.66.1" + version: 5.68.0 + resolution: "knip@npm:5.68.0" dependencies: "@nodelib/fs.walk": ^1.2.3 fast-glob: ^3.3.3 @@ -13213,7 +13213,7 @@ __metadata: jiti: ^2.6.0 js-yaml: ^4.1.0 minimist: ^1.2.8 - oxc-resolver: ^11.8.3 + oxc-resolver: ^11.12.0 picocolors: ^1.1.1 picomatch: ^4.0.1 smol-toml: ^1.4.1 @@ -13225,7 +13225,7 @@ __metadata: bin: knip: bin/knip.js knip-bun: bin/knip-bun.js - checksum: 27fbd27e2ab36d06ac07431cb6b70c9080d18e7cacb57f8a7c0a00afce8cf15eea3a2199ca13e8c2a9ac039267a8df68b41bc95a7ff3f951aad58ac9a439d6bf + checksum: a5ab5ae05c0f72f6dc5992908f252fa60cf7ba53aaa45af970f7882175de20ae98cec8f1813543a63cc0bd5353a701c37b20d47d80da62c3edb77a12234168ef languageName: node linkType: hard @@ -14974,15 +14974,6 @@ __metadata: languageName: node linkType: hard -"napi-postinstall@npm:^0.3.0": - version: 0.3.3 - resolution: "napi-postinstall@npm:0.3.3" - bin: - napi-postinstall: lib/cli.js - checksum: b18f36be61045821423f6fdfa68fcf27ef781d2f7d65ef16c611ee2d815439c7db0c2482f3982d26b0bdafbaaa0e8387cbc84172080079c506364686971d76fb - languageName: node - linkType: hard - "natural-compare@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare@npm:1.4.0" @@ -15491,30 +15482,29 @@ __metadata: languageName: node linkType: hard -"oxc-resolver@npm:^11.8.3": - version: 11.8.4 - resolution: "oxc-resolver@npm:11.8.4" - dependencies: - "@oxc-resolver/binding-android-arm-eabi": 11.8.4 - "@oxc-resolver/binding-android-arm64": 11.8.4 - "@oxc-resolver/binding-darwin-arm64": 11.8.4 - "@oxc-resolver/binding-darwin-x64": 11.8.4 - "@oxc-resolver/binding-freebsd-x64": 11.8.4 - "@oxc-resolver/binding-linux-arm-gnueabihf": 11.8.4 - "@oxc-resolver/binding-linux-arm-musleabihf": 11.8.4 - "@oxc-resolver/binding-linux-arm64-gnu": 11.8.4 - "@oxc-resolver/binding-linux-arm64-musl": 11.8.4 - "@oxc-resolver/binding-linux-ppc64-gnu": 11.8.4 - "@oxc-resolver/binding-linux-riscv64-gnu": 11.8.4 - "@oxc-resolver/binding-linux-riscv64-musl": 11.8.4 - "@oxc-resolver/binding-linux-s390x-gnu": 11.8.4 - "@oxc-resolver/binding-linux-x64-gnu": 11.8.4 - "@oxc-resolver/binding-linux-x64-musl": 11.8.4 - "@oxc-resolver/binding-wasm32-wasi": 11.8.4 - "@oxc-resolver/binding-win32-arm64-msvc": 11.8.4 - "@oxc-resolver/binding-win32-ia32-msvc": 11.8.4 - "@oxc-resolver/binding-win32-x64-msvc": 11.8.4 - napi-postinstall: ^0.3.0 +"oxc-resolver@npm:^11.12.0": + version: 11.13.1 + resolution: "oxc-resolver@npm:11.13.1" + dependencies: + "@oxc-resolver/binding-android-arm-eabi": 11.13.1 + "@oxc-resolver/binding-android-arm64": 11.13.1 + "@oxc-resolver/binding-darwin-arm64": 11.13.1 + "@oxc-resolver/binding-darwin-x64": 11.13.1 + "@oxc-resolver/binding-freebsd-x64": 11.13.1 + "@oxc-resolver/binding-linux-arm-gnueabihf": 11.13.1 + "@oxc-resolver/binding-linux-arm-musleabihf": 11.13.1 + "@oxc-resolver/binding-linux-arm64-gnu": 11.13.1 + "@oxc-resolver/binding-linux-arm64-musl": 11.13.1 + "@oxc-resolver/binding-linux-ppc64-gnu": 11.13.1 + "@oxc-resolver/binding-linux-riscv64-gnu": 11.13.1 + "@oxc-resolver/binding-linux-riscv64-musl": 11.13.1 + "@oxc-resolver/binding-linux-s390x-gnu": 11.13.1 + "@oxc-resolver/binding-linux-x64-gnu": 11.13.1 + "@oxc-resolver/binding-linux-x64-musl": 11.13.1 + "@oxc-resolver/binding-wasm32-wasi": 11.13.1 + "@oxc-resolver/binding-win32-arm64-msvc": 11.13.1 + "@oxc-resolver/binding-win32-ia32-msvc": 11.13.1 + "@oxc-resolver/binding-win32-x64-msvc": 11.13.1 dependenciesMeta: "@oxc-resolver/binding-android-arm-eabi": optional: true @@ -15554,7 +15544,7 @@ __metadata: optional: true "@oxc-resolver/binding-win32-x64-msvc": optional: true - checksum: 21a513b06d0f15a4ea941c5554485796b22694ef87555b06c29d86acd45aaf5de54698eabb649a8095a0e303212c66c184404c64eb5b3e24c60ba50c46f26e26 + checksum: 2aed976eac9d7142be0b518b95710ae6d988223064e49c5138951a334933a420b7176ec9a43f854b3e54d10a7d4fafc3cc5f15ea0aa297637165f47815f69151 languageName: node linkType: hard From bf003c8cc18358351e2779e18252d71774c3a2d0 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 10 Nov 2025 10:23:41 -0500 Subject: [PATCH 282/283] chore: remove unnecessary ts-expect-error from eslint.config.mjs --- eslint.config.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 1c27183e58f5..f4c3143af22e 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -44,7 +44,6 @@ export default defineConfig( // @ts-expect-error -- https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/pull/1038 ['jsx-a11y']: jsxA11yPlugin.flatConfigs.recommended.plugins['jsx-a11y'], ['perfectionist']: perfectionistPlugin, - // @ts-expect-error -- https://github.com/vitest-dev/eslint-plugin-vitest/issues/737 ['vitest']: vitestPlugin, // https://github.com/facebook/react/issues/28313 ['react']: reactPlugin, From 843f144797c0a94272cdb002c00c5639cf0797c6 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 10 Nov 2025 17:05:03 +0000 Subject: [PATCH 283/283] chore(release): publish 8.46.4 --- CHANGELOG.md | 16 +++ packages/ast-spec/CHANGELOG.md | 6 ++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 16 +++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 12 +++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 216 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02528e3e3502..36df7d48a5b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +## 8.46.4 (2025-11-10) + +### 🩹 Fixes + +- **eslint-plugin:** [no-deprecated] fix double-report on computed literal identifiers ([#11006](https://github.com/typescript-eslint/typescript-eslint/pull/11006), [#10958](https://github.com/typescript-eslint/typescript-eslint/issues/10958)) +- **eslint-plugin:** handle override modifier in promise-function-async fixer ([#11730](https://github.com/typescript-eslint/typescript-eslint/pull/11730)) +- **parser:** error when both `projectService` and `project` are set ([#11333](https://github.com/typescript-eslint/typescript-eslint/pull/11333)) + +### ❤️ Thank You + +- Evgeny Stepanovych @undsoft +- Kentaro Suzuki @sushichan044 +- Maria Solano @MariaSolOs + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) ### 🩹 Fixes diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 664353c89248..057df049c10e 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.4 (2025-11-10) + +This was a version bump only for ast-spec to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) This was a version bump only for ast-spec to align it with other projects, there were no code changes. diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 9805ddca37f3..98f50fdac96c 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.46.3", + "version": "8.46.4", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index b2eeaa6446c5..53995954dd83 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,19 @@ +## 8.46.4 (2025-11-10) + +### 🩹 Fixes + +- **parser:** error when both `projectService` and `project` are set ([#11333](https://github.com/typescript-eslint/typescript-eslint/pull/11333)) +- **eslint-plugin:** handle override modifier in promise-function-async fixer ([#11730](https://github.com/typescript-eslint/typescript-eslint/pull/11730)) +- **eslint-plugin:** [no-deprecated] fix double-report on computed literal identifiers ([#11006](https://github.com/typescript-eslint/typescript-eslint/pull/11006), [#10958](https://github.com/typescript-eslint/typescript-eslint/issues/10958)) + +### ❤️ Thank You + +- Evgeny Stepanovych @undsoft +- Kentaro Suzuki @sushichan044 +- Maria Solano @MariaSolOs + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) ### 🩹 Fixes diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 982d297e6530..14aab4ecfd9b 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.46.3", + "version": "8.46.4", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.46.3", - "@typescript-eslint/type-utils": "8.46.3", - "@typescript-eslint/utils": "8.46.3", - "@typescript-eslint/visitor-keys": "8.46.3", + "@typescript-eslint/scope-manager": "8.46.4", + "@typescript-eslint/type-utils": "8.46.4", + "@typescript-eslint/utils": "8.46.4", + "@typescript-eslint/visitor-keys": "8.46.4", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.46.3", - "@typescript-eslint/rule-tester": "8.46.3", + "@typescript-eslint/rule-schema-to-typescript-types": "8.46.4", + "@typescript-eslint/rule-tester": "8.46.4", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.46.3", + "@typescript-eslint/parser": "^8.46.4", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 7448bd8b8802..c9063221465a 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.4 (2025-11-10) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 2b35f484c596..ab5e4f8e997f 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.46.3", + "version": "8.46.4", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.46.3", - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/typescript-estree": "8.46.3", - "@typescript-eslint/visitor-keys": "8.46.3", + "@typescript-eslint/scope-manager": "8.46.4", + "@typescript-eslint/types": "8.46.4", + "@typescript-eslint/typescript-estree": "8.46.4", + "@typescript-eslint/visitor-keys": "8.46.4", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 23b3efe4f184..bf9d4d7e5704 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.4 (2025-11-10) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 9420e463ce68..cff8b0af692c 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.46.3", + "version": "8.46.4", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.46.3", - "@typescript-eslint/types": "^8.46.3", + "@typescript-eslint/tsconfig-utils": "^8.46.4", + "@typescript-eslint/types": "^8.46.4", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 495cb12421ff..d240d23a74b3 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.4 (2025-11-10) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 00d24a03ffd5..e6313346d319 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.46.3", + "version": "8.46.4", "description": "Converts ESLint rule schemas to equivalent TypeScript type strings.", "type": "module", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.46.3", - "@typescript-eslint/utils": "8.46.3", + "@typescript-eslint/type-utils": "8.46.4", + "@typescript-eslint/utils": "8.46.4", "natural-compare": "^1.4.0" }, "devDependencies": { diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index de5cc90b783a..2ceadf00ab3c 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.4 (2025-11-10) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 0e36a8bde631..b63e19e2b7d5 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.46.3", + "version": "8.46.4", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.46.3", - "@typescript-eslint/typescript-estree": "8.46.3", - "@typescript-eslint/utils": "8.46.3", + "@typescript-eslint/parser": "8.46.4", + "@typescript-eslint/typescript-estree": "8.46.4", + "@typescript-eslint/utils": "8.46.4", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 4950003089e4..de5fd4f62be6 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.4 (2025-11-10) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 59d80db0aa18..5214090600a6 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.46.3", + "version": "8.46.4", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/visitor-keys": "8.46.3" + "@typescript-eslint/types": "8.46.4", + "@typescript-eslint/visitor-keys": "8.46.4" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.46.3", + "@typescript-eslint/typescript-estree": "8.46.4", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index a729dbd0a67d..eccf448aa899 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.4 (2025-11-10) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index daba953fdc62..8fbaa26d1dfb 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.46.3", + "version": "8.46.4", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 572180a845c8..9257f2c6b57e 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.4 (2025-11-10) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index a39c7b64f632..59271a4bb535 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.46.3", + "version": "8.46.4", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/typescript-estree": "8.46.3", - "@typescript-eslint/utils": "8.46.3", + "@typescript-eslint/types": "8.46.4", + "@typescript-eslint/typescript-estree": "8.46.4", + "@typescript-eslint/utils": "8.46.4", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.46.3", + "@typescript-eslint/parser": "8.46.4", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index f1b0380e1768..7085c62c42b4 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.4 (2025-11-10) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index ee49cc9f573d..961fec65b815 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.46.3", + "version": "8.46.4", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index c7c367d81489..f26f3626d103 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.4 (2025-11-10) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 428942c4ade8..ff1414887fc1 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.46.3", + "version": "8.46.4", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.46.3", - "@typescript-eslint/parser": "8.46.3", - "@typescript-eslint/typescript-estree": "8.46.3", - "@typescript-eslint/utils": "8.46.3" + "@typescript-eslint/eslint-plugin": "8.46.4", + "@typescript-eslint/parser": "8.46.4", + "@typescript-eslint/typescript-estree": "8.46.4", + "@typescript-eslint/utils": "8.46.4" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index f374d1e9361d..0406f93e5141 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.46.4 (2025-11-10) + +### 🩹 Fixes + +- **parser:** error when both `projectService` and `project` are set ([#11333](https://github.com/typescript-eslint/typescript-eslint/pull/11333)) + +### ❤️ Thank You + +- Maria Solano @MariaSolOs + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) This was a version bump only for typescript-estree to align it with other projects, there were no code changes. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 79bbc5c51f21..e3a732a412ab 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.46.3", + "version": "8.46.4", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.46.3", - "@typescript-eslint/tsconfig-utils": "8.46.3", - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/visitor-keys": "8.46.3", + "@typescript-eslint/project-service": "8.46.4", + "@typescript-eslint/tsconfig-utils": "8.46.4", + "@typescript-eslint/types": "8.46.4", + "@typescript-eslint/visitor-keys": "8.46.4", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 35b26eff87f1..4e097649dc91 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.4 (2025-11-10) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index 40fa08156694..8b569c25913c 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.46.3", + "version": "8.46.4", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.46.3", - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/typescript-estree": "8.46.3" + "@typescript-eslint/scope-manager": "8.46.4", + "@typescript-eslint/types": "8.46.4", + "@typescript-eslint/typescript-estree": "8.46.4" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index fd0275ccab35..f5c5a0aec14c 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.46.4 (2025-11-10) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.46.3 (2025-11-03) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 5730b8f6b4de..6ac04b9ebd70 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.46.3", + "version": "8.46.4", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.46.3", + "@typescript-eslint/types": "8.46.4", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index d0c7c8fb3896..dd7f79df6a26 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5930,19 +5930,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.46.3, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.46.4, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.46.3 - "@typescript-eslint/rule-tester": 8.46.3 - "@typescript-eslint/scope-manager": 8.46.3 - "@typescript-eslint/type-utils": 8.46.3 - "@typescript-eslint/utils": 8.46.3 - "@typescript-eslint/visitor-keys": 8.46.3 + "@typescript-eslint/rule-schema-to-typescript-types": 8.46.4 + "@typescript-eslint/rule-tester": 8.46.4 + "@typescript-eslint/scope-manager": 8.46.4 + "@typescript-eslint/type-utils": 8.46.4 + "@typescript-eslint/utils": 8.46.4 + "@typescript-eslint/visitor-keys": 8.46.4 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5965,7 +5965,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.46.3 + "@typescript-eslint/parser": ^8.46.4 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -5981,14 +5981,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.46.3, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.46.4, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.46.3 - "@typescript-eslint/types": 8.46.3 - "@typescript-eslint/typescript-estree": 8.46.3 - "@typescript-eslint/visitor-keys": 8.46.3 + "@typescript-eslint/scope-manager": 8.46.4 + "@typescript-eslint/types": 8.46.4 + "@typescript-eslint/typescript-estree": 8.46.4 + "@typescript-eslint/visitor-keys": 8.46.4 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6002,12 +6002,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.46.3, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.46.4, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.46.3 - "@typescript-eslint/types": ^8.46.3 + "@typescript-eslint/tsconfig-utils": ^8.46.4 + "@typescript-eslint/types": ^8.46.4 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -6018,12 +6018,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.46.3, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.46.4, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.46.3 - "@typescript-eslint/utils": 8.46.3 + "@typescript-eslint/type-utils": 8.46.4 + "@typescript-eslint/utils": 8.46.4 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -6033,15 +6033,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.46.3, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.46.4, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.46.3 - "@typescript-eslint/typescript-estree": 8.46.3 - "@typescript-eslint/utils": 8.46.3 + "@typescript-eslint/parser": 8.46.4 + "@typescript-eslint/typescript-estree": 8.46.4 + "@typescript-eslint/utils": 8.46.4 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -6056,13 +6056,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.46.3, @typescript-eslint/scope-manager@^8.46.1, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.46.4, @typescript-eslint/scope-manager@^8.46.1, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.46.3 - "@typescript-eslint/typescript-estree": 8.46.3 - "@typescript-eslint/visitor-keys": 8.46.3 + "@typescript-eslint/types": 8.46.4 + "@typescript-eslint/typescript-estree": 8.46.4 + "@typescript-eslint/visitor-keys": 8.46.4 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -6073,7 +6073,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.46.3, @typescript-eslint/tsconfig-utils@^8.46.3, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.46.4, @typescript-eslint/tsconfig-utils@^8.46.4, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -6086,14 +6086,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.46.3, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.46.4, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.46.3 - "@typescript-eslint/types": 8.46.3 - "@typescript-eslint/typescript-estree": 8.46.3 - "@typescript-eslint/utils": 8.46.3 + "@typescript-eslint/parser": 8.46.4 + "@typescript-eslint/types": 8.46.4 + "@typescript-eslint/typescript-estree": 8.46.4 + "@typescript-eslint/utils": 8.46.4 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6108,7 +6108,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.46.3, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.46.3, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.46.4, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.46.4, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6182,15 +6182,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.46.3, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.46.4, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.46.3 - "@typescript-eslint/tsconfig-utils": 8.46.3 - "@typescript-eslint/types": 8.46.3 - "@typescript-eslint/visitor-keys": 8.46.3 + "@typescript-eslint/project-service": 8.46.4 + "@typescript-eslint/tsconfig-utils": 8.46.4 + "@typescript-eslint/types": 8.46.4 + "@typescript-eslint/visitor-keys": 8.46.4 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6208,14 +6208,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.46.3, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@^8.46.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.46.4, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@^8.46.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.46.3 - "@typescript-eslint/types": 8.46.3 - "@typescript-eslint/typescript-estree": 8.46.3 + "@typescript-eslint/scope-manager": 8.46.4 + "@typescript-eslint/types": 8.46.4 + "@typescript-eslint/typescript-estree": 8.46.4 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6227,11 +6227,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.46.3, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.46.4, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.46.3 + "@typescript-eslint/types": 8.46.4 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19702,10 +19702,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.46.3 - "@typescript-eslint/parser": 8.46.3 - "@typescript-eslint/typescript-estree": 8.46.3 - "@typescript-eslint/utils": 8.46.3 + "@typescript-eslint/eslint-plugin": 8.46.4 + "@typescript-eslint/parser": 8.46.4 + "@typescript-eslint/typescript-estree": 8.46.4 + "@typescript-eslint/utils": 8.46.4 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*"
@@ -61,20 +62,7 @@ function RuleRow({ {interpolateCode(rule.docs.description)} - {(() => { - switch (actualRecommended) { - case 'recommended': - return RECOMMENDED_CONFIG_EMOJI; - case 'strict': - return STRICT_CONFIG_EMOJI; - case 'stylistic': - return STYLISTIC_CONFIG_EMOJI; - default: - // for some reason the current version of babel loader won't elide - // this correctly recommended satisfies undefined; - return ''; - } - })()} + {emoji} rules.filter(r => { - const actualRecommended = getActualRecommended(r); + const actualRecommended = getActualRecommended(r)[1]; const opinions = [ match(filters.recommended, actualRecommended === 'recommended'), match( diff --git a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx index 32e1f91af462..0465e126aaad 100644 --- a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx +++ b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx @@ -20,7 +20,10 @@ import { import { Feature } from './Feature'; import styles from './RuleAttributes.module.css'; -const recommendations = { +const recommendations: Record< + RuleRecommendation, + [string, RuleRecommendation] +> = { recommended: [RECOMMENDED_CONFIG_EMOJI, 'recommended'], strict: [STRICT_CONFIG_EMOJI, 'strict'], stylistic: [STYLISTIC_CONFIG_EMOJI, 'stylistic'], @@ -45,19 +48,23 @@ const resolveRecommendation = ( }; const getRecommendation = (docs: RecommendedRuleMetaDataDocs): string[] => { - const recommended = docs.recommended; - const recommendation = - recommendations[ - typeof recommended === 'object' - ? resolveRecommendation(recommended) - : recommended - ]; + const recommendation = getRecommendationWithEmoji(docs.recommended); return docs.requiresTypeChecking ? [recommendation[0], `${recommendation[1]}-type-checked`] : recommendation; }; +export function getRecommendationWithEmoji( + recommended: RecommendedRuleMetaDataDocs['recommended'], +): [string, RuleRecommendation] { + const recommendationKey = + typeof recommended === 'object' + ? resolveRecommendation(recommended) + : recommended; + return recommendations[recommendationKey]; +} + export function RuleAttributes({ name }: { name: string }): React.ReactNode { const rules = useRulesMeta(); const rule = rules.find(rule => rule.name === name); From b90c8bf339b30f6cff2c9cfa9a3ae3f6d795c22b Mon Sep 17 00:00:00 2001 From: Max Schwenk Date: Mon, 26 May 2025 10:01:24 -0400 Subject: [PATCH 014/283] docs: add note about `max-semi-size` to performance section (#11200) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add note about max-semi-size * Update docs/troubleshooting/typed-linting/Performance.mdx Co-authored-by: Josh Goldberg ✨ --------- Co-authored-by: Josh Goldberg ✨ --- docs/troubleshooting/typed-linting/Performance.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/troubleshooting/typed-linting/Performance.mdx b/docs/troubleshooting/typed-linting/Performance.mdx index f81eaaca22a5..29775150a6d6 100644 --- a/docs/troubleshooting/typed-linting/Performance.mdx +++ b/docs/troubleshooting/typed-linting/Performance.mdx @@ -38,6 +38,14 @@ In particular for typed linting: - [Performance Tracing](https://github.com/microsoft/TypeScript/wiki/Performance#performance-tracing) can spotlight specific slow types within your project. - [Using Project References](https://github.com/microsoft/TypeScript/wiki/Performance#using-project-references) -which requires enabling the [new "project service" (`parserOptions.projectService`) in v8](/blog/announcing-typescript-eslint-v8-beta#project-service)- can be helpful to speed up type checking on larger projects. +If none of the above work, you can try adjusting the `--max-semi-space-size` of Node. Increasing the max size of a semi-space can improve performance at the cost of more memory consumption. You can [read more about setting space size in Node.js here](https://nodejs.org/api/cli.html#--max-semi-space-sizesize-in-mib). + +You can enable the setting by prepending your ESLint command like: + +```bash +NODE_OPTIONS=--max-semi-space-size=256 eslint +``` + ## Wide includes in your `tsconfig` When using type-aware linting, you provide us with one or more tsconfigs. From dca57b3e6643fdd533f2939c5322ffb9c6044e63 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 26 May 2025 17:18:29 +0000 Subject: [PATCH 015/283] chore(release): publish 8.33.0 --- CHANGELOG.md | 12 +++ packages/ast-spec/CHANGELOG.md | 6 ++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 6 ++ packages/eslint-plugin/package.json | 16 ++-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 11 +++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 11 +++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 8 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 8 +- packages/typescript-estree/CHANGELOG.md | 12 +++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 94 +++++++++---------- 30 files changed, 208 insertions(+), 96 deletions(-) create mode 100644 packages/project-service/CHANGELOG.md create mode 100644 packages/tsconfig-utils/CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c2483a9c2c3..c9b2905f6891 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.33.0 (2025-05-26) + +### 🚀 Features + +- create standalone project-service, tsconfig-utils packages ([#11182](https://github.com/typescript-eslint/typescript-eslint/pull/11182)) + +### ❤️ Thank You + +- Josh Goldberg ✨ + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.32.1 (2025-05-12) ### 🩹 Fixes diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 8ed2bd1083df..fd685411ed42 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.0 (2025-05-26) + +This was a version bump only for ast-spec to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.32.1 (2025-05-12) This was a version bump only for ast-spec to align it with other projects, there were no code changes. diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index b88610c936ca..56bc23f9fb88 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.32.1", + "version": "8.33.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 7b9fa13639b0..de23fecd47fe 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.0 (2025-05-26) + +This was a version bump only for eslint-plugin to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.32.1 (2025-05-12) ### 🩹 Fixes diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index a48904ddb6e2..81bcee646c1b 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.32.1", + "version": "8.33.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -61,10 +61,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.32.1", - "@typescript-eslint/type-utils": "8.32.1", - "@typescript-eslint/utils": "8.32.1", - "@typescript-eslint/visitor-keys": "8.32.1", + "@typescript-eslint/scope-manager": "8.33.0", + "@typescript-eslint/type-utils": "8.33.0", + "@typescript-eslint/utils": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -73,8 +73,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.32.1", - "@typescript-eslint/rule-tester": "8.32.1", + "@typescript-eslint/rule-schema-to-typescript-types": "8.33.0", + "@typescript-eslint/rule-tester": "8.33.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -94,7 +94,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "@typescript-eslint/parser": "^8.33.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index b532ad0f1e7b..bd89bd1fb8d4 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.0 (2025-05-26) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.32.1 (2025-05-12) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 99d63e8e0084..981558702bb6 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.32.1", + "version": "8.33.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -52,10 +52,10 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.32.1", - "@typescript-eslint/types": "8.32.1", - "@typescript-eslint/typescript-estree": "8.32.1", - "@typescript-eslint/visitor-keys": "8.32.1", + "@typescript-eslint/scope-manager": "8.33.0", + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/typescript-estree": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md new file mode 100644 index 000000000000..1743f9f6847e --- /dev/null +++ b/packages/project-service/CHANGELOG.md @@ -0,0 +1,11 @@ +## 8.33.0 (2025-05-26) + +### 🚀 Features + +- create standalone project-service, tsconfig-utils packages ([#11182](https://github.com/typescript-eslint/typescript-eslint/pull/11182)) + +### ❤️ Thank You + +- Josh Goldberg ✨ + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. \ No newline at end of file diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 6b84af53ee34..afd7e7c9d022 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.32.1", + "version": "8.33.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -46,8 +46,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.32.1", - "@typescript-eslint/types": "^8.32.1", + "@typescript-eslint/tsconfig-utils": "^8.33.0", + "@typescript-eslint/types": "^8.33.0", "debug": "^4.3.4" }, "funding": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index dbf54e916065..a80e749377a0 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.0 (2025-05-26) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.32.1 (2025-05-12) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 8e4963cb2b52..8d53c57da60f 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.32.1", + "version": "8.33.0", "private": true, "type": "commonjs", "exports": { @@ -33,8 +33,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.32.1", - "@typescript-eslint/utils": "8.32.1", + "@typescript-eslint/type-utils": "8.33.0", + "@typescript-eslint/utils": "8.33.0", "natural-compare": "^1.4.0", "prettier": "^3.2.5" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 74caa908f29f..cb9ae097a7fb 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.0 (2025-05-26) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.32.1 (2025-05-12) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index dfee240b8094..47baa0b016a6 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.32.1", + "version": "8.33.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -45,9 +45,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.32.1", - "@typescript-eslint/typescript-estree": "8.32.1", - "@typescript-eslint/utils": "8.32.1", + "@typescript-eslint/parser": "8.33.0", + "@typescript-eslint/typescript-estree": "8.33.0", + "@typescript-eslint/utils": "8.33.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 9d183fed0d04..148fc22ee153 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.0 (2025-05-26) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.32.1 (2025-05-12) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 1587be1bcc59..88b03ed616f8 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.32.1", + "version": "8.33.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -48,11 +48,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.32.1", - "@typescript-eslint/visitor-keys": "8.32.1" + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.32.1", + "@typescript-eslint/typescript-estree": "8.33.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "glob": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md new file mode 100644 index 000000000000..1743f9f6847e --- /dev/null +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -0,0 +1,11 @@ +## 8.33.0 (2025-05-26) + +### 🚀 Features + +- create standalone project-service, tsconfig-utils packages ([#11182](https://github.com/typescript-eslint/typescript-eslint/pull/11182)) + +### ❤️ Thank You + +- Josh Goldberg ✨ + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. \ No newline at end of file diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index d430af46082a..c6228ded899c 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.32.1", + "version": "8.33.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 219d98d9b64c..349af80f71c1 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.0 (2025-05-26) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.32.1 (2025-05-12) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 89bf9a6af9dc..d965eb0f851f 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.32.1", + "version": "8.33.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -45,8 +45,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/typescript-estree": "8.32.1", - "@typescript-eslint/utils": "8.32.1", + "@typescript-eslint/typescript-estree": "8.33.0", + "@typescript-eslint/utils": "8.33.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <5.9.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.32.1", + "@typescript-eslint/parser": "8.33.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index f8d27218edad..74fb35c32392 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.0 (2025-05-26) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.32.1 (2025-05-12) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 1a121bc52240..beb7fa0336b2 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.32.1", + "version": "8.33.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 1212ca5a6fad..cccfc29f9df6 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.0 (2025-05-26) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.32.1 (2025-05-12) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index b8c33d720f62..a01f53bb4431 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.32.1", + "version": "8.33.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -51,9 +51,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.32.1", - "@typescript-eslint/parser": "8.32.1", - "@typescript-eslint/utils": "8.32.1" + "@typescript-eslint/eslint-plugin": "8.33.0", + "@typescript-eslint/parser": "8.33.0", + "@typescript-eslint/utils": "8.33.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index bdff669307ce..8646298f637e 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.33.0 (2025-05-26) + +### 🚀 Features + +- create standalone project-service, tsconfig-utils packages ([#11182](https://github.com/typescript-eslint/typescript-eslint/pull/11182)) + +### ❤️ Thank You + +- Josh Goldberg ✨ + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.32.1 (2025-05-12) This was a version bump only for typescript-estree to align it with other projects, there were no code changes. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 41b687506a4f..c69574fd817d 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.32.1", + "version": "8.33.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -53,10 +53,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.32.1", - "@typescript-eslint/tsconfig-utils": "8.32.1", - "@typescript-eslint/types": "8.32.1", - "@typescript-eslint/visitor-keys": "8.32.1", + "@typescript-eslint/project-service": "8.33.0", + "@typescript-eslint/tsconfig-utils": "8.33.0", + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/visitor-keys": "8.33.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 04ab1821c337..5047442bed66 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.0 (2025-05-26) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.32.1 (2025-05-12) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index e9c39408029e..648d15ffc447 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.32.1", + "version": "8.33.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -63,9 +63,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.32.1", - "@typescript-eslint/types": "8.32.1", - "@typescript-eslint/typescript-estree": "8.32.1" + "@typescript-eslint/scope-manager": "8.33.0", + "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/typescript-estree": "8.33.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 927444b2f21c..08d606dca0a3 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.0 (2025-05-26) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.32.1 (2025-05-12) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 21ff63442c23..bd18f88f3fff 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.32.1", + "version": "8.33.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -46,7 +46,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/types": "8.33.0", "eslint-visitor-keys": "^4.2.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 09f7355bb869..4ed7d4b6ea24 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5423,19 +5423,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.32.1, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.33.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.32.1 - "@typescript-eslint/rule-tester": 8.32.1 - "@typescript-eslint/scope-manager": 8.32.1 - "@typescript-eslint/type-utils": 8.32.1 - "@typescript-eslint/utils": 8.32.1 - "@typescript-eslint/visitor-keys": 8.32.1 + "@typescript-eslint/rule-schema-to-typescript-types": 8.33.0 + "@typescript-eslint/rule-tester": 8.33.0 + "@typescript-eslint/scope-manager": 8.33.0 + "@typescript-eslint/type-utils": 8.33.0 + "@typescript-eslint/utils": 8.33.0 + "@typescript-eslint/visitor-keys": 8.33.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5458,7 +5458,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.0.0 || ^8.0.0-alpha.0 + "@typescript-eslint/parser": ^8.33.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" languageName: unknown @@ -5473,14 +5473,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.32.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.33.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.32.1 - "@typescript-eslint/types": 8.32.1 - "@typescript-eslint/typescript-estree": 8.32.1 - "@typescript-eslint/visitor-keys": 8.32.1 + "@typescript-eslint/scope-manager": 8.33.0 + "@typescript-eslint/types": 8.33.0 + "@typescript-eslint/typescript-estree": 8.33.0 + "@typescript-eslint/visitor-keys": 8.33.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 glob: "*" @@ -5493,22 +5493,22 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.32.1, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.33.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.32.1 - "@typescript-eslint/types": ^8.32.1 + "@typescript-eslint/tsconfig-utils": ^8.33.0 + "@typescript-eslint/types": ^8.33.0 debug: ^4.3.4 languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.32.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.33.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.32.1 - "@typescript-eslint/utils": 8.32.1 + "@typescript-eslint/type-utils": 8.33.0 + "@typescript-eslint/utils": 8.33.0 "@vitest/coverage-v8": ^3.1.3 natural-compare: ^1.4.0 prettier: ^3.2.5 @@ -5518,15 +5518,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.32.1, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.33.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.32.1 - "@typescript-eslint/typescript-estree": 8.32.1 - "@typescript-eslint/utils": 8.32.1 + "@typescript-eslint/parser": 8.33.0 + "@typescript-eslint/typescript-estree": 8.33.0 + "@typescript-eslint/utils": 8.33.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5541,13 +5541,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.32.1, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.33.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.32.1 - "@typescript-eslint/typescript-estree": 8.32.1 - "@typescript-eslint/visitor-keys": 8.32.1 + "@typescript-eslint/types": 8.33.0 + "@typescript-eslint/typescript-estree": 8.33.0 + "@typescript-eslint/visitor-keys": 8.33.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 glob: "*" @@ -5557,7 +5557,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.32.1, @typescript-eslint/tsconfig-utils@^8.32.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.33.0, @typescript-eslint/tsconfig-utils@^8.33.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" peerDependencies: @@ -5565,13 +5565,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.32.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.33.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.32.1 - "@typescript-eslint/typescript-estree": 8.32.1 - "@typescript-eslint/utils": 8.32.1 + "@typescript-eslint/parser": 8.33.0 + "@typescript-eslint/typescript-estree": 8.33.0 + "@typescript-eslint/utils": 8.33.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -5586,7 +5586,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.32.1, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.33.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.33.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -5661,15 +5661,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.32.1, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.33.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.32.1 - "@typescript-eslint/tsconfig-utils": 8.32.1 - "@typescript-eslint/types": 8.32.1 - "@typescript-eslint/visitor-keys": 8.32.1 + "@typescript-eslint/project-service": 8.33.0 + "@typescript-eslint/tsconfig-utils": 8.33.0 + "@typescript-eslint/types": 8.33.0 + "@typescript-eslint/visitor-keys": 8.33.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 fast-glob: ^3.3.2 @@ -5686,14 +5686,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.32.1, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.33.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.32.1 - "@typescript-eslint/types": 8.32.1 - "@typescript-eslint/typescript-estree": 8.32.1 + "@typescript-eslint/scope-manager": 8.33.0 + "@typescript-eslint/types": 8.33.0 + "@typescript-eslint/typescript-estree": 8.33.0 "@vitest/coverage-v8": ^3.1.3 rimraf: "*" typescript: "*" @@ -5704,11 +5704,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.32.1, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.33.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.32.1 + "@typescript-eslint/types": 8.33.0 "@vitest/coverage-v8": ^3.1.3 eslint-visitor-keys: ^4.2.0 rimraf: "*" @@ -18737,9 +18737,9 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.32.1 - "@typescript-eslint/parser": 8.32.1 - "@typescript-eslint/utils": 8.32.1 + "@typescript-eslint/eslint-plugin": 8.33.0 + "@typescript-eslint/parser": 8.33.0 + "@typescript-eslint/utils": 8.33.0 "@vitest/coverage-v8": ^3.1.3 rimraf: "*" typescript: "*" From d2ffec7988976a07495bde7270630db1a0fe1d32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Tue, 27 May 2025 14:39:56 +0100 Subject: [PATCH 016/283] chore: add publishConfig.access: public to project-service, tsconfig-utils (#11247) --- packages/project-service/package.json | 3 +++ packages/tsconfig-utils/package.json | 3 +++ 2 files changed, 6 insertions(+) diff --git a/packages/project-service/package.json b/packages/project-service/package.json index afd7e7c9d022..5be7e8bb3b61 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -54,6 +54,9 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, + "publishConfig": { + "access": "public" + }, "nx": { "name": "project-service", "includedScripts": [ diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index c6228ded899c..aab0e61bdba6 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -51,6 +51,9 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, + "publishConfig": { + "access": "public" + }, "nx": { "name": "tsconfig-utils", "includedScripts": [ From 02ebbe10f6d9fc6a415b33a76bd76eb5402083e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Thu, 29 May 2025 16:07:18 +0300 Subject: [PATCH 017/283] docs: blog post on parserOptions.projectService (#8031) * docs: blog post on parserOptions.projectService * Update packages/website/blog/2023-09-18-parser-options-project-true.md * Better diffs and a bit of streamlining * Account for solo and project references at each scale * Apply suggestions from code review Co-authored-by: Joshua Chen * Adjusted vision section * Refreshed blog post for latest versions and names * Real world examples * git checkout main -- packages/website/blog/2023-09-18-parser-options-project-true.md * git checkout main -- docs/packages/Parser.mdx * Lots of touchups * More tweaks * Back-links galore * nit: line length 'own' * allowDefaultProject rename * touch up project refs * Touch up feedback * More proofreading * More proofreading * More proofreading * More proofreading * More proofreading * fix broken link * Shoutout Benn and SvelteKit * Add back tsconfigRootDir * Apply suggestions from code review Co-authored-by: Ronen Amiel * Update packages/website/blog/2025-05-26-project-service.mdx Co-authored-by: Ronen Amiel --------- Co-authored-by: Joshua Chen Co-authored-by: Ronen Amiel --- .cspell.json | 1 + docs/packages/Parser.mdx | 2 + docs/packages/Project_Service.mdx | 2 +- .../blog/2025-05-26-project-service.mdx | 232 ++++++++++++++++++ 4 files changed, 236 insertions(+), 1 deletion(-) create mode 100644 packages/website/blog/2025-05-26-project-service.mdx diff --git a/.cspell.json b/.cspell.json index ec67987a3b5a..e064c26d4d53 100644 --- a/.cspell.json +++ b/.cspell.json @@ -196,6 +196,7 @@ "tsconfigrootdir", "tsconfigs", "tseslint", + "tsgo", "tsvfs", "typedef", "typedefs", diff --git a/docs/packages/Parser.mdx b/docs/packages/Parser.mdx index cd2ecaa19cc0..ecf132f7869d 100644 --- a/docs/packages/Parser.mdx +++ b/docs/packages/Parser.mdx @@ -294,6 +294,8 @@ Specifies using TypeScript APIs to generate type information for rules. It will automatically use the nearest `tsconfig.json` for each file (like `project: true`). It can also be configured to also allow type information to be computed for JavaScript files without the `allowJs` compiler option (unlike `project: true`). +See [Typed Linting with `parserOptions.projectService`](/blog/project-service) for more context. + diff --git a/docs/packages/Project_Service.mdx b/docs/packages/Project_Service.mdx index 7f841f3560b1..7cfe65b67d93 100644 --- a/docs/packages/Project_Service.mdx +++ b/docs/packages/Project_Service.mdx @@ -16,7 +16,7 @@ The typescript-eslint Project Service is a wrapper around TypeScript's "project These APIs are what editors such as VS Code use to programmatically "open" files and generate TypeScript programs for type information. :::note -See [Announcing typescript-eslint v8 > Project Service](/blog/announcing-typescript-eslint-v8#project-service) for more details on how lint users interact with the Project Service. +See [Blog > Typed Linting with Project Service](/blog/project-service) for more details on how lint users interact with the Project Service. ::: ```ts diff --git a/packages/website/blog/2025-05-26-project-service.mdx b/packages/website/blog/2025-05-26-project-service.mdx new file mode 100644 index 000000000000..eb64c4fc6754 --- /dev/null +++ b/packages/website/blog/2025-05-26-project-service.mdx @@ -0,0 +1,232 @@ +--- +authors: joshuakgoldberg +description: How typescript-eslint's new "Project Service" makes typed linting easier to configure, especially for large projects. +slug: project-service +tags: [parser, parser options, project, project service, tsconfig] +title: Typed Linting with Project Service +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +["Typed linting"](/blog/typed-linting), or enabling ESLint rules to understand TypeScript types, is one of the best parts of typescript-eslint. +It enables a slew of [more powerful lint rules](/rules/?=recommended-typeInformation) that check for nuanced bugs, best practice violations, and other code issues that can only be detected using type information. + +Typed linting hasn't always been straightforward to configure or performant at runtime. +We've seen users have to manage separate `tsconfig.eslint.json` files to enable typed linting — sometimes with different compiler options than the rest of the project. +Not ideal. + +In typescript-eslint 8.0, we stabilized a **`parserOptions.projectService`** option that uses more powerful, streamlined TypeScript APIs than before. +The "Project Service" brings several benefits: + +- ✍️ **Configuration**: simpler ESLint configs for typed linting with no ESLint-specific TSConfig files +- 🧠 **Predictability**: uses the same type information services as editors, including more reliability +- 🚀 **Scalability**: supporting TypeScript project references for larger repositories (i.e. monorepos) + +This blog post will cover how `parserOptions.projectService` simplifies configurations and aligns linting type information to what editors such as VS Code run with. + +:::tip +See [Getting Started](/getting-started) to learn how to lint JavaScript and TypeScript code with typescript-eslint, then [Linting with Type Information](/getting-started/typed-linting) to onboard to typed linting. +::: + + + +## Introducing the Project Service + +Back in [Relative TSConfig Projects with `parserOptions.project = true` > Project Services](2023-09-18-parser-options-project-true.md#project-services), we'd mentioned a replacement for `parserOptions.project`: + +> The downside of having users specify `parserOptions.project` at all is that `@typescript-eslint/parser` needs manual logic to create TypeScript Programs and associate them with linted files. +> Manual Program creation logic comes with a few issues: ... +> +> We're working on an option to instead call the same TypeScript "Project Service" APIs that editors such as VS Code use to create Programs for us instead. +> Project Services will automatically detect the TSConfig for each file (like `project: true`), and will also allow type information to be computed for JavaScript files without the `allowJs` compiler option (unlike `project: true`). + +Following a year of discussion and beta testing in typescript-eslint v6 and v7, we believe the new Project Service API is ready to be used by real-world projects. +We therefore promoted the `parserOptions.EXPERIMENTAL_useProjectService` option to the stable name **`parserOptions.projectService`** in typescript-eslint v8. + +:::note +See [Announcing typescript-eslint v8 > Project Service](/blog/announcing-typescript-eslint-v8#project-service) for the original announcement. +::: + +## Configuration + +You can change over to the new Project Service API by replacing `project` with `projectService` in your ESLint configuration: + + + + +```js title="eslint.config.js" +export default tseslint.config({ + // ... + languageOptions: { + parserOptions: { + // Remove this line + project: true, + // Add this line + projectService: true, + tsconfigRootDir: import.meta.dirname, + }, + }, + // ... +}); +``` + + + + +```js title=".eslintrc.cjs" +module.exports = { + // ... + parser: '@typescript-eslint/parser', + parserOptions: { + // Remove this line + project: true, + // Add this line + projectService: true, + tsconfigRootDir: __dirname, + }, + // ... +}; +``` + + + + +That's it! + +Other settings, including how you run ESLint and configure rules, should work the same. + +:::tip +See [Packages > Parser > `projectService`](/packages/parser#projectservice) for more details on granular configuration options. +::: + +### Additional Files + +One long-standing pain point of typed linting was enabling typed linting for files not included in the project's `tsconfig.json`. +Common solutions in the traditional Program API were to either skip typed linting for those files or to create a `tsconfig.eslint.json` enabling the `allowJs` compiler option. + +The new Project Service API allows for a configuration object specifying `allowDefaultProject`: a glob of "out-of-project" files to lint with type information. +That means you can lint those files without any new configuration files or TypeScript compiler options! + +For example, the following config solves the common case of projects that have root-level files like `eslint.config.js` or `vitest.config.ts`: + + + + +```js title="eslint.config.js" +export default tseslint.config({ + // ... + languageOptions: { + parserOptions: { + projectService: { + allowDefaultProject: ['*.js'], + }, + tsconfigRootDir: import.meta.dirname, + }, + }, + // ... +}); +``` + + + + +```js title=".eslintrc.cjs" +module.exports = { + // ... + parser: '@typescript-eslint/parser', + parserOptions: { + projectService: { + allowDefaultProject: ['*.js'], + tsconfigRootDir: __dirname, + }, + }, + // ... +}; +``` + + + + +This means most projects should be able to remove all `tsconfig.eslint.json` files! +🥳 + +:::tip +See [Packages > Parser > `projectService` > `ProjectServiceOptions`](/packages/parser#projectserviceoptions) for more details on out-of-project files and other granular configuration options. +::: + +## Predictability + +We've found configuring `tsconfig.eslint.json` files to be a common source of confusion with the traditional Program APIs. +They can result in the type information used for _linting_ accidentally being different from the type information used for _type checking_. +Unifying TypeScript configurations to the same `tsconfig.json` file(s) altogether avoids potential divergent types. + +Another benefit of using the new Project Service API is that typed linting requires no additional work in typescript-eslint for more difficult uses of ESLint and/or TypeScript. +We sometimes had to de-optimize the traditional Program API to support use cases: + +- CLI `--fix` mode would lose type information after the first pass ([#9577](https://github.com/typescript-eslint/typescript-eslint/pull/9577)) +- Extra file extensions such as `.svelte` and `.vue` were not supported at all ([#9504](https://github.com/typescript-eslint/typescript-eslint/issues/9504)) + +The new Project Service API does not suffer from these issues. +It supports extra file extensions out-of-the-box and does not slow down when used with ESLint's `--fix`. + +## Scalability + +[TypeScript's project references](https://www.typescriptlang.org/docs/handbook/project-references.html) are how many larger projects, in particular monorepos, scale TypeScript type checking. +They allow delineating discrete projects with their own `tsconfig.json` files and annotating which projects depend on which other projects. +TypeScript is able to cache type information and only recheck projects that have changed in builds based on those project references. + +The traditional `parserOptions.project` API did not support project references for typed linting. +We had experimented with adding support, but using the manual built-in TypeScript APIs would have been a significant maintenance investment with an unclear payoff. + +The new Project Service API does support project references out-of-the-box. +This is a huge win for monorepos, as it means you can lint all of your projects with type information without needing to create a separate `tsconfig.eslint.json` file for each project. + +## Performance + +Supporting project references allows the new Project Service API to be significantly faster than the traditional `parserOptions.project` API in many monorepo cases. +We've observed improvements for typed linting speed in real-world repositories [^babel-conversion] [^create-t3-app-conversion] [^sveltekit-conversion]. +For smaller projects, the performance of the new Project Service API is similar to the traditional `parserOptions.project` API. + +When we first started working with the new project service API, it outperformed equivalent `parserOptions.project` setups by ~10-15%. +Since then, we have observed regressions in performance that have brought it down in some cases to be slightly slower. + +We believe the new Project Service API should be faster than the traditional API, and are treating the lack of significant improvement as a bug. +See [⚡ Performance: parserOptions.projectService sometimes no longer outperforms parserOptions.project](https://github.com/typescript-eslint/typescript-eslint/issues/9571) for more information. + +## Next Steps + +The new Project Service API is available in typescript-eslint v8.0.0 and later. +We've been using it in our monorepo for over a year and have been thrilled to see many community repositories adopt it as well. + +### Giving Feedback + +We'd love to hear from you on how this option works for you. +Does it live up to what we've promised, and/or does it have bugs we haven't fixed yet? +Please do send us GitHub issues for any bugs you encounter or suggestions for how to improve the API. + +The [typescript-eslint Discord](https://discord.gg/FSxKq8Tdyg) is a great place to ask questions and engage with us more casually. +For support in onboarding, feel free to ask in its `#help` channel. +We'd be happy to help you try out `parserOptions.projectService` and learn more about how you use typescript-eslint. + +### Long Term Vision + +The new Project Service API is a great step towards making typed linting easier and more straightforward to configure. +Our priority for the next year will be to improve the new Project Service API so that it works in all places the traditional Program API does. +We won't remove the traditional project program behavior unless and until the new Project Service API is able to fully replace it. + +As of typescript-eslint@8.33.0, we've also extracted most of the Project Service code into a standalone [`@typescript-eslint/project-service`](/packages/project-service) package. +It has no dependencies on ESLint and is designed to be usable for any linter to enable TypeScript's Project Service API for typed linting. +See [Packages > Project Service](/packages/project-service) for more details. + +We're also looking forward to investigating support for [TypeScript's 10x faster Go port](https://github.com/typescript-eslint/typescript-eslint/issues/10940). +Abstracting configuration details into the Project Service API means it will be much easier for typescript-eslint to support typed linting using "tsgo" without any additional user configuration. + +So, please, try out the new Project Service API. +We're excited to hear how it works for you and what we can do to improve it. 💜 + +[^babel-conversion]: https://github.com/babel/babel/pull/16192#issue-2054613116 + +[^create-t3-app-conversion]: https://github.com/t3-oss/create-t3-app/pull/1936/#discussion_r1667389041 + +[^sveltekit-conversion]: https://github.com/sveltejs/kit/pull/13839 From 294fb238ced1d96d379336ffbb27122a66dd1bb4 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 29 May 2025 16:12:32 +0300 Subject: [PATCH 018/283] docs: correct Project Service blog post date --- ...5-05-26-project-service.mdx => 2025-05-29-project-service.mdx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/website/blog/{2025-05-26-project-service.mdx => 2025-05-29-project-service.mdx} (100%) diff --git a/packages/website/blog/2025-05-26-project-service.mdx b/packages/website/blog/2025-05-29-project-service.mdx similarity index 100% rename from packages/website/blog/2025-05-26-project-service.mdx rename to packages/website/blog/2025-05-29-project-service.mdx From 702cea862db34b980e580f46314141c24024ee47 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Thu, 29 May 2025 09:03:29 -0600 Subject: [PATCH 019/283] chore: remove postinstall steps from CI to speed up prepare-install action (#11219) --- .github/actions/prepare-install/action.yml | 1 + .github/workflows/ci.yml | 2 +- packages/types/project.json | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/prepare-install/action.yml b/.github/actions/prepare-install/action.yml index 2334ef0b406f..7686f9cd4de2 100644 --- a/.github/actions/prepare-install/action.yml +++ b/.github/actions/prepare-install/action.yml @@ -76,3 +76,4 @@ runs: YARN_INSTALL_STATE_PATH: .yarn/ci-cache/install-state.gz # Very small speedup when lock does not change # Other environment variables HUSKY: '0' # By default do not run HUSKY install + SKIP_POSTINSTALL: 'true' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a31e268f5a16..e0a6b9885b08 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,7 +78,7 @@ jobs: uses: ./.github/actions/prepare-install with: node-version: ${{ env.PRIMARY_NODE_VERSION }} - - run: yarn generate-configs + - run: yarn nx run generate-configs - run: git status --porcelain - if: failure() run: echo "Outdated result detected from yarn generate-configs. Please check in any file changes." diff --git a/packages/types/project.json b/packages/types/project.json index e40c639f06e7..5b170ee06cc5 100644 --- a/packages/types/project.json +++ b/packages/types/project.json @@ -14,7 +14,8 @@ "dependsOn": ["copy-ast-spec"] }, "lint": { - "executor": "@nx/eslint:lint" + "executor": "@nx/eslint:lint", + "dependsOn": ["typescript-eslint:build", "eslint-plugin-internal:build"] } } } From 4bc72143fd73614d12ea7bf38a9e223f60066da3 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Fri, 30 May 2025 01:11:18 -0600 Subject: [PATCH 020/283] chore: fix project service links (#11255) fix project service links --- docs/getting-started/Typed_Linting.mdx | 6 +++--- docs/packages/Parser.mdx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/getting-started/Typed_Linting.mdx b/docs/getting-started/Typed_Linting.mdx index 3459ce890d42..56d02afed969 100644 --- a/docs/getting-started/Typed_Linting.mdx +++ b/docs/getting-started/Typed_Linting.mdx @@ -82,7 +82,7 @@ module.exports = { In more detail: - `plugin:@typescript-eslint/recommended-type-checked` is a [shared configuration](../users/Shared_Configurations.mdx). It contains recommended rules that additionally require type information. -- `parserOptions.projectService: true` indicates to ask TypeScript's type checking service for each source file's type information (see [Parser > `projectService`](../packages/Parser.mdx#projectService)). +- `parserOptions.projectService: true` indicates to ask TypeScript's type checking service for each source file's type information (see [Parser > `projectService`](../packages/Parser.mdx#projectservice)). - `parserOptions.tsconfigRootDir` tells our parser the absolute path of your project's root directory (see [Parser > `tsconfigRootDir`](../packages/Parser.mdx#tsconfigrootdir)). @@ -163,5 +163,5 @@ If you're having problems with typed linting, please see our [Troubleshooting FA For details on the parser options that enable typed linting, see: -- [Parser > `projectService`](../packages/Parser.mdx#projectService): our recommended option, with settings to customize TypeScript project information -- [Parser > `project`](../packages/Parser.mdx#projectService): an older option that can be used as an alternative +- [Parser > `projectService`](../packages/Parser.mdx#projectservice): our recommended option, with settings to customize TypeScript project information +- [Parser > `project`](../packages/Parser.mdx#project): an older option that can be used as an alternative diff --git a/docs/packages/Parser.mdx b/docs/packages/Parser.mdx index ecf132f7869d..7e9336773f03 100644 --- a/docs/packages/Parser.mdx +++ b/docs/packages/Parser.mdx @@ -282,7 +282,7 @@ If this setting is specified, you must only lint files that are included in the } ``` -For an option that allows linting files outside of your TSConfig file(s), see [`projectService`](#projectService). +For an option that allows linting files outside of your TSConfig file(s), see [`projectService`](#projectservice). From e4933170f75b3a8a0c9bf3985fb4d2ddb6e4b4c6 Mon Sep 17 00:00:00 2001 From: Abhijeet Singh Date: Sat, 31 May 2025 13:42:44 +0530 Subject: [PATCH 021/283] docs(eslint-plugin): add FAQ about JSDoc link usage with no-unused-vars (#11259) * docs(no-unused-vars): add FAQ about link usage in JSDoc * lint: prettier fix * chore: small typo --- .../eslint-plugin/docs/rules/no-unused-vars.mdx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/eslint-plugin/docs/rules/no-unused-vars.mdx b/packages/eslint-plugin/docs/rules/no-unused-vars.mdx index 461cf3d93817..ea0a336a011f 100644 --- a/packages/eslint-plugin/docs/rules/no-unused-vars.mdx +++ b/packages/eslint-plugin/docs/rules/no-unused-vars.mdx @@ -118,3 +118,19 @@ export interface Box { If you find yourself writing runtime values only for types, consider refactoring your code to declare types directly. + +### Why are variables reported as unused despite being referenced by @link in JSDoc? + +JSDoc references are not supported by typescript-eslint. +You can use a rule such as [`jsdoc/no-undefined-types`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-undefined-types.md) to resolve variables as used in JSDoc comments. + +```ts +import type { Box } from './Box'; +// ~~~ +// 'Box' is defined but never used. + +/** + * @see {@link Box} + */ +export function getBox() {} +``` From 9d46857e1377980bf4878fb273d5ef3848075bb5 Mon Sep 17 00:00:00 2001 From: JounQin Date: Sun, 1 Jun 2025 19:16:11 +0800 Subject: [PATCH 022/283] fix(project-service): add missing `typescript` peer dependency (#11265) --- packages/project-service/package.json | 3 +++ yarn.lock | 2 ++ 2 files changed, 5 insertions(+) diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 5be7e8bb3b61..7de9b1303b9a 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -45,6 +45,9 @@ "test": "yarn run -BT nx test", "typecheck": "yarn run -BT nx typecheck" }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" + }, "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.33.0", "@typescript-eslint/types": "^8.33.0", diff --git a/yarn.lock b/yarn.lock index 4ed7d4b6ea24..7d0c48e3a331 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5500,6 +5500,8 @@ __metadata: "@typescript-eslint/tsconfig-utils": ^8.33.0 "@typescript-eslint/types": ^8.33.0 debug: ^4.3.4 + peerDependencies: + typescript: ">=4.8.4 <5.9.0" languageName: unknown linkType: soft From c14bcac24268636dddc8c75f85f66b42e8dbbf76 Mon Sep 17 00:00:00 2001 From: roottool Date: Mon, 2 Jun 2025 23:01:40 +0900 Subject: [PATCH 023/283] fix: exclude docs/ directory from eslint-plugin package (#11251) * chore: exclude docs/ directory in the eslint-plugin package * chore: exclude `docs/rules/README.md` in the eslint-plugin package --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- packages/eslint-plugin/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 81bcee646c1b..3b941c46fc59 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -5,12 +5,11 @@ "files": [ "dist", "!*.tsbuildinfo", - "docs", "index.d.ts", "raw-plugin.d.ts", "rules.d.ts", "package.json", - "README.md", + "./README.md", "LICENSE" ], "type": "commonjs", From 936f35022c1e1357da82c4b958b7bff2563e2075 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 2 Jun 2025 17:19:20 +0000 Subject: [PATCH 024/283] chore(release): publish 8.33.1 --- CHANGELOG.md | 14 +++ packages/ast-spec/CHANGELOG.md | 6 ++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 12 +++ packages/eslint-plugin/package.json | 16 ++-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 12 +++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 8 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 8 +- packages/typescript-estree/CHANGELOG.md | 6 ++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 94 +++++++++---------- 30 files changed, 206 insertions(+), 96 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9b2905f6891..9a17f0ba9d36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## 8.33.1 (2025-06-02) + +### 🩹 Fixes + +- exclude docs/ directory from eslint-plugin package ([#11251](https://github.com/typescript-eslint/typescript-eslint/pull/11251)) +- **project-service:** add missing `typescript` peer dependency ([#11265](https://github.com/typescript-eslint/typescript-eslint/pull/11265)) + +### ❤️ Thank You + +- JounQin +- roottool + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index fd685411ed42..778de3b88883 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.1 (2025-06-02) + +This was a version bump only for ast-spec to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) This was a version bump only for ast-spec to align it with other projects, there were no code changes. diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 56bc23f9fb88..c98d7ef1a580 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.33.0", + "version": "8.33.1", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index de23fecd47fe..67c169bbdc40 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.33.1 (2025-06-02) + +### 🩹 Fixes + +- exclude docs/ directory from eslint-plugin package ([#11251](https://github.com/typescript-eslint/typescript-eslint/pull/11251)) + +### ❤️ Thank You + +- roottool + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) This was a version bump only for eslint-plugin to align it with other projects, there were no code changes. diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 3b941c46fc59..b48775e4d07b 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.33.0", + "version": "8.33.1", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -60,10 +60,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.33.0", - "@typescript-eslint/type-utils": "8.33.0", - "@typescript-eslint/utils": "8.33.0", - "@typescript-eslint/visitor-keys": "8.33.0", + "@typescript-eslint/scope-manager": "8.33.1", + "@typescript-eslint/type-utils": "8.33.1", + "@typescript-eslint/utils": "8.33.1", + "@typescript-eslint/visitor-keys": "8.33.1", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -72,8 +72,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.33.0", - "@typescript-eslint/rule-tester": "8.33.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.33.1", + "@typescript-eslint/rule-tester": "8.33.1", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -93,7 +93,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.33.0", + "@typescript-eslint/parser": "^8.33.1", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index bd89bd1fb8d4..8b724cff58db 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.1 (2025-06-02) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 981558702bb6..a334a6654081 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.33.0", + "version": "8.33.1", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -52,10 +52,10 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.33.0", - "@typescript-eslint/types": "8.33.0", - "@typescript-eslint/typescript-estree": "8.33.0", - "@typescript-eslint/visitor-keys": "8.33.0", + "@typescript-eslint/scope-manager": "8.33.1", + "@typescript-eslint/types": "8.33.1", + "@typescript-eslint/typescript-estree": "8.33.1", + "@typescript-eslint/visitor-keys": "8.33.1", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 1743f9f6847e..9719109152c2 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.33.1 (2025-06-02) + +### 🩹 Fixes + +- **project-service:** add missing `typescript` peer dependency ([#11265](https://github.com/typescript-eslint/typescript-eslint/pull/11265)) + +### ❤️ Thank You + +- JounQin + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) ### 🚀 Features diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 7de9b1303b9a..2518a9b40b48 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.33.0", + "version": "8.33.1", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.33.0", - "@typescript-eslint/types": "^8.33.0", + "@typescript-eslint/tsconfig-utils": "^8.33.1", + "@typescript-eslint/types": "^8.33.1", "debug": "^4.3.4" }, "funding": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index a80e749377a0..a5935b673670 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.1 (2025-06-02) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 8d53c57da60f..e88204f33ed9 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.33.0", + "version": "8.33.1", "private": true, "type": "commonjs", "exports": { @@ -33,8 +33,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.33.0", - "@typescript-eslint/utils": "8.33.0", + "@typescript-eslint/type-utils": "8.33.1", + "@typescript-eslint/utils": "8.33.1", "natural-compare": "^1.4.0", "prettier": "^3.2.5" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index cb9ae097a7fb..468a208e2467 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.1 (2025-06-02) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 47baa0b016a6..8eee8e1d6d29 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.33.0", + "version": "8.33.1", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -45,9 +45,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.33.0", - "@typescript-eslint/typescript-estree": "8.33.0", - "@typescript-eslint/utils": "8.33.0", + "@typescript-eslint/parser": "8.33.1", + "@typescript-eslint/typescript-estree": "8.33.1", + "@typescript-eslint/utils": "8.33.1", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 148fc22ee153..d8e81638c715 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.1 (2025-06-02) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 88b03ed616f8..233360f3d777 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.33.0", + "version": "8.33.1", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -48,11 +48,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.33.0", - "@typescript-eslint/visitor-keys": "8.33.0" + "@typescript-eslint/types": "8.33.1", + "@typescript-eslint/visitor-keys": "8.33.1" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.33.0", + "@typescript-eslint/typescript-estree": "8.33.1", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "glob": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 1743f9f6847e..56304b0f2154 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.1 (2025-06-02) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) ### 🚀 Features diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index aab0e61bdba6..42d31485628a 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.33.0", + "version": "8.33.1", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 349af80f71c1..f06e639ddadd 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.1 (2025-06-02) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index d965eb0f851f..508fa36ae385 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.33.0", + "version": "8.33.1", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -45,8 +45,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/typescript-estree": "8.33.0", - "@typescript-eslint/utils": "8.33.0", + "@typescript-eslint/typescript-estree": "8.33.1", + "@typescript-eslint/utils": "8.33.1", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <5.9.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.33.0", + "@typescript-eslint/parser": "8.33.1", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 74fb35c32392..81652e6e1402 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.1 (2025-06-02) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index beb7fa0336b2..5324be9fb4a9 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.33.0", + "version": "8.33.1", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index cccfc29f9df6..ba315824890b 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.1 (2025-06-02) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index a01f53bb4431..1136510716a1 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.33.0", + "version": "8.33.1", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -51,9 +51,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.33.0", - "@typescript-eslint/parser": "8.33.0", - "@typescript-eslint/utils": "8.33.0" + "@typescript-eslint/eslint-plugin": "8.33.1", + "@typescript-eslint/parser": "8.33.1", + "@typescript-eslint/utils": "8.33.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 8646298f637e..d8eb1b11a6ee 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.1 (2025-06-02) + +This was a version bump only for typescript-estree to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) ### 🚀 Features diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index c69574fd817d..15556fdfd53b 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.33.0", + "version": "8.33.1", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -53,10 +53,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.33.0", - "@typescript-eslint/tsconfig-utils": "8.33.0", - "@typescript-eslint/types": "8.33.0", - "@typescript-eslint/visitor-keys": "8.33.0", + "@typescript-eslint/project-service": "8.33.1", + "@typescript-eslint/tsconfig-utils": "8.33.1", + "@typescript-eslint/types": "8.33.1", + "@typescript-eslint/visitor-keys": "8.33.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 5047442bed66..18453daeff51 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.1 (2025-06-02) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index 648d15ffc447..c5c543f6eb27 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.33.0", + "version": "8.33.1", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -63,9 +63,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.33.0", - "@typescript-eslint/types": "8.33.0", - "@typescript-eslint/typescript-estree": "8.33.0" + "@typescript-eslint/scope-manager": "8.33.1", + "@typescript-eslint/types": "8.33.1", + "@typescript-eslint/typescript-estree": "8.33.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 08d606dca0a3..3b29aa7ec35f 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.33.1 (2025-06-02) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.0 (2025-05-26) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index bd18f88f3fff..89aafa93bfa2 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.33.0", + "version": "8.33.1", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -46,7 +46,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.33.0", + "@typescript-eslint/types": "8.33.1", "eslint-visitor-keys": "^4.2.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 7d0c48e3a331..d9e67a848c5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5423,19 +5423,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.33.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.33.1, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.33.0 - "@typescript-eslint/rule-tester": 8.33.0 - "@typescript-eslint/scope-manager": 8.33.0 - "@typescript-eslint/type-utils": 8.33.0 - "@typescript-eslint/utils": 8.33.0 - "@typescript-eslint/visitor-keys": 8.33.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.33.1 + "@typescript-eslint/rule-tester": 8.33.1 + "@typescript-eslint/scope-manager": 8.33.1 + "@typescript-eslint/type-utils": 8.33.1 + "@typescript-eslint/utils": 8.33.1 + "@typescript-eslint/visitor-keys": 8.33.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5458,7 +5458,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.33.0 + "@typescript-eslint/parser": ^8.33.1 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" languageName: unknown @@ -5473,14 +5473,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.33.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.33.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.33.0 - "@typescript-eslint/types": 8.33.0 - "@typescript-eslint/typescript-estree": 8.33.0 - "@typescript-eslint/visitor-keys": 8.33.0 + "@typescript-eslint/scope-manager": 8.33.1 + "@typescript-eslint/types": 8.33.1 + "@typescript-eslint/typescript-estree": 8.33.1 + "@typescript-eslint/visitor-keys": 8.33.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 glob: "*" @@ -5493,24 +5493,24 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.33.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.33.1, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.33.0 - "@typescript-eslint/types": ^8.33.0 + "@typescript-eslint/tsconfig-utils": ^8.33.1 + "@typescript-eslint/types": ^8.33.1 debug: ^4.3.4 peerDependencies: typescript: ">=4.8.4 <5.9.0" languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.33.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.33.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.33.0 - "@typescript-eslint/utils": 8.33.0 + "@typescript-eslint/type-utils": 8.33.1 + "@typescript-eslint/utils": 8.33.1 "@vitest/coverage-v8": ^3.1.3 natural-compare: ^1.4.0 prettier: ^3.2.5 @@ -5520,15 +5520,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.33.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.33.1, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.33.0 - "@typescript-eslint/typescript-estree": 8.33.0 - "@typescript-eslint/utils": 8.33.0 + "@typescript-eslint/parser": 8.33.1 + "@typescript-eslint/typescript-estree": 8.33.1 + "@typescript-eslint/utils": 8.33.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5543,13 +5543,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.33.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.33.1, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.33.0 - "@typescript-eslint/typescript-estree": 8.33.0 - "@typescript-eslint/visitor-keys": 8.33.0 + "@typescript-eslint/types": 8.33.1 + "@typescript-eslint/typescript-estree": 8.33.1 + "@typescript-eslint/visitor-keys": 8.33.1 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 glob: "*" @@ -5559,7 +5559,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.33.0, @typescript-eslint/tsconfig-utils@^8.33.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.33.1, @typescript-eslint/tsconfig-utils@^8.33.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" peerDependencies: @@ -5567,13 +5567,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.33.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.33.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.33.0 - "@typescript-eslint/typescript-estree": 8.33.0 - "@typescript-eslint/utils": 8.33.0 + "@typescript-eslint/parser": 8.33.1 + "@typescript-eslint/typescript-estree": 8.33.1 + "@typescript-eslint/utils": 8.33.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -5588,7 +5588,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.33.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.33.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.33.1, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.33.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -5663,15 +5663,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.33.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.33.1, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.33.0 - "@typescript-eslint/tsconfig-utils": 8.33.0 - "@typescript-eslint/types": 8.33.0 - "@typescript-eslint/visitor-keys": 8.33.0 + "@typescript-eslint/project-service": 8.33.1 + "@typescript-eslint/tsconfig-utils": 8.33.1 + "@typescript-eslint/types": 8.33.1 + "@typescript-eslint/visitor-keys": 8.33.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 fast-glob: ^3.3.2 @@ -5688,14 +5688,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.33.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.33.1, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.33.0 - "@typescript-eslint/types": 8.33.0 - "@typescript-eslint/typescript-estree": 8.33.0 + "@typescript-eslint/scope-manager": 8.33.1 + "@typescript-eslint/types": 8.33.1 + "@typescript-eslint/typescript-estree": 8.33.1 "@vitest/coverage-v8": ^3.1.3 rimraf: "*" typescript: "*" @@ -5706,11 +5706,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.33.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.33.1, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.33.0 + "@typescript-eslint/types": 8.33.1 "@vitest/coverage-v8": ^3.1.3 eslint-visitor-keys: ^4.2.0 rimraf: "*" @@ -18739,9 +18739,9 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.33.0 - "@typescript-eslint/parser": 8.33.0 - "@typescript-eslint/utils": 8.33.0 + "@typescript-eslint/eslint-plugin": 8.33.1 + "@typescript-eslint/parser": 8.33.1 + "@typescript-eslint/utils": 8.33.1 "@vitest/coverage-v8": ^3.1.3 rimraf: "*" typescript: "*" From 0f5c59c1b116ced6aaff7b2c632f924b2ca49596 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Thu, 5 Jun 2025 10:18:24 -0600 Subject: [PATCH 025/283] chore(eslint-plugin): [prefer-optional-chain] fix comment placement (#11269) --- packages/eslint-plugin/src/rules/prefer-optional-chain.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts index ffbcd213fedd..241f4240e78d 100644 --- a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts +++ b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts @@ -109,7 +109,6 @@ export default createRule< const seenLogicals = new Set(); return { - // specific handling for `(foo ?? {}).bar` / `(foo || {}).bar` 'LogicalExpression[operator!="??"]'( node: TSESTree.LogicalExpression, ): void { @@ -157,6 +156,7 @@ export default createRule< } }, + // specific handling for `(foo ?? {}).bar` / `(foo || {}).bar` 'LogicalExpression[operator="||"], LogicalExpression[operator="??"]'( node: TSESTree.LogicalExpression, ): void { @@ -186,6 +186,7 @@ export default createRule< return leftPrecedence < OperatorPrecedence.LeftHandSide; } + checkNullishAndReport(context, parserServices, options, [leftNode], { node: parentNode, messageId: 'preferOptionalChain', From f5eb171473a248fd076c5a223c41643f144d4787 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" <53356952+typescript-eslint[bot]@users.noreply.github.com> Date: Fri, 6 Jun 2025 21:41:50 +0930 Subject: [PATCH 026/283] chore: update sponsors (#11277) Co-authored-by: typescript-eslint[bot] --- packages/website/data/sponsors.json | 102 ++++++++++++++-------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/packages/website/data/sponsors.json b/packages/website/data/sponsors.json index 7cb8bcdc4b12..6dad26759c96 100644 --- a/packages/website/data/sponsors.json +++ b/packages/website/data/sponsors.json @@ -3,7 +3,7 @@ "id": "ESLint", "image": "https://images.opencollective.com/eslint/48a2e5d/logo.png", "name": "ESLint", - "totalDonations": 3330000, + "totalDonations": 3360000, "website": "https://eslint.org/" }, { @@ -17,21 +17,21 @@ "id": "Nx (by Nrwl)", "image": "https://images.opencollective.com/nx/0efbe42/logo.png", "name": "Nx (by Nrwl)", - "totalDonations": 1250000, + "totalDonations": 1275000, "website": "https://nx.dev" }, { "id": "JetBrains", "image": "https://images.opencollective.com/jetbrains/fe76f99/logo.png", "name": "JetBrains", - "totalDonations": 850000, + "totalDonations": 900000, "website": "https://www.jetbrains.com/" }, { "id": "Cybozu", "image": "https://images.opencollective.com/cybozu/933e46d/logo.png", "name": "Cybozu", - "totalDonations": 685000, + "totalDonations": 710000, "website": "https://cybozu.co.jp/" }, { @@ -45,21 +45,21 @@ "id": "Codecademy", "image": "https://images.opencollective.com/codecademy/d56a48d/logo.png", "name": "Codecademy", - "totalDonations": 400000, + "totalDonations": 410000, "website": "https://codecademy.com" }, { "id": "Sourcegraph", "image": "https://images.opencollective.com/sourcegraph/f67b621/logo.png", "name": "Sourcegraph", - "totalDonations": 350000, + "totalDonations": 360000, "website": "https://about.sourcegraph.com" }, { "id": "Vite", "image": "https://images.opencollective.com/vite/e6d15e1/logo.png", "name": "Vite", - "totalDonations": 300000, + "totalDonations": 360000, "website": "https://vite.dev/" }, { @@ -69,6 +69,13 @@ "totalDonations": 300000, "website": "https://www.canva.com" }, + { + "id": "Airbnb", + "image": "https://images.opencollective.com/airbnb/d327d66/logo.png", + "name": "Airbnb", + "totalDonations": 295800, + "website": "https://www.airbnb.com/" + }, { "id": "THANKS.DEV", "image": "https://images.opencollective.com/thanks-dev/ed78b39/logo.png", @@ -76,18 +83,11 @@ "totalDonations": 293153, "website": "https://thanks.dev" }, - { - "id": "Airbnb", - "image": "https://images.opencollective.com/airbnb/d327d66/logo.png", - "name": "Airbnb", - "totalDonations": 290800, - "website": "https://www.airbnb.com/" - }, { "id": "GitBook", "image": "https://images.opencollective.com/gitbook/820419f/logo.png", "name": "GitBook", - "totalDonations": 230000, + "totalDonations": 240000, "website": "https://www.gitbook.com" }, { @@ -122,7 +122,7 @@ "id": "STORIS", "image": "https://images.opencollective.com/storis/dfb0e13/logo.png", "name": "STORIS", - "totalDonations": 106000, + "totalDonations": 109500, "website": "https://www.storis.com/" }, { @@ -157,9 +157,16 @@ "id": "WebdriverIO", "image": "https://images.opencollective.com/webdriverio/bbdd5c3/logo.png", "name": "WebdriverIO", - "totalDonations": 56000, + "totalDonations": 59500, "website": "https://webdriver.io/" }, + { + "id": "Torutek", + "image": "https://images.opencollective.com/torutek/logo.png", + "name": "Torutek", + "totalDonations": 55000, + "website": "https://torutek.com" + }, { "id": "Future Processing", "image": "https://images.opencollective.com/future-processing/1410d26/logo.png", @@ -174,6 +181,13 @@ "totalDonations": 50000, "website": "https://www.cryptonewsz.com/" }, + { + "id": "Defined Networking", + "image": "https://images.opencollective.com/defined-networking/072920e/logo.png", + "name": "Defined Networking", + "totalDonations": 50000, + "website": "https://www.defined.net" + }, { "id": "Skunk Team", "image": "https://images.opencollective.com/skunk-team/3ddba2f/logo.png", @@ -181,13 +195,6 @@ "totalDonations": 50000, "website": "https://skunk.team" }, - { - "id": "Torutek", - "image": "https://images.opencollective.com/torutek/logo.png", - "name": "Torutek", - "totalDonations": 50000, - "website": "https://torutek.com" - }, { "id": "vlt", "image": "https://images.opencollective.com/vlt/33d4066/logo.png", @@ -202,13 +209,6 @@ "totalDonations": 48000, "website": "https://joealden.com/" }, - { - "id": "Defined Networking", - "image": "https://images.opencollective.com/defined-networking/072920e/logo.png", - "name": "Defined Networking", - "totalDonations": 47500, - "website": "https://www.defined.net" - }, { "id": "Quicko", "image": "https://images.opencollective.com/quicko/7bd1dc9/logo.png", @@ -227,16 +227,9 @@ "id": "syntaxfm", "image": "https://avatars.githubusercontent.com/u/130389858?v=4", "name": "Syntax", - "totalDonations": 37639, + "totalDonations": 34208, "website": "https://syntax.fm" }, - { - "id": "frontendmasters", - "image": "https://avatars.githubusercontent.com/u/5613852?v=4", - "name": "Frontend Masters", - "totalDonations": 32379, - "website": "https://FrontendMasters.com" - }, { "id": "Monito", "image": "https://images.opencollective.com/monito/50fc878/logo.png", @@ -255,30 +248,37 @@ "id": "0+X", "image": "https://images.opencollective.com/0-x/707287f/logo.png", "name": "0+X", - "totalDonations": 29000, + "totalDonations": 30000, "website": "https://www.0x.se" }, { "id": "Trevor Burnham", "image": "https://images.opencollective.com/trevorburnham/016f6da/avatar.png", "name": "Trevor Burnham", - "totalDonations": 28000, + "totalDonations": 29000, "website": "https://trevorburnham.com" }, { "id": "Corellium", "image": "https://images.opencollective.com/corellium/aa8c228/logo.png", "name": "Corellium", - "totalDonations": 25200, + "totalDonations": 25800, "website": "https://www.corellium.com" }, { "id": "Evil Martians", "image": "https://images.opencollective.com/evilmartians/707ab4d/logo.png", "name": "Evil Martians", - "totalDonations": 25000, + "totalDonations": 25500, "website": "https://evilmartians.com/" }, + { + "id": "frontendmasters", + "image": "https://avatars.githubusercontent.com/u/5613852?v=4", + "name": "Frontend Masters", + "totalDonations": 24758, + "website": "https://FrontendMasters.com" + }, { "id": "revo.js", "image": "https://images.opencollective.com/revojsro/82623a7/logo.png", @@ -328,13 +328,6 @@ "totalDonations": 15000, "website": "https://paddn.com/" }, - { - "id": "getsentry", - "image": "https://avatars.githubusercontent.com/u/1396951?v=4", - "name": "Sentry", - "totalDonations": 14729, - "website": "https://sentry.io" - }, { "id": "Now4real", "image": "https://images.opencollective.com/now4real/54ca7d9/logo.png", @@ -342,11 +335,18 @@ "totalDonations": 14500, "website": "https://now4real.com/" }, + { + "id": "getsentry", + "image": "https://avatars.githubusercontent.com/u/1396951?v=4", + "name": "Sentry", + "totalDonations": 13614, + "website": "https://sentry.io" + }, { "id": "codecov", "image": "https://avatars.githubusercontent.com/u/8226205?v=4", "name": "Codecov", - "totalDonations": 14456, + "totalDonations": 13218, "website": "https://codecov.io/" }, { From 1e0ba6253cdecbbb69b37537599aad9a21ed310e Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Sat, 7 Jun 2025 03:49:00 +0100 Subject: [PATCH 027/283] fix(visitor-keys): fix visitor keys order (#11279) --- .../fixtures/type-declaration/index-access2.ts.shot | 4 ++-- .../fixtures/type-declaration/index-access3.ts.shot | 4 ++-- .../fixtures/type-declaration/mapped-named.ts.shot | 4 ++-- .../tests/fixtures/type-declaration/mapped.ts.shot | 4 ++-- packages/visitor-keys/src/visitor-keys.ts | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/scope-manager/tests/fixtures/type-declaration/index-access2.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/index-access2.ts.shot index cf446d378a40..815710f93125 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/index-access2.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/index-access2.ts.shot @@ -10,7 +10,7 @@ ScopeManager { ], name: "T", references: [ - Reference$2 { + Reference$1 { identifier: Identifier<"T">, isRead: true, isTypeReference: true, @@ -31,7 +31,7 @@ ScopeManager { ], name: "K", references: [ - Reference$1 { + Reference$2 { identifier: Identifier<"K">, isRead: true, isTypeReference: true, diff --git a/packages/scope-manager/tests/fixtures/type-declaration/index-access3.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/index-access3.ts.shot index 95e5ef75c6c2..d6665e50476b 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/index-access3.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/index-access3.ts.shot @@ -10,7 +10,7 @@ ScopeManager { ], name: "T", references: [ - Reference$3 { + Reference$2 { identifier: Identifier<"T">, isRead: true, isTypeReference: true, @@ -41,7 +41,7 @@ ScopeManager { resolved: Variable$3, writeExpr: Literal$3, }, - Reference$2 { + Reference$3 { identifier: Identifier<"k">, isRead: true, isTypeReference: false, diff --git a/packages/scope-manager/tests/fixtures/type-declaration/mapped-named.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/mapped-named.ts.shot index 526c1a55b9a4..8899edb1db89 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/mapped-named.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/mapped-named.ts.shot @@ -10,7 +10,7 @@ ScopeManager { ], name: "T", references: [ - Reference$4 { + Reference$3 { identifier: Identifier<"T">, isRead: true, isTypeReference: true, @@ -51,7 +51,7 @@ ScopeManager { isWrite: false, resolved: Variable$4, }, - Reference$3 { + Reference$4 { identifier: Identifier<"k">, isRead: true, isTypeReference: true, diff --git a/packages/scope-manager/tests/fixtures/type-declaration/mapped.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/mapped.ts.shot index 3f0c6e23cd71..4cc942930bd4 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/mapped.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/mapped.ts.shot @@ -10,7 +10,7 @@ ScopeManager { ], name: "T", references: [ - Reference$3 { + Reference$2 { identifier: Identifier<"T">, isRead: true, isTypeReference: true, @@ -43,7 +43,7 @@ ScopeManager { ], name: "k", references: [ - Reference$2 { + Reference$3 { identifier: Identifier<"k">, isRead: true, isTypeReference: true, diff --git a/packages/visitor-keys/src/visitor-keys.ts b/packages/visitor-keys/src/visitor-keys.ts index 283d2f36e389..8fd0d512ac98 100644 --- a/packages/visitor-keys/src/visitor-keys.ts +++ b/packages/visitor-keys/src/visitor-keys.ts @@ -213,8 +213,8 @@ const additionalKeys: AdditionalKeys = { TSExternalModuleReference: ['expression'], TSFunctionType: SharedVisitorKeys.FunctionType, TSImportEqualsDeclaration: ['id', 'moduleReference'], - TSImportType: ['argument', 'qualifier', 'typeArguments', 'options'], - TSIndexedAccessType: ['indexType', 'objectType'], + TSImportType: ['argument', 'options', 'qualifier', 'typeArguments'], + TSIndexedAccessType: ['objectType', 'indexType'], TSIndexSignature: ['parameters', 'typeAnnotation'], TSInferType: ['typeParameter'], TSInstantiationExpression: ['expression', 'typeArguments'], @@ -225,7 +225,7 @@ const additionalKeys: AdditionalKeys = { TSIntrinsicKeyword: [], TSLiteralType: ['literal'], TSMappedType: ['key', 'constraint', 'nameType', 'typeAnnotation'], - TSMethodSignature: ['typeParameters', 'key', 'params', 'returnType'], + TSMethodSignature: ['key', 'typeParameters', 'params', 'returnType'], TSModuleBlock: ['body'], TSModuleDeclaration: ['id', 'body'], TSNamedTupleMember: ['label', 'elementType'], @@ -238,7 +238,7 @@ const additionalKeys: AdditionalKeys = { TSOptionalType: ['typeAnnotation'], TSParameterProperty: ['decorators', 'parameter'], TSPrivateKeyword: [], - TSPropertySignature: ['typeAnnotation', 'key'], + TSPropertySignature: ['key', 'typeAnnotation'], TSProtectedKeyword: [], TSPublicKeyword: [], TSQualifiedName: ['left', 'right'], @@ -259,7 +259,7 @@ const additionalKeys: AdditionalKeys = { TSTypeParameter: ['name', 'constraint', 'default'], TSTypeParameterDeclaration: ['params'], TSTypeParameterInstantiation: ['params'], - TSTypePredicate: ['typeAnnotation', 'parameterName'], + TSTypePredicate: ['parameterName', 'typeAnnotation'], TSTypeQuery: ['exprName', 'typeArguments'], TSTypeReference: ['typeName', 'typeArguments'], TSUndefinedKeyword: [], From 2df6f99883b8ed2e762c602f80a05c854aef87dc Mon Sep 17 00:00:00 2001 From: Kim Sang Du Date: Mon, 9 Jun 2025 15:59:50 +0900 Subject: [PATCH 028/283] feat(type-utils): deprecated getSourceFileOfNode function (#11284) --- packages/type-utils/src/getSourceFileOfNode.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/type-utils/src/getSourceFileOfNode.ts b/packages/type-utils/src/getSourceFileOfNode.ts index 18e7ca27ecde..ffad3631a25a 100644 --- a/packages/type-utils/src/getSourceFileOfNode.ts +++ b/packages/type-utils/src/getSourceFileOfNode.ts @@ -1,6 +1,7 @@ import * as ts from 'typescript'; /** + * @deprecated * Gets the source file for a given node */ export function getSourceFileOfNode(node: ts.Node): ts.SourceFile { From d159a211d3970978f7311e5227462f30a53a060c Mon Sep 17 00:00:00 2001 From: Tao Date: Mon, 9 Jun 2025 15:10:10 +0800 Subject: [PATCH 029/283] fix(typescript-estree): change the token type of `null` from `Keyword` to `Null` (#11283) --- .../snapshots/2-TSESTree-Tokens.shot | 4 ++-- .../snapshots/6-AST-Alignment-Tokens.shot | 6 ++---- .../snapshots/2-TSESTree-Tokens.shot | 12 ++++++------ .../snapshots/2-TSESTree-Tokens.shot | 4 ++-- .../snapshots/2-TSESTree-Tokens.shot | 4 ++-- .../snapshots/6-AST-Alignment-Tokens.shot | 6 ++---- .../snapshots/2-TSESTree-Tokens.shot | 4 ++-- .../snapshots/6-AST-Alignment-Tokens.shot | 6 ++---- .../nested-types/snapshots/2-TSESTree-Tokens.shot | 4 ++-- .../snapshots/2-TSESTree-Tokens.shot | 4 ++-- .../snapshots/6-AST-Alignment-Tokens.shot | 6 ++---- .../tests/fixtures-with-differences-tokens.shot | 3 --- packages/typescript-estree/src/node-utils.ts | 3 +++ 13 files changed, 29 insertions(+), 37 deletions(-) diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot index c0d2cc8c0600..d7da87a7a9d7 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot @@ -29,8 +29,8 @@ end: { column: 6, line: 3 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [80, 84], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot index bfef506c822e..2fc7fb8f35c0 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot @@ -38,10 +38,8 @@ Snapshot Diff: end: { column: 6, line: 3 }, }, }, -- Keyword { -- type: 'Keyword', -+ Null { -+ type: 'Null', + Null { + type: 'Null', value: 'null', range: [80, 84], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot index c79f24defb00..2449e4574bc0 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot @@ -39,8 +39,8 @@ end: { column: 6, line: 3 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [80, 84], @@ -239,8 +239,8 @@ end: { column: 10, line: 7 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [117, 121], @@ -329,8 +329,8 @@ end: { column: 8, line: 10 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [146, 150], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot index f3c7150f41d1..fed3e2747887 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot @@ -29,8 +29,8 @@ end: { column: 10, line: 3 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [84, 88], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot index d17773cf1d68..c5d1e3db16f5 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot @@ -49,8 +49,8 @@ end: { column: 19, line: 3 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [93, 97], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot index d746756b46c1..1270fb2681e8 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot @@ -58,10 +58,8 @@ Snapshot Diff: end: { column: 19, line: 3 }, }, }, -- Keyword { -- type: 'Keyword', -+ Null { -+ type: 'Null', + Null { + type: 'Null', value: 'null', range: [93, 97], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot index 19f272b4f0a1..8e7e2549262f 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot @@ -89,8 +89,8 @@ end: { column: 40, line: 3 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [114, 118], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot index 56c8590cf6bb..56f0dedb193b 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot @@ -98,10 +98,8 @@ Snapshot Diff: end: { column: 40, line: 3 }, }, }, -- Keyword { -- type: 'Keyword', -+ Null { -+ type: 'Null', + Null { + type: 'Null', value: 'null', range: [114, 118], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot index a22433f5c8ca..f33dd4aed51b 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot @@ -249,8 +249,8 @@ end: { column: 23, line: 5 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [139, 143], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot index c5159511416e..547dd756f9d3 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot @@ -49,8 +49,8 @@ end: { column: 19, line: 3 }, }, }, - Keyword { - type: "Keyword", + Null { + type: "Null", value: "null", range: [93, 97], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot index f8ff003d5c8e..0f245d08a17f 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot @@ -58,10 +58,8 @@ Snapshot Diff: end: { column: 19, line: 3 }, }, }, -- Keyword { -- type: 'Keyword', -+ Null { -+ type: 'Null', + Null { + type: 'Null', value: 'null', range: [93, 97], diff --git a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot index fc6544193cf1..6afa608f53fd 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot @@ -76,12 +76,10 @@ exports[`AST Fixtures > List fixtures with Token differences`] "legacy-fixtures/basics/fixtures/non-null-assertion-operator/fixture.ts", "legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/fixture.ts", "legacy-fixtures/basics/fixtures/nullish-coalescing/fixture.ts", - "legacy-fixtures/basics/fixtures/object-with-escaped-properties/fixture.ts", "legacy-fixtures/basics/fixtures/type-assertion-in-interface/fixture.ts", "legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/fixture.ts", "legacy-fixtures/basics/fixtures/type-guard-in-interface/fixture.ts", "legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/fixture.ts", - "legacy-fixtures/basics/fixtures/typed-keyword-null/fixture.ts", "legacy-fixtures/basics/fixtures/typed-this/fixture.ts", "legacy-fixtures/basics/fixtures/union-intersection/fixture.ts", "legacy-fixtures/basics/fixtures/unknown-type-annotation/fixture.ts", @@ -111,7 +109,6 @@ exports[`AST Fixtures > List fixtures with Token differences`] "legacy-fixtures/types/fixtures/mapped-readonly/fixture.ts", "legacy-fixtures/types/fixtures/mapped-untypped/fixture.ts", "legacy-fixtures/types/fixtures/mapped/fixture.ts", - "legacy-fixtures/types/fixtures/nested-types/fixture.ts", "legacy-fixtures/types/fixtures/reference-generic-nested/fixture.ts", "legacy-fixtures/types/fixtures/reference-generic/fixture.ts", "legacy-fixtures/types/fixtures/reference/fixture.ts", diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index f2f60c777bd1..16054dfc9960 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -477,6 +477,9 @@ export function isChildUnwrappableOptionalChain( export function getTokenType( token: ts.Identifier | ts.Token, ): Exclude { + if (token.kind === SyntaxKind.NullKeyword) { + return AST_TOKEN_TYPES.Null; + } let keywordKind: ts.SyntaxKind | undefined; if (isAtLeast50 && token.kind === SyntaxKind.Identifier) { keywordKind = ts.identifierToKeywordKind(token as ts.Identifier); From 685e530478362c9e5a43db01aadc200a361cbc6f Mon Sep 17 00:00:00 2001 From: Tao Date: Mon, 9 Jun 2025 15:26:31 +0800 Subject: [PATCH 030/283] fix(typescript-estree): add validation to interface extends (#11271) Co-authored-by: Brad Zacher --- .../snapshots/1-TSESTree-Error.shot | 5 ++- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 7 +++- .../snapshots/3-Alignment-Error.shot | 2 +- .../fixtures-with-differences-errors.shot | 2 -- .../no-unused-vars/no-unused-vars.test.ts | 19 ----------- packages/typescript-estree/src/convert.ts | 33 +++++++++++++++++++ 7 files changed, 45 insertions(+), 25 deletions(-) diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/1-TSESTree-Error.shot index 3192c89d0208..70781ef9b372 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > non-identifier-extends > TSESTree - Error`] -NO ERROR +TSError +> 1 | interface F extends 1 {} + | ^ Interface declaration can only extend an identifier/qualified name with optional type arguments. + 2 | diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/3-Alignment-Error.shot index 8b8a05459c4b..a0844838800f 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > non-identifier-extends > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-TSESTree-Error.shot index b9716b289515..f57a1b692cd1 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-multiple-extends > TSESTree - Error`] -NO ERROR +TSError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | interface foo extends bar extends baz {} + | ^^^^^^^^^^^ 'extends' clause already seen. + 4 | diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/3-Alignment-Error.shot index 8c05c9ec9327..2b5ef310d7cd 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-multiple-extends > Error Alignment`] -Babel errored but TSESTree didn't +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 ef7f47117298..7051aa777fbb 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -12,7 +12,6 @@ exports[`AST Fixtures > List fixtures with Error differences`] "declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/fixture.ts", - "declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/fixture.ts", "declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/fixture.ts", "declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/fixture.ts", "declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/fixture.ts", @@ -45,7 +44,6 @@ exports[`AST Fixtures > List fixtures with Error differences`] "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/fixture.ts", - "legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/fixture.ts", "legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts", 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 5ebc8d9a406b..5f40bbcdc3cc 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 @@ -360,25 +360,6 @@ export interface Bar extends baz.test {} code: ` import test from 'test'; import baz from 'baz'; -export interface Bar extends baz().test {} - `, - errors: [ - { - column: 8, - data: { - action: 'defined', - additional: '', - varName: 'test', - }, - line: 2, - messageId: 'unusedVar', - }, - ], - }, - { - code: ` -import test from 'test'; -import baz from 'baz'; export class Bar implements baz.test {} `, errors: [ diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 22c0257505a2..8f293db2af02 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -70,6 +70,25 @@ export interface ASTMaps { tsNodeToESTreeNodeMap: ParserWeakMap; } +function isPropertyAccessEntityNameExpression( + node: ts.Node, +): node is ts.PropertyAccessEntityNameExpression { + return ( + ts.isPropertyAccessExpression(node) && + ts.isIdentifier(node.name) && + isEntityNameExpression(node.expression) + ); +} + +function isEntityNameExpression( + node: ts.Node, +): node is ts.EntityNameExpression { + return ( + node.kind === SyntaxKind.Identifier || + isPropertyAccessEntityNameExpression(node) + ); +} + export class Converter { private allowPattern = false; private readonly ast: ts.SourceFile; @@ -3024,6 +3043,7 @@ export class Converter { const interfaceHeritageClauses = node.heritageClauses ?? []; const interfaceExtends: TSESTree.TSInterfaceHeritage[] = []; + let seenExtendsClause = false; for (const heritageClause of interfaceHeritageClauses) { if (heritageClause.token !== SyntaxKind.ExtendsKeyword) { this.#throwError( @@ -3033,8 +3053,21 @@ export class Converter { : 'Unexpected token.', ); } + if (seenExtendsClause) { + this.#throwError(heritageClause, "'extends' clause already seen."); + } + seenExtendsClause = true; for (const heritageType of heritageClause.types) { + if ( + !isEntityNameExpression(heritageType.expression) || + ts.isOptionalChain(heritageType.expression) + ) { + this.#throwError( + heritageType, + 'Interface declaration can only extend an identifier/qualified name with optional type arguments.', + ); + } interfaceExtends.push( this.convertChild( heritageType, From b2eded83f68d8e1685d1ea5e826bbfa891086b7f Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 9 Jun 2025 15:28:46 +0800 Subject: [PATCH 031/283] test(ast-spec): snapshot codeframe of Babel parse error (#11240) Co-authored-by: Brad Zacher --- packages/ast-spec/package.json | 1 + .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../missing-body/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../_error_/enum/snapshots/2-Babel-Error.shot | 6 ++- .../namespace/snapshots/2-Babel-Error.shot | 6 ++- .../type-alias/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../assertion/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../async/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../decorator/snapshots/2-Babel-Error.shot | 6 ++- .../missing-body/snapshots/2-Babel-Error.shot | 6 ++- .../missing-id/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../import-kind/snapshots/2-Babel-Error.shot | 7 +++- .../missing-id/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../decorator/snapshots/2-Babel-Error.shot | 6 ++- .../missing-body/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../missing-id/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../missing-id/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../decorator/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../decorator/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../no-variables/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../no-arguments/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../call-expr/snapshots/2-Babel-Error.shot | 6 ++- .../literal/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../paren-expr/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 7 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 7 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 7 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 7 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 7 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 7 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../solo-const/snapshots/2-Babel-Error.shot | 7 +++- .../snapshots/2-Babel-Error.shot | 10 ++++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 5 ++- .../decl-init/snapshots/2-Babel-Error.shot | 6 ++- .../decl-multi/snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 8 +++- .../snapshots/2-Babel-Error.shot | 6 ++- .../snapshots/2-Babel-Error.shot | 9 +++- .../snapshots/2-Babel-Error.shot | 9 +++- packages/ast-spec/tests/fixtures.test.ts | 2 +- .../ast-spec/tests/util/serialize-error.ts | 42 ++++++++++++++++--- yarn.lock | 3 +- 236 files changed, 1424 insertions(+), 239 deletions(-) diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index c98d7ef1a580..bb8a82805740 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -48,6 +48,7 @@ "@babel/code-frame": "^7.24.2", "@babel/core": "^7.24.4", "@babel/eslint-parser": "^7.24.1", + "@babel/parser": "^7.24.1", "@microsoft/api-extractor": "^7.47.11", "@types/babel__code-frame": "^7.0.6", "@types/babel__core": "^7.20.5", diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot index 0e64270303c2..ac409fa55ba0 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > export-missing-name > Babel - Error`] -SyntaxError: A class name is required. (1:13) +BabelError +> 1 | export class { } + | ^ A class name is required. (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot index 56fdd942ce87..c5774c25f7ed 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > implements-non-identifier > Babel - Error`] -SyntaxError: Unexpected token (1:21) +BabelError +> 1 | class Foo implements 'thing' {} + | ^ Unexpected token (1:21) + 2 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot index 2dec9742a619..cc16e7c77a49 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:9) +BabelError +> 1 | class Foo; + | ^ Unexpected token, expected "{" (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Babel-Error.shot index a61921db5773..e3f5ef8b8219 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-extends-type-param > Babel - Error`] -SyntaxError: Type argument list cannot be empty. (1:17) +BabelError +> 1 | class C extends D<> {} + | ^ Type argument list cannot be empty. (1:17) + 2 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot index 2c265df14f59..c2f76a98fb66 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-type-param > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (1:7) +BabelError +> 1 | class C<> {} + | ^ Type parameter list cannot be empty. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot index dca1aa8e5e3c..c5b89c0e5107 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > non-identifier-name > Babel - Error`] -SyntaxError: A class name is required. (1:6) +BabelError +> 1 | class 'Foo' {} + | ^ A class name is required. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot index 2909d642ff49..2b75e5f4601f 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > non-identifier-type-param > Babel - Error`] -SyntaxError: Unexpected token (1:8) +BabelError +> 1 | class C<1> {} + | ^ Unexpected token (1:8) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Babel-Error.shot index 6efe9b3b7d81..3ec3216dc914 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportAllDeclaration > _error_ > missing-source > Babel - Error`] -SyntaxError: Unexpected token (1:13) +BabelError +> 1 | export * from; + | ^ Unexpected token (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot index f0134190e9c9..00afdab72fba 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportAllDeclaration > _error_ > non-string-source > Babel - Error`] -SyntaxError: Unexpected token (1:14) +BabelError +> 1 | export * from module; + | ^ Unexpected token (1:14) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot index 47bab5896cfe..491a0644ae9d 100644 --- a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportDefaultDeclaration > _error_ > enum > Babel - Error`] -SyntaxError: Unexpected reserved word 'enum'. (1:15) +BabelError +> 1 | export default enum Foo {} + | ^ Unexpected reserved word 'enum'. (1:15) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot index 835d3e6b6496..c66fdce48dd5 100644 --- a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportDefaultDeclaration > _error_ > namespace > Babel - Error`] -SyntaxError: Missing semicolon. (1:24) +BabelError +> 1 | export default namespace Foo {} + | ^ Missing semicolon. (1:24) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot index e9a8f373d0e6..ed1501e269f3 100644 --- a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportDefaultDeclaration > _error_ > type-alias > Babel - Error`] -SyntaxError: Missing semicolon. (1:19) +BabelError +> 1 | export default type Foo = 1; + | ^ Missing semicolon. (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot index be123c950dde..3b031210e7bc 100644 --- a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportDefaultDeclaration > _error_ > variable-declaration > Babel - Error`] -SyntaxError: Only expressions, functions or classes are allowed as the `default` export. (1:15) +BabelError +> 1 | export default const x = 1; + | ^ Only expressions, functions or classes are allowed as the `default` export. (1:15) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot index 30b0ef777673..c2035556e868 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > anonymous-class > Babel - Error`] -SyntaxError: A class name is required. (1:13) +BabelError +> 1 | export class {} + | ^ A class name is required. (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot index ff3be5f420c9..1a9032ea5498 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > anonymous-function-expression > Babel - Error`] -SyntaxError: Unexpected token (1:16) +BabelError +> 1 | export function () {} + | ^ Unexpected token (1:16) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot index f8f9efcc5de6..e475f632d493 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > arrow-function > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:7) +BabelError +> 1 | export () => {}; + | ^ Unexpected token, expected "{" (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot index 89b0658efc67..75d9c00ff13a 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > assertion > Babel - Error`] -SyntaxError: A JSON module can only be imported with `default`. (1:9) +BabelError +> 1 | export { foo } from 'mod' assert { type: 'json' }; + | ^ A JSON module can only be imported with `default`. (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot index d87d58c885c7..11121f10d40c 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-identifier-aliased-to-number-literal-with-source > Babel - Error`] -SyntaxError: Unexpected token (1:14) +BabelError +> 1 | export { a as 1 } from 'mod'; + | ^ Unexpected token (1:14) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot index 17bc155f8d2d..6d266bf43205 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-identifier-aliased-to-number-literal-without-source > Babel - Error`] -SyntaxError: Unexpected token (1:14) +BabelError +> 1 | export { a as 1 }; + | ^ Unexpected token (1:14) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot index c654860eb328..e749b5d25fe9 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-number-literal-with-source > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | export { 1 } from 'mod'; + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot index 27316defb9b0..e81fcdad7e08 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-number-literal-without-source > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | export { 1 }; + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot index eb3e40a2aa15..f201320ca0db 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot @@ -1,5 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-aliased-to-identifier-without-source > Babel - Error`] -SyntaxError: A string literal cannot be used as an exported binding without `from`. +BabelError +> 1 | export { 'a a' as b }; + | ^ A string literal cannot be used as an exported binding without `from`. - Did you mean `export { 'a a' as 'b' } from 'some-module'`? (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot index e91248efe601..8ab798e5cbab 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-aliased-to-number-literal-without-source > Babel - Error`] -SyntaxError: Unexpected token (1:18) +BabelError +> 1 | export { 'a a' as 1 }; + | ^ Unexpected token (1:18) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot index 4ca061f40171..c8830b8a6fd3 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot @@ -1,5 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-aliased-to-string-literal-without-source > Babel - Error`] -SyntaxError: A string literal cannot be used as an exported binding without `from`. +BabelError +> 1 | export { 'a a' as 'b b' }; + | ^ A string literal cannot be used as an exported binding without `from`. - Did you mean `export { 'a a' as 'b b' } from 'some-module'`? (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot index 0a53b6d2d4df..6d73afe3c0f4 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot @@ -1,5 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-many-without-source > Babel - Error`] -SyntaxError: A string literal cannot be used as an exported binding without `from`. +BabelError +> 1 | export { 'a a', 'b b' }; + | ^ A string literal cannot be used as an exported binding without `from`. - Did you mean `export { 'a a' as 'a a' } from 'some-module'`? (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot index b494c222dfda..648bcec8e693 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot @@ -1,5 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-without-source > Babel - Error`] -SyntaxError: A string literal cannot be used as an exported binding without `from`. +BabelError +> 1 | export { 'a a' }; + | ^ A string literal cannot be used as an exported binding without `from`. - Did you mean `export { 'a a' as 'a a' } from 'some-module'`? (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot index 3859e1338fb1..7f9ff6798317 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > class-expression > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:7) +BabelError +> 1 | export (class Foo {}); + | ^ Unexpected token, expected "{" (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot index f25331d54178..38ab33ea3608 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > identifier-direct > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:7) +BabelError +> 1 | export a; + | ^ Unexpected token, expected "{" (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot index 1fd7baadc861..3d38c4f9e70e 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > literal-direct > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:7) +BabelError +> 1 | export 'a'; + | ^ Unexpected token, expected "{" (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot index 8a3517755f4f..ce11286822a7 100644 --- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > missing-id-and-not-exported > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | function () {} + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot index 559cc556fbd3..6e7c4870ff8b 100644 --- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > missing-type-param > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (1:12) +BabelError +> 1 | function foo<>() {} + | ^ Type parameter list cannot be empty. (1:12) + 2 | + diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot index 907fe7ab23ae..b172c076d322 100644 --- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > non-identifier-name > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | function 1() {} + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot index 270e3399f309..700ebba3a301 100644 --- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > non-identifier-type-param > Babel - Error`] -SyntaxError: Unexpected token (1:13) +BabelError +> 1 | function foo<1>() {} + | ^ Unexpected token (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot index 7f8ffa9ce43d..0e3a25550420 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > default-and-named-and-namespace > Babel - Error`] -SyntaxError: Unexpected token, expected "from" (1:16) +BabelError +> 1 | import a, * as b, { c } from 'mod'; + | ^ Unexpected token, expected "from" (1:16) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot index b2062a8fd6c9..43ab6d6cbb6e 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > default-number-literal > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:7) +BabelError +> 1 | import 1 from 'mod'; + | ^ Unexpected token, expected "{" (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot index 6ef5744a9a28..6ac746b3158d 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > default-string-literal > Babel - Error`] -SyntaxError: Missing semicolon. (1:12) +BabelError +> 1 | import 'a a' from 'mod'; + | ^ Missing semicolon. (1:12) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Babel-Error.shot index acec1a57dfca..f0b67f5c7abb 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-and-namespace > Babel - Error`] -SyntaxError: Unexpected token, expected "from" (1:12) +BabelError +> 1 | import { b }, * as a from 'a'; + | ^ Unexpected token, expected "from" (1:12) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot index aaff744edc32..28b4fb532bbe 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-identifier-aliased-to-number-literal > Babel - Error`] -SyntaxError: Unexpected token (1:14) +BabelError +> 1 | import { X as 1 } from 'mod'; + | ^ Unexpected token (1:14) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot index 14d274da0ea3..f13d1ad86b72 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-identifier-aliased-to-string-literal > Babel - Error`] -SyntaxError: Unexpected token (1:14) +BabelError +> 1 | import { X as 'a a' } from 'mod'; + | ^ Unexpected token (1:14) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot index 6e9cc05e0006..cbce80d6b85d 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-number-literal-aliased-to-identifier > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | import { 1 as X } from 'mod'; + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot index 1ce70d79982d..0dcbc46684f9 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-number-literal-aliased-to-number-literal > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | import { 1 as 1 } from 'mod'; + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot index 5d0ee5c06f74..0346b41d38d4 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-number-literal-aliased-to-string-literal > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | import { 1 as 'a a' } from 'mod'; + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot index 3ab2880006e0..b3307fa4f464 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-number-literal > Babel - Error`] -SyntaxError: Unexpected token (1:9) +BabelError +> 1 | import { 1 } from 'mod'; + | ^ Unexpected token (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot index ba56e25400c6..db49d74cedaa 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-string-literal-aliased-to-number-literal > Babel - Error`] -SyntaxError: Unexpected token (1:17) +BabelError +> 1 | import { "😭" as 1 } from 'mod'; + | ^ Unexpected token (1:17) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot index ef0d81834f4e..9294a60a3d0e 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-string-literal-aliased-to-string-literal > Babel - Error`] -SyntaxError: Unexpected token (1:17) +BabelError +> 1 | import { "😭" as 'a a' } from 'mod'; + | ^ Unexpected token (1:17) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot index 811ae5af3b35..d40da4301b86 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot @@ -1,5 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-string-literal > Babel - Error`] -SyntaxError: A string literal cannot be used as an imported binding. +BabelError +> 1 | import { "😭" } from 'mod'; + | ^ A string literal cannot be used as an imported binding. - Did you mean `import { "😭" as foo }`? (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Babel-Error.shot index 370a42b15d95..bfbfc646d0d0 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > namespace-and-default > Babel - Error`] -SyntaxError: Unexpected token, expected "from" (1:13) +BabelError +> 1 | import * as b, a from 'mod'; + | ^ Unexpected token, expected "from" (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Babel-Error.shot index 2bfe0c35942c..c966103d9606 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > namespace-and-named > Babel - Error`] -SyntaxError: Unexpected token, expected "from" (1:13) +BabelError +> 1 | import * as a, { b } from 'a'; + | ^ Unexpected token, expected "from" (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Babel-Error.shot index 7020792b5fc4..84285d1c9a9a 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > namespace-and-namespace > Babel - Error`] -SyntaxError: Unexpected token, expected "from" (1:13) +BabelError +> 1 | import * as a, * as b from 'a'; + | ^ Unexpected token, expected "from" (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Babel-Error.shot index 4b27d2236cfa..444773331adc 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > namespace-non-identifier > Babel - Error`] -SyntaxError: Unexpected token (1:12) +BabelError +> 1 | import * as 1 from 'mod'; + | ^ Unexpected token (1:12) + 2 | + diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot index b1be30149fd4..a4ab23c8f836 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > non-string-source > Babel - Error`] -SyntaxError: Unexpected token (1:19) +BabelError +> 1 | import * as x from module; + | ^ Unexpected token (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Babel-Error.shot index b5d9b98f7eb0..ccb57192de34 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > async > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare async function foo(); + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Babel-Error.shot index e7d1600ede23..8bd1dcb842a0 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > declare-with-body > Babel - Error`] -SyntaxError: An implementation cannot be declared in ambient contexts. (1:0) +BabelError +> 1 | declare function foo(): void {}; + | ^ An implementation cannot be declared in ambient contexts. (1:0) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot index b0f108c8f608..0ba263f88f09 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > missing-id-and-not-exported > Babel - Error`] -SyntaxError: Unexpected token (1:17) +BabelError +> 1 | declare function (); + | ^ Unexpected token (1:17) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot index f940ce76c084..541b20502249 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > missing-type-param > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (1:20) +BabelError +> 1 | declare function foo<>(): void; + | ^ Type parameter list cannot be empty. (1:20) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot index 835c21eb16a8..4444ecfc395a 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > non-identifier-name > Babel - Error`] -SyntaxError: Unexpected token (1:17) +BabelError +> 1 | declare function 1(); + | ^ Unexpected token (1:17) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot index 84802a911f35..d7a45581d36a 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > non-identifier-type-param > Babel - Error`] -SyntaxError: Unexpected token (1:19) +BabelError +> 1 | declare function f<1>(): void; + | ^ Unexpected token (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot index 3b8661db0c38..5daf5307227b 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSEnumDeclaration > _error_ > decorator > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (1:6) +BabelError +> 1 | @decl enum Test {} + | ^ Leading decorators must be attached to a class declaration. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot index dd8d595e57ec..a82bf4ed854d 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSEnumDeclaration > _error_ > missing-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:8) +BabelError +> 1 | enum Foo; + | ^ Unexpected token, expected "{" (1:8) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot index 4418c7a1e888..359f07219f1e 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSEnumDeclaration > _error_ > missing-id > Babel - Error`] -SyntaxError: Unexpected token (1:5) +BabelError +> 1 | enum {} + | ^ Unexpected token (1:5) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot index 46552a854f62..cd61634a1671 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSEnumDeclaration > _error_ > non-identifier-name > Babel - Error`] -SyntaxError: Unexpected token (1:5) +BabelError +> 1 | enum 1 {} + | ^ Unexpected token (1:5) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Babel-Error.shot index 617513c26619..44149a67c407 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > entity-name-invalid > Babel - Error`] -SyntaxError: Unexpected token (1:11) +BabelError +> 1 | import F = 1; + | ^ Unexpected token (1:11) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot index 8df50b7d4c15..bf2fbca1e9ff 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > external-module-ref-non-string-2 > Babel - Error`] -SyntaxError: Unexpected token (1:19) +BabelError +> 1 | import F = require(1 + 1); + | ^ Unexpected token (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot index 9bf1d048bb0e..fa619f841cad 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > external-module-ref-non-string-3 > Babel - Error`] -SyntaxError: Unexpected token (1:19) +BabelError +> 1 | import F = require(`1`); + | ^ Unexpected token (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Babel-Error.shot index d38a4d68b8cc..936a12f12e14 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > external-module-ref-non-string > Babel - Error`] -SyntaxError: Unexpected token (1:19) +BabelError +> 1 | import F = require(1); + | ^ Unexpected token (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Babel-Error.shot index 9421f645d99f..2423a59ece17 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > import-kind > Babel - Error`] -SyntaxError: An import alias can not use 'import type'. (2:16) +BabelError + 1 | type T = 1; +> 2 | import type F = T; + | ^ An import alias can not use 'import type'. (2:16) + 3 | + diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot index 4d8cd7ddc0cd..555339c64c79 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > missing-id > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:7) +BabelError +> 1 | import = A.B; + | ^ Unexpected token, expected "{" (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Babel-Error.shot index 1b7acc81492b..dda3416a1214 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > missing-reference > Babel - Error`] -SyntaxError: Unexpected token, expected "from" (1:8) +BabelError +> 1 | import F; + | ^ Unexpected token, expected "from" (1:8) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot index 9713e325ea24..d628e241dec7 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > decorator > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (1:6) +BabelError +> 1 | @decl interface Test {} + | ^ Leading decorators must be attached to a class declaration. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot index e53fa56c6786..eb2cf802539b 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:11) +BabelError +> 1 | interface F; + | ^ Unexpected token, expected "{" (1:11) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Babel-Error.shot index aebcf3e06ed4..d07294c49c41 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-extends > Babel - Error`] -SyntaxError: 'extends' list cannot be empty. (1:20) +BabelError +> 1 | interface F extends {} + | ^ 'extends' list cannot be empty. (1:20) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot index d6516a5c585d..311305cc57af 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-id > Babel - Error`] -SyntaxError: 'interface' declarations must be followed by an identifier. (1:10) +BabelError +> 1 | interface {} + | ^ 'interface' declarations must be followed by an identifier. (1:10) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot index 456d9b250c57..22e5cae199c7 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-type-param > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (1:11) +BabelError +> 1 | interface F<> {} + | ^ Type parameter list cannot be empty. (1:11) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Babel-Error.shot index b62fbf292fa0..65b6f8b67aed 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > non-identifier-extends > Babel - Error`] -SyntaxError: Unexpected token (1:20) +BabelError +> 1 | interface F extends 1 {} + | ^ Unexpected token (1:20) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot index 5daa78ba69de..c9df50bbff86 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > non-identifier-name > Babel - Error`] -SyntaxError: 'interface' declarations must be followed by an identifier. (1:10) +BabelError +> 1 | interface 1 {} + | ^ 'interface' declarations must be followed by an identifier. (1:10) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot index 03d74ec17daa..1c7e4398f35a 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > non-identifier-type-param > Babel - Error`] -SyntaxError: Unexpected token (1:12) +BabelError +> 1 | interface F<1> {} + | ^ Unexpected token (1:12) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Babel-Error.shot index 16fe0276b649..9a4e17520361 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > module-invalid-id > Babel - Error`] -SyntaxError: Missing semicolon. (1:6) +BabelError +> 1 | module 1 {} + | ^ Missing semicolon. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Babel-Error.shot index 9a5f13dad8e9..3c09b48c89e4 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > module-missing-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:8) +BabelError +> 1 | module F; + | ^ Unexpected token, expected "{" (1:8) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Babel-Error.shot index 38f3cc629b93..44e80efd9d15 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > namespace-declare-no-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:19) +BabelError +> 1 | declare namespace F; + | ^ Unexpected token, expected "{" (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Babel-Error.shot index 542fe6e7fcf6..77e6d42ec05f 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > namespace-id-literal > Babel - Error`] -SyntaxError: Missing semicolon. (1:9) +BabelError +> 1 | namespace 'a' {} + | ^ Missing semicolon. (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Babel-Error.shot index 699035689429..f570ef75b13d 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > namespace-invalid-id > Babel - Error`] -SyntaxError: Missing semicolon. (1:9) +BabelError +> 1 | namespace 1 {} + | ^ Missing semicolon. (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Babel-Error.shot index 516bca2e2d70..9eaea9131b54 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > namespace-no-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:11) +BabelError +> 1 | namespace F; + | ^ Unexpected token, expected "{" (1:11) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot index 95f461ed4516..af94e2dca261 100644 --- a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSNamespaceExportDeclaration > _error_ > missing-id > Babel - Error`] -SyntaxError: Unexpected token (1:19) +BabelError +> 1 | export as namespace; + | ^ Unexpected token (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot index ce1d4566a724..2604d4552462 100644 --- a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSNamespaceExportDeclaration > _error_ > non-identifier-name > Babel - Error`] -SyntaxError: Unexpected token (1:20) +BabelError +> 1 | export as namespace 1; + | ^ Unexpected token (1:20) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot index 726aeb6d7ce3..bd3effe3de20 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > decorator > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (1:6) +BabelError +> 1 | @decl type Test = {}; + | ^ Leading decorators must be attached to a class declaration. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Babel-Error.shot index 1f660ee4bb9e..0aa1adadcafb 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > missing-type-parameter > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (1:6) +BabelError +> 1 | type T<> = 1; + | ^ Type parameter list cannot be empty. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot index 4cad91910783..fe78642818bf 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > non-identifier-name > Babel - Error`] -SyntaxError: Missing semicolon. (1:4) +BabelError +> 1 | type 1 = 2; + | ^ Missing semicolon. (1:4) + 2 | + diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Babel-Error.shot index f0022623ea80..bcf3c74735a2 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > non-identifier-type-parameter > Babel - Error`] -SyntaxError: Unexpected token (1:7) +BabelError +> 1 | type T<1> = 2; + | ^ Unexpected token (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/snapshots/2-Babel-Error.shot index 63d96fa8f413..c96b185741e0 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-destructure-no-init > Babel - Error`] -SyntaxError: Missing initializer in destructuring declaration. (1:13) +BabelError +> 1 | const { foo }; + | ^ Missing initializer in destructuring declaration. (1:13) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/snapshots/2-Babel-Error.shot index f19c9134851b..f6c5fb6e9694 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-destructure-type-no-init > Babel - Error`] -SyntaxError: Missing initializer in destructuring declaration. (1:18) +BabelError +> 1 | const { foo }: any; + | ^ Missing initializer in destructuring declaration. (1:18) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-no-init/snapshots/2-Babel-Error.shot index fbaf6994db12..0bdc8232084c 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-id-definite-no-init > Babel - Error`] -SyntaxError: Missing initializer in const declaration. (1:10) +BabelError +> 1 | const foo!; + | ^ Missing initializer in const declaration. (1:10) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-type-no-init/snapshots/2-Babel-Error.shot index d6d04284fdb0..3a6191ee1fd1 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-id-definite-type-no-init > Babel - Error`] -SyntaxError: Missing initializer in const declaration. (1:15) +BabelError +> 1 | const foo!: any; + | ^ Missing initializer in const declaration. (1:15) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-no-init/snapshots/2-Babel-Error.shot index 4778736de1c9..b6caba1e3a80 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-id-no-init > Babel - Error`] -SyntaxError: Missing initializer in const declaration. (1:9) +BabelError +> 1 | const foo; + | ^ Missing initializer in const declaration. (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-type-no-init/snapshots/2-Babel-Error.shot index b114ab299fee..eb6f8b5c4c0c 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-id-type-no-init > Babel - Error`] -SyntaxError: Missing initializer in const declaration. (1:14) +BabelError +> 1 | const foo: any; + | ^ Missing initializer in const declaration. (1:14) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-destructure-type-init/snapshots/2-Babel-Error.shot index a4077cb77749..5adb20d1948b 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-destructure-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-destructure-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-const-destructure-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:29) +BabelError +> 1 | declare const { foo }: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:29) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-definite-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-definite-type-init/snapshots/2-Babel-Error.shot index 97938c07e956..714b75ab5786 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-definite-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-definite-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-const-id-definite-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:26) +BabelError +> 1 | declare const foo!: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:26) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-type-init/snapshots/2-Babel-Error.shot index 6527f12080d1..a8c480413692 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-const-id-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:25) +BabelError +> 1 | declare const foo: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:25) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-init/snapshots/2-Babel-Error.shot index c602f4cb545e..61ea7c4c9b4f 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-destructure-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:22) +BabelError +> 1 | declare let { foo } = 1; + | ^ Initializers are not allowed in ambient contexts. (1:22) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-type-init/snapshots/2-Babel-Error.shot index ea40786b38d6..db2c7091e208 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-destructure-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:27) +BabelError +> 1 | declare let { foo }: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:27) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-init/snapshots/2-Babel-Error.shot index 1a4d52e5efb7..7dcf5ae87a8e 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-id-definite-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:19) +BabelError +> 1 | declare let foo! = 1; + | ^ Initializers are not allowed in ambient contexts. (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-type-init/snapshots/2-Babel-Error.shot index 2799404577f1..bb42e1891168 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-id-definite-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:24) +BabelError +> 1 | declare let foo!: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:24) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-init/snapshots/2-Babel-Error.shot index 9d1e1a93cb3c..79d191b1fea9 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-id-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:18) +BabelError +> 1 | declare let foo = 1; + | ^ Initializers are not allowed in ambient contexts. (1:18) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-type-init/snapshots/2-Babel-Error.shot index 7d3b4dbacd1d..89f962475274 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-id-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:23) +BabelError +> 1 | declare let foo: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:23) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-init/snapshots/2-Babel-Error.shot index 512c30b84f78..929b7944477c 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-destructure-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using { foo } = 1; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-no-init/snapshots/2-Babel-Error.shot index 7b5830248706..4997023f0aa4 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-destructure-no-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using { foo }; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-init/snapshots/2-Babel-Error.shot index ef81adfc0b85..c2cecbb8104d 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-destructure-type-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using { foo }: any = 1; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-no-init/snapshots/2-Babel-Error.shot index 2cf637689700..f80c5fc88016 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-destructure-type-no-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using { foo }: any; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot index c95370820204..506605699490 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo! = 1; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot index 69bbfebd9e0d..6da6ff4f9888 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-no-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo!; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot index d109f14d40f9..d347213e6ad4 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-type-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo!: any = 1; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot index d41036eea117..3ece5982f90f 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-type-no-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo!: any; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot index 9ffd885b9fb3..c3883b0d2ef1 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo = 1; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot index 50648d64ba1d..62096b9772ac 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-no-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot index ccdb04651388..553ccd15573b 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-type-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo: any = 1; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot index a605c534f9f6..11158f84f69e 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-type-no-init > Babel - Error`] -SyntaxError: Missing semicolon. (1:7) +BabelError +> 1 | declare using foo: any; + | ^ Missing semicolon. (1:7) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-init/snapshots/2-Babel-Error.shot index b81a030fdae0..6cf7effbdbfb 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-destructure-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:22) +BabelError +> 1 | declare var { foo } = 1; + | ^ Initializers are not allowed in ambient contexts. (1:22) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-type-init/snapshots/2-Babel-Error.shot index c716f5ee6e62..c5883210e4e9 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-destructure-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:27) +BabelError +> 1 | declare var { foo }: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:27) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-init/snapshots/2-Babel-Error.shot index 5599c8a79783..26b7602ac1d5 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-id-definite-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:19) +BabelError +> 1 | declare var foo! = 1; + | ^ Initializers are not allowed in ambient contexts. (1:19) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-type-init/snapshots/2-Babel-Error.shot index 4c73b29511d3..9b0332014fc4 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-id-definite-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:24) +BabelError +> 1 | declare var foo!: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:24) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-init/snapshots/2-Babel-Error.shot index 7c80c93c3a1d..d23db1eb32cf 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-id-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:18) +BabelError +> 1 | declare var foo = 1; + | ^ Initializers are not allowed in ambient contexts. (1:18) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-type-init/snapshots/2-Babel-Error.shot index 0eece7d22e74..c50e75b93a0e 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-id-type-init > Babel - Error`] -SyntaxError: Initializers are not allowed in ambient contexts. (1:23) +BabelError +> 1 | declare var foo: any = 1; + | ^ Initializers are not allowed in ambient contexts. (1:23) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot index ee1c40040dbb..70ea5eb9260e 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > decorator > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (1:6) +BabelError +> 1 | @decl type Test = {}; + | ^ Leading decorators must be attached to a class declaration. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-no-init/snapshots/2-Babel-Error.shot index d3dbedec0c5e..1118f9cce9a0 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > let-destructure-no-init > Babel - Error`] -SyntaxError: Missing initializer in destructuring declaration. (1:11) +BabelError +> 1 | let { foo }; + | ^ Missing initializer in destructuring declaration. (1:11) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-type-no-init/snapshots/2-Babel-Error.shot index 90a0241d8eec..eac75eb96185 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > let-destructure-type-no-init > Babel - Error`] -SyntaxError: Missing initializer in destructuring declaration. (1:16) +BabelError +> 1 | let { foo }: any; + | ^ Missing initializer in destructuring declaration. (1:16) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Babel-Error.shot index 2f8edbf36213..6217ca96ac49 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > missing-id-with-value > Babel - Error`] -SyntaxError: Unexpected token (1:6) +BabelError +> 1 | const = 1; + | ^ Unexpected token (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot index 7be36c3bbd62..d58c5400eebf 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > no-variables > Babel - Error`] -SyntaxError: Unexpected token (1:5) +BabelError +> 1 | const; + | ^ Unexpected token (1:5) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-init/snapshots/2-Babel-Error.shot index 3c5579d38485..a557bde70a73 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-destructure-init > Babel - Error`] -SyntaxError: Using declaration cannot have destructuring patterns. (1:6) +BabelError +> 1 | using { foo } = 1; + | ^ Using declaration cannot have destructuring patterns. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-no-init/snapshots/2-Babel-Error.shot index 9c6a4fd029be..8f9f395f5be7 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-destructure-no-init > Babel - Error`] -SyntaxError: Using declaration cannot have destructuring patterns. (1:6) +BabelError +> 1 | using { foo }; + | ^ Using declaration cannot have destructuring patterns. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-init/snapshots/2-Babel-Error.shot index 11639dfd0961..4bfa641b372d 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-destructure-type-init > Babel - Error`] -SyntaxError: Using declaration cannot have destructuring patterns. (1:6) +BabelError +> 1 | using { foo }: any = 1; + | ^ Using declaration cannot have destructuring patterns. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-no-init/snapshots/2-Babel-Error.shot index 2843f96cd215..5172befcf8ec 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-destructure-type-no-init > Babel - Error`] -SyntaxError: Using declaration cannot have destructuring patterns. (1:6) +BabelError +> 1 | using { foo }: any; + | ^ Using declaration cannot have destructuring patterns. (1:6) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-no-init/snapshots/2-Babel-Error.shot index 8d285d2c268d..65f7136c6dd4 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-id-definite-no-init > Babel - Error`] -SyntaxError: Missing initializer in using declaration. (1:10) +BabelError +> 1 | using foo!; + | ^ Missing initializer in using declaration. (1:10) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-type-no-init/snapshots/2-Babel-Error.shot index e9809e204145..4abda6a53640 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-id-definite-type-no-init > Babel - Error`] -SyntaxError: Missing initializer in using declaration. (1:15) +BabelError +> 1 | using foo!: any; + | ^ Missing initializer in using declaration. (1:15) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-no-init/snapshots/2-Babel-Error.shot index 25a73d34c442..491e41264099 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-id-no-init > Babel - Error`] -SyntaxError: Missing initializer in using declaration. (1:9) +BabelError +> 1 | using foo; + | ^ Missing initializer in using declaration. (1:9) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-type-no-init/snapshots/2-Babel-Error.shot index 269b21209e25..07af234b3468 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-id-type-no-init > Babel - Error`] -SyntaxError: Missing initializer in using declaration. (1:14) +BabelError +> 1 | using foo: any; + | ^ Missing initializer in using declaration. (1:14) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-no-init/snapshots/2-Babel-Error.shot index e8b80abcf677..00f7eed3ebd2 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > var-destructure-no-init > Babel - Error`] -SyntaxError: Missing initializer in destructuring declaration. (1:11) +BabelError +> 1 | var { foo }; + | ^ Missing initializer in destructuring declaration. (1:11) + 2 | + diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-type-no-init/snapshots/2-Babel-Error.shot index 28b00d00ddee..9b74a4b499ec 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-type-no-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > var-destructure-type-no-init > Babel - Error`] -SyntaxError: Missing initializer in destructuring declaration. (1:16) +BabelError +> 1 | var { foo }: any; + | ^ Missing initializer in destructuring declaration. (1:16) + 2 | + diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot index af9f804ebc24..b099dd074fa8 100644 --- a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > element > AccessorProperty > _error_ > modifier-abstract-property-with-value > Babel - Error`] -SyntaxError: Property 'property' cannot have an initializer because it is marked abstract. (2:20) +BabelError + 1 | abstract class Foo { +> 2 | abstract property = 1; + | ^ Property 'property' cannot have an initializer because it is marked abstract. (2:20) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot index 9efd284b0d93..848b03e5c5b9 100644 --- a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > element > AccessorProperty > _error_ > modifier-override-with-no-extends > Babel - Error`] -SyntaxError: This member cannot have an 'override' modifier because its containing class does not extend another class. (2:2) +BabelError + 1 | class Foo { +> 2 | override accessor foo = 2; + | ^ This member cannot have an 'override' modifier because its containing class does not extend another class. (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot index e191f9064a5c..6d6ec2a3e287 100644 --- a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > element > MethodDefinition > _error_ > duplicated-accessibility-modifiers > Babel - Error`] -SyntaxError: Accessibility modifier already seen. (2:9) +BabelError + 1 | class Foo { +> 2 | public public bar() {}; + | ^ Accessibility modifier already seen. (2:9) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot index a29fa5ab09a0..05ef660a6ae1 100644 --- a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > element > MethodDefinition > _error_ > mixed-accessibility-modifiers > Babel - Error`] -SyntaxError: Accessibility modifier already seen. (2:9) +BabelError + 1 | class Foo { +> 2 | public protected bar() {}; + | ^ Accessibility modifier already seen. (2:9) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot index 8493e50d46c6..7da522cb7532 100644 --- a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > element > PropertyDefinition > _error_ > duplicated-accessibility-modifiers > Babel - Error`] -SyntaxError: Accessibility modifier already seen. (2:9) +BabelError + 1 | class Foo { +> 2 | public public bar; + | ^ Accessibility modifier already seen. (2:9) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot index 2ad65ba9c9fd..3498ed99592a 100644 --- a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > element > PropertyDefinition > _error_ > mixed-accessibility-modifiers > Babel - Error`] -SyntaxError: Accessibility modifier already seen. (2:9) +BabelError + 1 | class Foo { +> 2 | public protected bar; + | ^ Accessibility modifier already seen. (2:9) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot index e172a1d225d5..0cf17825f8a7 100644 --- a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > ImportExpression > _error_ > extra-arguments > Babel - Error`] -SyntaxError: `import()` requires exactly one or two arguments. (1:0) +BabelError +> 1 | import( + | ^ `import()` requires exactly one or two arguments. (1:0) + 2 | "./source.json", + 3 | {assert: {type: "json"}}, + 4 | extraArgument + diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot index 6fb52dd6f0b0..24bd7006421a 100644 --- a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > ImportExpression > _error_ > no-arguments > Babel - Error`] -SyntaxError: `import()` requires exactly one or two arguments. (1:0) +BabelError +> 1 | import(); + | ^ `import()` requires exactly one or two arguments. (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot index 75be7695d3c1..f008887400ca 100644 --- a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > ObjectExpression > _error_ > missing-getter-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:11) +BabelError +> 1 | ({get foo();}) + | ^ Unexpected token, expected "{" (1:11) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot index 63c0979436ab..f88ac257cfaf 100644 --- a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > ObjectExpression > _error_ > missing-method-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:10) +BabelError +> 1 | ({method();}) + | ^ Unexpected token, expected "{" (1:10) + 2 | + diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot index 2f6b7b23b6b4..1414079b7aed 100644 --- a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > ObjectExpression > _error_ > missing-setter-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (1:16) +BabelError +> 1 | ({set foo(value);}) + | ^ Unexpected token, expected "{" (1:16) + 2 | + diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/call-expr/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/call-expr/snapshots/2-Babel-Error.shot index f254c274c881..11c9fa5deba0 100644 --- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/call-expr/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/call-expr/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > UpdateExpression > _error_ > call-expr > Babel - Error`] -SyntaxError: Invalid left-hand side in postfix operation. (1:0) +BabelError +> 1 | a()++; + | ^ Invalid left-hand side in postfix operation. (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/literal/snapshots/2-Babel-Error.shot index 67b54975f662..c2766f769ac6 100644 --- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/literal/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > UpdateExpression > _error_ > literal > Babel - Error`] -SyntaxError: Invalid left-hand side in postfix operation. (1:0) +BabelError +> 1 | 1++; + | ^ Invalid left-hand side in postfix operation. (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain/snapshots/2-Babel-Error.shot index 91473dbcc636..7a3e4de5faf0 100644 --- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > UpdateExpression > _error_ > optional-chain > Babel - Error`] -SyntaxError: This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0) +BabelError +> 1 | x?.y++; + | ^ This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain2/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain2/snapshots/2-Babel-Error.shot index 0ddfe456abaa..9dd7dbc9fb81 100644 --- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain2/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain2/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > UpdateExpression > _error_ > optional-chain2 > Babel - Error`] -SyntaxError: This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0) +BabelError +> 1 | x?.y.z++; + | ^ This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain3/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain3/snapshots/2-Babel-Error.shot index 3c478bc81318..25bcdc744cb3 100644 --- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain3/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain3/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > UpdateExpression > _error_ > optional-chain3 > Babel - Error`] -SyntaxError: This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0) +BabelError +> 1 | x?.y().z++; + | ^ This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/paren-expr/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/paren-expr/snapshots/2-Babel-Error.shot index 96d9daba8b0b..c99074e87e83 100644 --- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/paren-expr/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/paren-expr/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > expression > UpdateExpression > _error_ > paren-expr > Babel - Error`] -SyntaxError: Invalid left-hand side in postfix operation. (1:1) +BabelError +> 1 | (a())++; + | ^ Invalid left-hand side in postfix operation. (1:1) + 2 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Babel-Error.shot index 802164c43fb8..c3064f2c191b 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > abstract-class-with-abstract-static-constructor > Babel - Error`] -SyntaxError: 'static' modifier cannot be used with 'abstract' modifier. (4:11) +BabelError + 2 | + 3 | export abstract class AbstractSocket { +> 4 | abstract static constructor(); + | ^ 'static' modifier cannot be used with 'abstract' modifier. (4:11) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Babel-Error.shot index 0b00b4cdf6c5..aa73011ad650 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > abstract-class-with-override-property > Babel - Error`] -SyntaxError: Property 'foo' cannot have an initializer because it is marked abstract. (4:24) +BabelError + 2 | + 3 | abstract class SpecializedComponent extends SomeComponent { +> 4 | abstract override foo = 1; + | ^ Property 'foo' cannot have an initializer because it is marked abstract. (4:24) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Babel-Error.shot index 4bb592375d4a..1af0e07eb087 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > abstract-interface > Babel - Error`] -SyntaxError: 'abstract' modifier can only appear on a class, method, or property declaration. (3:7) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | export abstract interface I { + | ^ 'abstract' modifier can only appear on a class, method, or property declaration. (3:7) + 4 | } + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Babel-Error.shot index 06bf7d76b398..c36fee2891bf 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > await-without-async-function > Babel - Error`] -SyntaxError: Unexpected reserved word 'await'. (4:14) +BabelError + 2 | + 3 | function foo() { +> 4 | const bar = await baz(); + | ^ Unexpected reserved word 'await'. (4:14) + 5 | return bar.qux; + 6 | } + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Babel-Error.shot index f33c24ea95a7..b4121cb4ae51 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-private-identifier-field-with-accessibility-error > Babel - Error`] -SyntaxError: Private elements cannot have an accessibility modifier ('private'). (4:2) +BabelError + 2 | + 3 | class Foo { +> 4 | private #priv1: string + | ^ Private elements cannot have an accessibility modifier ('private'). (4:2) + 5 | public #priv2: string + 6 | static #priv3: string + 7 | } + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Babel-Error.shot index db76a5bf8aa9..69f1445d8735 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-constructor-and-type-parameters > Babel - Error`] -SyntaxError: Type parameters cannot appear on a constructor declaration. (4:13) +BabelError + 2 | + 3 | class C { +> 4 | constructor() { } + | ^ Type parameters cannot appear on a constructor declaration. (4:13) + 5 | + 6 | ['constructor']() { } + 7 | } + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Babel-Error.shot index 4f49707b5721..448313d2ceb8 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-export-parameter-properties > Babel - Error`] -SyntaxError: Unexpected keyword 'export'. (4:16) +BabelError + 2 | + 3 | class Foo { +> 4 | constructor(export a: string) { + | ^ Unexpected keyword 'export'. (4:16) + 5 | + 6 | } + 7 | } + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Babel-Error.shot index f3b7c8370e86..6eecefc158d1 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-implements-and-extends > Babel - Error`] -SyntaxError: Unexpected token, expected "," (3:57) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | class ClassWithParentAndInterface implements MyInterface extends MyOtherClass {} + | ^ Unexpected token, expected "," (3:57) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Babel-Error.shot index 93ba259b14c2..222ba46172fc 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-static-parameter-properties > Babel - Error`] -SyntaxError: Unexpected reserved word 'static'. (4:16) +BabelError + 2 | + 3 | class Foo { +> 4 | constructor(static a: string) { + | ^ Unexpected reserved word 'static'. (4:16) + 5 | + 6 | } + 7 | } + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Babel-Error.shot index e27b8241af48..c2de560d7935 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-two-methods-computed-constructor > Babel - Error`] -SyntaxError: Type parameters cannot appear on a constructor declaration. (4:15) +BabelError + 2 | + 3 | class A { +> 4 | "constructor"(): number { + | ^ Type parameters cannot appear on a constructor declaration. (4:15) + 5 | } + 6 | + 7 | ["constructor"](): number { + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Babel-Error.shot index d36815d31301..8627909786fd 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > const-assertions > Babel - Error`] -SyntaxError: Identifier 'x' has already been declared. (13:4) +BabelError + 11 | + 12 | // Type '10' +> 13 | let x = 10; + | ^ Identifier 'x' has already been declared. (13:4) + 14 | + 15 | // Type 'readonly [10, 20]' + 16 | let y = [10, 20]; + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Babel-Error.shot index e3ebeee984c1..2810528b926b 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-number > Babel - Error`] -SyntaxError: Unexpected token (4:4) +BabelError + 2 | + 3 | export enum Foo { +> 4 | [1], + | ^ Unexpected token (4:4) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Babel-Error.shot index 30b625fd5ba4..d296e5c547da 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-string > Babel - Error`] -SyntaxError: Unexpected token (4:4) +BabelError + 2 | + 3 | export enum Foo { +> 4 | ['baz'], + | ^ Unexpected token (4:4) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Babel-Error.shot index 2612787d1b85..f34477b53b70 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-var-ref > Babel - Error`] -SyntaxError: Unexpected token (4:4) +BabelError + 2 | + 3 | export enum Foo { +> 4 | [x], + | ^ Unexpected token (4:4) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Babel-Error.shot index 580ccafe0581..55ec89897af8 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-with-import-assertions > Babel - Error`] -SyntaxError: A JSON module can only be imported with `default`. (3:9) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | export { foo } from "mod" assert { type: "json" }; + | ^ A JSON module can only be imported with `default`. (3:9) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Babel-Error.shot index fbb578bcabad..3745c520879d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > import-type-error > Babel - Error`] -SyntaxError: A type-only import can specify a default import or named bindings, but not both. (3:0) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | import type foo, { bar } from 'bar'; + | ^ A type-only import can specify a default import or named bindings, but not both. (3:0) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Babel-Error.shot index 98c91ef49faf..227ecfb29f8c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > interface-with-construct-signature-with-parameter-accessibility > Babel - Error`] -SyntaxError: A parameter property is only allowed in a constructor implementation. (4:9) +BabelError + 2 | + 3 | interface Test { +> 4 | new (public x, private y); + | ^ A parameter property is only allowed in a constructor implementation. (4:9) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Babel-Error.shot index 35034cb9ecdf..fa95c78a4f0c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > new-target-in-arrow-function-body > Babel - Error`] -SyntaxError: `new.target` can only be used in functions or class properties. (3:16) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | const b = () => new.target; + | ^ `new.target` can only be used in functions or class properties. (3:16) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Babel-Error.shot index 084bd81246e1..5b148e27fcc7 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > var-with-definite-assignment > Babel - Error`] -SyntaxError: Missing initializer in const declaration. (3:16) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | const x!: string; + | ^ Missing initializer in const declaration. (3:16) + 4 | var y!: number; + 5 | let z!: object; + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Babel-Error.shot index a7759221c36d..c2a01fb21025 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > class-empty-extends-implements > Babel - Error`] -SyntaxError: Unexpected reserved word 'implements'. (3:18) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | class Foo extends implements Bar { + | ^ Unexpected reserved word 'implements'. (3:18) + 4 | + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Babel-Error.shot index 4ec40f4b3b0e..d66d7ee5ec1a 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > class-empty-extends > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (6:0) +BabelError + 4 | + 5 | } +> 6 | + | ^ Unexpected token, expected "{" (6:0) + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Babel-Error.shot index 8e3eea6c1131..d9a512c232d2 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > class-extends-empty-implements > Babel - Error`] -SyntaxError: 'implements' list cannot be empty. (3:33) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | class Foo extends Bar implements { + | ^ 'implements' list cannot be empty. (3:33) + 4 | + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Babel-Error.shot index 9bc9aef71f23..b3835b41371c 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > class-multiple-implements > Babel - Error`] -SyntaxError: Unexpected token, expected "," (3:21) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | class a implements b implements c {} + | ^ Unexpected token, expected "," (3:21) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Babel-Error.shot index 78f8c4703d14..49920535e977 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > decorator-on-enum-declaration > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (3:5) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | @dec enum E {} + | ^ Leading decorators must be attached to a class declaration. (3:5) + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Babel-Error.shot index 0e2ce63ec8c7..c21fbbfa8050 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > decorator-on-function > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (4:0) +BabelError + 2 | + 3 | @dec +> 4 | function b(){} + | ^ Leading decorators must be attached to a class declaration. (4:0) + 5 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Babel-Error.shot index 6c236792b4cf..cd433bb6eff6 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > decorator-on-interface-declaration > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (4:0) +BabelError + 2 | + 3 | @deco() +> 4 | interface M {} + | ^ Leading decorators must be attached to a class declaration. (4:0) + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Babel-Error.shot index de18083b45ff..2de8a9c2e651 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > decorator-on-variable > Babel - Error`] -SyntaxError: Leading decorators must be attached to a class declaration. (4:0) +BabelError + 2 | + 3 | @deco() +> 4 | const a = 1 + | ^ Leading decorators must be attached to a class declaration. (4:0) + 5 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Babel-Error.shot index f59176307e6a..91534ecc195a 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-call-expression > Babel - Error`] -SyntaxError: Unexpected token (3:4) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | foo<>(); + | ^ Unexpected token (3:4) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Babel-Error.shot index 93efdda3f71f..14594e627a49 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-new-expression > Babel - Error`] -SyntaxError: Unexpected token (3:8) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | new Foo<>() + | ^ Unexpected token (3:8) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Babel-Error.shot index ada9518aae7f..50d06d9aa9bd 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments > Babel - Error`] -SyntaxError: Type argument list cannot be empty. (3:14) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | const foo: Foo<> + | ^ Type argument list cannot be empty. (3:14) + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot index bea6f602ef56..bc141a4b2018 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-arrow-function > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (3:11) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | function f1<>() {} + | ^ Type parameter list cannot be empty. (3:11) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Babel-Error.shot index 690ef1aa63bb..16a2f804505e 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-constructor > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (4:13) +BabelError + 2 | + 3 | class foo { +> 4 | constructor<>() {} + | ^ Type parameter list cannot be empty. (4:13) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot index 8865ff0be4c9..0338cc8a0dd9 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-expression > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (3:20) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | const foo = function<>() {} + | ^ Type parameter list cannot be empty. (3:20) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Babel-Error.shot index 78845bb622fc..e64d189f57d3 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-method-signature > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (4:6) +BabelError + 2 | + 3 | interface foo { +> 4 | test<>(); + | ^ Type parameter list cannot be empty. (4:6) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Babel-Error.shot index 8edfff6a61ee..3094f70c4dea 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-method > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (4:6) +BabelError + 2 | + 3 | class foo { +> 4 | test<>() {} + | ^ Type parameter list cannot be empty. (4:6) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot index 18c13853083c..8a54317d1574 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters > Babel - Error`] -SyntaxError: Type parameter list cannot be empty. (3:11) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | function f1<>() {} + | ^ Type parameter list cannot be empty. (3:11) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Babel-Error.shot index 4a5bede8b8ba..8fc83f6a5be4 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > enum-with-keywords > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (3:7) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | export private public protected static readonly abstract async enum X {} + | ^ Unexpected token, expected "{" (3:7) + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Babel-Error.shot index 2cc0c09a7eaf..554c009cecd0 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > index-signature-parameters > Babel - Error`] -SyntaxError: Unexpected token, expected "]" (4:12) +BabelError + 2 | + 3 | type foo = { +> 4 | [a: string, b: string]: string; + | ^ Unexpected token, expected "]" (4:12) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Babel-Error.shot index c8fd8337e295..0c7e138c8054 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-empty-extends > Babel - Error`] -SyntaxError: 'extends' list cannot be empty. (3:22) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | interface Foo extends { + | ^ 'extends' list cannot be empty. (3:22) + 4 | + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Babel-Error.shot index 363365dcf16d..c422799a230e 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-implements > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (3:12) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | interface d implements e {} + | ^ Unexpected token, expected "{" (3:12) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Babel-Error.shot index 68489300cc2e..08b5aa8c4257 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-export > Babel - Error`] -SyntaxError: Unexpected token, expected ";" (4:9) +BabelError + 2 | + 3 | interface Foo { +> 4 | export [baz: string]: string; + | ^ Unexpected token, expected ";" (4:9) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Babel-Error.shot index 1647b535967c..86a7acc9b701 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-private > Babel - Error`] -SyntaxError: 'private' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | private [baz: string]: string; + | ^ 'private' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Babel-Error.shot index 2950f6174dcf..aa422f5e065f 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-protected > Babel - Error`] -SyntaxError: 'protected' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | protected [baz: string]: string; + | ^ 'protected' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Babel-Error.shot index 1d027ab3288d..7a6f073d84c1 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-public > Babel - Error`] -SyntaxError: 'public' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | public [baz: string]: string; + | ^ 'public' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Babel-Error.shot index d29363a7d59a..12fd7616e919 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-static > Babel - Error`] -SyntaxError: 'static' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | static [baz: string]: string; + | ^ 'static' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Babel-Error.shot index a0bf025bfd18..fa5282c6d766 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-export > Babel - Error`] -SyntaxError: Unexpected token, expected ";" (4:11) +BabelError + 2 | + 3 | interface Foo { +> 4 | export g(bar: string): void; + | ^ Unexpected token, expected ";" (4:11) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Babel-Error.shot index 4f4403185561..d5dbbcdfca6d 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-private > Babel - Error`] -SyntaxError: 'private' modifier cannot appear on a type member. (4:4) +BabelError + 2 | + 3 | interface Foo { +> 4 | private g(bar: string): void; + | ^ 'private' modifier cannot appear on a type member. (4:4) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Babel-Error.shot index 7c6aea8cbc42..567f70c03ab5 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-protected > Babel - Error`] -SyntaxError: 'protected' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | protected g(bar: string): void; + | ^ 'protected' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Babel-Error.shot index 67adc051ce12..9d0c9ab867f4 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-public > Babel - Error`] -SyntaxError: 'public' modifier cannot appear on a type member. (4:4) +BabelError + 2 | + 3 | interface Foo { +> 4 | public g(bar: string): void; + | ^ 'public' modifier cannot appear on a type member. (4:4) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Babel-Error.shot index e1d86c915bec..c6663365d284 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-readonly > Babel - Error`] -SyntaxError: 'readonly' modifier can only appear on a property declaration or index signature. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | readonly g(bar: string): void; + | ^ 'readonly' modifier can only appear on a property declaration or index signature. (4:2) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Babel-Error.shot index 9c86c96dcf2c..f3ef64ea4040 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-static > Babel - Error`] -SyntaxError: 'static' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | static g(bar: string): void; + | ^ 'static' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Babel-Error.shot index 5ce932646399..d2a84ab002b5 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-multiple-extends > Babel - Error`] -SyntaxError: Unexpected token, expected "," (3:26) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | interface foo extends bar extends baz {} + | ^ Unexpected token, expected "," (3:26) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Babel-Error.shot index 91b39c29c98a..6518ef2afcf9 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-export > Babel - Error`] -SyntaxError: Unexpected token, expected ";" (4:9) +BabelError + 2 | + 3 | interface Foo { +> 4 | export a: string; + | ^ Unexpected token, expected ";" (4:9) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Babel-Error.shot index 2f122b91e44a..504c0e300be5 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-private > Babel - Error`] -SyntaxError: 'private' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | private b: string; + | ^ 'private' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Babel-Error.shot index 3f79550c6121..09ee6837fbc8 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-protected > Babel - Error`] -SyntaxError: 'protected' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | protected a: string; + | ^ 'protected' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Babel-Error.shot index 57ead1416304..29882083cc96 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-public > Babel - Error`] -SyntaxError: 'public' modifier cannot appear on a type member. (4:4) +BabelError + 2 | + 3 | interface Foo { +> 4 | public a: string; + | ^ 'public' modifier cannot appear on a type member. (4:4) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Babel-Error.shot index b2a5dab697a4..cf0246ca09ed 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-static > Babel - Error`] -SyntaxError: 'static' modifier cannot appear on a type member. (4:2) +BabelError + 2 | + 3 | interface Foo { +> 4 | static a: string; + | ^ 'static' modifier cannot appear on a type member. (4:2) + 5 | } + 6 | + 7 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Babel-Error.shot index 5fa027e9cf4e..c05e5ad7cfa0 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-with-default-value > Babel - Error`] -SyntaxError: Unexpected token, expected ";" (4:14) +BabelError + 2 | + 3 | interface Foo { +> 4 | bar: string = 'a'; + | ^ Unexpected token, expected ";" (4:14) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Babel-Error.shot index ae893daf528c..ecc6c39a7e58 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-with-no-body > Babel - Error`] -SyntaxError: Unexpected token, expected "{" (4:0) +BabelError + 2 | + 3 | interface Foo +> 4 | + | ^ Unexpected token, expected "{" (4:0) + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Babel-Error.shot index 38311897df43..532294b0ddfa 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-with-optional-index-signature > Babel - Error`] -SyntaxError: Unexpected token (4:7) +BabelError + 2 | + 3 | interface Foo { +> 4 | [fff?: number]: string; + | ^ Unexpected token (4:7) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Babel-Error.shot index e15c3c0564bd..00507051d9c1 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > object-assertion-not-allowed > Babel - Error`] -SyntaxError: Unexpected token, expected "," (3:3) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | ({a!} = {}) + | ^ Unexpected token, expected "," (3:3) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Babel-Error.shot index 4008e062d595..e1f5b59abe76 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > object-optional-not-allowed > Babel - Error`] -SyntaxError: Unexpected token, expected "," (3:3) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | ({a?} = {}) + | ^ Unexpected token, expected "," (3:3) + 4 | + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Babel-Error.shot index 84f2232f20d1..f02a6ac4f0b2 100644 --- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Babel-Error.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > solo-const > Babel - Error`] -SyntaxError: Unexpected token (3:5) +BabelError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | const + | ^ Unexpected token (3:5) + diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Babel-Error.shot index 77fa78f82897..a1b2396cef0c 100644 --- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Babel-Error.shot @@ -1,4 +1,12 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > expressions > _error_ > instantiation-expression > Babel - Error`] -SyntaxError: Unexpected token (5:7) +BabelError + 3 | a; + 4 | +> 5 | a; + | ^ Unexpected token (5:7) + 6 | a(); + 7 | a?.(); + 8 | a?.b(); + diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Babel-Error.shot index b4627fafc300..99340a2f665a 100644 --- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > parameter-decorators > _error_ > parameter-array-pattern-decorator > Babel - Error`] -SyntaxError: Unexpected token (4:28) +BabelError + 2 | + 3 | class Foo { +> 4 | bar(@special(true) [ bar ]: any) {} + | ^ Unexpected token (4:28) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Babel-Error.shot index 6d7c60703ac4..646af8ded572 100644 --- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > parameter-decorators > _error_ > parameter-rest-element-decorator > Babel - Error`] -SyntaxError: Unexpected token (4:21) +BabelError + 2 | + 3 | class Foo { +> 4 | bar(@special(true) ...foo: any) {} + | ^ Unexpected token (4:21) + 5 | } + 6 | + diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot index 746f2d00e0bb..330f905389c4 100644 --- a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > parameter > TSParameterProperty > _error_ > override-function-parameter > Babel - Error`] -SyntaxError: A parameter property is only allowed in a constructor implementation. (1:13) +BabelError +> 1 | function foo(override parameter) {} + | ^ A parameter property is only allowed in a constructor implementation. (1:13) + 2 | + diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot index c01c6423d57f..56ac32bf65b0 100644 --- a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > parameter > TSParameterProperty > _error_ > override-method-parameter > Babel - Error`] -SyntaxError: A parameter property is only allowed in a constructor implementation. (2:9) +BabelError + 1 | class Foo { +> 2 | method(override parameter) {} + | ^ A parameter property is only allowed in a constructor implementation. (2:9) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/special/CatchClause/fixtures/_error_/with-initializer/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/special/CatchClause/fixtures/_error_/with-initializer/snapshots/2-Babel-Error.shot index 45304cec97a8..49ba046f48b7 100644 --- a/packages/ast-spec/src/special/CatchClause/fixtures/_error_/with-initializer/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/special/CatchClause/fixtures/_error_/with-initializer/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > special > CatchClause > _error_ > with-initializer > Babel - Error`] -SyntaxError: Unexpected token, expected ")" (3:9) +BabelError + 1 | try { + 2 | } +> 3 | catch (e = 1) { + | ^ Unexpected token, expected ")" (3:9) + 4 | } + 5 | + diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot index 14ba1326d51f..8066f19648c0 100644 --- a/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot @@ -1,5 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > special > ExportSpecifier > _error_ > literal-specifier > Babel - Error`] -SyntaxError: A string literal cannot be used as an exported binding without `from`. +BabelError +> 1 | export { 'A' as A }; + | ^ A string literal cannot be used as an exported binding without `from`. - Did you mean `export { 'A' as 'A' } from 'some-module'`? (1:9) + 2 | + diff --git a/packages/ast-spec/src/statement/ForInStatement/fixtures/_error_/using-initializer/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ForInStatement/fixtures/_error_/using-initializer/snapshots/2-Babel-Error.shot index de1d87cc292d..155a5df05e1c 100644 --- a/packages/ast-spec/src/statement/ForInStatement/fixtures/_error_/using-initializer/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/statement/ForInStatement/fixtures/_error_/using-initializer/snapshots/2-Babel-Error.shot @@ -1,4 +1,7 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > statement > ForInStatement > _error_ > using-initializer > Babel - Error`] -SyntaxError: For-in loop may not start with 'using' declaration. (1:4) +BabelError +> 1 | for(using foo in {}); + | ^ For-in loop may not start with 'using' declaration. (1:4) + diff --git a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-init/snapshots/2-Babel-Error.shot index 7cee4dc26990..f9f88b371b57 100644 --- a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-init/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > statement > ForOfStatement > _error_ > decl-init > Babel - Error`] -SyntaxError: 'for-of' loop variable declaration may not have an initializer. (1:5) +BabelError +> 1 | for (const x = 1 of []) {} + | ^ 'for-of' loop variable declaration may not have an initializer. (1:5) + 2 | + diff --git a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-multi/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-multi/snapshots/2-Babel-Error.shot index 415f6f6fc038..fff804c7ba6b 100644 --- a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-multi/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-multi/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > statement > ForOfStatement > _error_ > decl-multi > Babel - Error`] -SyntaxError: Missing initializer in const declaration. (1:12) +BabelError +> 1 | for (const x, y of []) {} + | ^ Missing initializer in const declaration. (1:12) + 2 | + diff --git a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/expr-not-assignment-target/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/expr-not-assignment-target/snapshots/2-Babel-Error.shot index fab92480a170..3cd37f4376f4 100644 --- a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/expr-not-assignment-target/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/expr-not-assignment-target/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > statement > ForOfStatement > _error_ > expr-not-assignment-target > Babel - Error`] -SyntaxError: Invalid left-hand side in for-of statement. (1:5) +BabelError +> 1 | for (1 of []) {} + | ^ Invalid left-hand side in for-of statement. (1:5) + 2 | + diff --git a/packages/ast-spec/src/statement/SwitchStatement/fixtures/_error_/multiple-default-cases/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/SwitchStatement/fixtures/_error_/multiple-default-cases/snapshots/2-Babel-Error.shot index 2c9a2de70deb..b96cae72438d 100644 --- a/packages/ast-spec/src/statement/SwitchStatement/fixtures/_error_/multiple-default-cases/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/statement/SwitchStatement/fixtures/_error_/multiple-default-cases/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > statement > SwitchStatement > _error_ > multiple-default-cases > Babel - Error`] -SyntaxError: Multiple default clauses. (2:10) +BabelError + 1 | switch (true) { +> 2 | default: default: + | ^ Multiple default clauses. (2:10) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot index 7ae654c72d7a..164119608484 100644 --- a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > statement > ThrowStatement > _error_ > missing-argument > Babel - Error`] -SyntaxError: Illegal newline after throw. (2:9) +BabelError + 1 | { +> 2 | throw + | ^ Illegal newline after throw. (2:9) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/snapshots/2-Babel-Error.shot index ff33d238cf32..dd4ad391b99f 100644 --- a/packages/ast-spec/src/type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/snapshots/2-Babel-Error.shot @@ -1,4 +1,8 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > type > TSImportType > _error_ > type-import-type-with-import-attributes-assert > Babel - Error`] -SyntaxError: Unexpected token, expected "with" (1:23) +BabelError +> 1 | type A = import("A", { assert: { type: "json" } }); + | ^ Unexpected token, expected "with" (1:23) + 2 | + diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-after/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-after/snapshots/2-Babel-Error.shot index 9f5f417fcabd..0d9adec2645d 100644 --- a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-after/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-after/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > type > TSMappedType > _error_ > with-member-after > Babel - Error`] -SyntaxError: Unexpected token, expected "}" (3:2) +BabelError + 1 | type Mapped = { + 2 | [key in keyof O]: number; +> 3 | member: member; + | ^ Unexpected token, expected "}" (3:2) + 4 | }; + 5 | + diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-before/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-before/snapshots/2-Babel-Error.shot index c1f120be3d57..5b1a1229034e 100644 --- a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-before/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-before/snapshots/2-Babel-Error.shot @@ -1,4 +1,11 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > type > TSMappedType > _error_ > with-member-before > Babel - Error`] -SyntaxError: Unexpected token, expected "]" (3:16) +BabelError + 1 | type Mapped = { + 2 | member: member; +> 3 | [key in keyof O]: number; + | ^ Unexpected token, expected "]" (3:16) + 4 | }; + 5 | + diff --git a/packages/ast-spec/tests/fixtures.test.ts b/packages/ast-spec/tests/fixtures.test.ts index 0660b3df3a7c..16534e6f0c1e 100644 --- a/packages/ast-spec/tests/fixtures.test.ts +++ b/packages/ast-spec/tests/fixtures.test.ts @@ -231,7 +231,7 @@ describe('AST Fixtures', async () => { await expect( [ `${vitestSnapshotHeader}\n\nexports[\`${expect.getState().currentTestName}\`]`, - babelParsed.error, + serializeError(babelParsed.error, contents), '', ].join('\n'), ).toMatchFileSnapshot(snapshotFiles.error.babel(2)); diff --git a/packages/ast-spec/tests/util/serialize-error.ts b/packages/ast-spec/tests/util/serialize-error.ts index 8a54fe232230..26f296a2b8c3 100644 --- a/packages/ast-spec/tests/util/serialize-error.ts +++ b/packages/ast-spec/tests/util/serialize-error.ts @@ -1,12 +1,9 @@ +import type { ParseError as BabelParseError } from '@babel/parser'; import { codeFrameColumns } from '@babel/code-frame'; import { TSError } from './parsers/typescript-estree-import'; -export function serializeError(error: unknown, contents: string): unknown { - if (!(error instanceof TSError)) { - return error; - } - +function serializeTSError(error: TSError, contents: string): string { const { location: { end, start }, message, @@ -23,3 +20,38 @@ ${codeFrameColumns( { highlightCode: false, message }, )}`; } + +type BabelError = SyntaxError & + BabelParseError & { loc: { column: number; line: number } }; + +const isBabelError = (error: unknown): error is BabelError => + error instanceof SyntaxError && + 'code' in error && + 'reasonCode' in error && + 'loc' in error; + +function serializeBabelError(error: BabelError, contents: string): string { + const { loc, message } = error; + + return `BabelError +${codeFrameColumns( + contents, + { + start: { column: loc.column + 1, line: loc.line }, + }, + { highlightCode: false, message }, +)} + `; +} + +export function serializeError(error: unknown, contents: string): unknown { + if (error instanceof TSError) { + return serializeTSError(error, contents); + } + + if (isBabelError(error)) { + return serializeBabelError(error, contents); + } + + return error; +} diff --git a/yarn.lock b/yarn.lock index d9e67a848c5e..723bbab5c3ba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -547,7 +547,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": version: 7.27.2 resolution: "@babel/parser@npm:7.27.2" dependencies: @@ -5392,6 +5392,7 @@ __metadata: "@babel/code-frame": ^7.24.2 "@babel/core": ^7.24.4 "@babel/eslint-parser": ^7.24.1 + "@babel/parser": ^7.24.1 "@microsoft/api-extractor": ^7.47.11 "@types/babel__code-frame": ^7.0.6 "@types/babel__core": ^7.20.5 From 8208974140a1e658e5234435836476642e9a56e1 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Mon, 9 Jun 2025 14:18:31 +0300 Subject: [PATCH 032/283] docs: rename "directive comments" to "comment directives" (#11268) * Update ban-ts-comment.mdx * rename more --- packages/eslint-plugin/docs/rules/ban-ts-comment.mdx | 6 +++--- packages/eslint-plugin/src/util/astUtils.ts | 4 ++-- .../scope-manager/src/variable/ESLintScopeVariable.ts | 8 ++++---- packages/utils/src/ts-eslint/Config.ts | 2 +- packages/utils/src/ts-eslint/eslint/ESLintShared.ts | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/ban-ts-comment.mdx b/packages/eslint-plugin/docs/rules/ban-ts-comment.mdx index e2338747b707..0f162f5ee57f 100644 --- a/packages/eslint-plugin/docs/rules/ban-ts-comment.mdx +++ b/packages/eslint-plugin/docs/rules/ban-ts-comment.mdx @@ -9,11 +9,11 @@ import TabItem from '@theme/TabItem'; > > See **https://typescript-eslint.io/rules/ban-ts-comment** for documentation. -TypeScript provides several directive comments that can be used to alter how it processes files. +TypeScript provides several comment directives that can be used to alter how it processes files. Using these to suppress TypeScript compiler errors reduces the effectiveness of TypeScript overall. Instead, it's generally better to correct the types of code, to make directives unnecessary. -The directive comments supported by TypeScript are: +The comment directives supported by TypeScript are: ```ts // @ts-expect-error @@ -22,7 +22,7 @@ The directive comments supported by TypeScript are: // @ts-check ``` -This rule lets you set which directive comments you want to allow in your codebase. +This rule lets you set which comment directives you want to allow in your codebase. ## Options diff --git a/packages/eslint-plugin/src/util/astUtils.ts b/packages/eslint-plugin/src/util/astUtils.ts index c2450ae30130..1d8500052634 100644 --- a/packages/eslint-plugin/src/util/astUtils.ts +++ b/packages/eslint-plugin/src/util/astUtils.ts @@ -11,9 +11,9 @@ export * from '@typescript-eslint/utils/ast-utils'; // https://github.com/eslint/eslint/blob/145aec1ab9052fbca96a44d04927c595951b1536/lib/rules/utils/ast-utils.js#L1751-L1779 // Could be export { getNameLocationInGlobalDirectiveComment } from 'eslint/lib/rules/utils/ast-utils' /** - * Get the `loc` object of a given name in a `/*globals` directive comment. + * Get the `loc` object of a given name in a `/*globals` comment directive. * @param sourceCode The source code to convert index to loc. - * @param comment The `/*globals` directive comment which include the name. + * @param comment The `/*globals` comment directive which include the name. * @param name The name to find. * @returns The `loc` object. */ diff --git a/packages/scope-manager/src/variable/ESLintScopeVariable.ts b/packages/scope-manager/src/variable/ESLintScopeVariable.ts index be5a95acec89..a51995f27ec7 100644 --- a/packages/scope-manager/src/variable/ESLintScopeVariable.ts +++ b/packages/scope-manager/src/variable/ESLintScopeVariable.ts @@ -17,21 +17,21 @@ export class ESLintScopeVariable extends VariableBase { /** * Written to by ESLint. - * This property is undefined if there are no globals directive comments. - * The array of globals directive comments which defined this global variable in the source code file. + * This property is undefined if there are no globals comment directives. + * The array of globals comment directives which defined this global variable in the source code file. */ public eslintExplicitGlobal?: boolean; /** * Written to by ESLint. - * The configured value in config files. This can be different from `variable.writeable` if there are globals directive comments. + * The configured value in config files. This can be different from `variable.writeable` if there are globals comment directives. */ public eslintImplicitGlobalSetting?: 'readonly' | 'writable'; /** * Written to by ESLint. * If this key exists, it is a global variable added by ESLint. - * If `true`, this global variable was defined by a globals directive comment in the source code file. + * If `true`, this global variable was defined by a globals comment directive in the source code file. */ public eslintExplicitGlobalComments?: TSESTree.Comment[]; } diff --git a/packages/utils/src/ts-eslint/Config.ts b/packages/utils/src/ts-eslint/Config.ts index b80646756e35..8dc9b80c9e28 100644 --- a/packages/utils/src/ts-eslint/Config.ts +++ b/packages/utils/src/ts-eslint/Config.ts @@ -79,7 +79,7 @@ export namespace ClassicConfig { */ globals?: GlobalsConfig; /** - * The flag that disables directive comments. + * The flag that disables comment directives. */ noInlineConfig?: boolean; /** diff --git a/packages/utils/src/ts-eslint/eslint/ESLintShared.ts b/packages/utils/src/ts-eslint/eslint/ESLintShared.ts index db6e5b4de20d..54a79d150bd1 100644 --- a/packages/utils/src/ts-eslint/eslint/ESLintShared.ts +++ b/packages/utils/src/ts-eslint/eslint/ESLintShared.ts @@ -104,7 +104,7 @@ export declare class ESLintBase< } export interface ESLintOptions { /** - * If false is present, ESLint suppresses directive comments in source code. + * If false is present, ESLint suppresses comment directives in source code. * If this option is false, it overrides the noInlineConfig setting in your configurations. * @default true */ From 9b598778b4033e2cd5bdf3fa6e1af32c84a34a0b Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 9 Jun 2025 05:26:25 -0600 Subject: [PATCH 033/283] docs: fix up config links (#11254) * fix up config links * update link text * missed some * mistake --- docs/users/Shared_Configurations.mdx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/users/Shared_Configurations.mdx b/docs/users/Shared_Configurations.mdx index 5071a67d08fe..e77d68bcf6a2 100644 --- a/docs/users/Shared_Configurations.mdx +++ b/docs/users/Shared_Configurations.mdx @@ -144,7 +144,7 @@ module.exports = { -See [`configs/recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended.ts) for the exact contents of this config. +See [the source code for the `recommended` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended.ts) for the exact contents. ### `recommended-type-checked` @@ -173,7 +173,7 @@ module.exports = { -See [`configs/recommended-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts) for the exact contents of this config. +See [the source code for the `recommended-type-checked` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts) for the exact contents. ### `strict` @@ -203,7 +203,7 @@ module.exports = { Some rules also enabled in `recommended` default to more strict settings in this configuration. -See [`configs/strict.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict.ts) for the exact contents of this config. +See [the source code for the `strict` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict.ts) for the exact contents. :::tip We recommend a TypeScript project extend from `plugin:@typescript-eslint/strict` only if a nontrivial percentage of its developers are highly proficient in TypeScript. @@ -242,7 +242,7 @@ module.exports = { Some rules also enabled in `recommended-type-checked` default to more strict settings in this configuration. -See [`configs/strict-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts) for the exact contents of this config. +See [the source code for the `strict-type-checked` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts) for the exact contents. :::tip We recommend a TypeScript project extend from `plugin:@typescript-eslint/strict-type-checked` only if a nontrivial percentage of its developers are highly proficient in TypeScript. @@ -283,7 +283,7 @@ module.exports = { Note that `stylistic` does not replace `recommended` or `strict`. `stylistic` adds additional rules. -See [`configs/stylistic.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic.ts) for the exact contents of this config. +See [the source code for the `stylistic` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic.ts) for the exact contents. ### `stylistic-type-checked` @@ -315,7 +315,7 @@ module.exports = { Note that `stylistic-type-checked` does not replace `recommended-type-checked` or `strict-type-checked`. `stylistic-type-checked` adds additional rules. -See [`configs/stylistic-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts) for the exact contents of this config. +See [the source code for the `stylistic-type-checked` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts) for the exact contents. ## Other Configurations @@ -326,7 +326,7 @@ typescript-eslint includes a few utility configurations. Enables each the rules provided as a part of typescript-eslint. Note that many rules are not applicable in all codebases, or are meant to be configured. -See [`configs/all.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/all.ts) for the exact contents of this config. +See [the source code for the `all` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/all.ts) for the exact contents. :::warning We do not recommend TypeScript projects extend from `plugin:@typescript-eslint/all`. @@ -345,14 +345,14 @@ We don't recommend using this directly; instead, extend from an earlier recommen This config is automatically included if you use any of the recommended configurations. -See [`configs/base.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/base.ts) for the exact contents of this config. +See [the source code for the `base` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/base.ts) for the exact contents. ### `disable-type-checked` A utility ruleset that will disable type-aware linting and all type-aware rules available in our project. This config is useful if you'd like to have your base config concerned with type-aware linting, and then conditionally use [overrides](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-based-on-glob-patterns) to disable type-aware linting on specific subsets of your codebase. -See [`configs/disable-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts) for the exact contents of this config. +See [the source code for the `disable-type-checked` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts) for the exact contents. :::info If you use type-aware rules from other plugins, you will need to manually disable these rules or use a premade config they provide to disable them. @@ -449,7 +449,7 @@ module.exports = { This config is automatically included if you use any of the recommended configurations. -See [`configs/eslint-recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/eslint-recommended.ts) for the exact contents of this config. +See [the source code for the `eslint-recommended` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended-raw.ts) for the exact contents. ### `recommended-type-checked-only` @@ -462,7 +462,7 @@ module.exports = { }; ``` -See [`configs/recommended-type-checked-only.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked-only.ts) for the exact contents of this config. +See [the source code for the `recommended-type-checked-only` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked-only.ts) for the exact contents. ### `strict-type-checked-only` @@ -475,7 +475,7 @@ module.exports = { }; ``` -See [`configs/strict-type-checked-only.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts) for the exact contents of this config. +See [the source code for the `strict-type-checked-only` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts) for the exact contents. :::warning This configuration is not considered "stable" under Semantic Versioning (semver). @@ -493,7 +493,7 @@ module.exports = { }; ``` -See [`configs/stylistic-type-checked-only.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts) for the exact contents of this config. +See [the source code for the `stylistic-type-checked-only` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts) for the exact contents. ## Suggesting Configuration Changes From 8915a477608892596fc6ed2bc45dbbac7f41a361 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 9 Jun 2025 17:18:32 +0000 Subject: [PATCH 034/283] chore(release): publish 8.34.0 --- CHANGELOG.md | 20 ++++ packages/ast-spec/CHANGELOG.md | 13 +++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 12 +++ packages/eslint-plugin/package.json | 16 ++-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 12 +++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 12 +++ packages/type-utils/package.json | 8 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 8 +- packages/typescript-estree/CHANGELOG.md | 13 +++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 12 +++ packages/visitor-keys/package.json | 4 +- yarn.lock | 94 +++++++++---------- 30 files changed, 238 insertions(+), 96 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a17f0ba9d36..82baad46921b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +## 8.34.0 (2025-06-09) + +### 🚀 Features + +- **type-utils:** deprecated getSourceFileOfNode function ([#11284](https://github.com/typescript-eslint/typescript-eslint/pull/11284)) + +### 🩹 Fixes + +- **typescript-estree:** change the token type of `null` from `Keyword` to `Null` ([#11283](https://github.com/typescript-eslint/typescript-eslint/pull/11283)) +- **typescript-estree:** add validation to interface extends ([#11271](https://github.com/typescript-eslint/typescript-eslint/pull/11271)) +- **visitor-keys:** fix visitor keys order ([#11279](https://github.com/typescript-eslint/typescript-eslint/pull/11279)) + +### ❤️ Thank You + +- Kim Sang Du @developer-bandi +- overlookmotel +- Tao + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) ### 🩹 Fixes diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 778de3b88883..222ce18a261e 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,16 @@ +## 8.34.0 (2025-06-09) + +### 🩹 Fixes + +- **typescript-estree:** add validation to interface extends ([#11271](https://github.com/typescript-eslint/typescript-eslint/pull/11271)) +- **typescript-estree:** change the token type of `null` from `Keyword` to `Null` ([#11283](https://github.com/typescript-eslint/typescript-eslint/pull/11283)) + +### ❤️ Thank You + +- Tao + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) This was a version bump only for ast-spec to align it with other projects, there were no code changes. diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index bb8a82805740..c865d9588fe5 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.33.1", + "version": "8.34.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 67c169bbdc40..d967cf606b04 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.34.0 (2025-06-09) + +### 🩹 Fixes + +- **typescript-estree:** add validation to interface extends ([#11271](https://github.com/typescript-eslint/typescript-eslint/pull/11271)) + +### ❤️ Thank You + +- Tao + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) ### 🩹 Fixes diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index b48775e4d07b..0e0f237f0d53 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.33.1", + "version": "8.34.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -60,10 +60,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.33.1", - "@typescript-eslint/type-utils": "8.33.1", - "@typescript-eslint/utils": "8.33.1", - "@typescript-eslint/visitor-keys": "8.33.1", + "@typescript-eslint/scope-manager": "8.34.0", + "@typescript-eslint/type-utils": "8.34.0", + "@typescript-eslint/utils": "8.34.0", + "@typescript-eslint/visitor-keys": "8.34.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -72,8 +72,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.33.1", - "@typescript-eslint/rule-tester": "8.33.1", + "@typescript-eslint/rule-schema-to-typescript-types": "8.34.0", + "@typescript-eslint/rule-tester": "8.34.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -93,7 +93,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.33.1", + "@typescript-eslint/parser": "^8.34.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 8b724cff58db..46bc42e708a2 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.0 (2025-06-09) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index a334a6654081..774cd5692460 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.33.1", + "version": "8.34.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -52,10 +52,10 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.33.1", - "@typescript-eslint/types": "8.33.1", - "@typescript-eslint/typescript-estree": "8.33.1", - "@typescript-eslint/visitor-keys": "8.33.1", + "@typescript-eslint/scope-manager": "8.34.0", + "@typescript-eslint/types": "8.34.0", + "@typescript-eslint/typescript-estree": "8.34.0", + "@typescript-eslint/visitor-keys": "8.34.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 9719109152c2..76ef76731ce6 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.0 (2025-06-09) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) ### 🩹 Fixes diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 2518a9b40b48..d5c25f23a455 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.33.1", + "version": "8.34.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.33.1", - "@typescript-eslint/types": "^8.33.1", + "@typescript-eslint/tsconfig-utils": "^8.34.0", + "@typescript-eslint/types": "^8.34.0", "debug": "^4.3.4" }, "funding": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index a5935b673670..faed4d020889 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.0 (2025-06-09) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index e88204f33ed9..48be2c1fbcac 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.33.1", + "version": "8.34.0", "private": true, "type": "commonjs", "exports": { @@ -33,8 +33,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.33.1", - "@typescript-eslint/utils": "8.33.1", + "@typescript-eslint/type-utils": "8.34.0", + "@typescript-eslint/utils": "8.34.0", "natural-compare": "^1.4.0", "prettier": "^3.2.5" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 468a208e2467..0d8670fa6a79 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.0 (2025-06-09) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 8eee8e1d6d29..e0c5cdae1b73 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.33.1", + "version": "8.34.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -45,9 +45,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.33.1", - "@typescript-eslint/typescript-estree": "8.33.1", - "@typescript-eslint/utils": "8.33.1", + "@typescript-eslint/parser": "8.34.0", + "@typescript-eslint/typescript-estree": "8.34.0", + "@typescript-eslint/utils": "8.34.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index d8e81638c715..d0ab44f79f44 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.34.0 (2025-06-09) + +### 🩹 Fixes + +- **visitor-keys:** fix visitor keys order ([#11279](https://github.com/typescript-eslint/typescript-eslint/pull/11279)) + +### ❤️ Thank You + +- overlookmotel + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 233360f3d777..6286550611e0 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.33.1", + "version": "8.34.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -48,11 +48,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.33.1", - "@typescript-eslint/visitor-keys": "8.33.1" + "@typescript-eslint/types": "8.34.0", + "@typescript-eslint/visitor-keys": "8.34.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.33.1", + "@typescript-eslint/typescript-estree": "8.34.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "glob": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 56304b0f2154..3c01fbcc477e 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.0 (2025-06-09) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 42d31485628a..97f071a896c9 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.33.1", + "version": "8.34.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index f06e639ddadd..ac1cc1204241 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.34.0 (2025-06-09) + +### 🚀 Features + +- **type-utils:** deprecated getSourceFileOfNode function ([#11284](https://github.com/typescript-eslint/typescript-eslint/pull/11284)) + +### ❤️ Thank You + +- Kim Sang Du @developer-bandi + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 508fa36ae385..9f3b152efc68 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.33.1", + "version": "8.34.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -45,8 +45,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/typescript-estree": "8.33.1", - "@typescript-eslint/utils": "8.33.1", + "@typescript-eslint/typescript-estree": "8.34.0", + "@typescript-eslint/utils": "8.34.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <5.9.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.33.1", + "@typescript-eslint/parser": "8.34.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 81652e6e1402..ab8fa06d3038 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.0 (2025-06-09) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 5324be9fb4a9..6761a72cbd78 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.33.1", + "version": "8.34.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index ba315824890b..577a28bb5b00 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.0 (2025-06-09) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 1136510716a1..8eaff5aa6a74 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.33.1", + "version": "8.34.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -51,9 +51,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.33.1", - "@typescript-eslint/parser": "8.33.1", - "@typescript-eslint/utils": "8.33.1" + "@typescript-eslint/eslint-plugin": "8.34.0", + "@typescript-eslint/parser": "8.34.0", + "@typescript-eslint/utils": "8.34.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index d8eb1b11a6ee..a4d8f790ee02 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,16 @@ +## 8.34.0 (2025-06-09) + +### 🩹 Fixes + +- **typescript-estree:** add validation to interface extends ([#11271](https://github.com/typescript-eslint/typescript-eslint/pull/11271)) +- **typescript-estree:** change the token type of `null` from `Keyword` to `Null` ([#11283](https://github.com/typescript-eslint/typescript-eslint/pull/11283)) + +### ❤️ Thank You + +- Tao + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) This was a version bump only for typescript-estree to align it with other projects, there were no code changes. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 15556fdfd53b..0d624efcede6 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.33.1", + "version": "8.34.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -53,10 +53,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.33.1", - "@typescript-eslint/tsconfig-utils": "8.33.1", - "@typescript-eslint/types": "8.33.1", - "@typescript-eslint/visitor-keys": "8.33.1", + "@typescript-eslint/project-service": "8.34.0", + "@typescript-eslint/tsconfig-utils": "8.34.0", + "@typescript-eslint/types": "8.34.0", + "@typescript-eslint/visitor-keys": "8.34.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 18453daeff51..6ec06c2e10bd 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.0 (2025-06-09) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index c5c543f6eb27..33031c95984a 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.33.1", + "version": "8.34.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -63,9 +63,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.33.1", - "@typescript-eslint/types": "8.33.1", - "@typescript-eslint/typescript-estree": "8.33.1" + "@typescript-eslint/scope-manager": "8.34.0", + "@typescript-eslint/types": "8.34.0", + "@typescript-eslint/typescript-estree": "8.34.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 3b29aa7ec35f..5bf112e0cf53 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.34.0 (2025-06-09) + +### 🩹 Fixes + +- **visitor-keys:** fix visitor keys order ([#11279](https://github.com/typescript-eslint/typescript-eslint/pull/11279)) + +### ❤️ Thank You + +- overlookmotel + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.33.1 (2025-06-02) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 89aafa93bfa2..146e7611edac 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.33.1", + "version": "8.34.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -46,7 +46,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.33.1", + "@typescript-eslint/types": "8.34.0", "eslint-visitor-keys": "^4.2.0" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 723bbab5c3ba..7e866d06c518 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5424,19 +5424,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.33.1, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.34.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.33.1 - "@typescript-eslint/rule-tester": 8.33.1 - "@typescript-eslint/scope-manager": 8.33.1 - "@typescript-eslint/type-utils": 8.33.1 - "@typescript-eslint/utils": 8.33.1 - "@typescript-eslint/visitor-keys": 8.33.1 + "@typescript-eslint/rule-schema-to-typescript-types": 8.34.0 + "@typescript-eslint/rule-tester": 8.34.0 + "@typescript-eslint/scope-manager": 8.34.0 + "@typescript-eslint/type-utils": 8.34.0 + "@typescript-eslint/utils": 8.34.0 + "@typescript-eslint/visitor-keys": 8.34.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5459,7 +5459,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.33.1 + "@typescript-eslint/parser": ^8.34.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" languageName: unknown @@ -5474,14 +5474,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.33.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.34.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.33.1 - "@typescript-eslint/types": 8.33.1 - "@typescript-eslint/typescript-estree": 8.33.1 - "@typescript-eslint/visitor-keys": 8.33.1 + "@typescript-eslint/scope-manager": 8.34.0 + "@typescript-eslint/types": 8.34.0 + "@typescript-eslint/typescript-estree": 8.34.0 + "@typescript-eslint/visitor-keys": 8.34.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 glob: "*" @@ -5494,24 +5494,24 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.33.1, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.34.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.33.1 - "@typescript-eslint/types": ^8.33.1 + "@typescript-eslint/tsconfig-utils": ^8.34.0 + "@typescript-eslint/types": ^8.34.0 debug: ^4.3.4 peerDependencies: typescript: ">=4.8.4 <5.9.0" languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.33.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.34.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.33.1 - "@typescript-eslint/utils": 8.33.1 + "@typescript-eslint/type-utils": 8.34.0 + "@typescript-eslint/utils": 8.34.0 "@vitest/coverage-v8": ^3.1.3 natural-compare: ^1.4.0 prettier: ^3.2.5 @@ -5521,15 +5521,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.33.1, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.34.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.33.1 - "@typescript-eslint/typescript-estree": 8.33.1 - "@typescript-eslint/utils": 8.33.1 + "@typescript-eslint/parser": 8.34.0 + "@typescript-eslint/typescript-estree": 8.34.0 + "@typescript-eslint/utils": 8.34.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5544,13 +5544,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.33.1, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.34.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.33.1 - "@typescript-eslint/typescript-estree": 8.33.1 - "@typescript-eslint/visitor-keys": 8.33.1 + "@typescript-eslint/types": 8.34.0 + "@typescript-eslint/typescript-estree": 8.34.0 + "@typescript-eslint/visitor-keys": 8.34.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 glob: "*" @@ -5560,7 +5560,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.33.1, @typescript-eslint/tsconfig-utils@^8.33.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.34.0, @typescript-eslint/tsconfig-utils@^8.34.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" peerDependencies: @@ -5568,13 +5568,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.33.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.34.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.33.1 - "@typescript-eslint/typescript-estree": 8.33.1 - "@typescript-eslint/utils": 8.33.1 + "@typescript-eslint/parser": 8.34.0 + "@typescript-eslint/typescript-estree": 8.34.0 + "@typescript-eslint/utils": 8.34.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -5589,7 +5589,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.33.1, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.33.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.34.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.34.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -5664,15 +5664,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.33.1, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.34.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.33.1 - "@typescript-eslint/tsconfig-utils": 8.33.1 - "@typescript-eslint/types": 8.33.1 - "@typescript-eslint/visitor-keys": 8.33.1 + "@typescript-eslint/project-service": 8.34.0 + "@typescript-eslint/tsconfig-utils": 8.34.0 + "@typescript-eslint/types": 8.34.0 + "@typescript-eslint/visitor-keys": 8.34.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 fast-glob: ^3.3.2 @@ -5689,14 +5689,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.33.1, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.34.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.33.1 - "@typescript-eslint/types": 8.33.1 - "@typescript-eslint/typescript-estree": 8.33.1 + "@typescript-eslint/scope-manager": 8.34.0 + "@typescript-eslint/types": 8.34.0 + "@typescript-eslint/typescript-estree": 8.34.0 "@vitest/coverage-v8": ^3.1.3 rimraf: "*" typescript: "*" @@ -5707,11 +5707,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.33.1, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.34.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.33.1 + "@typescript-eslint/types": 8.34.0 "@vitest/coverage-v8": ^3.1.3 eslint-visitor-keys: ^4.2.0 rimraf: "*" @@ -18740,9 +18740,9 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.33.1 - "@typescript-eslint/parser": 8.33.1 - "@typescript-eslint/utils": 8.33.1 + "@typescript-eslint/eslint-plugin": 8.34.0 + "@typescript-eslint/parser": 8.34.0 + "@typescript-eslint/utils": 8.34.0 "@vitest/coverage-v8": ^3.1.3 rimraf: "*" typescript: "*" From 445514aa1c9a2927051d73a7c0c4a1d004a7f855 Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Wed, 11 Jun 2025 00:14:49 +0100 Subject: [PATCH 035/283] fix(visitor-keys): bump `eslint-visitor-keys` dependency (#11294) --- packages/visitor-keys/package.json | 2 +- yarn.lock | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 146e7611edac..837dfa0145ae 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -47,7 +47,7 @@ }, "dependencies": { "@typescript-eslint/types": "8.34.0", - "eslint-visitor-keys": "^4.2.0" + "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", diff --git a/yarn.lock b/yarn.lock index 7e866d06c518..e7f1935ceaf2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5713,7 +5713,7 @@ __metadata: dependencies: "@typescript-eslint/types": 8.34.0 "@vitest/coverage-v8": ^3.1.3 - eslint-visitor-keys: ^4.2.0 + eslint-visitor-keys: ^4.2.1 rimraf: "*" typescript: "*" vitest: ^3.1.3 @@ -9567,6 +9567,13 @@ __metadata: languageName: node linkType: hard +"eslint-visitor-keys@npm:^4.2.1": + version: 4.2.1 + resolution: "eslint-visitor-keys@npm:4.2.1" + checksum: 3a77e3f99a49109f6fb2c5b7784bc78f9743b834d238cdba4d66c602c6b52f19ed7bcd0a5c5dbbeae3a8689fd785e76c001799f53d2228b278282cf9f699fff5 + languageName: node + linkType: hard + "eslint@npm:*, eslint@npm:^9.15.0, eslint@npm:^9.26.0": version: 9.26.0 resolution: "eslint@npm:9.26.0" From de8943e98e188d83801ec1044ffc69451db1aa63 Mon Sep 17 00:00:00 2001 From: David Archibald Date: Fri, 13 Jun 2025 16:45:30 -0700 Subject: [PATCH 036/283] fix(types): add 2026/17 to EcmaVersion (#11304) fix: add 2026/17 to EcmaVersion --- packages/types/src/parser-options.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/types/src/parser-options.ts b/packages/types/src/parser-options.ts index e90c42fa640a..c9ed6b106d3d 100644 --- a/packages/types/src/parser-options.ts +++ b/packages/types/src/parser-options.ts @@ -21,6 +21,7 @@ export type EcmaVersion = | 14 | 15 | 16 + | 17 | 2015 | 2016 | 2017 @@ -32,6 +33,7 @@ export type EcmaVersion = | 2023 | 2024 | 2025 + | 2026 | 'latest' | undefined; From af94f163a1d6447a84c5571fff5e38e4c700edb9 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" <53356952+typescript-eslint[bot]@users.noreply.github.com> Date: Sun, 15 Jun 2025 07:20:04 +0930 Subject: [PATCH 037/283] chore: update sponsors (#11301) Co-authored-by: typescript-eslint[bot] --- packages/website/data/sponsors.json | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/website/data/sponsors.json b/packages/website/data/sponsors.json index 6dad26759c96..8079458ea4bb 100644 --- a/packages/website/data/sponsors.json +++ b/packages/website/data/sponsors.json @@ -227,7 +227,7 @@ "id": "syntaxfm", "image": "https://avatars.githubusercontent.com/u/130389858?v=4", "name": "Syntax", - "totalDonations": 34208, + "totalDonations": 39473, "website": "https://syntax.fm" }, { @@ -321,6 +321,13 @@ "totalDonations": 17000, "website": "https://balsa.com/" }, + { + "id": "getsentry", + "image": "https://avatars.githubusercontent.com/u/1396951?v=4", + "name": "Sentry", + "totalDonations": 15455, + "website": "https://sentry.io" + }, { "id": "THE PADDING", "image": "https://images.opencollective.com/thepadding/55e79ad/logo.png", @@ -328,6 +335,13 @@ "totalDonations": 15000, "website": "https://paddn.com/" }, + { + "id": "codecov", + "image": "https://avatars.githubusercontent.com/u/8226205?v=4", + "name": "Codecov", + "totalDonations": 14501, + "website": "https://codecov.io/" + }, { "id": "Now4real", "image": "https://images.opencollective.com/now4real/54ca7d9/logo.png", @@ -335,20 +349,6 @@ "totalDonations": 14500, "website": "https://now4real.com/" }, - { - "id": "getsentry", - "image": "https://avatars.githubusercontent.com/u/1396951?v=4", - "name": "Sentry", - "totalDonations": 13614, - "website": "https://sentry.io" - }, - { - "id": "codecov", - "image": "https://avatars.githubusercontent.com/u/8226205?v=4", - "name": "Codecov", - "totalDonations": 13218, - "website": "https://codecov.io/" - }, { "id": "gitbutlerapp", "image": "https://avatars.githubusercontent.com/u/123460877?v=4", From c971881e7af3e8e91f45391e6653a2815f725c3a Mon Sep 17 00:00:00 2001 From: Tao <2471314@gmail.com> Date: Mon, 16 Jun 2025 19:23:01 +0800 Subject: [PATCH 038/283] fix(typescript-estree): emit a Literal instead of Identifier for constructor when the identifier is a string (#11299) --- .../constructor-string-literal/fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 100 +++++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 92 ++++++++++++++++ .../snapshots/3-Babel-AST.shot | 100 +++++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 92 ++++++++++++++++ .../fixtures/constructor/fixture.ts | 3 + .../constructor/snapshots/1-TSESTree-AST.shot | 101 ++++++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 92 ++++++++++++++++ .../constructor/snapshots/3-Babel-AST.shot | 101 ++++++++++++++++++ .../constructor/snapshots/4-Babel-Tokens.shot | 92 ++++++++++++++++ packages/typescript-estree/src/convert.ts | 26 +++-- 11 files changed, 795 insertions(+), 8 deletions(-) create mode 100644 packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/fixture.ts create mode 100644 packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/fixture.ts create mode 100644 packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/4-Babel-Tokens.shot diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/fixture.ts b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/fixture.ts new file mode 100644 index 000000000000..4c180fec4267 --- /dev/null +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/fixture.ts @@ -0,0 +1,4 @@ +class Foo { + // prettier-ignore + "constructor"() {} +} diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c67c432e3f4e --- /dev/null +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,100 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: [], + key: Literal { + type: "Literal", + raw: ""constructor"", + value: "constructor", + + range: [35, 48], + loc: { + start: { column: 2, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + kind: "constructor", + optional: false, + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: [], + + range: [51, 53], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + declare: false, + expression: false, + generator: false, + id: null, + params: [], + + range: [48, 53], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [35, 53], + loc: { + start: { column: 2, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + + range: [10, 55], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 4 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 55], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [0, 56], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 5 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d7b945f9e519 --- /dev/null +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,92 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + String { + type: "String", + value: ""constructor"", + + range: [35, 48], + loc: { + start: { column: 2, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [48, 49], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [49, 50], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [51, 52], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [52, 53], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [54, 55], + loc: { + start: { column: 0, line: 4 }, + end: { column: 1, line: 4 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..c67c432e3f4e --- /dev/null +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/3-Babel-AST.shot @@ -0,0 +1,100 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: [], + key: Literal { + type: "Literal", + raw: ""constructor"", + value: "constructor", + + range: [35, 48], + loc: { + start: { column: 2, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + kind: "constructor", + optional: false, + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: [], + + range: [51, 53], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + declare: false, + expression: false, + generator: false, + id: null, + params: [], + + range: [48, 53], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [35, 53], + loc: { + start: { column: 2, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + + range: [10, 55], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 4 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 55], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [0, 56], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 5 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..d7b945f9e519 --- /dev/null +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,92 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + String { + type: "String", + value: ""constructor"", + + range: [35, 48], + loc: { + start: { column: 2, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [48, 49], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [49, 50], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [51, 52], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [52, 53], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [54, 55], + loc: { + start: { column: 0, line: 4 }, + end: { column: 1, line: 4 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/fixture.ts b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/fixture.ts new file mode 100644 index 000000000000..5e9e3c9272a2 --- /dev/null +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + constructor() {} +} diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..3eef72dde2c6 --- /dev/null +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,101 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: [], + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [14, 25], + loc: { + start: { column: 2, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, + kind: "constructor", + optional: false, + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: [], + + range: [28, 30], + loc: { + start: { column: 16, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + declare: false, + expression: false, + generator: false, + id: null, + params: [], + + range: [25, 30], + loc: { + start: { column: 13, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + + range: [14, 30], + loc: { + start: { column: 2, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + ], + + range: [10, 32], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..dae0e3eb6ca1 --- /dev/null +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,92 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [14, 25], + loc: { + start: { column: 2, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [25, 26], + loc: { + start: { column: 13, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [26, 27], + loc: { + start: { column: 14, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [28, 29], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [29, 30], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [31, 32], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..3eef72dde2c6 --- /dev/null +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/3-Babel-AST.shot @@ -0,0 +1,101 @@ +Program { + type: "Program", + body: [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: false, + body: ClassBody { + type: "ClassBody", + body: [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: [], + key: Identifier { + type: "Identifier", + decorators: [], + name: "constructor", + optional: false, + + range: [14, 25], + loc: { + start: { column: 2, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, + kind: "constructor", + optional: false, + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: [], + + range: [28, 30], + loc: { + start: { column: 16, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + declare: false, + expression: false, + generator: false, + id: null, + params: [], + + range: [25, 30], + loc: { + start: { column: 13, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + + range: [14, 30], + loc: { + start: { column: 2, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + ], + + range: [10, 32], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: false, + decorators: [], + id: Identifier { + type: "Identifier", + decorators: [], + name: "Foo", + optional: false, + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: [], + superClass: null, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..dae0e3eb6ca1 --- /dev/null +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,92 @@ +[ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [14, 25], + loc: { + start: { column: 2, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [25, 26], + loc: { + start: { column: 13, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [26, 27], + loc: { + start: { column: 14, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [28, 29], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [29, 30], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [31, 32], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] \ No newline at end of file diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 8f293db2af02..f2a504aa4a1d 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1695,14 +1695,24 @@ export class Converter { this.fixParentLocation(constructor, constructor.typeParameters.range); } - const constructorKey = this.createNode(node, { - type: AST_NODE_TYPES.Identifier, - range: [constructorToken.getStart(this.ast), constructorToken.end], - decorators: [], - name: 'constructor', - optional: false, - typeAnnotation: undefined, - }); + const constructorKey = + constructorToken.kind === SyntaxKind.StringLiteral + ? this.createNode(constructorToken, { + type: AST_NODE_TYPES.Literal, + raw: constructorToken.getText(), + value: 'constructor', + }) + : this.createNode(node, { + type: AST_NODE_TYPES.Identifier, + range: [ + constructorToken.getStart(this.ast), + constructorToken.end, + ], + decorators: [], + name: 'constructor', + optional: false, + typeAnnotation: undefined, + }); const isStatic = hasModifier(SyntaxKind.StaticKeyword, node); From f9d4d10c2330b6d646eff148b7648a84b7387a1e Mon Sep 17 00:00:00 2001 From: Vinccool96 Date: Mon, 16 Jun 2025 09:28:41 -0400 Subject: [PATCH 039/283] chore(eslint-plugin): switch auto-generated test cases to hand-written in no-base-to-string.test.ts (#11280) Switch to handwritten test cases --- .../tests/rules/no-base-to-string.test.ts | 278 +++++++++++++++--- 1 file changed, 240 insertions(+), 38 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts index f0fe39979c4d..340433769679 100644 --- a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts +++ b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts @@ -13,55 +13,257 @@ const ruleTester = new RuleTester({ }, }); -const literalListBasic: string[] = [ - "''", - "'text'", - 'true', - 'false', - '1', - '1n', - '[]', - '/regex/', -]; - -const literalListNeedParen: string[] = [ - "__dirname === 'foobar'", - '{}.constructor()', - '() => {}', - 'function() {}', -]; - -const literalList = [...literalListBasic, ...literalListNeedParen]; - -const literalListWrapped = [ - ...literalListBasic, - ...literalListNeedParen.map(i => `(${i})`), -]; - ruleTester.run('no-base-to-string', rule, { valid: [ // template - ...literalList.map(i => `\`\${${i}}\`;`), + "`${''}`;", + "`${'text'}`;", + '`${true}`;', + '`${false}`;', + '`${1}`;', + '`${1n}`;', + '`${[]}`;', + '`${/regex/}`;', + "`${__dirname === 'foobar'}`;", + '`${{}.constructor()}`;', + '`${() => {}}`;', + '`${function () {}}`;', // operator + += - ...literalListWrapped.flatMap(l => - literalListWrapped.map(r => `${l} + ${r};`), - ), + "'' + '';", + "'' + 'text';", + "'' + true;", + "'' + false;", + "'' + 1;", + "'' + 1n;", + "'' + [];", + "'' + /regex/;", + "'' + (__dirname === 'foobar');", + "'' + {}.constructor();", + "'' + (() => {});", + "'' + function () {};", + "'text' + '';", + "'text' + 'text';", + "'text' + true;", + "'text' + false;", + "'text' + 1;", + "'text' + 1n;", + "'text' + [];", + "'text' + /regex/;", + "'text' + (__dirname === 'foobar');", + "'text' + {}.constructor();", + "'text' + (() => {});", + "'text' + function () {};", + "true + '';", + "true + 'text';", + 'true + true;', + 'true + false;', + 'true + 1;', + 'true + 1n;', + 'true + [];', + 'true + /regex/;', + "true + (__dirname === 'foobar');", + 'true + {}.constructor();', + 'true + (() => {});', + 'true + function () {};', + "false + '';", + "false + 'text';", + 'false + true;', + 'false + false;', + 'false + 1;', + 'false + 1n;', + 'false + [];', + 'false + /regex/;', + "false + (__dirname === 'foobar');", + 'false + {}.constructor();', + 'false + (() => {});', + 'false + function () {};', + "1 + '';", + "1 + 'text';", + '1 + true;', + '1 + false;', + '1 + 1;', + '1 + 1n;', + '1 + [];', + '1 + /regex/;', + "1 + (__dirname === 'foobar');", + '1 + {}.constructor();', + '1 + (() => {});', + '1 + function () {};', + "1n + '';", + "1n + 'text';", + '1n + true;', + '1n + false;', + '1n + 1;', + '1n + 1n;', + '1n + [];', + '1n + /regex/;', + "1n + (__dirname === 'foobar');", + '1n + {}.constructor();', + '1n + (() => {});', + '1n + function () {};', + "[] + '';", + "[] + 'text';", + '[] + true;', + '[] + false;', + '[] + 1;', + '[] + 1n;', + '[] + [];', + '[] + /regex/;', + "[] + (__dirname === 'foobar');", + '[] + {}.constructor();', + '[] + (() => {});', + '[] + function () {};', + "/regex/ + '';", + "/regex/ + 'text';", + '/regex/ + true;', + '/regex/ + false;', + '/regex/ + 1;', + '/regex/ + 1n;', + '/regex/ + [];', + '/regex/ + /regex/;', + "/regex/ + (__dirname === 'foobar');", + '/regex/ + {}.constructor();', + '/regex/ + (() => {});', + '/regex/ + function () {};', + "(__dirname === 'foobar') + '';", + "(__dirname === 'foobar') + 'text';", + "(__dirname === 'foobar') + true;", + "(__dirname === 'foobar') + false;", + "(__dirname === 'foobar') + 1;", + "(__dirname === 'foobar') + 1n;", + "(__dirname === 'foobar') + [];", + "(__dirname === 'foobar') + /regex/;", + "(__dirname === 'foobar') + (__dirname === 'foobar');", + "(__dirname === 'foobar') + {}.constructor();", + "(__dirname === 'foobar') + (() => {});", + "(__dirname === 'foobar') + function () {};", + "({}).constructor() + '';", + "({}).constructor() + 'text';", + '({}).constructor() + true;', + '({}).constructor() + false;', + '({}).constructor() + 1;', + '({}).constructor() + 1n;', + '({}).constructor() + [];', + '({}).constructor() + /regex/;', + "({}).constructor() + (__dirname === 'foobar');", + '({}).constructor() + {}.constructor();', + '({}).constructor() + (() => {});', + '({}).constructor() + function () {};', + "(() => {}) + '';", + "(() => {}) + 'text';", + '(() => {}) + true;', + '(() => {}) + false;', + '(() => {}) + 1;', + '(() => {}) + 1n;', + '(() => {}) + [];', + '(() => {}) + /regex/;', + "(() => {}) + (__dirname === 'foobar');", + '(() => {}) + {}.constructor();', + '(() => {}) + (() => {});', + '(() => {}) + function () {};', + "(function () {}) + '';", + "(function () {}) + 'text';", + '(function () {}) + true;', + '(function () {}) + false;', + '(function () {}) + 1;', + '(function () {}) + 1n;', + '(function () {}) + [];', + '(function () {}) + /regex/;', + "(function () {}) + (__dirname === 'foobar');", + '(function () {}) + {}.constructor();', + '(function () {}) + (() => {});', + '(function () {}) + function () {};', // toString() - ...literalListWrapped.map(i => `${i === '1' ? `(${i})` : i}.toString();`), + "''.toString();", + "'text'.toString();", + 'true.toString();', + 'false.toString();', + '(1).toString();', + '1n.toString();', + '[].toString();', + '/regex/.toString();', + "(__dirname === 'foobar').toString();", + '({}).constructor().toString();', + '(() => {}).toString();', + '(function () {}).toString();', // variable toString() and template - ...literalList.map( - i => ` - let value = ${i}; - value.toString(); - let text = \`\${value}\`; - `, - ), + ` +let value = ''; +value.toString(); +let text = \`\${value}\`; + `, + ` +let value = 'text'; +value.toString(); +let text = \`\${value}\`; + `, + ` +let value = true; +value.toString(); +let text = \`\${value}\`; + `, + ` +let value = false; +value.toString(); +let text = \`\${value}\`; + `, + ` +let value = 1; +value.toString(); +let text = \`\${value}\`; + `, + ` +let value = 1n; +value.toString(); +let text = \`\${value}\`; + `, + ` +let value = []; +value.toString(); +let text = \`\${value}\`; + `, + ` +let value = /regex/; +value.toString(); +let text = \`\${value}\`; + `, + ` +let value = __dirname === 'foobar'; +value.toString(); +let text = \`\${value}\`; + `, + ` +let value = {}.constructor(); +value.toString(); +let text = \`\${value}\`; + `, + ` +let value = () => {}; +value.toString(); +let text = \`\${value}\`; + `, + ` +let value = function () {}; +value.toString(); +let text = \`\${value}\`; + `, // String() - ...literalList.map(i => `String(${i});`), + "String('');", + "String('text');", + 'String(true);', + 'String(false);', + 'String(1);', + 'String(1n);', + 'String([]);', + 'String(/regex/);', + "String(__dirname === 'foobar');", + 'String({}.constructor());', + 'String(() => {});', + 'String(function () {});', ` function someFunction() {} someFunction.toString(); From 6a7424c0d5132ec077f066779ffaf17ec21f7f7c Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Mon, 16 Jun 2025 06:30:31 -0700 Subject: [PATCH 040/283] chore: upgrade to Docusaurus 3.7 (#11262) --- packages/website/package.json | 14 +- yarn.lock | 1836 +++++++++++++++++++++++++-------- 2 files changed, 1408 insertions(+), 442 deletions(-) diff --git a/packages/website/package.json b/packages/website/package.json index eb0fd1bafcce..4dfbd280da49 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -28,12 +28,12 @@ }, "dependencies": { "@babel/runtime": "^7.24.4", - "@docusaurus/core": "^3.2.1", - "@docusaurus/plugin-client-redirects": "^3.2.1", - "@docusaurus/plugin-pwa": "^3.2.1", - "@docusaurus/preset-classic": "^3.2.1", - "@docusaurus/remark-plugin-npm2yarn": "^3.2.1", - "@docusaurus/theme-common": "^3.2.1", + "@docusaurus/core": "~3.7.0", + "@docusaurus/plugin-client-redirects": "~3.7.0", + "@docusaurus/plugin-pwa": "~3.7.0", + "@docusaurus/preset-classic": "~3.7.0", + "@docusaurus/remark-plugin-npm2yarn": "~3.7.0", + "@docusaurus/theme-common": "~3.7.0", "@typescript-eslint/parser": "workspace:*", "@typescript-eslint/website-eslint": "workspace:*", "@uiw/react-shields": "2.0.1", @@ -55,7 +55,7 @@ "typescript": "*" }, "devDependencies": { - "@docusaurus/module-type-aliases": "^3.2.1", + "@docusaurus/module-type-aliases": "~3.7.0", "@types/mdast": "^4.0.3", "@types/react": "*", "@types/unist": "^3.0.2", diff --git a/yarn.lock b/yarn.lock index e7f1935ceaf2..262252c559d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -60,126 +60,125 @@ __metadata: languageName: node linkType: hard -"@algolia/autocomplete-core@npm:1.9.3": - version: 1.9.3 - resolution: "@algolia/autocomplete-core@npm:1.9.3" +"@algolia/autocomplete-core@npm:1.17.9": + version: 1.17.9 + resolution: "@algolia/autocomplete-core@npm:1.17.9" dependencies: - "@algolia/autocomplete-plugin-algolia-insights": 1.9.3 - "@algolia/autocomplete-shared": 1.9.3 - checksum: ce78048568660184a4fa3c6548f344a7f5ce0ba45d4cfc233f9756b6d4f360afd5ae3a18efefcd27a626d3a0d6cf22d9cba3e21b217afae62b8e9d11bc4960da + "@algolia/autocomplete-plugin-algolia-insights": 1.17.9 + "@algolia/autocomplete-shared": 1.17.9 + checksum: dde242b1a2d8485e6c7bc94d00e25d707aa66dcd276ee1dde13213f1620bf6a1d289a61c657e40c707ca726a8aa009ab5e8229f92ae5cf22266de490b0634d20 languageName: node linkType: hard -"@algolia/autocomplete-plugin-algolia-insights@npm:1.9.3": - version: 1.9.3 - resolution: "@algolia/autocomplete-plugin-algolia-insights@npm:1.9.3" +"@algolia/autocomplete-plugin-algolia-insights@npm:1.17.9": + version: 1.17.9 + resolution: "@algolia/autocomplete-plugin-algolia-insights@npm:1.17.9" dependencies: - "@algolia/autocomplete-shared": 1.9.3 + "@algolia/autocomplete-shared": 1.17.9 peerDependencies: search-insights: ">= 1 < 3" - checksum: 030695bf692021c27f52a3d4931efed23032796e326d4ae7957ae91b51c36a10dc2d885fb043909e853f961c994b8e9ff087f50bb918cfa075370562251a199f + checksum: 32761d44a407d7c5ecfae98bb78b45a1ca85c59f44167ea36057315fb357c49684e9126bb7a67a513a27bda60a9661cecd6215f2daa903288860201b0b18c745 languageName: node linkType: hard -"@algolia/autocomplete-preset-algolia@npm:1.9.3": - version: 1.9.3 - resolution: "@algolia/autocomplete-preset-algolia@npm:1.9.3" +"@algolia/autocomplete-preset-algolia@npm:1.17.9": + version: 1.17.9 + resolution: "@algolia/autocomplete-preset-algolia@npm:1.17.9" dependencies: - "@algolia/autocomplete-shared": 1.9.3 + "@algolia/autocomplete-shared": 1.17.9 peerDependencies: "@algolia/client-search": ">= 4.9.1 < 6" algoliasearch: ">= 4.9.1 < 6" - checksum: 1ab3273d3054b348eed286ad1a54b21807846326485507b872477b827dc688006d4f14233cebd0bf49b2932ec8e29eca6d76e48a3c9e9e963b25153b987549c0 + checksum: 0dac2aae02121d37466b4ce1ca533420b25cd70e218a9e645e6194bd84a6012a0e94c22125437adb89599ecf14e4488882f91da382c6c9a8d9447e929b317522 languageName: node linkType: hard -"@algolia/autocomplete-shared@npm:1.9.3": - version: 1.9.3 - resolution: "@algolia/autocomplete-shared@npm:1.9.3" +"@algolia/autocomplete-shared@npm:1.17.9": + version: 1.17.9 + resolution: "@algolia/autocomplete-shared@npm:1.17.9" peerDependencies: "@algolia/client-search": ">= 4.9.1 < 6" algoliasearch: ">= 4.9.1 < 6" - checksum: 06014c8b08d30c452de079f48c0235d8fa09904bf511da8dc1b7e491819940fd4ff36b9bf65340242b2e157a26799a3b9aea01feee9c5bf67be3c48d7dff43d7 + checksum: f16223f5995db0deb014a066e3587ec2da76e62b861aa21411be92cb255b7023507803283803d8c960b396a2c6b690951337c32fef34f68c59ecfb3822dee577 languageName: node linkType: hard -"@algolia/cache-browser-local-storage@npm:4.22.1": - version: 4.22.1 - resolution: "@algolia/cache-browser-local-storage@npm:4.22.1" +"@algolia/client-abtesting@npm:5.25.0": + version: 5.25.0 + resolution: "@algolia/client-abtesting@npm:5.25.0" dependencies: - "@algolia/cache-common": 4.22.1 - checksum: 82e65c0dbc015d55bf17842757d21c3769fde95c10235d038062ccb41f2f64b3b1efd953df0f1b4892f352d83cdf2b8374a8f1b4e06b4ba42b35c3a449d316e7 + "@algolia/client-common": 5.25.0 + "@algolia/requester-browser-xhr": 5.25.0 + "@algolia/requester-fetch": 5.25.0 + "@algolia/requester-node-http": 5.25.0 + checksum: 104b680681eae79e6e38f60f1c57eb7e6172305c8d1b1bca3ca15e19c74c9a502bbce0cb83371d2a5824775c7c023be71d3f355f9617208ed592ff0b557e90c6 languageName: node linkType: hard -"@algolia/cache-common@npm:4.22.1": - version: 4.22.1 - resolution: "@algolia/cache-common@npm:4.22.1" - checksum: b57b195fdf75ca53417541fd03b48fa2351c18261f21ddc462ca4e76adef4750a35df9db707e9acc9f7a67fb465757d7f254423b4f8b0661056e4d2ec07392c1 - languageName: node - linkType: hard - -"@algolia/cache-in-memory@npm:4.22.1": - version: 4.22.1 - resolution: "@algolia/cache-in-memory@npm:4.22.1" +"@algolia/client-analytics@npm:5.25.0": + version: 5.25.0 + resolution: "@algolia/client-analytics@npm:5.25.0" dependencies: - "@algolia/cache-common": 4.22.1 - checksum: 83dfe0e3360f5dd03ead8165f6e92e5a414d9e43eee2dd2fb682d418ddcf8c2cb176d040f57ac75018f62ab805518991157bf8572625f1420515f1959f4fdcaa + "@algolia/client-common": 5.25.0 + "@algolia/requester-browser-xhr": 5.25.0 + "@algolia/requester-fetch": 5.25.0 + "@algolia/requester-node-http": 5.25.0 + checksum: ddc0feed1203e9fdd23a799110162b33fe134248020ea6887f24502d73462ab6cc39de30b7a9f1e6e4187d857323468d3f43997c93438e5ac536b9952cefaa8f languageName: node linkType: hard -"@algolia/client-account@npm:4.22.1": - version: 4.22.1 - resolution: "@algolia/client-account@npm:4.22.1" - dependencies: - "@algolia/client-common": 4.22.1 - "@algolia/client-search": 4.22.1 - "@algolia/transporter": 4.22.1 - checksum: 85f3f7f9fa8e9d5b723e128f3b801583d73e4dc529086d57adfc1ac1718c3e13c0660c0d3f3a43a033d5aa231962ed405912826ae74a5c996929943fc575e7ed +"@algolia/client-common@npm:5.25.0": + version: 5.25.0 + resolution: "@algolia/client-common@npm:5.25.0" + checksum: c9d1dc65ec4504a276e7150a0f82aa451aff779662bc9f975aa461f729a4ea250e693791115cd51c5aeeef3e0320af97b585fa7356142c12dbf92ddf97d6c655 languageName: node linkType: hard -"@algolia/client-analytics@npm:4.22.1": - version: 4.22.1 - resolution: "@algolia/client-analytics@npm:4.22.1" +"@algolia/client-insights@npm:5.25.0": + version: 5.25.0 + resolution: "@algolia/client-insights@npm:5.25.0" dependencies: - "@algolia/client-common": 4.22.1 - "@algolia/client-search": 4.22.1 - "@algolia/requester-common": 4.22.1 - "@algolia/transporter": 4.22.1 - checksum: 8a352ae6bbddeba86fbf12de6bdd4f48d7331c5d8cdf803af803f5957a10d0a09ead58e75e364d25a7becdf68e9d5252377e307c055cbfbd6bc2048557bd75f6 + "@algolia/client-common": 5.25.0 + "@algolia/requester-browser-xhr": 5.25.0 + "@algolia/requester-fetch": 5.25.0 + "@algolia/requester-node-http": 5.25.0 + checksum: 1ce9b03d9a50c89f6b64713c3cca6fa388fee3bb605e6e5aa4ce9775eeac6288469b2f63cc5dc66f0d828f560fb3924819136db9bd5013b4642c3ac4393c7a24 languageName: node linkType: hard -"@algolia/client-common@npm:4.22.1": - version: 4.22.1 - resolution: "@algolia/client-common@npm:4.22.1" +"@algolia/client-personalization@npm:5.25.0": + version: 5.25.0 + resolution: "@algolia/client-personalization@npm:5.25.0" dependencies: - "@algolia/requester-common": 4.22.1 - "@algolia/transporter": 4.22.1 - checksum: 848225464bf62972eee80faed400b6e9666678e724c5ddd3ecedc6fb57db1cd5c47c4a06a4cba90f83db38353ea8dcbf53b51d1423164a0258bce7bbe417e7f8 + "@algolia/client-common": 5.25.0 + "@algolia/requester-browser-xhr": 5.25.0 + "@algolia/requester-fetch": 5.25.0 + "@algolia/requester-node-http": 5.25.0 + checksum: 096453dbb4d79ef994f6f1974bb809bf12232b1446fc4bd57873a044feee022fe64bec595036c9789d06a963361a6449fd0c9119e359edc92f5698ad00a60b16 languageName: node linkType: hard -"@algolia/client-personalization@npm:4.22.1": - version: 4.22.1 - resolution: "@algolia/client-personalization@npm:4.22.1" +"@algolia/client-query-suggestions@npm:5.25.0": + version: 5.25.0 + resolution: "@algolia/client-query-suggestions@npm:5.25.0" dependencies: - "@algolia/client-common": 4.22.1 - "@algolia/requester-common": 4.22.1 - "@algolia/transporter": 4.22.1 - checksum: 64c359c12d2722dfcc821a3bacfed2c49f94159060776fba871b66e4961757732d9696840f415b45bbe5ad1dbd39e2c512a81851a9cfeeec8511975396dad245 + "@algolia/client-common": 5.25.0 + "@algolia/requester-browser-xhr": 5.25.0 + "@algolia/requester-fetch": 5.25.0 + "@algolia/requester-node-http": 5.25.0 + checksum: 26445be4bbfaf1ea939339fb365c2f62211803670dc2e8d821ccb36266fc2f99e5b08109c3befdb937e904dee313981ad7b0af8c20ba7e2954d1fcccce792942 languageName: node linkType: hard -"@algolia/client-search@npm:4.22.1": - version: 4.22.1 - resolution: "@algolia/client-search@npm:4.22.1" +"@algolia/client-search@npm:5.25.0": + version: 5.25.0 + resolution: "@algolia/client-search@npm:5.25.0" dependencies: - "@algolia/client-common": 4.22.1 - "@algolia/requester-common": 4.22.1 - "@algolia/transporter": 4.22.1 - checksum: 0477f003c19cf1dbb6190fd491136927bc7174fa9d5a27dead218a51807da9c519be114000bd035265c018682fd8654d110cab07f74004c8c8d069db19800c3d + "@algolia/client-common": 5.25.0 + "@algolia/requester-browser-xhr": 5.25.0 + "@algolia/requester-fetch": 5.25.0 + "@algolia/requester-node-http": 5.25.0 + checksum: fbad54f129a465210398d3995884fedbe16433eb460496fd8279212c8c41ad9b5fa6ec7b86bea73bc57b01c6e4650fc6449533c5ae4dcbaabb842b8dddeb0b41 languageName: node linkType: hard @@ -190,55 +189,66 @@ __metadata: languageName: node linkType: hard -"@algolia/logger-common@npm:4.22.1": - version: 4.22.1 - resolution: "@algolia/logger-common@npm:4.22.1" - checksum: 3ac5430f73e8eabb4e7561b271d38151fb7f128491437c202dac3d54f7c3a83ebc96818532746422ea4abdf9d68a6ccb716dc8b97f69101ff642afaff12057e5 +"@algolia/ingestion@npm:1.25.0": + version: 1.25.0 + resolution: "@algolia/ingestion@npm:1.25.0" + dependencies: + "@algolia/client-common": 5.25.0 + "@algolia/requester-browser-xhr": 5.25.0 + "@algolia/requester-fetch": 5.25.0 + "@algolia/requester-node-http": 5.25.0 + checksum: 802ea840fe5cd6cdd113428c18d038a7e2e431cf70c3306c1ed32f03b7ca023d849b04c62640c75818e40547524fb190a65601fd1840bbe8f593fbc7542820e1 languageName: node linkType: hard -"@algolia/logger-console@npm:4.22.1": - version: 4.22.1 - resolution: "@algolia/logger-console@npm:4.22.1" +"@algolia/monitoring@npm:1.25.0": + version: 1.25.0 + resolution: "@algolia/monitoring@npm:1.25.0" dependencies: - "@algolia/logger-common": 4.22.1 - checksum: fc6ea0623b257420f4e10ca1a78875dfb4c55841a0db5712150344d742ca457038f209b63c4e25848338c652e5ca5ea052a4143c87c3dc1203eedc5bff0c54f3 + "@algolia/client-common": 5.25.0 + "@algolia/requester-browser-xhr": 5.25.0 + "@algolia/requester-fetch": 5.25.0 + "@algolia/requester-node-http": 5.25.0 + checksum: 4b268201719cc6f56f89e0aa5ab97e764c9d204ab07b202de550d48280e69c5d95cece8e9a7f8247c8e7ac5c89957f98efe48a90f7c07b8aaabc50e895a0e97e languageName: node linkType: hard -"@algolia/requester-browser-xhr@npm:4.22.1": - version: 4.22.1 - resolution: "@algolia/requester-browser-xhr@npm:4.22.1" +"@algolia/recommend@npm:5.25.0": + version: 5.25.0 + resolution: "@algolia/recommend@npm:5.25.0" dependencies: - "@algolia/requester-common": 4.22.1 - checksum: 825cf73fdc6aa8b159cd35ebb1facbeccb9fe27c4360661b7c9287d830d92409baaa38ad78f6c6f72bcdebc6e9d6ae8a5c8648e998fd34617b7f1eb7a59ea83b + "@algolia/client-common": 5.25.0 + "@algolia/requester-browser-xhr": 5.25.0 + "@algolia/requester-fetch": 5.25.0 + "@algolia/requester-node-http": 5.25.0 + checksum: b462e360abe2e58c6d6cd39c61b8dc6f9b26a056c308b8289b35c49d43e82d06c631d0936332cd43f9d277964fbf765898d783845f8b4ea458edda6398c76e74 languageName: node linkType: hard -"@algolia/requester-common@npm:4.22.1": - version: 4.22.1 - resolution: "@algolia/requester-common@npm:4.22.1" - checksum: 7caae4924efccabefd6b1a1d4e7090ed2f6dd4ab53dedf2f2095d5c1ef016c841129331c79791f7ded8072e174204503814f11119ac8bc75f5e10ae2eb42a85b +"@algolia/requester-browser-xhr@npm:5.25.0": + version: 5.25.0 + resolution: "@algolia/requester-browser-xhr@npm:5.25.0" + dependencies: + "@algolia/client-common": 5.25.0 + checksum: cbe78d3ffc5d60571b459735cd6b6115c3d96a8f6fac07256d1765e499b9d24941e0e39ce18bd9b3dc46faa1cb1380fb8487154c36a6acbf534d1bb7d3ac3867 languageName: node linkType: hard -"@algolia/requester-node-http@npm:4.22.1": - version: 4.22.1 - resolution: "@algolia/requester-node-http@npm:4.22.1" +"@algolia/requester-fetch@npm:5.25.0": + version: 5.25.0 + resolution: "@algolia/requester-fetch@npm:5.25.0" dependencies: - "@algolia/requester-common": 4.22.1 - checksum: 511348954b7747006875132ed0bc922ec3cfcf0187f41a665fc45426982479dd5cd55fab1de592ac9a71180539ff2e4c7457eea3bdab0e56bce27de2de1ba677 + "@algolia/client-common": 5.25.0 + checksum: 795ddbc4c9a50c64088ae2745d8270a9b5275f6f9bb13f53ccaa4e9193666bcbcb514ca5c2e82138698c2c194995c97ce6386927c75e5aaf116e5663cb47657d languageName: node linkType: hard -"@algolia/transporter@npm:4.22.1": - version: 4.22.1 - resolution: "@algolia/transporter@npm:4.22.1" +"@algolia/requester-node-http@npm:5.25.0": + version: 5.25.0 + resolution: "@algolia/requester-node-http@npm:5.25.0" dependencies: - "@algolia/cache-common": 4.22.1 - "@algolia/logger-common": 4.22.1 - "@algolia/requester-common": 4.22.1 - checksum: 737e787ac77215f30db54ebab3431e06cfee1790ab7cf45222546470546ecb276eedfaa0aedf78b2c95efa9d5550ea7d47c947535f143d7002a22f781d8721ce + "@algolia/client-common": 5.25.0 + checksum: 24231761720f059311d753abea5328038417e36c458acdff06d22e287d75e11b23ddb93011a86c4381a28e903622835f0b73a28160bfec7a69bea26c5b1d5942 languageName: node linkType: hard @@ -2151,6 +2161,46 @@ __metadata: languageName: node linkType: hard +"@csstools/cascade-layer-name-parser@npm:^2.0.5": + version: 2.0.5 + resolution: "@csstools/cascade-layer-name-parser@npm:2.0.5" + peerDependencies: + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + checksum: fb26ae1db6f7a71ee0c3fdaea89f5325f88d7a0b2505fcf4b75e94f2c816ef1edb2961eecbc397df06f67d696ccc6bc99588ea9ee07dd7632bf10febf6b67ed9 + languageName: node + linkType: hard + +"@csstools/color-helpers@npm:^5.0.2": + version: 5.0.2 + resolution: "@csstools/color-helpers@npm:5.0.2" + checksum: 76753f9823579af959630be5f7682e1abe5ae13b75621532927cfc1ff601cc1e31b78547fe387699980820bb7353e20e8cab258fab590aac9d19aa44984283d5 + languageName: node + linkType: hard + +"@csstools/css-calc@npm:^2.1.4": + version: 2.1.4 + resolution: "@csstools/css-calc@npm:2.1.4" + peerDependencies: + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + checksum: b833d1a031dfb3e3268655aa384121b864fce9bad05f111a3cf2a343eed69ba5d723f3f7cd0793fd7b7a28de2f8141f94568828f48de41d86cefa452eee06390 + languageName: node + linkType: hard + +"@csstools/css-color-parser@npm:^3.0.10": + version: 3.0.10 + resolution: "@csstools/css-color-parser@npm:3.0.10" + dependencies: + "@csstools/color-helpers": ^5.0.2 + "@csstools/css-calc": ^2.1.4 + peerDependencies: + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + checksum: 53741dd054b5347c1c5fc51efdff336f9ac4398ef9402603eabd95cf046e8a7c1eae67dfe2497af77b6bfae3dcd5f5ae23aaa37e7d6329210e1768a9c8e8fc90 + languageName: node + linkType: hard + "@csstools/css-parser-algorithms@npm:^3.0.4": version: 3.0.4 resolution: "@csstools/css-parser-algorithms@npm:3.0.4" @@ -2160,6 +2210,15 @@ __metadata: languageName: node linkType: hard +"@csstools/css-parser-algorithms@npm:^3.0.5": + version: 3.0.5 + resolution: "@csstools/css-parser-algorithms@npm:3.0.5" + peerDependencies: + "@csstools/css-tokenizer": ^3.0.4 + checksum: 80647139574431071e4664ad3c3e141deef4368f0ca536a63b3872487db68cf0d908fb76000f967deb1866963a90e6357fc6b9b00fdfa032f3321cebfcc66cd7 + languageName: node + linkType: hard + "@csstools/css-tokenizer@npm:^3.0.3": version: 3.0.3 resolution: "@csstools/css-tokenizer@npm:3.0.3" @@ -2167,6 +2226,13 @@ __metadata: languageName: node linkType: hard +"@csstools/css-tokenizer@npm:^3.0.4": + version: 3.0.4 + resolution: "@csstools/css-tokenizer@npm:3.0.4" + checksum: adc6681d3a0d7a75dc8e5ee0488c99ad4509e4810ae45dd6549a2e64a996e8d75512e70bb244778dc0c6ee85723e20eaeea8c083bf65b51eb19034e182554243 + languageName: node + linkType: hard + "@csstools/media-query-list-parser@npm:^4.0.2": version: 4.0.2 resolution: "@csstools/media-query-list-parser@npm:4.0.2" @@ -2177,6 +2243,437 @@ __metadata: languageName: node linkType: hard +"@csstools/media-query-list-parser@npm:^4.0.3": + version: 4.0.3 + resolution: "@csstools/media-query-list-parser@npm:4.0.3" + peerDependencies: + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + checksum: dd7dc015a94e0832e5289794f6ab730d1c3fdc85fbd92433eb608dceb91e4977d345c08fe90c487359ce3ba39185fe15789d09c321c799f5c18c6aec7bd8da09 + languageName: node + linkType: hard + +"@csstools/postcss-cascade-layers@npm:^5.0.1": + version: 5.0.1 + resolution: "@csstools/postcss-cascade-layers@npm:5.0.1" + dependencies: + "@csstools/selector-specificity": ^5.0.0 + postcss-selector-parser: ^7.0.0 + peerDependencies: + postcss: ^8.4 + checksum: 5181c56823791ad43763b6daed225b4da290bea950f4cfb38be1961383a8366a47f67fb0098d7adb0b63ac84a7912295383452f1b05ab53bd681d9d13e91f97a + languageName: node + linkType: hard + +"@csstools/postcss-color-function@npm:^4.0.10": + version: 4.0.10 + resolution: "@csstools/postcss-color-function@npm:4.0.10" + dependencies: + "@csstools/css-color-parser": ^3.0.10 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/postcss-progressive-custom-properties": ^4.1.0 + "@csstools/utilities": ^2.0.0 + peerDependencies: + postcss: ^8.4 + checksum: bf7650eab21784bfd3ed5618e1df081a989cedccf54b80accc72819dd463c4c57d99b9c4e5479cac5d889f39d09cc8ad610b82148300591e6bc547b238464056 + languageName: node + linkType: hard + +"@csstools/postcss-color-mix-function@npm:^3.0.10": + version: 3.0.10 + resolution: "@csstools/postcss-color-mix-function@npm:3.0.10" + dependencies: + "@csstools/css-color-parser": ^3.0.10 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/postcss-progressive-custom-properties": ^4.1.0 + "@csstools/utilities": ^2.0.0 + peerDependencies: + postcss: ^8.4 + checksum: ea52be6f45979297de77310a095d2df105e0da064300f489572cb9b78e4906e9e6bbbe8fdfc82cf2e01a8bdb2473c36a234852ad5c5ea1eda580b9bc222159b4 + languageName: node + linkType: hard + +"@csstools/postcss-color-mix-variadic-function-arguments@npm:^1.0.0": + version: 1.0.0 + resolution: "@csstools/postcss-color-mix-variadic-function-arguments@npm:1.0.0" + dependencies: + "@csstools/css-color-parser": ^3.0.10 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/postcss-progressive-custom-properties": ^4.1.0 + "@csstools/utilities": ^2.0.0 + peerDependencies: + postcss: ^8.4 + checksum: f12bf1d63eaf348ebe2ef9c79ddb1a63df3370a556f02d11cbe3ab8540016bd47fd7384948a426207f92131e0f5981d3695fbd046b5768c0ec63e45cc92e31a7 + languageName: node + linkType: hard + +"@csstools/postcss-content-alt-text@npm:^2.0.6": + version: 2.0.6 + resolution: "@csstools/postcss-content-alt-text@npm:2.0.6" + dependencies: + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/postcss-progressive-custom-properties": ^4.1.0 + "@csstools/utilities": ^2.0.0 + peerDependencies: + postcss: ^8.4 + checksum: 2edca1f35b9d59cc3933a318db8cdeaed435169c35d1b0e9fb394349d4633c544ca03243b21be849c8d9f0986a9b10125635e7ed33ef89c28c1346cdb05fdab6 + languageName: node + linkType: hard + +"@csstools/postcss-exponential-functions@npm:^2.0.9": + version: 2.0.9 + resolution: "@csstools/postcss-exponential-functions@npm:2.0.9" + dependencies: + "@csstools/css-calc": ^2.1.4 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + peerDependencies: + postcss: ^8.4 + checksum: 80d5847d747fc67c32ee3ba49f9c9290654fb086c58b2f13256b14124b7349dac68ba8e107f631248cef2448ca57ef18adbbbc816dd63a54ba91826345373f39 + languageName: node + linkType: hard + +"@csstools/postcss-font-format-keywords@npm:^4.0.0": + version: 4.0.0 + resolution: "@csstools/postcss-font-format-keywords@npm:4.0.0" + dependencies: + "@csstools/utilities": ^2.0.0 + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: 63091d4748cfc5a51e3c288cd620f058a4e776ba15da6180edaee94aaad9c4e92076f575d064dabc00b28966b33dd1e59f84a6ca6a66aed59556ef92a0dfed45 + languageName: node + linkType: hard + +"@csstools/postcss-gamut-mapping@npm:^2.0.10": + version: 2.0.10 + resolution: "@csstools/postcss-gamut-mapping@npm:2.0.10" + dependencies: + "@csstools/css-color-parser": ^3.0.10 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + peerDependencies: + postcss: ^8.4 + checksum: 371449cc8c3db29a27b75afeb500777150f9f9e4edca71f63f2de12bc2c68f4157450ed6a6fdddfaa5596f4a17922176b862d14458a7ce6c15c81d06a0e9fc12 + languageName: node + linkType: hard + +"@csstools/postcss-gradients-interpolation-method@npm:^5.0.10": + version: 5.0.10 + resolution: "@csstools/postcss-gradients-interpolation-method@npm:5.0.10" + dependencies: + "@csstools/css-color-parser": ^3.0.10 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/postcss-progressive-custom-properties": ^4.1.0 + "@csstools/utilities": ^2.0.0 + peerDependencies: + postcss: ^8.4 + checksum: ed639018eddd83ebcb96f1c09573c052ebaad153d87abc5f5fa3c0b6dc2a4ed151e25da91c173b87b7b087688c9ec3239210eba2dbc4b9d6bc624a05209e2d33 + languageName: node + linkType: hard + +"@csstools/postcss-hwb-function@npm:^4.0.10": + version: 4.0.10 + resolution: "@csstools/postcss-hwb-function@npm:4.0.10" + dependencies: + "@csstools/css-color-parser": ^3.0.10 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/postcss-progressive-custom-properties": ^4.1.0 + "@csstools/utilities": ^2.0.0 + peerDependencies: + postcss: ^8.4 + checksum: b2a003fe844b0d5b44a1ba46754afdb298be94a771e2b4109391e774b07a04bfad0bc8d9e833bb862567bed533f54cdc146cdc5b869b69bdd3e5526e2651c200 + languageName: node + linkType: hard + +"@csstools/postcss-ic-unit@npm:^4.0.2": + version: 4.0.2 + resolution: "@csstools/postcss-ic-unit@npm:4.0.2" + dependencies: + "@csstools/postcss-progressive-custom-properties": ^4.1.0 + "@csstools/utilities": ^2.0.0 + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: 4242221d9c1ed5f6062b6816a5cbbfb121aa919a0468bb786ff84e8eaf4e7656754b4587c51e9b2ae5bc6a7e53ac17ce05297b095866c8a02edb3b31ce74e18e + languageName: node + linkType: hard + +"@csstools/postcss-initial@npm:^2.0.1": + version: 2.0.1 + resolution: "@csstools/postcss-initial@npm:2.0.1" + peerDependencies: + postcss: ^8.4 + checksum: 914e9f56faf4e69757b0c905c4808dd39b1de30d151db5817da04510b89cb19b570a405ac2ca070941a42d5ce3f48682329de5ac21ac76416a0a98fee2de2d0d + languageName: node + linkType: hard + +"@csstools/postcss-is-pseudo-class@npm:^5.0.1": + version: 5.0.1 + resolution: "@csstools/postcss-is-pseudo-class@npm:5.0.1" + dependencies: + "@csstools/selector-specificity": ^5.0.0 + postcss-selector-parser: ^7.0.0 + peerDependencies: + postcss: ^8.4 + checksum: 6f9fa0815d762a3eee703d14ab992b1e653d0b7abfe0422755daf659fa0d360a015c624357a0b75dc660054acf54997171ce723740f96441cef540d00b60be7d + languageName: node + linkType: hard + +"@csstools/postcss-light-dark-function@npm:^2.0.9": + version: 2.0.9 + resolution: "@csstools/postcss-light-dark-function@npm:2.0.9" + dependencies: + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/postcss-progressive-custom-properties": ^4.1.0 + "@csstools/utilities": ^2.0.0 + peerDependencies: + postcss: ^8.4 + checksum: 98a68dc44dfc053b8afddf96bcf8790703d58455bc36475908255f716b88a1e87e49807ff7ae8ecf9c7345ee88524eadd2a872c8ab347348dee1a37f58c58bc4 + languageName: node + linkType: hard + +"@csstools/postcss-logical-float-and-clear@npm:^3.0.0": + version: 3.0.0 + resolution: "@csstools/postcss-logical-float-and-clear@npm:3.0.0" + peerDependencies: + postcss: ^8.4 + checksum: 793d9a89c28d4809a83b6111d321f60947a59f119d61046e5c4023ce2caedbb221298e69b6df38995e51b763545807db7b03da47e47461622f32928fec92b65f + languageName: node + linkType: hard + +"@csstools/postcss-logical-overflow@npm:^2.0.0": + version: 2.0.0 + resolution: "@csstools/postcss-logical-overflow@npm:2.0.0" + peerDependencies: + postcss: ^8.4 + checksum: bf73ea1d7754f59773af5a7b434e9eaa2ce05c8fe7aa26a726dce8f2a42abb0f5686fbf9672d25912250226174c35f2c5737ca072d21f8b68420500b7449fe58 + languageName: node + linkType: hard + +"@csstools/postcss-logical-overscroll-behavior@npm:^2.0.0": + version: 2.0.0 + resolution: "@csstools/postcss-logical-overscroll-behavior@npm:2.0.0" + peerDependencies: + postcss: ^8.4 + checksum: bf043fdad02b9578fc2dcddb409b014a15dee65a9813ceb583237dff1caf807e18101f68bde2b0d8b685139d823114ab8deed6da3027878d11a945755824d3b1 + languageName: node + linkType: hard + +"@csstools/postcss-logical-resize@npm:^3.0.0": + version: 3.0.0 + resolution: "@csstools/postcss-logical-resize@npm:3.0.0" + dependencies: + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: 3be1133a9ac27e0a0d73b19d573adc00ad78a697522eaf6c9de90260882ba8ff0904c7ab3e68379ee7724e28661c4b497cb665e258214bc8355f4a0d91021c46 + languageName: node + linkType: hard + +"@csstools/postcss-logical-viewport-units@npm:^3.0.4": + version: 3.0.4 + resolution: "@csstools/postcss-logical-viewport-units@npm:3.0.4" + dependencies: + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/utilities": ^2.0.0 + peerDependencies: + postcss: ^8.4 + checksum: ddb8d9b473c55cce1c1261652d657d33d9306d80112eac578d53b05dd48a5607ea2064fcf6bc298ccc1e63143e11517d35230bad6063dae14d445530c45a81ec + languageName: node + linkType: hard + +"@csstools/postcss-media-minmax@npm:^2.0.9": + version: 2.0.9 + resolution: "@csstools/postcss-media-minmax@npm:2.0.9" + dependencies: + "@csstools/css-calc": ^2.1.4 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/media-query-list-parser": ^4.0.3 + peerDependencies: + postcss: ^8.4 + checksum: 24da18a5a41daef2ea4cf7d85f459b5b425085501324a3f0546309ba13f682ab57d9aabc4e639a724cd1d91a0ead046b9ab8164adad31d89c9e39ca918f5494b + languageName: node + linkType: hard + +"@csstools/postcss-media-queries-aspect-ratio-number-values@npm:^3.0.5": + version: 3.0.5 + resolution: "@csstools/postcss-media-queries-aspect-ratio-number-values@npm:3.0.5" + dependencies: + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/media-query-list-parser": ^4.0.3 + peerDependencies: + postcss: ^8.4 + checksum: 5a316f59c3d422eef942d01c4007d14fad8f85ce85efce080a90d8d3eb3257dc6fcce612c5ee57cf4665993a03bc5ccb538dac8e25041242ecf74f5c348a3c5a + languageName: node + linkType: hard + +"@csstools/postcss-nested-calc@npm:^4.0.0": + version: 4.0.0 + resolution: "@csstools/postcss-nested-calc@npm:4.0.0" + dependencies: + "@csstools/utilities": ^2.0.0 + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: f334861687d7e3a4b9c26940e767a06f07e0095cab405a5b086fca407d6f743c57b552d4504ba7d5b1700a97da3507a41bf3bc2d126a26028b79f96ea38b6af5 + languageName: node + linkType: hard + +"@csstools/postcss-normalize-display-values@npm:^4.0.0": + version: 4.0.0 + resolution: "@csstools/postcss-normalize-display-values@npm:4.0.0" + dependencies: + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: 750093837486da6dd0cc66183fe9909a18485f23610669806b708ab9942c721a773997cde37fd7ee085aca3d6de065ffd5609c77df5e2f303d67af106e53726e + languageName: node + linkType: hard + +"@csstools/postcss-oklab-function@npm:^4.0.10": + version: 4.0.10 + resolution: "@csstools/postcss-oklab-function@npm:4.0.10" + dependencies: + "@csstools/css-color-parser": ^3.0.10 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/postcss-progressive-custom-properties": ^4.1.0 + "@csstools/utilities": ^2.0.0 + peerDependencies: + postcss: ^8.4 + checksum: 5d715a58e821aa5f5d30efe69b4b0a3dde301c75343d30c7b6a1a39ce3f6b7d060c10d063cda1c6424d58e4efeebee187f910fe7c011a701d623b71d3444b603 + languageName: node + linkType: hard + +"@csstools/postcss-progressive-custom-properties@npm:^4.1.0": + version: 4.1.0 + resolution: "@csstools/postcss-progressive-custom-properties@npm:4.1.0" + dependencies: + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: ac60f683d25e224a15e5b2c06b1b0e29f51f72cc9f2704b82565e489d7f0f8532267a4b9300396ae402a93590bc9c35d5002ffda446f430e2c1c61a6cffcfd5c + languageName: node + linkType: hard + +"@csstools/postcss-random-function@npm:^2.0.1": + version: 2.0.1 + resolution: "@csstools/postcss-random-function@npm:2.0.1" + dependencies: + "@csstools/css-calc": ^2.1.4 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + peerDependencies: + postcss: ^8.4 + checksum: d421a790b11675edf493f3e48259636beca164c494ed2883042118b35674d26f04e1a46f9e89203a179e20acc2a1f5912078ec81b330a2c1a1abef7e7387e587 + languageName: node + linkType: hard + +"@csstools/postcss-relative-color-syntax@npm:^3.0.10": + version: 3.0.10 + resolution: "@csstools/postcss-relative-color-syntax@npm:3.0.10" + dependencies: + "@csstools/css-color-parser": ^3.0.10 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/postcss-progressive-custom-properties": ^4.1.0 + "@csstools/utilities": ^2.0.0 + peerDependencies: + postcss: ^8.4 + checksum: d09d0e559a538f3e0c120f1c660de799ada6f9f77423b945faf6648d914f8c6a3a6d8647ab6c895e5edaade4dfcceb207d6a44ff5e7e63998330677bf304cb08 + languageName: node + linkType: hard + +"@csstools/postcss-scope-pseudo-class@npm:^4.0.1": + version: 4.0.1 + resolution: "@csstools/postcss-scope-pseudo-class@npm:4.0.1" + dependencies: + postcss-selector-parser: ^7.0.0 + peerDependencies: + postcss: ^8.4 + checksum: 043667ad54b3a26e619d6c16129c1f4d8f8c7cd1c52443475aa7782dbc411390c23bd2fe41ea9c6a3f280594abbcdd9d4117a3d7c27cd2a77e31e6fd11e29fc0 + languageName: node + linkType: hard + +"@csstools/postcss-sign-functions@npm:^1.1.4": + version: 1.1.4 + resolution: "@csstools/postcss-sign-functions@npm:1.1.4" + dependencies: + "@csstools/css-calc": ^2.1.4 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + peerDependencies: + postcss: ^8.4 + checksum: 0afcb008142a0a41df51267d79cf950f4f314394dca7c041e3a0be87df56517ac5400861630a979b5bef49f01c296025106622110384039e3c8f82802d6adcde + languageName: node + linkType: hard + +"@csstools/postcss-stepped-value-functions@npm:^4.0.9": + version: 4.0.9 + resolution: "@csstools/postcss-stepped-value-functions@npm:4.0.9" + dependencies: + "@csstools/css-calc": ^2.1.4 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + peerDependencies: + postcss: ^8.4 + checksum: 6465a883be42d4cc4a4e83be2626a1351de4bfe84a63641c53e7c39d3c0e109152489ca2d8235625cdf6726341c676b9fbbca18fe80bb5eae8d488a0e42fc5e4 + languageName: node + linkType: hard + +"@csstools/postcss-text-decoration-shorthand@npm:^4.0.2": + version: 4.0.2 + resolution: "@csstools/postcss-text-decoration-shorthand@npm:4.0.2" + dependencies: + "@csstools/color-helpers": ^5.0.2 + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: c67b9c6582f7cd05d8a0df5ba98531ca07721c80f3ddf8ec69d1b9da5c6e1fd9313e25ce9ed378bbdf11c6dcd37367f3ebf1d4fabb6af99232e11bb662bfa1f9 + languageName: node + linkType: hard + +"@csstools/postcss-trigonometric-functions@npm:^4.0.9": + version: 4.0.9 + resolution: "@csstools/postcss-trigonometric-functions@npm:4.0.9" + dependencies: + "@csstools/css-calc": ^2.1.4 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + peerDependencies: + postcss: ^8.4 + checksum: c746cd986df061a87de4f2d0129aa2d2e98a2948e5005fe6fe419a9e9ec7a0f7382461847cbd3f67f8f66169bdf23a1d7f53ca6b9922ddd235ec45f2867a8825 + languageName: node + linkType: hard + +"@csstools/postcss-unset-value@npm:^4.0.0": + version: 4.0.0 + resolution: "@csstools/postcss-unset-value@npm:4.0.0" + peerDependencies: + postcss: ^8.4 + checksum: 3d194feea11f80ba82e19733d1531546abeba0af9fe6fc105acdf10452d699661da4e1bce45101f90bcb624a30570e469cee945c5a62b9ffe1445959a0b782d1 + languageName: node + linkType: hard + +"@csstools/selector-resolve-nested@npm:^3.0.0": + version: 3.0.0 + resolution: "@csstools/selector-resolve-nested@npm:3.0.0" + peerDependencies: + postcss-selector-parser: ^7.0.0 + checksum: 2059b6d1931d157162fb4a79ebdea614cf2b0024609f5e5cba4aa44a80367b25503c22c49bff99de4fa5fa921ce713cc642fa8aa562f3535e8d0126e6b41778e + languageName: node + linkType: hard + "@csstools/selector-specificity@npm:^5.0.0": version: 5.0.0 resolution: "@csstools/selector-specificity@npm:5.0.0" @@ -2186,6 +2683,15 @@ __metadata: languageName: node linkType: hard +"@csstools/utilities@npm:^2.0.0": + version: 2.0.0 + resolution: "@csstools/utilities@npm:2.0.0" + peerDependencies: + postcss: ^8.4 + checksum: c9c8d82063ec5156d56b056c9124fed95714f05d7c1a64043174b0559aa099989f17a826579f22045384defe152e32d6355b7a9660cfed96819f43fccf277941 + languageName: node + linkType: hard + "@discoveryjs/json-ext@npm:0.5.7": version: 0.5.7 resolution: "@discoveryjs/json-ext@npm:0.5.7" @@ -2193,25 +2699,25 @@ __metadata: languageName: node linkType: hard -"@docsearch/css@npm:3.5.2": - version: 3.5.2 - resolution: "@docsearch/css@npm:3.5.2" - checksum: d1d60dd230dd48f896755f21bd20b59583ba844212d7d336953ae48d389baaf868bdf83320fb734a4ed679c3f95b15d620cf3764cd538f6941cae239f8c9d35d +"@docsearch/css@npm:3.9.0": + version: 3.9.0 + resolution: "@docsearch/css@npm:3.9.0" + checksum: 8e6f5a995d17881c76b31e5364274b3387917ccbc417ba183009f2655dd507244f7009d27807675f09011efcd8e13d80505e7e17eff1a5d93bcd71324a5fc262 languageName: node linkType: hard -"@docsearch/react@npm:^3.5.2": - version: 3.5.2 - resolution: "@docsearch/react@npm:3.5.2" +"@docsearch/react@npm:^3.8.1": + version: 3.9.0 + resolution: "@docsearch/react@npm:3.9.0" dependencies: - "@algolia/autocomplete-core": 1.9.3 - "@algolia/autocomplete-preset-algolia": 1.9.3 - "@docsearch/css": 3.5.2 - algoliasearch: ^4.19.1 + "@algolia/autocomplete-core": 1.17.9 + "@algolia/autocomplete-preset-algolia": 1.17.9 + "@docsearch/css": 3.9.0 + algoliasearch: ^5.14.2 peerDependencies: - "@types/react": ">= 16.8.0 < 19.0.0" - react: ">= 16.8.0 < 19.0.0" - react-dom: ">= 16.8.0 < 19.0.0" + "@types/react": ">= 16.8.0 < 20.0.0" + react: ">= 16.8.0 < 20.0.0" + react-dom: ">= 16.8.0 < 20.0.0" search-insights: ">= 1 < 3" peerDependenciesMeta: "@types/react": @@ -2222,13 +2728,13 @@ __metadata: optional: true search-insights: optional: true - checksum: 4b4584c2c73fc18cbd599047538896450974e134c2c74f19eb202db0ce8e6c3c49c6f65ed6ade61c796d476d3cbb55d6be58df62bc9568a0c72d88e42fca1d16 + checksum: af6c531af5f4c10fb57d4d29ae47fe297e4201c5130492e2c73c34306348bf87ab05b7eeae2cb83a6c33dbe8da3754b82275b86ae0116df65f34a9e51f9291bc languageName: node linkType: hard -"@docusaurus/babel@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/babel@npm:3.6.1" +"@docusaurus/babel@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/babel@npm:3.7.0" dependencies: "@babel/core": ^7.25.9 "@babel/generator": ^7.25.9 @@ -2240,26 +2746,25 @@ __metadata: "@babel/runtime": ^7.25.9 "@babel/runtime-corejs3": ^7.25.9 "@babel/traverse": ^7.25.9 - "@docusaurus/logger": 3.6.1 - "@docusaurus/utils": 3.6.1 + "@docusaurus/logger": 3.7.0 + "@docusaurus/utils": 3.7.0 babel-plugin-dynamic-import-node: ^2.3.3 fs-extra: ^11.1.1 tslib: ^2.6.0 - checksum: fcd6420fe2df051c353f5b651de1874841ccbd5d1e1fd26e77f312fcb46a3bc4cb9cc916789d59b99730bd2fbea77e05689f86abada163b26a67f17624f075a5 + checksum: 1a620722de3e6090a409e2e14c8d5f779b735ad33961b12ec0e53f48b04bacb6a49b48de73a5a3f5f9f8c4487e032ec5f8a354c50fcb429445d7df9949e5491d languageName: node linkType: hard -"@docusaurus/bundler@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/bundler@npm:3.6.1" +"@docusaurus/bundler@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/bundler@npm:3.7.0" dependencies: "@babel/core": ^7.25.9 - "@docusaurus/babel": 3.6.1 - "@docusaurus/cssnano-preset": 3.6.1 - "@docusaurus/logger": 3.6.1 - "@docusaurus/types": 3.6.1 - "@docusaurus/utils": 3.6.1 - autoprefixer: ^10.4.14 + "@docusaurus/babel": 3.7.0 + "@docusaurus/cssnano-preset": 3.7.0 + "@docusaurus/logger": 3.7.0 + "@docusaurus/types": 3.7.0 + "@docusaurus/utils": 3.7.0 babel-loader: ^9.2.1 clean-css: ^5.3.2 copy-webpack-plugin: ^11.0.0 @@ -2272,6 +2777,7 @@ __metadata: null-loader: ^4.0.1 postcss: ^8.4.26 postcss-loader: ^7.3.3 + postcss-preset-env: ^10.1.0 react-dev-utils: ^12.0.1 terser-webpack-plugin: ^5.3.9 tslib: ^2.6.0 @@ -2283,21 +2789,21 @@ __metadata: peerDependenciesMeta: "@docusaurus/faster": optional: true - checksum: 996bf2dc8ece4287cb26eedb49089c524d3ba616ac56de9b434041eccb0dfb8fe38051dab3916cf730da4820cf4a4846c2c4955729d17fc6c84deadc114478b7 + checksum: a4278095ff7480d2ed63dd66a96f9913284dc8cae05d489bee9964fdf22a34fc4c5ddb4712f544aaed6e6bb60dac0701a27437f37040895fc6504f8432eb1c64 languageName: node linkType: hard -"@docusaurus/core@npm:3.6.1, @docusaurus/core@npm:^3.2.1": - version: 3.6.1 - resolution: "@docusaurus/core@npm:3.6.1" +"@docusaurus/core@npm:3.7.0, @docusaurus/core@npm:~3.7.0": + version: 3.7.0 + resolution: "@docusaurus/core@npm:3.7.0" dependencies: - "@docusaurus/babel": 3.6.1 - "@docusaurus/bundler": 3.6.1 - "@docusaurus/logger": 3.6.1 - "@docusaurus/mdx-loader": 3.6.1 - "@docusaurus/utils": 3.6.1 - "@docusaurus/utils-common": 3.6.1 - "@docusaurus/utils-validation": 3.6.1 + "@docusaurus/babel": 3.7.0 + "@docusaurus/bundler": 3.7.0 + "@docusaurus/logger": 3.7.0 + "@docusaurus/mdx-loader": 3.7.0 + "@docusaurus/utils": 3.7.0 + "@docusaurus/utils-common": 3.7.0 + "@docusaurus/utils-validation": 3.7.0 boxen: ^6.2.1 chalk: ^4.1.2 chokidar: ^3.5.3 @@ -2318,13 +2824,12 @@ __metadata: p-map: ^4.0.0 prompts: ^2.4.2 react-dev-utils: ^12.0.1 - react-helmet-async: ^1.3.0 + react-helmet-async: "npm:@slorber/react-helmet-async@1.3.0" react-loadable: "npm:@docusaurus/react-loadable@6.0.0" react-loadable-ssr-addon-v5-slorber: ^1.0.1 react-router: ^5.3.4 react-router-config: ^5.1.1 react-router-dom: ^5.3.4 - rtl-detect: ^1.0.4 semver: ^7.5.4 serve-handler: ^6.1.6 shelljs: ^0.8.5 @@ -2336,43 +2841,43 @@ __metadata: webpack-merge: ^6.0.1 peerDependencies: "@mdx-js/react": ^3.0.0 - react: ^18.0.0 - react-dom: ^18.0.0 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 bin: docusaurus: bin/docusaurus.mjs - checksum: 5a12e4b57fad44e0107896450995c79c565c24201efb1341f3522fc74ec2739ce5a23b52ef8dd301b5cd383aa49d647f86e1e2e7f94d8beda97ffc4582572efe + checksum: 6f9dafa3f615e518786203e6ee1cc21cd990bcea47cb11727b2d02e555d9744d977dda7b42d0486e36936401116069117b8edebbaa18855399391dbf4ac44268 languageName: node linkType: hard -"@docusaurus/cssnano-preset@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/cssnano-preset@npm:3.6.1" +"@docusaurus/cssnano-preset@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/cssnano-preset@npm:3.7.0" dependencies: cssnano-preset-advanced: ^6.1.2 postcss: ^8.4.38 postcss-sort-media-queries: ^5.2.0 tslib: ^2.6.0 - checksum: ab1cd28815b88d8b5ff3e23e9d60f233a70f2613c4471d6b1b7db0a1e7bc1c360bf3b2e2b2ec9dad55f38c4ffc731bba22c4deb795b063f989300afc57ef93fb + checksum: 3d2af3abddbe32777d0dcbffd5d8858ed5934d08cd48b0ff3c81e8d328c7895287c0c0c7a823b3ecdf9f2582ac38aad3a8ca9fa53010dba4ff59ce1a259265a5 languageName: node linkType: hard -"@docusaurus/logger@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/logger@npm:3.6.1" +"@docusaurus/logger@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/logger@npm:3.7.0" dependencies: chalk: ^4.1.2 tslib: ^2.6.0 - checksum: b4e3ea7df30411d2c0f5a288f96d16ded76864fc2f114c6cd6ddf2f73ef858fe734dfa29a8ef68d71507783dbb6f0b2cf5e2329e6353e15cdf1d9077f244e775 + checksum: 22e0cfbaf2775bb813d424385b17cc72343dae2e10c9a3bd43cb8e6ab929322313b4a00cadfa3b1f0589003dd561c49fa523f87a31ed02a8f27d17a677d19d8a languageName: node linkType: hard -"@docusaurus/mdx-loader@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/mdx-loader@npm:3.6.1" +"@docusaurus/mdx-loader@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/mdx-loader@npm:3.7.0" dependencies: - "@docusaurus/logger": 3.6.1 - "@docusaurus/utils": 3.6.1 - "@docusaurus/utils-validation": 3.6.1 + "@docusaurus/logger": 3.7.0 + "@docusaurus/utils": 3.7.0 + "@docusaurus/utils-validation": 3.7.0 "@mdx-js/mdx": ^3.0.0 "@slorber/remark-comment": ^1.0.0 escape-html: ^1.0.3 @@ -2395,62 +2900,62 @@ __metadata: vfile: ^6.0.1 webpack: ^5.88.1 peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 9498e35e12b53b476ab7382b5e8bd33db70a54bae98839b2c589f6651a8f9cee3bd16fe34032bbae6e6fc11383ffd2a78a98d9a0d707e0dcaaa162d29ccec3e2 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: be3307029f2c3f96c4caf72e71746676c065f376037d6d869fe4ce5fb5c41cdd41515a4b780e112e428b91e2873409115dbfa3f00894c8e24f261bdd1dbe91af languageName: node linkType: hard -"@docusaurus/module-type-aliases@npm:3.6.1, @docusaurus/module-type-aliases@npm:^3.2.1": - version: 3.6.1 - resolution: "@docusaurus/module-type-aliases@npm:3.6.1" +"@docusaurus/module-type-aliases@npm:3.7.0, @docusaurus/module-type-aliases@npm:~3.7.0": + version: 3.7.0 + resolution: "@docusaurus/module-type-aliases@npm:3.7.0" dependencies: - "@docusaurus/types": 3.6.1 + "@docusaurus/types": 3.7.0 "@types/history": ^4.7.11 "@types/react": "*" "@types/react-router-config": "*" "@types/react-router-dom": "*" - react-helmet-async: "*" + react-helmet-async: "npm:@slorber/react-helmet-async@*" react-loadable: "npm:@docusaurus/react-loadable@6.0.0" peerDependencies: react: "*" react-dom: "*" - checksum: ad151a3ee4799b66fc623f76bc88009815e8420bbfd70a176eb4484ba9b54e98016cdfcd13fc04f5257355d65a7c0a959671e7a3ba8942ad12abe9e733ca6f41 + checksum: 6fa31e416e81b0763c42ec5593f06e48950223ae4df47060a60baa84a70f5e955987f028d04087e8ecd0ce12e831087b00fc435c375536a8665440bd13a74e6a languageName: node linkType: hard -"@docusaurus/plugin-client-redirects@npm:^3.2.1": - version: 3.6.1 - resolution: "@docusaurus/plugin-client-redirects@npm:3.6.1" +"@docusaurus/plugin-client-redirects@npm:~3.7.0": + version: 3.7.0 + resolution: "@docusaurus/plugin-client-redirects@npm:3.7.0" dependencies: - "@docusaurus/core": 3.6.1 - "@docusaurus/logger": 3.6.1 - "@docusaurus/utils": 3.6.1 - "@docusaurus/utils-common": 3.6.1 - "@docusaurus/utils-validation": 3.6.1 + "@docusaurus/core": 3.7.0 + "@docusaurus/logger": 3.7.0 + "@docusaurus/utils": 3.7.0 + "@docusaurus/utils-common": 3.7.0 + "@docusaurus/utils-validation": 3.7.0 eta: ^2.2.0 fs-extra: ^11.1.1 lodash: ^4.17.21 tslib: ^2.6.0 peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 530ba9fab4b532cc0aed5f8bdd8389f5aaaba51722987e936c3e2531f28dc384c87c5ca9ad62e70679a41e2265b9fae90afb67444f889b5f5228829ff3c76314 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: d5a803ce42ae1d54a8b39912b64a02d36770457345150f3ef3892e48fa875d2537cd92fafc02226ae1a0de173d05936a3524483956a5b523cc66205667f46f14 languageName: node linkType: hard -"@docusaurus/plugin-content-blog@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/plugin-content-blog@npm:3.6.1" +"@docusaurus/plugin-content-blog@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/plugin-content-blog@npm:3.7.0" dependencies: - "@docusaurus/core": 3.6.1 - "@docusaurus/logger": 3.6.1 - "@docusaurus/mdx-loader": 3.6.1 - "@docusaurus/theme-common": 3.6.1 - "@docusaurus/types": 3.6.1 - "@docusaurus/utils": 3.6.1 - "@docusaurus/utils-common": 3.6.1 - "@docusaurus/utils-validation": 3.6.1 + "@docusaurus/core": 3.7.0 + "@docusaurus/logger": 3.7.0 + "@docusaurus/mdx-loader": 3.7.0 + "@docusaurus/theme-common": 3.7.0 + "@docusaurus/types": 3.7.0 + "@docusaurus/utils": 3.7.0 + "@docusaurus/utils-common": 3.7.0 + "@docusaurus/utils-validation": 3.7.0 cheerio: 1.0.0-rc.12 feed: ^4.2.2 fs-extra: ^11.1.1 @@ -2463,25 +2968,25 @@ __metadata: webpack: ^5.88.1 peerDependencies: "@docusaurus/plugin-content-docs": "*" - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 684b61ab003c39c8e313f2c7dafcadbaad81df33253e21b7c2768c27e40434d36e377c53f1521e0b7c7b5794fe601b0d7b00587f63ccd7cf028f4891fefb14b2 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: 2a36adc80a9f9d6de472cb2844445084f58ac08f222f5037dfcb8b2beddc524c4cef63f4a3926f750539f36b53337159121d744b68a4a9d2d301c064bded03c6 languageName: node linkType: hard -"@docusaurus/plugin-content-docs@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/plugin-content-docs@npm:3.6.1" +"@docusaurus/plugin-content-docs@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/plugin-content-docs@npm:3.7.0" dependencies: - "@docusaurus/core": 3.6.1 - "@docusaurus/logger": 3.6.1 - "@docusaurus/mdx-loader": 3.6.1 - "@docusaurus/module-type-aliases": 3.6.1 - "@docusaurus/theme-common": 3.6.1 - "@docusaurus/types": 3.6.1 - "@docusaurus/utils": 3.6.1 - "@docusaurus/utils-common": 3.6.1 - "@docusaurus/utils-validation": 3.6.1 + "@docusaurus/core": 3.7.0 + "@docusaurus/logger": 3.7.0 + "@docusaurus/mdx-loader": 3.7.0 + "@docusaurus/module-type-aliases": 3.7.0 + "@docusaurus/theme-common": 3.7.0 + "@docusaurus/types": 3.7.0 + "@docusaurus/utils": 3.7.0 + "@docusaurus/utils-common": 3.7.0 + "@docusaurus/utils-validation": 3.7.0 "@types/react-router-config": ^5.0.7 combine-promises: ^1.1.0 fs-extra: ^11.1.1 @@ -2491,108 +2996,108 @@ __metadata: utility-types: ^3.10.0 webpack: ^5.88.1 peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 0c64903e14f27903e56454971e170ded55c004179764a4aee165e0fee1251c41a5ec4c17a7053243b2da3c99d15d5ceeb7de82e6edb5ce09c182700f89cb4a6d + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: 933936fcbfd8552f775443e93daf0e05ac233b458e574d05214949970731b1ca0e6b9cb919fd63648f54af3a7395f713c3c0e25dfdece2a4bfc599ad2de5e21c languageName: node linkType: hard -"@docusaurus/plugin-content-pages@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/plugin-content-pages@npm:3.6.1" +"@docusaurus/plugin-content-pages@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/plugin-content-pages@npm:3.7.0" dependencies: - "@docusaurus/core": 3.6.1 - "@docusaurus/mdx-loader": 3.6.1 - "@docusaurus/types": 3.6.1 - "@docusaurus/utils": 3.6.1 - "@docusaurus/utils-validation": 3.6.1 + "@docusaurus/core": 3.7.0 + "@docusaurus/mdx-loader": 3.7.0 + "@docusaurus/types": 3.7.0 + "@docusaurus/utils": 3.7.0 + "@docusaurus/utils-validation": 3.7.0 fs-extra: ^11.1.1 tslib: ^2.6.0 webpack: ^5.88.1 peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 6c1cea84c753ba994431c6de3ee8af3c427f132b99be321a7942ff6e9466ec8b518f949abb50b687554671d3da5d6e592adb52c8bf929339e4674e363aaaf6f3 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: bdb2a4655e1067262075503e80fc2302addbe3f15f3fa3cd41df49ecf5bbf5f6df282263a0f340e405a2859369b0fda5e4a4c494b6a82c7f345d06e916be168f languageName: node linkType: hard -"@docusaurus/plugin-debug@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/plugin-debug@npm:3.6.1" +"@docusaurus/plugin-debug@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/plugin-debug@npm:3.7.0" dependencies: - "@docusaurus/core": 3.6.1 - "@docusaurus/types": 3.6.1 - "@docusaurus/utils": 3.6.1 + "@docusaurus/core": 3.7.0 + "@docusaurus/types": 3.7.0 + "@docusaurus/utils": 3.7.0 fs-extra: ^11.1.1 react-json-view-lite: ^1.2.0 tslib: ^2.6.0 peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: daa7cc8944a99d3fa75e6694aa786b204dec36ff7f7eef8ea1426e188bb27445ff1e9ec9906d8e6042cb5cb7fb20f051aa97da9923614c43aa35f4f68853ad87 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: 5daca21e8162060742c9656bebab59bff4e519a260a21c40f4a024d509a08d6505eb60663953e5382787bd1104a43c2deea8fffb47f1f4dd3e1205cfa6bb4670 languageName: node linkType: hard -"@docusaurus/plugin-google-analytics@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/plugin-google-analytics@npm:3.6.1" +"@docusaurus/plugin-google-analytics@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/plugin-google-analytics@npm:3.7.0" dependencies: - "@docusaurus/core": 3.6.1 - "@docusaurus/types": 3.6.1 - "@docusaurus/utils-validation": 3.6.1 + "@docusaurus/core": 3.7.0 + "@docusaurus/types": 3.7.0 + "@docusaurus/utils-validation": 3.7.0 tslib: ^2.6.0 peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 41566b48487f7aace54d34742dc684532a6be2539d019f6a01770872243e34c123d3ecc34fd0dc62ea01798300f9b5525c0563f8f3062033705b226cdecd9ba5 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: 09eda2b1fbf577f70fee4bbe22683208fb77fc5a402cd70c06236a1a97d10f48c7fdce91cc4d489eb1f8a44adc56c8fd7dcd3b3d2cefc76a1d86cf7fc1213166 languageName: node linkType: hard -"@docusaurus/plugin-google-gtag@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/plugin-google-gtag@npm:3.6.1" +"@docusaurus/plugin-google-gtag@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/plugin-google-gtag@npm:3.7.0" dependencies: - "@docusaurus/core": 3.6.1 - "@docusaurus/types": 3.6.1 - "@docusaurus/utils-validation": 3.6.1 + "@docusaurus/core": 3.7.0 + "@docusaurus/types": 3.7.0 + "@docusaurus/utils-validation": 3.7.0 "@types/gtag.js": ^0.0.12 tslib: ^2.6.0 peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 0465e0758172464dff0cad284bfc56a5493ce0f1e06543f4786f514d35661d3f7cdb94df67301d1227bc4b588b4dd4a4d261e950e117b8961599c7573fdab67d + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: d09eb00798c8091581fe670a9a15ea5de933afee54e5ed66e1d283812adf001062a7e14f1106fc3b6dd264048df56aa2a5cc066c647c7456788f814a81788b42 languageName: node linkType: hard -"@docusaurus/plugin-google-tag-manager@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/plugin-google-tag-manager@npm:3.6.1" +"@docusaurus/plugin-google-tag-manager@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/plugin-google-tag-manager@npm:3.7.0" dependencies: - "@docusaurus/core": 3.6.1 - "@docusaurus/types": 3.6.1 - "@docusaurus/utils-validation": 3.6.1 + "@docusaurus/core": 3.7.0 + "@docusaurus/types": 3.7.0 + "@docusaurus/utils-validation": 3.7.0 tslib: ^2.6.0 peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 9eba5bac300c33b129210bc18546e3d9b51648f4843c36f36a2fef2beac3af6d9e26d543ff21d29fb92bad51ef442a32993e4cb0becfbbe47173ece586c51bad + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: 83906f1fd7e00869de53917ba881ec1e3fb68a7c8e04aeae40d9e5f03a172186ef77754182d1ccba1065616ffac31dbc9d572ee0b6ba3750c5aaead08cf0db4d languageName: node linkType: hard -"@docusaurus/plugin-pwa@npm:^3.2.1": - version: 3.6.1 - resolution: "@docusaurus/plugin-pwa@npm:3.6.1" +"@docusaurus/plugin-pwa@npm:~3.7.0": + version: 3.7.0 + resolution: "@docusaurus/plugin-pwa@npm:3.7.0" dependencies: "@babel/core": ^7.25.9 "@babel/preset-env": ^7.25.9 - "@docusaurus/bundler": 3.6.1 - "@docusaurus/core": 3.6.1 - "@docusaurus/logger": 3.6.1 - "@docusaurus/theme-common": 3.6.1 - "@docusaurus/theme-translations": 3.6.1 - "@docusaurus/types": 3.6.1 - "@docusaurus/utils": 3.6.1 - "@docusaurus/utils-validation": 3.6.1 + "@docusaurus/bundler": 3.7.0 + "@docusaurus/core": 3.7.0 + "@docusaurus/logger": 3.7.0 + "@docusaurus/theme-common": 3.7.0 + "@docusaurus/theme-translations": 3.7.0 + "@docusaurus/types": 3.7.0 + "@docusaurus/utils": 3.7.0 + "@docusaurus/utils-validation": 3.7.0 babel-loader: ^9.2.1 clsx: ^2.0.0 core-js: ^3.31.1 @@ -2603,86 +3108,106 @@ __metadata: workbox-precaching: ^7.0.0 workbox-window: ^7.0.0 peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 43e451f90500f1732544da10b8bd961843d982b1a17f2c519eb962e33e996eb937e78a42b0f0ad860e2d4c925a843ef197aaaa020738c7799d1756aaade07e15 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: 2e98b131e5819e40e6e917f02653af76662c6a5d51f354e942553708c567a6db17d5c3f1e4dd775574a32be34036d0ef7854ac59f1e621b1a85ee2f45c76e0a1 languageName: node linkType: hard -"@docusaurus/plugin-sitemap@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/plugin-sitemap@npm:3.6.1" +"@docusaurus/plugin-sitemap@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/plugin-sitemap@npm:3.7.0" dependencies: - "@docusaurus/core": 3.6.1 - "@docusaurus/logger": 3.6.1 - "@docusaurus/types": 3.6.1 - "@docusaurus/utils": 3.6.1 - "@docusaurus/utils-common": 3.6.1 - "@docusaurus/utils-validation": 3.6.1 + "@docusaurus/core": 3.7.0 + "@docusaurus/logger": 3.7.0 + "@docusaurus/types": 3.7.0 + "@docusaurus/utils": 3.7.0 + "@docusaurus/utils-common": 3.7.0 + "@docusaurus/utils-validation": 3.7.0 fs-extra: ^11.1.1 sitemap: ^7.1.1 tslib: ^2.6.0 peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: be1568448b233a390c096a44edba14a368ffb37b984542ad4ae1bfc7207143ce2f19a01e5f0421d67827721617c5dc906dd72658dada7ee5a6a1ebfa7cb696c9 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: ed03a2d306642ed099305ae8c1b8f40a52dc36f5a82ac57df14216eeec04214b5e85985aabcce41d4e422fbb77ee67719d07df103d72f864eda1cec65c478a96 languageName: node linkType: hard -"@docusaurus/preset-classic@npm:^3.2.1": - version: 3.6.1 - resolution: "@docusaurus/preset-classic@npm:3.6.1" +"@docusaurus/plugin-svgr@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/plugin-svgr@npm:3.7.0" dependencies: - "@docusaurus/core": 3.6.1 - "@docusaurus/plugin-content-blog": 3.6.1 - "@docusaurus/plugin-content-docs": 3.6.1 - "@docusaurus/plugin-content-pages": 3.6.1 - "@docusaurus/plugin-debug": 3.6.1 - "@docusaurus/plugin-google-analytics": 3.6.1 - "@docusaurus/plugin-google-gtag": 3.6.1 - "@docusaurus/plugin-google-tag-manager": 3.6.1 - "@docusaurus/plugin-sitemap": 3.6.1 - "@docusaurus/theme-classic": 3.6.1 - "@docusaurus/theme-common": 3.6.1 - "@docusaurus/theme-search-algolia": 3.6.1 - "@docusaurus/types": 3.6.1 + "@docusaurus/core": 3.7.0 + "@docusaurus/types": 3.7.0 + "@docusaurus/utils": 3.7.0 + "@docusaurus/utils-validation": 3.7.0 + "@svgr/core": 8.1.0 + "@svgr/webpack": ^8.1.0 + tslib: ^2.6.0 + webpack: ^5.88.1 peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 505b1adcc9f73ab992bfa8cbbc5c43ac9829630996df7d995a63529578bddf22fbdbd4d20f8e8f939e1be3957d20c6c8426ca4751c23c1dbeb0922a115dc210b + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: 2ada44b314f21ff824b9df9a9872cb5fdc942133151111c214d7d47ff1a8c271c5e02f35fe6d6ff9768c35fd5f797e8a7e3e26e7467066271143c9988fd2cbce languageName: node linkType: hard -"@docusaurus/remark-plugin-npm2yarn@npm:^3.2.1": - version: 3.6.1 - resolution: "@docusaurus/remark-plugin-npm2yarn@npm:3.6.1" +"@docusaurus/preset-classic@npm:~3.7.0": + version: 3.7.0 + resolution: "@docusaurus/preset-classic@npm:3.7.0" + dependencies: + "@docusaurus/core": 3.7.0 + "@docusaurus/plugin-content-blog": 3.7.0 + "@docusaurus/plugin-content-docs": 3.7.0 + "@docusaurus/plugin-content-pages": 3.7.0 + "@docusaurus/plugin-debug": 3.7.0 + "@docusaurus/plugin-google-analytics": 3.7.0 + "@docusaurus/plugin-google-gtag": 3.7.0 + "@docusaurus/plugin-google-tag-manager": 3.7.0 + "@docusaurus/plugin-sitemap": 3.7.0 + "@docusaurus/plugin-svgr": 3.7.0 + "@docusaurus/theme-classic": 3.7.0 + "@docusaurus/theme-common": 3.7.0 + "@docusaurus/theme-search-algolia": 3.7.0 + "@docusaurus/types": 3.7.0 + peerDependencies: + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: 560205e072dc983705b6794e22d546ced4a2a4589bc93c8be8c3962b37279e33f2580a72c7a3d2a4db74c955dffca1ece66c01645c3dea6287c2870bdbf005a0 + languageName: node + linkType: hard + +"@docusaurus/remark-plugin-npm2yarn@npm:~3.7.0": + version: 3.7.0 + resolution: "@docusaurus/remark-plugin-npm2yarn@npm:3.7.0" dependencies: mdast-util-mdx: ^3.0.0 npm-to-yarn: ^3.0.0 tslib: ^2.6.0 unified: ^11.0.3 unist-util-visit: ^5.0.0 - checksum: 5df3aa21cda38cc586ebd9261249856f7f0d64857682b732b4e1b7c9955ce0e61b78ba052d5736e6434275b19ecb7e2a519b57b8b987ebe190ae6531d93d3665 - languageName: node - linkType: hard - -"@docusaurus/theme-classic@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/theme-classic@npm:3.6.1" - dependencies: - "@docusaurus/core": 3.6.1 - "@docusaurus/logger": 3.6.1 - "@docusaurus/mdx-loader": 3.6.1 - "@docusaurus/module-type-aliases": 3.6.1 - "@docusaurus/plugin-content-blog": 3.6.1 - "@docusaurus/plugin-content-docs": 3.6.1 - "@docusaurus/plugin-content-pages": 3.6.1 - "@docusaurus/theme-common": 3.6.1 - "@docusaurus/theme-translations": 3.6.1 - "@docusaurus/types": 3.6.1 - "@docusaurus/utils": 3.6.1 - "@docusaurus/utils-common": 3.6.1 - "@docusaurus/utils-validation": 3.6.1 + checksum: 30c87a41b7ca67d10f983adb83c3a53d78f3a6d637a8d60e433f3899d5e1af754e91dab4405ac86a153232725b6307b08e217b7afe50ce45e88bc7c264711eb7 + languageName: node + linkType: hard + +"@docusaurus/theme-classic@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/theme-classic@npm:3.7.0" + dependencies: + "@docusaurus/core": 3.7.0 + "@docusaurus/logger": 3.7.0 + "@docusaurus/mdx-loader": 3.7.0 + "@docusaurus/module-type-aliases": 3.7.0 + "@docusaurus/plugin-content-blog": 3.7.0 + "@docusaurus/plugin-content-docs": 3.7.0 + "@docusaurus/plugin-content-pages": 3.7.0 + "@docusaurus/theme-common": 3.7.0 + "@docusaurus/theme-translations": 3.7.0 + "@docusaurus/types": 3.7.0 + "@docusaurus/utils": 3.7.0 + "@docusaurus/utils-common": 3.7.0 + "@docusaurus/utils-validation": 3.7.0 "@mdx-js/react": ^3.0.0 clsx: ^2.0.0 copy-text-to-clipboard: ^3.2.0 @@ -2697,20 +3222,20 @@ __metadata: tslib: ^2.6.0 utility-types: ^3.10.0 peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: ce9d10911163db2da3ed0c5e0de721e47b4fbd5e3254a14a899a789b4c4e0242f3417b84ae3054c80c495c85c6e05cba95d0dcad1c2c05a5f4a187b808224703 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: 2a6029657e4f0221adfe53ed44f770a48bcccf4cf7668af6b51e0e18d7b330d5bfe32865fbf86bd9c793a2598be4a4e65693c929f17a66ac3f555e0ce6d14992 languageName: node linkType: hard -"@docusaurus/theme-common@npm:3.6.1, @docusaurus/theme-common@npm:^3.2.1": - version: 3.6.1 - resolution: "@docusaurus/theme-common@npm:3.6.1" +"@docusaurus/theme-common@npm:3.7.0, @docusaurus/theme-common@npm:~3.7.0": + version: 3.7.0 + resolution: "@docusaurus/theme-common@npm:3.7.0" dependencies: - "@docusaurus/mdx-loader": 3.6.1 - "@docusaurus/module-type-aliases": 3.6.1 - "@docusaurus/utils": 3.6.1 - "@docusaurus/utils-common": 3.6.1 + "@docusaurus/mdx-loader": 3.7.0 + "@docusaurus/module-type-aliases": 3.7.0 + "@docusaurus/utils": 3.7.0 + "@docusaurus/utils-common": 3.7.0 "@types/history": ^4.7.11 "@types/react": "*" "@types/react-router-config": "*" @@ -2721,26 +3246,26 @@ __metadata: utility-types: ^3.10.0 peerDependencies: "@docusaurus/plugin-content-docs": "*" - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 60421104901a49f3e795894337ccd85a04d41bd406385e13dfef63e2485e390fe63e4f89f076b27ff7c61bea64ac464872a6e6f6edc695a5fb2be8709f7e6b2d - languageName: node - linkType: hard - -"@docusaurus/theme-search-algolia@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/theme-search-algolia@npm:3.6.1" - dependencies: - "@docsearch/react": ^3.5.2 - "@docusaurus/core": 3.6.1 - "@docusaurus/logger": 3.6.1 - "@docusaurus/plugin-content-docs": 3.6.1 - "@docusaurus/theme-common": 3.6.1 - "@docusaurus/theme-translations": 3.6.1 - "@docusaurus/utils": 3.6.1 - "@docusaurus/utils-validation": 3.6.1 - algoliasearch: ^4.18.0 - algoliasearch-helper: ^3.13.3 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: 7b5c7db66185066b1b4f8394595bcb7b3869b925199def22b382ebb0fbb44e4d40c293abdd8fb719fc299169d6e0fa3f305c6f25af1b5839ab8186f7383eb749 + languageName: node + linkType: hard + +"@docusaurus/theme-search-algolia@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/theme-search-algolia@npm:3.7.0" + dependencies: + "@docsearch/react": ^3.8.1 + "@docusaurus/core": 3.7.0 + "@docusaurus/logger": 3.7.0 + "@docusaurus/plugin-content-docs": 3.7.0 + "@docusaurus/theme-common": 3.7.0 + "@docusaurus/theme-translations": 3.7.0 + "@docusaurus/utils": 3.7.0 + "@docusaurus/utils-validation": 3.7.0 + algoliasearch: ^5.17.1 + algoliasearch-helper: ^3.22.6 clsx: ^2.0.0 eta: ^2.2.0 fs-extra: ^11.1.1 @@ -2748,76 +3273,75 @@ __metadata: tslib: ^2.6.0 utility-types: ^3.10.0 peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 48bf03f57b7f6f1ccdf949691a6d897a38fb289fe4cefd3e0af25ce961543ca5566f5e91369da31749445a0397ef0e4092b61aca52ede9d31540f5a0c3a21411 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: 9910c63abadcce7a1fc05c45a91560c9f792e724ad5a78a26c13d0ba37dab6f306daa8be5be63ae5d3f26f941b059777c0901519c84fe42ad42042f6fcaa7e65 languageName: node linkType: hard -"@docusaurus/theme-translations@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/theme-translations@npm:3.6.1" +"@docusaurus/theme-translations@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/theme-translations@npm:3.7.0" dependencies: fs-extra: ^11.1.1 tslib: ^2.6.0 - checksum: 8a784297b5d9abbad1841b6ff64f5f5a5066be45742316f71f2862d76f72230307a3fa2efd75256bb47cba3ed14d84a26c6625205dab2b945803cf7b48ac09ec + checksum: 800166bc415efd5be73e268de2a3da040a477ce47b296684fecc698f61a1175a971c196a418934f663db5892a1aa217e47351959f443e647092fae00798f994d languageName: node linkType: hard -"@docusaurus/types@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/types@npm:3.6.1" +"@docusaurus/types@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/types@npm:3.7.0" dependencies: "@mdx-js/mdx": ^3.0.0 "@types/history": ^4.7.11 "@types/react": "*" commander: ^5.1.0 joi: ^17.9.2 - react-helmet-async: ^1.3.0 + react-helmet-async: "npm:@slorber/react-helmet-async@1.3.0" utility-types: ^3.10.0 webpack: ^5.95.0 webpack-merge: ^5.9.0 peerDependencies: - react: ^18.0.0 - react-dom: ^18.0.0 - checksum: 17f667d4f64021fabe019277965b18878dc588852c4d11cf275afdad05aeee5ef482fe0ab993764a2779b9be4bf861c9e32fcd535fe2e65f7d9112746674a369 + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + checksum: 0757f6dd1879a25cb60ffdf1886746d03a30d7dc01d5adb036a18da3977f4a0a2bcbbc057f0db43cb60f0412179d31eaba5073004880a146fa3fcb2ce10ad99d languageName: node linkType: hard -"@docusaurus/utils-common@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/utils-common@npm:3.6.1" +"@docusaurus/utils-common@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/utils-common@npm:3.7.0" dependencies: - "@docusaurus/types": 3.6.1 + "@docusaurus/types": 3.7.0 tslib: ^2.6.0 - checksum: 822b8be36fc05a239e0336d8b2deba4f92f52407e63bbdcf50e424dc89d33cad4254b1da4d4ceadff530faa6e2916258e4c061c9791d77584bdd525971670b1f + checksum: 3938f9fada19a641009c3a5517b754a1ba4e9f8aa3edaff27ba24cfd927c234fb0e598ab076c4abf82537fc09976a547d18a00b7e97e9b704d7784102dc500a5 languageName: node linkType: hard -"@docusaurus/utils-validation@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/utils-validation@npm:3.6.1" +"@docusaurus/utils-validation@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/utils-validation@npm:3.7.0" dependencies: - "@docusaurus/logger": 3.6.1 - "@docusaurus/utils": 3.6.1 - "@docusaurus/utils-common": 3.6.1 + "@docusaurus/logger": 3.7.0 + "@docusaurus/utils": 3.7.0 + "@docusaurus/utils-common": 3.7.0 fs-extra: ^11.2.0 joi: ^17.9.2 js-yaml: ^4.1.0 lodash: ^4.17.21 tslib: ^2.6.0 - checksum: 45b8e1341ec053fc9daca50534f89306940933dd663a151b04e699feeb109e46b612f85edcf269d67df221dcdedc35dc7ad911b092a0bcb0248d80333fe03eb2 + checksum: b5f1e4ce126e5f08ad190b2e09504f4530408ad06f33798625827fa635199a5c781cb89edafba5402aefc0001a1896d949013b46d1d37d6506e82eaa1353abdf languageName: node linkType: hard -"@docusaurus/utils@npm:3.6.1": - version: 3.6.1 - resolution: "@docusaurus/utils@npm:3.6.1" +"@docusaurus/utils@npm:3.7.0": + version: 3.7.0 + resolution: "@docusaurus/utils@npm:3.7.0" dependencies: - "@docusaurus/logger": 3.6.1 - "@docusaurus/types": 3.6.1 - "@docusaurus/utils-common": 3.6.1 - "@svgr/webpack": ^8.1.0 + "@docusaurus/logger": 3.7.0 + "@docusaurus/types": 3.7.0 + "@docusaurus/utils-common": 3.7.0 escape-string-regexp: ^4.0.0 file-loader: ^6.2.0 fs-extra: ^11.1.1 @@ -2835,7 +3359,7 @@ __metadata: url-loader: ^4.1.1 utility-types: ^3.10.0 webpack: ^5.88.1 - checksum: 82c5806880351623f7347f5419e4eff407f22bea9bda53b3f88275a2437632bf381158f58f2569bd58a7373e764bfea45a26c0f7b0bcfc676db3c815d80cdef7 + checksum: c488addc4e605200149976f95695fd0a567d502b1bcc8d0c0b042cdee5860223f2e46df6b0f2d13aa349c15a1c28c3dcb9eef5e6e0758e6881c70102f967acb2 languageName: node linkType: hard @@ -6260,36 +6784,35 @@ __metadata: languageName: node linkType: hard -"algoliasearch-helper@npm:^3.13.3": - version: 3.16.3 - resolution: "algoliasearch-helper@npm:3.16.3" +"algoliasearch-helper@npm:^3.22.6": + version: 3.25.0 + resolution: "algoliasearch-helper@npm:3.25.0" dependencies: "@algolia/events": ^4.0.1 peerDependencies: algoliasearch: ">= 3.1 < 6" - checksum: b4664168e2900628e274508dbf4a7f366fa1397468ba49bd0a5c4f2b0d2d1f7ed8bd137ca218a6d142fec49963b7c0774e8929371e1906416bf0d82bcbb61fc1 + checksum: 424db7021a5939a0de0c659313483bbce895c21f5d9841cabd2495300e86db2ebbd3e050c6bfaa88723068ea87c2e5e9710f59187e640db8602f022924402863 languageName: node linkType: hard -"algoliasearch@npm:^4.18.0, algoliasearch@npm:^4.19.1": - version: 4.22.1 - resolution: "algoliasearch@npm:4.22.1" +"algoliasearch@npm:^5.14.2, algoliasearch@npm:^5.17.1": + version: 5.25.0 + resolution: "algoliasearch@npm:5.25.0" dependencies: - "@algolia/cache-browser-local-storage": 4.22.1 - "@algolia/cache-common": 4.22.1 - "@algolia/cache-in-memory": 4.22.1 - "@algolia/client-account": 4.22.1 - "@algolia/client-analytics": 4.22.1 - "@algolia/client-common": 4.22.1 - "@algolia/client-personalization": 4.22.1 - "@algolia/client-search": 4.22.1 - "@algolia/logger-common": 4.22.1 - "@algolia/logger-console": 4.22.1 - "@algolia/requester-browser-xhr": 4.22.1 - "@algolia/requester-common": 4.22.1 - "@algolia/requester-node-http": 4.22.1 - "@algolia/transporter": 4.22.1 - checksum: 65226e7ac081fd2dccd2a949b211a67010d933e86572be7cc714b3f5ca07edf099e8a2fd328e8c4a772d971d06ec49779c2b8670196c811faede5b78765cb5bf + "@algolia/client-abtesting": 5.25.0 + "@algolia/client-analytics": 5.25.0 + "@algolia/client-common": 5.25.0 + "@algolia/client-insights": 5.25.0 + "@algolia/client-personalization": 5.25.0 + "@algolia/client-query-suggestions": 5.25.0 + "@algolia/client-search": 5.25.0 + "@algolia/ingestion": 1.25.0 + "@algolia/monitoring": 1.25.0 + "@algolia/recommend": 5.25.0 + "@algolia/requester-browser-xhr": 5.25.0 + "@algolia/requester-fetch": 5.25.0 + "@algolia/requester-node-http": 5.25.0 + checksum: bf3a3e8eabb3f13fed03d8f96c5fd828cb07659402931bfbd25b31cebd90aa35679e234b801cf033b6fe1b400609850d1202df6505b1b4a38474a18ca24e684b languageName: node linkType: hard @@ -6620,7 +7143,7 @@ __metadata: languageName: node linkType: hard -"autoprefixer@npm:^10.4.14, autoprefixer@npm:^10.4.19": +"autoprefixer@npm:^10.4.19": version: 10.4.19 resolution: "autoprefixer@npm:10.4.19" dependencies: @@ -6638,6 +7161,24 @@ __metadata: languageName: node linkType: hard +"autoprefixer@npm:^10.4.21": + version: 10.4.21 + resolution: "autoprefixer@npm:10.4.21" + dependencies: + browserslist: ^4.24.4 + caniuse-lite: ^1.0.30001702 + fraction.js: ^4.3.7 + normalize-range: ^0.1.2 + picocolors: ^1.1.1 + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.1.0 + bin: + autoprefixer: bin/autoprefixer + checksum: 11770ce635a0520e457eaf2ff89056cd57094796a9f5d6d9375513388a5a016cd947333dcfd213b822fdd8a0b43ce68ae4958e79c6f077c41d87444c8cca0235 + languageName: node + linkType: hard + "available-typed-arrays@npm:^1.0.7": version: 1.0.7 resolution: "available-typed-arrays@npm:1.0.7" @@ -6960,6 +7501,20 @@ __metadata: languageName: node linkType: hard +"browserslist@npm:^4.24.5": + version: 4.25.0 + resolution: "browserslist@npm:4.25.0" + dependencies: + caniuse-lite: ^1.0.30001718 + electron-to-chromium: ^1.5.160 + node-releases: ^2.0.19 + update-browserslist-db: ^1.1.3 + bin: + browserslist: cli.js + checksum: 0d34fa0c6e23e962598ba68ee9f4566a4b575ec550ff7e9e7287c5e94a6e0f208f75f4f7d578ccd060f843167e0e495bde8f6d278f353f0da783cd50f758e5c7 + languageName: node + linkType: hard + "buffer-from@npm:^1.0.0": version: 1.1.2 resolution: "buffer-from@npm:1.1.2" @@ -7166,6 +7721,13 @@ __metadata: languageName: node linkType: hard +"caniuse-lite@npm:^1.0.30001702, caniuse-lite@npm:^1.0.30001718": + version: 1.0.30001720 + resolution: "caniuse-lite@npm:1.0.30001720" + checksum: 97b9f9de842595ff9674001abb9c5bc093c03bb985d481ed97617ea48fc248bfb2cc1f1afe19da2bf20016f28793e495fa2f339e22080d8da3c9714fb7950926 + languageName: node + linkType: hard + "ccount@npm:^2.0.0": version: 2.0.1 resolution: "ccount@npm:2.0.1" @@ -8080,6 +8642,17 @@ __metadata: languageName: node linkType: hard +"css-blank-pseudo@npm:^7.0.1": + version: 7.0.1 + resolution: "css-blank-pseudo@npm:7.0.1" + dependencies: + postcss-selector-parser: ^7.0.0 + peerDependencies: + postcss: ^8.4 + checksum: 0720f013394141e129f757ffadb780a47be37fae71d195a1e8fbd02b038001bc2c3b62be83e397fe1fb1282ba656b7fce4e972d583defb6f8163e0d791c816a4 + languageName: node + linkType: hard + "css-declaration-sorter@npm:^7.2.0": version: 7.2.0 resolution: "css-declaration-sorter@npm:7.2.0" @@ -8096,6 +8669,19 @@ __metadata: languageName: node linkType: hard +"css-has-pseudo@npm:^7.0.2": + version: 7.0.2 + resolution: "css-has-pseudo@npm:7.0.2" + dependencies: + "@csstools/selector-specificity": ^5.0.0 + postcss-selector-parser: ^7.0.0 + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: 422ae6eb59982dcd7a9e2ccfe1471070c71764d7f7167d3541ed91c938791e66d3def93dcb25affb1f7ee366f221ddeffddb45c87a7ce7195d77d6d67e52be0e + languageName: node + linkType: hard + "css-loader@npm:^6.8.1": version: 6.10.0 resolution: "css-loader@npm:6.10.0" @@ -8149,6 +8735,15 @@ __metadata: languageName: node linkType: hard +"css-prefers-color-scheme@npm:^10.0.0": + version: 10.0.0 + resolution: "css-prefers-color-scheme@npm:10.0.0" + peerDependencies: + postcss: ^8.4 + checksum: 02b634aac859f5b07482563e39fc415544f8b35064b6b73e93408892dccb86fbb2eff407df4ae666780ee06350601fc6cd3ca42bc05900c7062f52589723d350 + languageName: node + linkType: hard + "css-select@npm:^4.1.3": version: 4.1.3 resolution: "css-select@npm:4.1.3" @@ -8219,6 +8814,13 @@ __metadata: languageName: node linkType: hard +"cssdb@npm:^8.3.0": + version: 8.3.0 + resolution: "cssdb@npm:8.3.0" + checksum: 1da768bfaa4ed1fa06251e3dd4d790b6611586d3a84fa8fb9f8f6be6acb430bbd3857e43fbea208c65f6c5f45d977691d256f5c6b4f4dfea218e85e2aa1b2adf + languageName: node + linkType: hard + "cssesc@npm:^3.0.0": version: 3.0.0 resolution: "cssesc@npm:3.0.0" @@ -8821,6 +9423,13 @@ __metadata: languageName: node linkType: hard +"electron-to-chromium@npm:^1.5.160": + version: 1.5.161 + resolution: "electron-to-chromium@npm:1.5.161" + checksum: 80cbed2237eec0349878692600971c57a099d08c1928ae812aa8f7e96cc0220088a4f1854b8bdcb464ec5cb553805bcc69373b49157776ca9828c58539a534d6 + languageName: node + linkType: hard + "emoji-regex@npm:^10.3.0": version: 10.3.0 resolution: "emoji-regex@npm:10.3.0" @@ -15342,6 +15951,17 @@ __metadata: languageName: node linkType: hard +"postcss-attribute-case-insensitive@npm:^7.0.1": + version: 7.0.1 + resolution: "postcss-attribute-case-insensitive@npm:7.0.1" + dependencies: + postcss-selector-parser: ^7.0.0 + peerDependencies: + postcss: ^8.4 + checksum: 18829dfc6dd2f6b1ca82afa8555f07ec8ac5687fe95612e353aa601b842bdec05ca78fc96016dba2b7d32607b31e085e5087fda00e1e0dfdc6c2a1b07b1b15c2 + languageName: node + linkType: hard + "postcss-calc@npm:^9.0.1": version: 9.0.1 resolution: "postcss-calc@npm:9.0.1" @@ -15354,6 +15974,56 @@ __metadata: languageName: node linkType: hard +"postcss-clamp@npm:^4.1.0": + version: 4.1.0 + resolution: "postcss-clamp@npm:4.1.0" + dependencies: + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4.6 + checksum: 118eec936b3b035dc8d75c89973408f15c5a3de3d1ee210a2b3511e3e431d9c56e6f354b509a90540241e2225ffe3caaa2fdf25919c63348ce4583a28ada642c + languageName: node + linkType: hard + +"postcss-color-functional-notation@npm:^7.0.10": + version: 7.0.10 + resolution: "postcss-color-functional-notation@npm:7.0.10" + dependencies: + "@csstools/css-color-parser": ^3.0.10 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/postcss-progressive-custom-properties": ^4.1.0 + "@csstools/utilities": ^2.0.0 + peerDependencies: + postcss: ^8.4 + checksum: af873fbd4899bd863aeed7b40753ab3e6028bf7b8eef53b54de1cbd1b83d92b1007a9a90db314781c2bc0ec204537ca423d17cdc37aee46ed1308d7406b81729 + languageName: node + linkType: hard + +"postcss-color-hex-alpha@npm:^10.0.0": + version: 10.0.0 + resolution: "postcss-color-hex-alpha@npm:10.0.0" + dependencies: + "@csstools/utilities": ^2.0.0 + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: 2dbbd66d76522c7d281c292589360f21806b6dd31a582484e7e4a848e5244d645d5c5e1b6c6219dd5fb7333808cd94a27dd0d2e1db093d043668ed7b42db59ad + languageName: node + linkType: hard + +"postcss-color-rebeccapurple@npm:^10.0.0": + version: 10.0.0 + resolution: "postcss-color-rebeccapurple@npm:10.0.0" + dependencies: + "@csstools/utilities": ^2.0.0 + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: 8ca0ee2b6b45ff62abdfc9b6757d8832d398c2e47dd705759485b685f544eaed81ec00f050a1bad67ffb5e6243332085a09807d47526ce3b43456b027119e0ae + languageName: node + linkType: hard + "postcss-colormin@npm:^6.1.0": version: 6.1.0 resolution: "postcss-colormin@npm:6.1.0" @@ -15380,6 +16050,60 @@ __metadata: languageName: node linkType: hard +"postcss-custom-media@npm:^11.0.6": + version: 11.0.6 + resolution: "postcss-custom-media@npm:11.0.6" + dependencies: + "@csstools/cascade-layer-name-parser": ^2.0.5 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/media-query-list-parser": ^4.0.3 + peerDependencies: + postcss: ^8.4 + checksum: 3b8ab5eb6d80cf9dd0b74acf69530f73009d860509d820fc5349894a10c2abd08eb1ff77f90c59ee51aebf422fe09d4093ece8d15f652f771ab0fcfd03a42417 + languageName: node + linkType: hard + +"postcss-custom-properties@npm:^14.0.5": + version: 14.0.5 + resolution: "postcss-custom-properties@npm:14.0.5" + dependencies: + "@csstools/cascade-layer-name-parser": ^2.0.5 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/utilities": ^2.0.0 + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: e6b746b7b37dc0126f2f7b5f260251240cda1150db74aea1e1f8f3bd3b41fcdff055911c3eadecb1d8e867ef42b422c7fde2a4b45ff7503e92c359729e78946c + languageName: node + linkType: hard + +"postcss-custom-selectors@npm:^8.0.5": + version: 8.0.5 + resolution: "postcss-custom-selectors@npm:8.0.5" + dependencies: + "@csstools/cascade-layer-name-parser": ^2.0.5 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + postcss-selector-parser: ^7.0.0 + peerDependencies: + postcss: ^8.4 + checksum: 191cfe62ad3eaf3d8bff75ed461baebbb3b9a52de9c1c75bded61da4ed2302d7c53c457e9febfa7cffc9a1fb7f6ed98cab8c4b2a071a1097e487e0117018e6cf + languageName: node + linkType: hard + +"postcss-dir-pseudo-class@npm:^9.0.1": + version: 9.0.1 + resolution: "postcss-dir-pseudo-class@npm:9.0.1" + dependencies: + postcss-selector-parser: ^7.0.0 + peerDependencies: + postcss: ^8.4 + checksum: 7f6212fe7f2a83e95d85df14208df3edb75b6b8f89ad865fdfbd1abf5765b6649ff46bb7ff56f7788ff8cfe60546ff305cc2fd2f9b1f9e1647a4386507714070 + languageName: node + linkType: hard + "postcss-discard-comments@npm:^6.0.2": version: 6.0.2 resolution: "postcss-discard-comments@npm:6.0.2" @@ -15427,6 +16151,86 @@ __metadata: languageName: node linkType: hard +"postcss-double-position-gradients@npm:^6.0.2": + version: 6.0.2 + resolution: "postcss-double-position-gradients@npm:6.0.2" + dependencies: + "@csstools/postcss-progressive-custom-properties": ^4.1.0 + "@csstools/utilities": ^2.0.0 + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: cc0302e2850334566ca7b85bddfbf6f5e839132d542d41eb8c380194048e35656aa4b7b9ea9e557747e4924a90fbd590d5abaea799e5c7493b0f239eb3d27721 + languageName: node + linkType: hard + +"postcss-focus-visible@npm:^10.0.1": + version: 10.0.1 + resolution: "postcss-focus-visible@npm:10.0.1" + dependencies: + postcss-selector-parser: ^7.0.0 + peerDependencies: + postcss: ^8.4 + checksum: 47c038ccf139bad6a4c12cf59c5ac78acbac96ae0517ae08d5db676680d585ae7943e22328bd0d31876d6bacc24e4b717b5f809d26218d76989f7b9a44369793 + languageName: node + linkType: hard + +"postcss-focus-within@npm:^9.0.1": + version: 9.0.1 + resolution: "postcss-focus-within@npm:9.0.1" + dependencies: + postcss-selector-parser: ^7.0.0 + peerDependencies: + postcss: ^8.4 + checksum: ca953bf566605c6519f5318a5a4886f8f0698798ba96d505c287cc0397d90a80246de948af354592a680615667e553c3fb67e88d9f55bdf630dab67b0fc0ceaa + languageName: node + linkType: hard + +"postcss-font-variant@npm:^5.0.0": + version: 5.0.0 + resolution: "postcss-font-variant@npm:5.0.0" + peerDependencies: + postcss: ^8.1.0 + checksum: a19286589261c2bc3e20470486e1ee3b4daf34271c5020167f30856c9b30c26f23264307cb97a184d503814e1b8c5d8a1f9f64a14fd4fd9551c173dca9424695 + languageName: node + linkType: hard + +"postcss-gap-properties@npm:^6.0.0": + version: 6.0.0 + resolution: "postcss-gap-properties@npm:6.0.0" + peerDependencies: + postcss: ^8.4 + checksum: 8fa8a208fe254ddfcb0442072a6232576efa1fc3deea917be6d3a0c25dfcb855cc6806572e42a098aa0276a5ad3917f19b269409f5ce1f22d233c0072d72f823 + languageName: node + linkType: hard + +"postcss-image-set-function@npm:^7.0.0": + version: 7.0.0 + resolution: "postcss-image-set-function@npm:7.0.0" + dependencies: + "@csstools/utilities": ^2.0.0 + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: 328946f3f258c230ac50f2f54dc43ac89f21b1afe42e2828fa20bfd19692a1198e439becabe9dfb64de50932c6ef987a8b2b5ea9398ae7ca813afb4f7e595be7 + languageName: node + linkType: hard + +"postcss-lab-function@npm:^7.0.10": + version: 7.0.10 + resolution: "postcss-lab-function@npm:7.0.10" + dependencies: + "@csstools/css-color-parser": ^3.0.10 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/postcss-progressive-custom-properties": ^4.1.0 + "@csstools/utilities": ^2.0.0 + peerDependencies: + postcss: ^8.4 + checksum: bd3fb9350a72147d474bf5a5e924ff911ac16b8218ab7d5a8e06c158409a79e6817b6dc54533c62c4983024a91c706d9128d883369a0bdec58b650f4c5a4a7cf + languageName: node + linkType: hard + "postcss-loader@npm:^7.3.3": version: 7.3.4 resolution: "postcss-loader@npm:7.3.4" @@ -15441,6 +16245,17 @@ __metadata: languageName: node linkType: hard +"postcss-logical@npm:^8.1.0": + version: 8.1.0 + resolution: "postcss-logical@npm:8.1.0" + dependencies: + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: 7db1e8c9f9c1ec9dc8cef56830ac3686766629cc7e28c0494b6e0f3699979f18c11225a39c37210cf81be4491adaa6bdbc394429d7e050f2d03e5845ef6608f9 + languageName: node + linkType: hard + "postcss-merge-idents@npm:^6.0.3": version: 6.0.3 resolution: "postcss-merge-idents@npm:6.0.3" @@ -15571,6 +16386,19 @@ __metadata: languageName: node linkType: hard +"postcss-nesting@npm:^13.0.1": + version: 13.0.1 + resolution: "postcss-nesting@npm:13.0.1" + dependencies: + "@csstools/selector-resolve-nested": ^3.0.0 + "@csstools/selector-specificity": ^5.0.0 + postcss-selector-parser: ^7.0.0 + peerDependencies: + postcss: ^8.4 + checksum: 71899e369a92678d6a19846a40cf851d84751f7018ea42e17707aa15611bc4bc3774deb1adc23b941dcb6350c83f78761230070055dd299b843de1c8d88b5b86 + languageName: node + linkType: hard + "postcss-normalize-charset@npm:^6.0.2": version: 6.0.2 resolution: "postcss-normalize-charset@npm:6.0.2" @@ -15669,6 +16497,15 @@ __metadata: languageName: node linkType: hard +"postcss-opacity-percentage@npm:^3.0.0": + version: 3.0.0 + resolution: "postcss-opacity-percentage@npm:3.0.0" + peerDependencies: + postcss: ^8.4 + checksum: dc813113f05f91f1c87ab3c125911f9e5989d1f3fc7cc5586a165901a63c0d02077d134df844391ea5624088680c6b3cee75bc33b8efdcaf340a91046e47e4e1 + languageName: node + linkType: hard + "postcss-ordered-values@npm:^6.0.2": version: 6.0.2 resolution: "postcss-ordered-values@npm:6.0.2" @@ -15681,6 +16518,122 @@ __metadata: languageName: node linkType: hard +"postcss-overflow-shorthand@npm:^6.0.0": + version: 6.0.0 + resolution: "postcss-overflow-shorthand@npm:6.0.0" + dependencies: + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: 80f07e0beb97b7ac5dac590802591fc93392b0d7a9678e17998b4d34ee0cca637665232c7ea88b3a4342192bc9a2a4f5c757ad86b837a5fd59d083d37cc7da16 + languageName: node + linkType: hard + +"postcss-page-break@npm:^3.0.4": + version: 3.0.4 + resolution: "postcss-page-break@npm:3.0.4" + peerDependencies: + postcss: ^8 + checksum: a7d08c945fc691f62c77ac701e64722218b14ec5c8fc1972b8af9c21553492d40808cf95e61b9697b1dacaf7e6180636876d7fee314f079e6c9e39ac1b1edc6f + languageName: node + linkType: hard + +"postcss-place@npm:^10.0.0": + version: 10.0.0 + resolution: "postcss-place@npm:10.0.0" + dependencies: + postcss-value-parser: ^4.2.0 + peerDependencies: + postcss: ^8.4 + checksum: 738cd0dc2412cf573bcfb2f7dce8e1cd21887f61c8808f55114f08fb8fbf03715e957fdd8859241eecebe400a5202771f513610b04e0f17c7742f6a5ea3bafb3 + languageName: node + linkType: hard + +"postcss-preset-env@npm:^10.1.0": + version: 10.2.0 + resolution: "postcss-preset-env@npm:10.2.0" + dependencies: + "@csstools/postcss-cascade-layers": ^5.0.1 + "@csstools/postcss-color-function": ^4.0.10 + "@csstools/postcss-color-mix-function": ^3.0.10 + "@csstools/postcss-color-mix-variadic-function-arguments": ^1.0.0 + "@csstools/postcss-content-alt-text": ^2.0.6 + "@csstools/postcss-exponential-functions": ^2.0.9 + "@csstools/postcss-font-format-keywords": ^4.0.0 + "@csstools/postcss-gamut-mapping": ^2.0.10 + "@csstools/postcss-gradients-interpolation-method": ^5.0.10 + "@csstools/postcss-hwb-function": ^4.0.10 + "@csstools/postcss-ic-unit": ^4.0.2 + "@csstools/postcss-initial": ^2.0.1 + "@csstools/postcss-is-pseudo-class": ^5.0.1 + "@csstools/postcss-light-dark-function": ^2.0.9 + "@csstools/postcss-logical-float-and-clear": ^3.0.0 + "@csstools/postcss-logical-overflow": ^2.0.0 + "@csstools/postcss-logical-overscroll-behavior": ^2.0.0 + "@csstools/postcss-logical-resize": ^3.0.0 + "@csstools/postcss-logical-viewport-units": ^3.0.4 + "@csstools/postcss-media-minmax": ^2.0.9 + "@csstools/postcss-media-queries-aspect-ratio-number-values": ^3.0.5 + "@csstools/postcss-nested-calc": ^4.0.0 + "@csstools/postcss-normalize-display-values": ^4.0.0 + "@csstools/postcss-oklab-function": ^4.0.10 + "@csstools/postcss-progressive-custom-properties": ^4.1.0 + "@csstools/postcss-random-function": ^2.0.1 + "@csstools/postcss-relative-color-syntax": ^3.0.10 + "@csstools/postcss-scope-pseudo-class": ^4.0.1 + "@csstools/postcss-sign-functions": ^1.1.4 + "@csstools/postcss-stepped-value-functions": ^4.0.9 + "@csstools/postcss-text-decoration-shorthand": ^4.0.2 + "@csstools/postcss-trigonometric-functions": ^4.0.9 + "@csstools/postcss-unset-value": ^4.0.0 + autoprefixer: ^10.4.21 + browserslist: ^4.24.5 + css-blank-pseudo: ^7.0.1 + css-has-pseudo: ^7.0.2 + css-prefers-color-scheme: ^10.0.0 + cssdb: ^8.3.0 + postcss-attribute-case-insensitive: ^7.0.1 + postcss-clamp: ^4.1.0 + postcss-color-functional-notation: ^7.0.10 + postcss-color-hex-alpha: ^10.0.0 + postcss-color-rebeccapurple: ^10.0.0 + postcss-custom-media: ^11.0.6 + postcss-custom-properties: ^14.0.5 + postcss-custom-selectors: ^8.0.5 + postcss-dir-pseudo-class: ^9.0.1 + postcss-double-position-gradients: ^6.0.2 + postcss-focus-visible: ^10.0.1 + postcss-focus-within: ^9.0.1 + postcss-font-variant: ^5.0.0 + postcss-gap-properties: ^6.0.0 + postcss-image-set-function: ^7.0.0 + postcss-lab-function: ^7.0.10 + postcss-logical: ^8.1.0 + postcss-nesting: ^13.0.1 + postcss-opacity-percentage: ^3.0.0 + postcss-overflow-shorthand: ^6.0.0 + postcss-page-break: ^3.0.4 + postcss-place: ^10.0.0 + postcss-pseudo-class-any-link: ^10.0.1 + postcss-replace-overflow-wrap: ^4.0.0 + postcss-selector-not: ^8.0.1 + peerDependencies: + postcss: ^8.4 + checksum: 0d00ca805e0d869d137cdc4cce4ebbfa02b28b7c75ab43f8b245fa8242e834a654fda4dff37cc6161ac0f6e16f6614bf3e6d584ed35c68e75dd4b804bdc72c2a + languageName: node + linkType: hard + +"postcss-pseudo-class-any-link@npm:^10.0.1": + version: 10.0.1 + resolution: "postcss-pseudo-class-any-link@npm:10.0.1" + dependencies: + postcss-selector-parser: ^7.0.0 + peerDependencies: + postcss: ^8.4 + checksum: 376525d1a6fa223d908deb884b93d5cb76f4fa7431c090a8ada63e5ee9657bec7bf8e23eff1c36264c051c5a653928e38392165a862b7c5bf5e39e9364383fce + languageName: node + linkType: hard + "postcss-reduce-idents@npm:^6.0.3": version: 6.0.3 resolution: "postcss-reduce-idents@npm:6.0.3" @@ -15715,6 +16668,15 @@ __metadata: languageName: node linkType: hard +"postcss-replace-overflow-wrap@npm:^4.0.0": + version: 4.0.0 + resolution: "postcss-replace-overflow-wrap@npm:4.0.0" + peerDependencies: + postcss: ^8.0.3 + checksum: 3ffe20b300a4c377a11c588b142740d8557e03c707474c45234c934190ac374750ddc92c7906c373471d273a20504a429c2062c21fdcaff830fb28e0a81ac1dc + languageName: node + linkType: hard + "postcss-resolve-nested-selector@npm:^0.1.6": version: 0.1.6 resolution: "postcss-resolve-nested-selector@npm:0.1.6" @@ -15731,6 +16693,17 @@ __metadata: languageName: node linkType: hard +"postcss-selector-not@npm:^8.0.1": + version: 8.0.1 + resolution: "postcss-selector-not@npm:8.0.1" + dependencies: + postcss-selector-parser: ^7.0.0 + peerDependencies: + postcss: ^8.4 + checksum: 28c1f7863ac85016ecd695304ee1eb21b1128eacba333d6d4540fd93691c58ff6329ac323b6a640f2da918e95c7b58e8f534c8b6e2ed016f6e31cdfdc743edbc + languageName: node + linkType: hard + "postcss-selector-parser@npm:^6.0.11, postcss-selector-parser@npm:^6.0.16, postcss-selector-parser@npm:^6.0.2, postcss-selector-parser@npm:^6.0.4": version: 6.1.2 resolution: "postcss-selector-parser@npm:6.1.2" @@ -15741,7 +16714,7 @@ __metadata: languageName: node linkType: hard -"postcss-selector-parser@npm:^7.1.0": +"postcss-selector-parser@npm:^7.0.0, postcss-selector-parser@npm:^7.1.0": version: 7.1.0 resolution: "postcss-selector-parser@npm:7.1.0" dependencies: @@ -16169,9 +17142,9 @@ __metadata: languageName: node linkType: hard -"react-helmet-async@npm:*, react-helmet-async@npm:^1.3.0": +"react-helmet-async@npm:@slorber/react-helmet-async@*, react-helmet-async@npm:@slorber/react-helmet-async@1.3.0": version: 1.3.0 - resolution: "react-helmet-async@npm:1.3.0" + resolution: "@slorber/react-helmet-async@npm:1.3.0" dependencies: "@babel/runtime": ^7.12.5 invariant: ^2.2.4 @@ -16179,9 +17152,9 @@ __metadata: react-fast-compare: ^3.2.0 shallowequal: ^1.1.0 peerDependencies: - react: ^16.6.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.6.0 || ^17.0.0 || ^18.0.0 - checksum: 7ca7e47f8af14ea186688b512a87ab912bf6041312b297f92516341b140b3f0f8aedf5a44d226d99e69ed067b0cc106e38aeb9c9b738ffcc63d10721c844db90 + react: ^16.6.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^16.6.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + checksum: 2bd080035aa4145761cc08caa2a64f1d8e867ddda71967936b1325f84c5bc7161ac77c1095818952bc5bb09c78ffbd594e7d0508d54255c5bfbc15e3769ef538 languageName: node linkType: hard @@ -16993,13 +17966,6 @@ __metadata: languageName: node linkType: hard -"rtl-detect@npm:^1.0.4": - version: 1.0.4 - resolution: "rtl-detect@npm:1.0.4" - checksum: d562535baa0db62f57f0a1d4676297bff72fd6b94e88f0f0900d5c3e810ab512c5c4cadffd3e05fbe8d9c74310c919afa3ea8c1001c244e5555e8eef12d02d6f - languageName: node - linkType: hard - "rtlcss@npm:^4.1.0": version: 4.1.1 resolution: "rtlcss@npm:4.1.1" @@ -19519,13 +20485,13 @@ __metadata: resolution: "website@workspace:packages/website" dependencies: "@babel/runtime": ^7.24.4 - "@docusaurus/core": ^3.2.1 - "@docusaurus/module-type-aliases": ^3.2.1 - "@docusaurus/plugin-client-redirects": ^3.2.1 - "@docusaurus/plugin-pwa": ^3.2.1 - "@docusaurus/preset-classic": ^3.2.1 - "@docusaurus/remark-plugin-npm2yarn": ^3.2.1 - "@docusaurus/theme-common": ^3.2.1 + "@docusaurus/core": ~3.7.0 + "@docusaurus/module-type-aliases": ~3.7.0 + "@docusaurus/plugin-client-redirects": ~3.7.0 + "@docusaurus/plugin-pwa": ~3.7.0 + "@docusaurus/preset-classic": ~3.7.0 + "@docusaurus/remark-plugin-npm2yarn": ~3.7.0 + "@docusaurus/theme-common": ~3.7.0 "@types/mdast": ^4.0.3 "@types/react": "*" "@types/unist": ^3.0.2 From 58ce73fdce008f4546941ba97c8ec870f9b4774e Mon Sep 17 00:00:00 2001 From: Vinccool96 Date: Mon, 16 Jun 2025 09:34:05 -0400 Subject: [PATCH 041/283] chore(eslint-plugin): switch auto-generated test cases to hand-written in no-inferrable-types.test.ts (#11275) * Switch to handwritten test cases * Removed duplicated tests --- .../tests/rules/no-inferrable-types.test.ts | 676 +++++++++++++++--- 1 file changed, 586 insertions(+), 90 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts b/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts index 79304307ea3d..5cb60d8f6c85 100644 --- a/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts +++ b/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts @@ -1,100 +1,50 @@ -import type { InvalidTestCase } from '@typescript-eslint/rule-tester'; - import { RuleTester } from '@typescript-eslint/rule-tester'; -import type { - InferMessageIdsTypeFromRule, - InferOptionsTypeFromRule, -} from '../../src/util'; - import rule from '../../src/rules/no-inferrable-types'; -type MessageIds = InferMessageIdsTypeFromRule; -type Options = InferOptionsTypeFromRule; - -const testCases = [ - { - code: [ - '10n', - '-10n', - 'BigInt(10)', - '-BigInt(10)', - 'BigInt?.(10)', - '-BigInt?.(10)', - ], - type: 'bigint', - }, - { - code: ['false', 'true', 'Boolean(null)', 'Boolean?.(null)', '!0'], - type: 'boolean', - }, - { - code: [ - '10', - '+10', - '-10', - 'Number("1")', - '+Number("1")', - '-Number("1")', - 'Number?.("1")', - '+Number?.("1")', - '-Number?.("1")', - 'Infinity', - '+Infinity', - '-Infinity', - 'NaN', - '+NaN', - '-NaN', - ], - type: 'number', - }, - { - code: ['null'], - type: 'null', - }, - { - code: ['/a/', 'RegExp("a")', 'RegExp?.("a")', 'new RegExp("a")'], - type: 'RegExp', - }, - { - code: ['"str"', "'str'", '`str`', 'String(1)', 'String?.(1)'], - type: 'string', - }, - { - code: ['Symbol("a")', 'Symbol?.("a")'], - type: 'symbol', - }, - { - code: ['undefined', 'void someValue'], - type: 'undefined', - }, -]; -const validTestCases = testCases.flatMap(c => - c.code.map(code => `const a = ${code}`), -); -const invalidTestCases: InvalidTestCase[] = - testCases.flatMap(cas => - cas.code.map(code => ({ - code: `const a: ${cas.type} = ${code}`, - errors: [ - { - column: 7, - data: { - type: cas.type, - }, - line: 1, - messageId: 'noInferrableType', - }, - ], - output: `const a = ${code}`, - })), - ); - const ruleTester = new RuleTester(); ruleTester.run('no-inferrable-types', rule, { valid: [ - ...validTestCases, + 'const a = 10n;', + 'const a = -10n;', + 'const a = BigInt(10);', + 'const a = -BigInt(10);', + 'const a = BigInt?.(10);', + 'const a = -BigInt?.(10);', + 'const a = false;', + 'const a = true;', + 'const a = Boolean(null);', + 'const a = Boolean?.(null);', + 'const a = !0;', + 'const a = 10;', + 'const a = +10;', + 'const a = -10;', + "const a = Number('1');", + "const a = +Number('1');", + "const a = -Number('1');", + "const a = Number?.('1');", + "const a = +Number?.('1');", + "const a = -Number?.('1');", + 'const a = Infinity;', + 'const a = +Infinity;', + 'const a = -Infinity;', + 'const a = NaN;', + 'const a = +NaN;', + 'const a = -NaN;', + 'const a = null;', + 'const a = /a/;', + "const a = RegExp('a');", + "const a = RegExp?.('a');", + "const a = new RegExp('a');", + "const a = 'str';", + 'const a = `str`;', + 'const a = String(1);', + 'const a = String?.(1);', + "const a = Symbol('a');", + "const a = Symbol?.('a');", + 'const a = undefined;', + 'const a = void someValue;', "const fn = (a = 5, b = true, c = 'foo') => {};", "const fn = function (a = 5, b = true, c = 'foo') {};", @@ -171,7 +121,553 @@ class Foo { ], invalid: [ - ...invalidTestCases, + { + code: 'const a: bigint = 10n;', + errors: [ + { + column: 7, + data: { + type: 'bigint', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = 10n;', + }, + { + code: 'const a: bigint = -10n;', + errors: [ + { + column: 7, + data: { + type: 'bigint', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = -10n;', + }, + { + code: 'const a: bigint = BigInt(10);', + errors: [ + { + column: 7, + data: { + type: 'bigint', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = BigInt(10);', + }, + { + code: 'const a: bigint = -BigInt(10);', + errors: [ + { + column: 7, + data: { + type: 'bigint', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = -BigInt(10);', + }, + { + code: 'const a: bigint = BigInt?.(10);', + errors: [ + { + column: 7, + data: { + type: 'bigint', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = BigInt?.(10);', + }, + { + code: 'const a: bigint = -BigInt?.(10);', + errors: [ + { + column: 7, + data: { + type: 'bigint', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = -BigInt?.(10);', + }, + { + code: 'const a: boolean = false;', + errors: [ + { + column: 7, + data: { + type: 'boolean', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = false;', + }, + { + code: 'const a: boolean = true;', + errors: [ + { + column: 7, + data: { + type: 'boolean', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = true;', + }, + { + code: 'const a: boolean = Boolean(null);', + errors: [ + { + column: 7, + data: { + type: 'boolean', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = Boolean(null);', + }, + { + code: 'const a: boolean = Boolean?.(null);', + errors: [ + { + column: 7, + data: { + type: 'boolean', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = Boolean?.(null);', + }, + { + code: 'const a: boolean = !0;', + errors: [ + { + column: 7, + data: { + type: 'boolean', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = !0;', + }, + { + code: 'const a: number = 10;', + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = 10;', + }, + { + code: 'const a: number = +10;', + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = +10;', + }, + { + code: 'const a: number = -10;', + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = -10;', + }, + { + code: "const a: number = Number('1');", + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: "const a = Number('1');", + }, + { + code: "const a: number = +Number('1');", + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: "const a = +Number('1');", + }, + { + code: "const a: number = -Number('1');", + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: "const a = -Number('1');", + }, + { + code: "const a: number = Number?.('1');", + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: "const a = Number?.('1');", + }, + { + code: "const a: number = +Number?.('1');", + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: "const a = +Number?.('1');", + }, + { + code: "const a: number = -Number?.('1');", + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: "const a = -Number?.('1');", + }, + { + code: 'const a: number = Infinity;', + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = Infinity;', + }, + { + code: 'const a: number = +Infinity;', + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = +Infinity;', + }, + { + code: 'const a: number = -Infinity;', + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = -Infinity;', + }, + { + code: 'const a: number = NaN;', + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = NaN;', + }, + { + code: 'const a: number = +NaN;', + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = +NaN;', + }, + { + code: 'const a: number = -NaN;', + errors: [ + { + column: 7, + data: { + type: 'number', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = -NaN;', + }, + { + code: 'const a: null = null;', + errors: [ + { + column: 7, + data: { + type: 'null', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = null;', + }, + { + code: 'const a: RegExp = /a/;', + errors: [ + { + column: 7, + data: { + type: 'RegExp', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = /a/;', + }, + { + code: "const a: RegExp = RegExp('a');", + errors: [ + { + column: 7, + data: { + type: 'RegExp', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: "const a = RegExp('a');", + }, + { + code: "const a: RegExp = RegExp?.('a');", + errors: [ + { + column: 7, + data: { + type: 'RegExp', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: "const a = RegExp?.('a');", + }, + { + code: "const a: RegExp = new RegExp('a');", + errors: [ + { + column: 7, + data: { + type: 'RegExp', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: "const a = new RegExp('a');", + }, + { + code: "const a: string = 'str';", + errors: [ + { + column: 7, + data: { + type: 'string', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: "const a = 'str';", + }, + { + code: 'const a: string = `str`;', + errors: [ + { + column: 7, + data: { + type: 'string', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = `str`;', + }, + { + code: 'const a: string = String(1);', + errors: [ + { + column: 7, + data: { + type: 'string', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = String(1);', + }, + { + code: 'const a: string = String?.(1);', + errors: [ + { + column: 7, + data: { + type: 'string', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = String?.(1);', + }, + { + code: "const a: symbol = Symbol('a');", + errors: [ + { + column: 7, + data: { + type: 'symbol', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: "const a = Symbol('a');", + }, + { + code: "const a: symbol = Symbol?.('a');", + errors: [ + { + column: 7, + data: { + type: 'symbol', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: "const a = Symbol?.('a');", + }, + { + code: 'const a: undefined = undefined;', + errors: [ + { + column: 7, + data: { + type: 'undefined', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = undefined;', + }, + { + code: 'const a: undefined = void someValue;', + errors: [ + { + column: 7, + data: { + type: 'undefined', + }, + line: 1, + messageId: 'noInferrableType', + }, + ], + output: 'const a = void someValue;', + }, + { // This is invalid TS semantic, but it's trivial to make valid anyway code: 'const fn = (a?: number = 5) => {};', From 8a69a33ab1e22c7e4b3727aa004fb58b98fd4a3b Mon Sep 17 00:00:00 2001 From: Vinccool96 Date: Mon, 16 Jun 2025 09:41:03 -0400 Subject: [PATCH 042/283] chore(eslint-plugin): switch auto-generated test cases to hand-written in prefer-readonly-parameter-types.test.ts (#11288) Switch to handwritten test cases --- .../prefer-readonly-parameter-types.test.ts | 225 ++++++++++-------- 1 file changed, 129 insertions(+), 96 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts b/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts index 12df0c7928c3..027f2f7ae49e 100644 --- a/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts @@ -1,21 +1,10 @@ -import type { InvalidTestCase } from '@typescript-eslint/rule-tester'; - import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; import * as path from 'node:path'; -import type { - InferMessageIdsTypeFromRule, - InferOptionsTypeFromRule, -} from '../../src/util'; - import rule from '../../src/rules/prefer-readonly-parameter-types'; import { readonlynessOptionsDefaults } from '../../src/util'; -import { dedupeTestCases } from '../dedupeTestCases'; import { getFixturesRootDir } from '../RuleTester'; -type MessageIds = InferMessageIdsTypeFromRule; -type Options = InferOptionsTypeFromRule; - const rootPath = getFixturesRootDir(); const ruleTester = new RuleTester({ @@ -27,54 +16,23 @@ const ruleTester = new RuleTester({ }, }); -const primitives = [ - 'boolean', - 'true', - 'string', - "'a'", - 'number', - '1', - 'symbol', - 'any', - 'unknown', - 'never', - 'null', - 'undefined', -]; -const arrays = [ - 'readonly string[]', - 'Readonly', - 'ReadonlyArray', - 'readonly [string]', - 'Readonly<[string]>', -]; -const objects = [ - '{ foo: "" }', - '{ foo: readonly string[] }', - '{ foo(): void }', -]; -const weirdIntersections = [ - ` - interface Test { - (): void - readonly property: boolean - } - function foo(arg: Test) {} - `, - ` - type Test = (() => void) & { - readonly property: boolean - }; - function foo(arg: Test) {} - `, -]; - ruleTester.run('prefer-readonly-parameter-types', rule, { valid: [ 'function foo() {}', // primitives - ...primitives.map(type => `function foo(arg: ${type}) {}`), + 'function foo(arg: boolean) {}', + 'function foo(arg: true) {}', + 'function foo(arg: string) {}', + "function foo(arg: 'a') {}", + 'function foo(arg: number) {}', + 'function foo(arg: 1) {}', + 'function foo(arg: symbol) {}', + 'function foo(arg: any) {}', + 'function foo(arg: unknown) {}', + 'function foo(arg: never) {}', + 'function foo(arg: null) {}', + 'function foo(arg: undefined) {}', ` const symb = Symbol('a'); function foo(arg: typeof symb) {} @@ -88,7 +46,12 @@ ruleTester.run('prefer-readonly-parameter-types', rule, { `, // arrays - ...arrays.map(type => `function foo(arg: ${type}) {}`), + 'function foo(arg: readonly string[]) {}', + 'function foo(arg: Readonly) {}', + 'function foo(arg: ReadonlyArray) {}', + 'function foo(arg: readonly [string]) {}', + 'function foo(arg: Readonly<[string]>) {}', + // nested arrays 'function foo(arg: readonly (readonly string[])[]) {}', 'function foo(arg: Readonly[]>) {}', @@ -104,7 +67,9 @@ ruleTester.run('prefer-readonly-parameter-types', rule, { 'function foo(arg: ReadonlyArray | ReadonlyArray) {}', // objects - ...objects.map(type => `function foo(arg: Readonly<${type}>) {}`), + "function foo(arg: Readonly<{ foo: '' }>) {}", + 'function foo(arg: Readonly<{ foo: readonly string[] }>) {}', + 'function foo(arg: Readonly<{ foo(): void }>) {}', ` function foo(arg: { readonly foo: { @@ -124,7 +89,19 @@ ruleTester.run('prefer-readonly-parameter-types', rule, { `, // weird other cases - ...weirdIntersections.map(code => code), + ` +interface Test { + (): void; + readonly property: boolean; +} +function foo(arg: Test) {} + `, + ` +type Test = (() => void) & { + readonly property: boolean; +}; +function foo(arg: Test) {} + `, ` interface Test extends ReadonlyArray { readonly property: boolean; @@ -480,24 +457,36 @@ ruleTester.run('prefer-readonly-parameter-types', rule, { invalid: [ // arrays // Removing readonly causes duplicates - ...dedupeTestCases( - arrays.map>(baseType => { - const type = baseType - .replaceAll('readonly ', '') - .replaceAll(/Readonly<(.+?)>/g, '$1') - .replaceAll('ReadonlyArray', 'Array'); - return { - code: `function foo(arg: ${type}) {}`, - errors: [ - { - column: 14, - endColumn: 19 + type.length, - messageId: 'shouldBeReadonly', - }, - ], - }; - }), - ), + { + code: 'function foo(arg: string[]) {}', + errors: [ + { + column: 14, + endColumn: 27, + messageId: 'shouldBeReadonly', + }, + ], + }, + { + code: 'function foo(arg: Array) {}', + errors: [ + { + column: 14, + endColumn: 32, + messageId: 'shouldBeReadonly', + }, + ], + }, + { + code: 'function foo(arg: [string]) {}', + errors: [ + { + column: 14, + endColumn: 27, + messageId: 'shouldBeReadonly', + }, + ], + }, // nested arrays { code: 'function foo(arg: readonly string[][]) {}', @@ -531,18 +520,36 @@ ruleTester.run('prefer-readonly-parameter-types', rule, { }, // objects - ...objects.map>(type => { - return { - code: `function foo(arg: ${type}) {}`, - errors: [ - { - column: 14, - endColumn: 19 + type.length, - messageId: 'shouldBeReadonly', - }, - ], - }; - }), + { + code: "function foo(arg: { foo: '' }) {}", + errors: [ + { + column: 14, + endColumn: 30, + messageId: 'shouldBeReadonly', + }, + ], + }, + { + code: 'function foo(arg: { foo: readonly string[] }) {}', + errors: [ + { + column: 14, + endColumn: 45, + messageId: 'shouldBeReadonly', + }, + ], + }, + { + code: 'function foo(arg: { foo(): void }) {}', + errors: [ + { + column: 14, + endColumn: 34, + messageId: 'shouldBeReadonly', + }, + ], + }, { code: ` function foo(arg: { @@ -592,15 +599,41 @@ ruleTester.run('prefer-readonly-parameter-types', rule, { }, // weird intersections - ...weirdIntersections.map>( - baseCode => { - const code = baseCode.replaceAll('readonly ', ''); - return { - code, - errors: [{ messageId: 'shouldBeReadonly' }], - }; - }, - ), + { + code: ` +interface Test { + (): void; + property: boolean; +} +function foo(arg: Test) {} + `, + errors: [ + { + column: 14, + endColumn: 23, + endLine: 6, + line: 6, + messageId: 'shouldBeReadonly', + }, + ], + }, + { + code: ` +type Test = (() => void) & { + property: boolean; +}; +function foo(arg: Test) {} + `, + errors: [ + { + column: 14, + endColumn: 23, + endLine: 5, + line: 5, + messageId: 'shouldBeReadonly', + }, + ], + }, { code: ` interface Test extends Array { From 2fbae4863fc39279f61ba77bfe01e080a5796072 Mon Sep 17 00:00:00 2001 From: Vinccool96 Date: Mon, 16 Jun 2025 09:54:46 -0400 Subject: [PATCH 043/283] chore(eslint-plugin): switch auto-generated test cases to hand-written in strict-boolean-expressions.test.ts (#11296) Switch to handwritten test cases --- .../rules/strict-boolean-expressions.test.ts | 986 +++++++++++++----- 1 file changed, 700 insertions(+), 286 deletions(-) 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 87bade1d7fc3..50cedd3b489d 100644 --- a/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts @@ -1,15 +1,8 @@ -/* eslint-disable @typescript-eslint/no-deprecated -- TODO - migrate this test away from `batchedSingleLineTests` */ - import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; import * as path from 'node:path'; -import type { - MessageId, - Options, -} from '../../src/rules/strict-boolean-expressions'; - import rule from '../../src/rules/strict-boolean-expressions'; -import { batchedSingleLineTests, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir } from '../RuleTester'; const rootPath = getFixturesRootDir(); const ruleTester = new RuleTester({ @@ -645,67 +638,99 @@ declare function f(x: string | null): boolean; invalid: [ // non-boolean in RHS of test expression - ...batchedSingleLineTests({ - code: noFormat` - if (true && (1 + 1)) {} - while (false || "a" + "b") {} - (x: object) => true || false || x ? true : false; + { + code: ` +if (true && 1 + 1) { +} `, errors: [ { - column: 14, - data: { - context: 'conditional', - }, + column: 13, + data: { context: 'conditional' }, line: 2, messageId: 'conditionErrorNumber', suggestions: [ { messageId: 'conditionFixCompareZero', - output: 'if (true && ((1 + 1) !== 0)) {}', + output: ` +if (true && ((1 + 1) !== 0)) { +} + `, }, { messageId: 'conditionFixCompareNaN', - output: 'if (true && (!Number.isNaN((1 + 1)))) {}', + output: ` +if (true && (!Number.isNaN((1 + 1)))) { +} + `, }, { messageId: 'conditionFixCastBoolean', - output: 'if (true && (Boolean((1 + 1)))) {}', + output: ` +if (true && (Boolean((1 + 1)))) { +} + `, }, ], }, + ], + options: [ { - column: 25, - line: 3, + allowNullableObject: false, + allowNumber: false, + allowString: false, + }, + ], + }, + { + code: "while (false || 'a' + 'b') {}", + errors: [ + { + column: 17, + line: 1, messageId: 'conditionErrorString', suggestions: [ { messageId: 'conditionFixCompareStringLength', - output: ' while (false || (("a" + "b").length > 0)) {}', + output: "while (false || (('a' + 'b').length > 0)) {}", }, { messageId: 'conditionFixCompareEmptyString', - output: ' while (false || (("a" + "b") !== "")) {}', + output: `while (false || (('a' + 'b') !== "")) {}`, }, { messageId: 'conditionFixCastBoolean', - output: ' while (false || (Boolean(("a" + "b")))) {}', + output: "while (false || (Boolean(('a' + 'b')))) {}", }, ], }, + ], + options: [ { - column: 41, - data: { - context: 'conditional', - }, - line: 4, + allowNullableObject: false, + allowNumber: false, + allowString: false, + }, + ], + }, + { + code: '(x: object) => (true || false || x ? true : false);', + errors: [ + { + column: 34, + data: { context: 'conditional' }, + line: 1, messageId: 'conditionErrorObject', }, ], options: [ - { allowNullableObject: false, allowNumber: false, allowString: false }, + { + allowNullableObject: false, + allowNumber: false, + allowString: false, + }, ], - }), + }, // check if all and only the outermost operands are checked { @@ -1538,404 +1563,632 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } }, // nullish in boolean context - ...batchedSingleLineTests({ - code: noFormat` - null || {}; - undefined && []; - declare const x: null; if (x) {} - (x: undefined) => !x; - (x: T) => x ? 1 : 0; - (x: T) => x ? 1 : 0; - (x: T) => x ? 1 : 0; + { + code: 'null || {};', + errors: [ + { + column: 1, + line: 1, + messageId: 'conditionErrorNullish', + }, + ], + }, + { + code: 'undefined && [];', + errors: [ + { + column: 1, + line: 1, + messageId: 'conditionErrorNullish', + }, + ], + }, + { + code: ` +declare const x: null; +if (x) { +} `, errors: [ - { column: 1, line: 2, messageId: 'conditionErrorNullish' }, - { column: 9, line: 3, messageId: 'conditionErrorNullish' }, - { column: 36, line: 4, messageId: 'conditionErrorNullish' }, - { column: 28, line: 5, messageId: 'conditionErrorNullish' }, - { column: 47, line: 6, messageId: 'conditionErrorNullish' }, - { column: 35, line: 7, messageId: 'conditionErrorNullish' }, - { column: 40, line: 8, messageId: 'conditionErrorNullish' }, - ], - }), + { + column: 5, + line: 3, + messageId: 'conditionErrorNullish', + }, + ], + }, + { + code: '(x: undefined) => !x;', + errors: [ + { + column: 20, + line: 1, + messageId: 'conditionErrorNullish', + }, + ], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ + { + column: 40, + line: 1, + messageId: 'conditionErrorNullish', + }, + ], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ + { + column: 28, + line: 1, + messageId: 'conditionErrorNullish', + }, + ], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ + { + column: 33, + line: 1, + messageId: 'conditionErrorNullish', + }, + ], + }, // object in boolean context - ...batchedSingleLineTests({ - code: noFormat` - [] || 1; - ({}) && "a"; - declare const x: symbol; if (x) {} - (x: () => void) => !x; - (x: T) => x ? 1 : 0; - (x: T) => x ? 1 : 0; - (x: T) => x ? 1 : 0; - void>(x: T) => x ? 1 : 0; - `, + { + code: '[] || 1;', errors: [ { column: 1, data: { context: 'conditional', }, - line: 2, + line: 1, messageId: 'conditionErrorObject', }, + ], + }, + { + code: "({}) && 'a';", + errors: [ { - column: 10, + column: 2, data: { context: 'conditional', }, - line: 3, + line: 1, messageId: 'conditionErrorObject', }, + ], + }, + { + code: ` +declare const x: symbol; +if (x) { +} + `, + errors: [ { - column: 38, + column: 5, data: { context: 'conditional', }, - line: 4, + line: 3, messageId: 'conditionErrorObject', }, + ], + }, + { + code: '(x: () => void) => !x;', + errors: [ { - column: 29, + column: 21, data: { context: 'conditional', }, - line: 5, + line: 1, messageId: 'conditionErrorObject', }, + ], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ { - column: 37, + column: 30, data: { context: 'conditional', }, - line: 6, + line: 1, messageId: 'conditionErrorObject', }, + ], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ { - column: 48, + column: 41, data: { context: 'conditional', }, - line: 7, + line: 1, messageId: 'conditionErrorObject', }, + ], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ { - column: 44, + column: 37, data: { context: 'conditional', }, - line: 8, + line: 1, messageId: 'conditionErrorObject', }, + ], + }, + { + code: ' void>(x: T) => (x ? 1 : 0);', + errors: [ { - column: 41, + column: 34, data: { context: 'conditional', }, - line: 9, + line: 1, messageId: 'conditionErrorObject', }, ], - }), + }, // string in boolean context - ...batchedSingleLineTests({ - code: noFormat` - while ("") {} - for (; "foo";) {} - declare const x: string; if (x) {} - (x: string) => (!x); - (x: T) => x ? 1 : 0; - `, + { + code: "while ('') {}", errors: [ { column: 8, data: { context: 'conditional', }, - line: 2, + line: 1, messageId: 'conditionErrorString', suggestions: [ { messageId: 'conditionFixCompareStringLength', - output: `while ("".length > 0) {}`, + output: "while (''.length > 0) {}", }, { messageId: 'conditionFixCompareEmptyString', - output: `while ("" !== "") {}`, + output: `while ('' !== "") {}`, }, { messageId: 'conditionFixCastBoolean', - output: `while (Boolean("")) {}`, + output: "while (Boolean('')) {}", }, ], }, + ], + options: [ { - column: 16, + allowString: false, + }, + ], + }, + { + code: "for (; 'foo'; ) {}", + errors: [ + { + column: 8, data: { context: 'conditional', }, - line: 3, + line: 1, messageId: 'conditionErrorString', suggestions: [ { messageId: 'conditionFixCompareStringLength', - output: ` for (; "foo".length > 0;) {}`, + output: "for (; 'foo'.length > 0; ) {}", }, { messageId: 'conditionFixCompareEmptyString', - output: ` for (; "foo" !== "";) {}`, + output: `for (; 'foo' !== ""; ) {}`, }, { messageId: 'conditionFixCastBoolean', - output: ` for (; Boolean("foo");) {}`, + output: "for (; Boolean('foo'); ) {}", }, ], }, + ], + options: [ + { + allowString: false, + }, + ], + }, + { + code: ` +declare const x: string; +if (x) { +} + `, + errors: [ { - column: 38, + column: 5, data: { context: 'conditional', }, - line: 4, + line: 3, messageId: 'conditionErrorString', suggestions: [ { messageId: 'conditionFixCompareStringLength', - output: ` declare const x: string; if (x.length > 0) {}`, + output: ` +declare const x: string; +if (x.length > 0) { +} + `, }, { messageId: 'conditionFixCompareEmptyString', - output: ` declare const x: string; if (x !== "") {}`, + output: ` +declare const x: string; +if (x !== "") { +} + `, }, { messageId: 'conditionFixCastBoolean', - output: ` declare const x: string; if (Boolean(x)) {}`, + output: ` +declare const x: string; +if (Boolean(x)) { +} + `, }, ], }, + ], + options: [ { - column: 26, + allowString: false, + }, + ], + }, + { + code: '(x: string) => !x;', + errors: [ + { + column: 17, data: { context: 'conditional', }, - line: 5, + line: 1, messageId: 'conditionErrorString', suggestions: [ { messageId: 'conditionFixCompareStringLength', - output: ` (x: string) => (x.length === 0);`, + output: '(x: string) => x.length === 0;', }, { messageId: 'conditionFixCompareEmptyString', - output: ` (x: string) => (x === "");`, + output: '(x: string) => x === "";', }, { messageId: 'conditionFixCastBoolean', - output: ` (x: string) => (!Boolean(x));`, + output: '(x: string) => !Boolean(x);', }, ], }, + ], + options: [ + { + allowString: false, + }, + ], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ { - column: 37, + column: 30, data: { context: 'conditional', }, - line: 6, + line: 1, messageId: 'conditionErrorString', suggestions: [ { messageId: 'conditionFixCompareStringLength', - output: ` (x: T) => (x.length > 0) ? 1 : 0;`, + output: '(x: T) => ((x.length > 0) ? 1 : 0);', }, { messageId: 'conditionFixCompareEmptyString', - output: ` (x: T) => (x !== "") ? 1 : 0;`, + output: '(x: T) => ((x !== "") ? 1 : 0);', }, { messageId: 'conditionFixCastBoolean', - output: ` (x: T) => (Boolean(x)) ? 1 : 0;`, + output: '(x: T) => ((Boolean(x)) ? 1 : 0);', }, ], }, ], - options: [{ allowString: false }], - }), + options: [ + { + allowString: false, + }, + ], + }, // number in boolean context - ...batchedSingleLineTests({ - code: noFormat` - while (0n) {} - for (; 123;) {} - declare const x: number; if (x) {} - (x: bigint) => !x; - (x: T) => (x) ? 1 : 0; - ![]["length"]; // doesn't count as array.length when computed - declare const a: any[] & { notLength: number }; if (a.notLength) {} - `, + { + code: 'while (0n) {}', errors: [ { column: 8, data: { context: 'conditional', }, - line: 2, + line: 1, messageId: 'conditionErrorNumber', suggestions: [ { messageId: 'conditionFixCompareZero', // TODO: fix compare zero suggestion for bigint - output: `while (0n !== 0) {}`, + output: 'while (0n !== 0) {}', }, { // TODO: remove check NaN suggestion for bigint messageId: 'conditionFixCompareNaN', - output: `while (!Number.isNaN(0n)) {}`, + output: 'while (!Number.isNaN(0n)) {}', }, { messageId: 'conditionFixCastBoolean', - output: `while (Boolean(0n)) {}`, + output: 'while (Boolean(0n)) {}', }, ], }, + ], + options: [ { - column: 16, + allowNumber: false, + }, + ], + }, + { + code: 'for (; 123; ) {}', + errors: [ + { + column: 8, data: { context: 'conditional', }, - line: 3, + line: 1, messageId: 'conditionErrorNumber', suggestions: [ { messageId: 'conditionFixCompareZero', - output: ` for (; 123 !== 0;) {}`, + output: 'for (; 123 !== 0; ) {}', }, { messageId: 'conditionFixCompareNaN', - output: ` for (; !Number.isNaN(123);) {}`, + output: 'for (; !Number.isNaN(123); ) {}', }, { messageId: 'conditionFixCastBoolean', - output: ` for (; Boolean(123);) {}`, + output: 'for (; Boolean(123); ) {}', }, ], }, + ], + options: [ + { + allowNumber: false, + }, + ], + }, + { + code: ` +declare const x: number; +if (x) { +} + `, + errors: [ { - column: 38, + column: 5, data: { context: 'conditional', }, - line: 4, + line: 3, messageId: 'conditionErrorNumber', suggestions: [ { messageId: 'conditionFixCompareZero', - output: ` declare const x: number; if (x !== 0) {}`, + output: ` +declare const x: number; +if (x !== 0) { +} + `, }, { messageId: 'conditionFixCompareNaN', - output: ` declare const x: number; if (!Number.isNaN(x)) {}`, + output: ` +declare const x: number; +if (!Number.isNaN(x)) { +} + `, }, { messageId: 'conditionFixCastBoolean', - output: ` declare const x: number; if (Boolean(x)) {}`, + output: ` +declare const x: number; +if (Boolean(x)) { +} + `, }, ], }, + ], + options: [ { - column: 25, + allowNumber: false, + }, + ], + }, + { + code: '(x: bigint) => !x;', + errors: [ + { + column: 17, data: { context: 'conditional', }, - line: 5, + line: 1, messageId: 'conditionErrorNumber', suggestions: [ { - messageId: 'conditionFixCompareZero', // TODO: fix compare zero suggestion for bigint - output: ` (x: bigint) => x === 0;`, + messageId: 'conditionFixCompareZero', + output: '(x: bigint) => x === 0;', }, { // TODO: remove check NaN suggestion for bigint messageId: 'conditionFixCompareNaN', - output: ` (x: bigint) => Number.isNaN(x);`, + output: '(x: bigint) => Number.isNaN(x);', }, { messageId: 'conditionFixCastBoolean', - output: ` (x: bigint) => !Boolean(x);`, + output: '(x: bigint) => !Boolean(x);', }, ], }, + ], + options: [ + { + allowNumber: false, + }, + ], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ { - column: 38, + column: 30, data: { context: 'conditional', }, - line: 6, + line: 1, messageId: 'conditionErrorNumber', suggestions: [ { messageId: 'conditionFixCompareZero', - output: ` (x: T) => (x !== 0) ? 1 : 0;`, + output: '(x: T) => ((x !== 0) ? 1 : 0);', }, { messageId: 'conditionFixCompareNaN', - output: ` (x: T) => (!Number.isNaN(x)) ? 1 : 0;`, + output: + '(x: T) => ((!Number.isNaN(x)) ? 1 : 0);', }, { messageId: 'conditionFixCastBoolean', - output: ` (x: T) => (Boolean(x)) ? 1 : 0;`, + output: '(x: T) => ((Boolean(x)) ? 1 : 0);', }, ], }, + ], + options: [ { - column: 10, + allowNumber: false, + }, + ], + }, + { + code: "![]['length']; // doesn't count as array.length when computed", + errors: [ + { + column: 2, data: { context: 'conditional', }, - line: 7, + line: 1, messageId: 'conditionErrorNumber', suggestions: [ { messageId: 'conditionFixCompareZero', - output: ` []["length"] === 0; // doesn't count as array.length when computed`, + output: + "[]['length'] === 0; // doesn't count as array.length when computed", }, { messageId: 'conditionFixCompareNaN', - output: ` Number.isNaN([]["length"]); // doesn't count as array.length when computed`, + output: + "Number.isNaN([]['length']); // doesn't count as array.length when computed", }, { messageId: 'conditionFixCastBoolean', - output: ` !Boolean([]["length"]); // doesn't count as array.length when computed`, + output: + "!Boolean([]['length']); // doesn't count as array.length when computed", }, ], }, + ], + options: [ { - column: 61, - data: { - context: 'conditional', - }, - line: 8, + allowNumber: false, + }, + ], + }, + { + code: ` +declare const a: any[] & { notLength: number }; +if (a.notLength) { +} + `, + errors: [ + { + column: 5, + data: { context: 'conditional' }, + line: 3, messageId: 'conditionErrorNumber', suggestions: [ { messageId: 'conditionFixCompareZero', - output: ` declare const a: any[] & { notLength: number }; if (a.notLength !== 0) {}`, + output: ` +declare const a: any[] & { notLength: number }; +if (a.notLength !== 0) { +} + `, }, { messageId: 'conditionFixCompareNaN', - output: ` declare const a: any[] & { notLength: number }; if (!Number.isNaN(a.notLength)) {}`, + output: ` +declare const a: any[] & { notLength: number }; +if (!Number.isNaN(a.notLength)) { +} + `, }, { messageId: 'conditionFixCastBoolean', - output: ` declare const a: any[] & { notLength: number }; if (Boolean(a.notLength)) {}`, + output: ` +declare const a: any[] & { notLength: number }; +if (Boolean(a.notLength)) { +} + `, }, ], }, ], - options: [{ allowNumber: false }], - }), + options: [ + { + allowNumber: false, + }, + ], + }, // number (array.length) in boolean context @@ -2017,342 +2270,487 @@ if ([].length === 0) { }, // mixed `string | number` value in boolean context - ...batchedSingleLineTests({ - code: noFormat` - declare const x: string | number; if (x) {} - (x: bigint | string) => !x; - (x: T) => x ? 1 : 0; + { + code: ` +declare const x: string | number; +if (x) { +} `, errors: [ - { column: 39, line: 2, messageId: 'conditionErrorOther' }, - { column: 34, line: 3, messageId: 'conditionErrorOther' }, - { column: 55, line: 4, messageId: 'conditionErrorOther' }, + { + column: 5, + line: 3, + messageId: 'conditionErrorOther', + }, + ], + options: [{ allowNumber: true, allowString: true }], + }, + { + code: '(x: bigint | string) => !x;', + errors: [ + { + column: 26, + line: 1, + messageId: 'conditionErrorOther', + }, + ], + options: [{ allowNumber: true, allowString: true }], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ + { + column: 48, + line: 1, + messageId: 'conditionErrorOther', + }, ], options: [{ allowNumber: true, allowString: true }], - }), + }, // nullable boolean in boolean context - ...batchedSingleLineTests({ - code: noFormat` - declare const x: boolean | null; if (x) {} - (x?: boolean) => !x; - (x: T) => x ? 1 : 0; + { + code: ` +declare const x: boolean | null; +if (x) { +} `, errors: [ { - column: 38, + column: 5, data: { context: 'conditional', }, - line: 2, + line: 3, messageId: 'conditionErrorNullableBoolean', suggestions: [ { messageId: 'conditionFixDefaultFalse', - output: `declare const x: boolean | null; if (x ?? false) {}`, + output: ` +declare const x: boolean | null; +if (x ?? false) { +} + `, }, { messageId: 'conditionFixCompareTrue', - output: `declare const x: boolean | null; if (x === true) {}`, + output: ` +declare const x: boolean | null; +if (x === true) { +} + `, }, ], }, + ], + options: [{ allowNullableBoolean: false }], + }, + { + code: '(x?: boolean) => !x;', + errors: [ { - column: 27, + column: 19, data: { context: 'conditional', }, - line: 3, + line: 1, messageId: 'conditionErrorNullableBoolean', suggestions: [ { messageId: 'conditionFixDefaultFalse', - output: ` (x?: boolean) => !(x ?? false);`, + output: '(x?: boolean) => !(x ?? false);', }, { messageId: 'conditionFixCompareFalse', - output: ` (x?: boolean) => x === false;`, + output: '(x?: boolean) => x === false;', }, ], }, + ], + options: [{ allowNullableBoolean: false }], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ { - column: 57, + column: 50, data: { context: 'conditional', }, - line: 4, + line: 1, messageId: 'conditionErrorNullableBoolean', suggestions: [ { messageId: 'conditionFixDefaultFalse', - output: ` (x: T) => (x ?? false) ? 1 : 0;`, + output: + '(x: T) => ((x ?? false) ? 1 : 0);', }, { messageId: 'conditionFixCompareTrue', - output: ` (x: T) => (x === true) ? 1 : 0;`, + output: + '(x: T) => ((x === true) ? 1 : 0);', }, ], }, ], options: [{ allowNullableBoolean: false }], - }), + }, // nullable object in boolean context - ...batchedSingleLineTests({ - code: noFormat` - declare const x: object | null; if (x) {} - (x?: { a: number }) => !x; - (x: T) => x ? 1 : 0; + { + code: ` +declare const x: object | null; +if (x) { +} `, errors: [ { - column: 37, - line: 2, + column: 5, + line: 3, messageId: 'conditionErrorNullableObject', suggestions: [ { messageId: 'conditionFixCompareNullish', - output: 'declare const x: object | null; if (x != null) {}', + output: ` +declare const x: object | null; +if (x != null) { +} + `, }, ], }, + ], + options: [{ allowNullableObject: false }], + }, + { + code: '(x?: { a: number }) => !x;', + errors: [ { - column: 33, - line: 3, + column: 25, + line: 1, messageId: 'conditionErrorNullableObject', suggestions: [ { messageId: 'conditionFixCompareNullish', - output: ` (x?: { a: number }) => x == null;`, + output: '(x?: { a: number }) => x == null;', }, ], }, + ], + options: [{ allowNullableObject: false }], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ { - column: 52, - line: 4, + column: 45, + line: 1, messageId: 'conditionErrorNullableObject', suggestions: [ { messageId: 'conditionFixCompareNullish', - output: ` (x: T) => (x != null) ? 1 : 0;`, + output: + '(x: T) => ((x != null) ? 1 : 0);', }, ], }, ], options: [{ allowNullableObject: false }], - }), + }, // nullable string in boolean context - ...batchedSingleLineTests({ - code: noFormat` - declare const x: string | null; if (x) {} - (x?: string) => !x; - (x: T) => x ? 1 : 0; - function foo(x: '' | 'bar' | null) { if (!x) {} } + { + code: ` +declare const x: string | null; +if (x) { +} `, errors: [ { - column: 37, + column: 5, data: { context: 'conditional', }, - line: 2, + line: 3, messageId: 'conditionErrorNullableString', suggestions: [ { messageId: 'conditionFixCompareNullish', - output: 'declare const x: string | null; if (x != null) {}', + output: ` +declare const x: string | null; +if (x != null) { +} + `, }, { messageId: 'conditionFixDefaultEmptyString', - output: 'declare const x: string | null; if (x ?? "") {}', + output: ` +declare const x: string | null; +if (x ?? "") { +} + `, }, { messageId: 'conditionFixCastBoolean', - output: 'declare const x: string | null; if (Boolean(x)) {}', + output: ` +declare const x: string | null; +if (Boolean(x)) { +} + `, }, ], }, + ], + }, + { + code: '(x?: string) => !x;', + errors: [ { - column: 26, + column: 18, data: { context: 'conditional', }, - line: 3, + line: 1, messageId: 'conditionErrorNullableString', suggestions: [ { messageId: 'conditionFixCompareNullish', - output: ' (x?: string) => x == null;', + output: '(x?: string) => x == null;', }, { messageId: 'conditionFixDefaultEmptyString', - output: ' (x?: string) => !(x ?? "");', + output: '(x?: string) => !(x ?? "");', }, { messageId: 'conditionFixCastBoolean', - output: ' (x?: string) => !Boolean(x);', + output: '(x?: string) => !Boolean(x);', }, ], }, + ], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ { - column: 56, - data: { - context: 'conditional', - }, - line: 4, + column: 49, + data: { context: 'conditional' }, + line: 1, messageId: 'conditionErrorNullableString', suggestions: [ { messageId: 'conditionFixCompareNullish', output: - ' (x: T) => (x != null) ? 1 : 0;', + '(x: T) => ((x != null) ? 1 : 0);', }, { messageId: 'conditionFixDefaultEmptyString', output: - ' (x: T) => (x ?? "") ? 1 : 0;', + '(x: T) => ((x ?? "") ? 1 : 0);', }, { messageId: 'conditionFixCastBoolean', output: - ' (x: T) => (Boolean(x)) ? 1 : 0;', + '(x: T) => ((Boolean(x)) ? 1 : 0);', }, ], }, + ], + }, + { + code: ` +function foo(x: '' | 'bar' | null) { + if (!x) { + } +} + `, + errors: [ { - column: 51, - data: { - context: 'conditional', - }, - line: 5, + column: 8, + data: { context: 'conditional' }, + line: 3, messageId: 'conditionErrorNullableString', suggestions: [ { messageId: 'conditionFixCompareNullish', - output: - " function foo(x: '' | 'bar' | null) { if (x == null) {} }", + output: ` +function foo(x: '' | 'bar' | null) { + if (x == null) { + } +} + `, }, { messageId: 'conditionFixDefaultEmptyString', - output: - " function foo(x: '' | 'bar' | null) { if (!(x ?? \"\")) {} }", + output: ` +function foo(x: '' | 'bar' | null) { + if (!(x ?? "")) { + } +} + `, }, { messageId: 'conditionFixCastBoolean', - output: - " function foo(x: '' | 'bar' | null) { if (!Boolean(x)) {} }", + output: ` +function foo(x: '' | 'bar' | null) { + if (!Boolean(x)) { + } +} + `, }, ], }, ], - }), + }, // nullable number in boolean context - ...batchedSingleLineTests({ - code: noFormat` - declare const x: number | null; if (x) {} - (x?: number) => !x; - (x: T) => x ? 1 : 0; - function foo(x: 0 | 1 | null) { if (!x) {} } + { + code: ` +declare const x: number | null; +if (x) { +} `, errors: [ { - column: 37, + column: 5, data: { context: 'conditional', }, - line: 2, + line: 3, messageId: 'conditionErrorNullableNumber', suggestions: [ { messageId: 'conditionFixCompareNullish', - output: 'declare const x: number | null; if (x != null) {}', + output: ` +declare const x: number | null; +if (x != null) { +} + `, }, { messageId: 'conditionFixDefaultZero', - output: 'declare const x: number | null; if (x ?? 0) {}', + output: ` +declare const x: number | null; +if (x ?? 0) { +} + `, }, { messageId: 'conditionFixCastBoolean', - output: 'declare const x: number | null; if (Boolean(x)) {}', + output: ` +declare const x: number | null; +if (Boolean(x)) { +} + `, }, ], }, + ], + }, + { + code: '(x?: number) => !x;', + errors: [ { - column: 26, + column: 18, data: { context: 'conditional', }, - line: 3, + line: 1, messageId: 'conditionErrorNullableNumber', suggestions: [ { messageId: 'conditionFixCompareNullish', - output: ' (x?: number) => x == null;', + output: '(x?: number) => x == null;', }, { messageId: 'conditionFixDefaultZero', - output: ' (x?: number) => !(x ?? 0);', + output: '(x?: number) => !(x ?? 0);', }, { messageId: 'conditionFixCastBoolean', - output: ' (x?: number) => !Boolean(x);', + output: '(x?: number) => !Boolean(x);', }, ], }, + ], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ { - column: 56, + column: 49, data: { context: 'conditional', }, - line: 4, + line: 1, messageId: 'conditionErrorNullableNumber', suggestions: [ { messageId: 'conditionFixCompareNullish', output: - ' (x: T) => (x != null) ? 1 : 0;', + '(x: T) => ((x != null) ? 1 : 0);', }, { messageId: 'conditionFixDefaultZero', output: - ' (x: T) => (x ?? 0) ? 1 : 0;', + '(x: T) => ((x ?? 0) ? 1 : 0);', }, { messageId: 'conditionFixCastBoolean', output: - ' (x: T) => (Boolean(x)) ? 1 : 0;', + '(x: T) => ((Boolean(x)) ? 1 : 0);', }, ], }, + ], + }, + { + code: ` +function foo(x: 0 | 1 | null) { + if (!x) { + } +} + `, + errors: [ { - column: 46, + column: 8, data: { context: 'conditional', }, - line: 5, + line: 3, messageId: 'conditionErrorNullableNumber', suggestions: [ { messageId: 'conditionFixCompareNullish', - output: - ' function foo(x: 0 | 1 | null) { if (x == null) {} }', + output: ` +function foo(x: 0 | 1 | null) { + if (x == null) { + } +} + `, }, { messageId: 'conditionFixDefaultZero', - output: - ' function foo(x: 0 | 1 | null) { if (!(x ?? 0)) {} }', + output: ` +function foo(x: 0 | 1 | null) { + if (!(x ?? 0)) { + } +} + `, }, { messageId: 'conditionFixCastBoolean', - output: - ' function foo(x: 0 | 1 | null) { if (!Boolean(x)) {} }', + output: ` +function foo(x: 0 | 1 | null) { + if (!Boolean(x)) { + } +} + `, }, ], }, ], - }), + }, // nullable enum in boolean context { @@ -2765,12 +3163,10 @@ if ([].length === 0) { }, // any in boolean context - ...batchedSingleLineTests({ - code: noFormat` - if (x) {} - x => !x; - (x: T) => x ? 1 : 0; - (x: T) => x ? 1 : 0; + { + code: ` +if (x) { +} `, errors: [ { @@ -2783,54 +3179,72 @@ if ([].length === 0) { suggestions: [ { messageId: 'conditionFixCastBoolean', - output: 'if (Boolean(x)) {}', + output: ` +if (Boolean(x)) { +} + `, }, ], }, + ], + }, + { + code: 'x => !x;', + errors: [ { - column: 15, + column: 7, data: { context: 'conditional', }, - line: 3, + line: 1, messageId: 'conditionErrorAny', suggestions: [ { messageId: 'conditionFixCastBoolean', - output: ' x => !(Boolean(x));', + output: 'x => !(Boolean(x));', }, ], }, + ], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ { - column: 34, + column: 27, data: { context: 'conditional', }, - line: 4, + line: 1, messageId: 'conditionErrorAny', suggestions: [ { messageId: 'conditionFixCastBoolean', - output: ' (x: T) => (Boolean(x)) ? 1 : 0;', + output: '(x: T) => ((Boolean(x)) ? 1 : 0);', }, ], }, + ], + }, + { + code: '(x: T) => (x ? 1 : 0);', + errors: [ { - column: 22, + column: 16, data: { context: 'conditional', }, - line: 5, + line: 1, messageId: 'conditionErrorAny', suggestions: [ { messageId: 'conditionFixCastBoolean', - output: ' (x: T) => (Boolean(x)) ? 1 : 0;', + output: '(x: T) => ((Boolean(x)) ? 1 : 0);', }, ], }, ], - }), + }, // noStrictNullCheck { From 6123d79e4e4d1447cedec4a9775fbb8e905e660f Mon Sep 17 00:00:00 2001 From: Kim Sang Du Date: Mon, 16 Jun 2025 23:00:13 +0900 Subject: [PATCH 044/283] chore: speed up semantic-breaking-change-pr.yml (#11286) * feat(breaking-pr-check): Refactored to breaking-pr-check and deleted index.js file * feat: change pr code * refactor: remove unused dependencies * test: rule test * chore: add test code * chore: add test logic * chore: rename action and remove obsolete workflow file * feat: add permission * fix: token * fix: revert test code & lock file update * fix: remove test code * Update .github/actions/breaking-pr-check/action.yml --------- Co-authored-by: Josh Goldberg --- .github/actions/breaking-pr-check/action.yml | 59 +++++- .github/actions/breaking-pr-check/index.js | 78 ------- ...l => semantic-breaking-change-pr-test.yml} | 1 - package.json | 2 - yarn.lock | 200 ------------------ 5 files changed, 57 insertions(+), 283 deletions(-) delete mode 100644 .github/actions/breaking-pr-check/index.js rename .github/workflows/{semantic-breaking-change-pr.yml => semantic-breaking-change-pr-test.yml} (89%) diff --git a/.github/actions/breaking-pr-check/action.yml b/.github/actions/breaking-pr-check/action.yml index f54443a4f433..c132bb404d8c 100644 --- a/.github/actions/breaking-pr-check/action.yml +++ b/.github/actions/breaking-pr-check/action.yml @@ -2,5 +2,60 @@ name: Validate Breaking Change PR description: Validate breaking change PR title and description runs: - using: node20 - main: index.js + using: 'composite' + steps: + - name: Check PR title and body using github-script + uses: actions/github-script@v7 + with: + github-token: ${{ env.GITHUB_TOKEN }} + script: | + async function getPullRequest() { + const pr = context.payload.pull_request; + if (!pr) { + throw new Error("This action can only be run on pull_request events."); + } + + const owner = pr.base.repo.owner.login; + const repo = pr.base.repo.name; + const pull_number = pr.number; + + const { data } = await github.rest.pulls.get({ + owner, + repo, + pull_number, + }); + + return data; + } + + function checkTitle(title) { + if (/^[a-z]+(\([a-z-]+\))?!: /.test(title)) { + throw new Error( + `Do not use exclamation mark ('!') to indicate breaking change in the PR Title.`, + ); + } + } + + function checkDescription(body, labels) { + if (!labels.some(label => label.name === 'breaking change')) { + return; + } + + const [firstLine, secondLine] = body.split(/\r?\n/); + + if (!firstLine || !/^BREAKING CHANGE:/.test(firstLine)) { + throw new Error( + `Breaking change PR body should start with "BREAKING CHANGE:". See https://typescript-eslint.io/maintenance/releases#2-merging-breaking-changes.`, + ); + } + + if (!secondLine) { + throw new Error( + `The description of breaking change is missing. See https://typescript-eslint.io/maintenance/releases#2-merging-breaking-changes.`, + ); + } + } + + const pr = await getPullRequest(); + checkTitle(pr.title); + checkDescription(pr.body ?? '', pr.labels); diff --git a/.github/actions/breaking-pr-check/index.js b/.github/actions/breaking-pr-check/index.js deleted file mode 100644 index 2aa900456a9c..000000000000 --- a/.github/actions/breaking-pr-check/index.js +++ /dev/null @@ -1,78 +0,0 @@ -// @ts-check -/* eslint-disable jsdoc/no-types, @typescript-eslint/no-require-imports */ - -const core = require('@actions/core'); -const github = require('@actions/github'); - -async function getPullRequest() { - const token = process.env.GITHUB_TOKEN; - if (!token) { - throw new Error( - 'The GITHUB_TOKEN environment variable is required to run this action.', - ); - } - const client = github.getOctokit(token); - - const pr = github.context.payload.pull_request; - if (!pr) { - throw new Error( - "This action can only be invoked in `pull_request_target` or `pull_request` events. Otherwise the pull request can't be inferred.", - ); - } - - const owner = pr.base.user.login; - const repo = pr.base.repo.name; - - const { data } = await client.rest.pulls.get({ - owner, - pull_number: pr.number, - repo, - }); - - return data; -} - -/** - * @param {string} title The PR title to check - */ -function checkTitle(title) { - if (/^[a-z]+(\([a-z-]+\))?!: /.test(title)) { - throw new Error( - `Do not use exclamation mark ('!') to indicate breaking change in the PR Title.`, - ); - } -} - -/** - * @param {string} body The body of the PR - * @param {any[]} labels The labels applied to the PR - */ -function checkDescription(body, labels) { - if (!labels.some(label => label.name === 'breaking change')) { - return; - } - const [firstLine, secondLine] = body.split(/\r?\n/); - - if (!firstLine || !/^BREAKING CHANGE:/.test(firstLine)) { - throw new Error( - `Breaking change PR body should start with "BREAKING CHANGE:". See https://typescript-eslint.io/maintenance/releases#2-merging-breaking-changes.`, - ); - } - if (!secondLine) { - throw new Error( - `The description of breaking change is missing. See https://typescript-eslint.io/maintenance/releases#2-merging-breaking-changes.`, - ); - } -} - -async function run() { - const pullRequest = await getPullRequest(); - try { - checkTitle(pullRequest.title); - checkDescription(pullRequest.body ?? '', pullRequest.labels); - } catch (/** @type {any} */ e) { - core.setFailed(e.message); - } -} - -run(); diff --git a/.github/workflows/semantic-breaking-change-pr.yml b/.github/workflows/semantic-breaking-change-pr-test.yml similarity index 89% rename from .github/workflows/semantic-breaking-change-pr.yml rename to .github/workflows/semantic-breaking-change-pr-test.yml index dcae58270de1..46d4627b3fdc 100644 --- a/.github/workflows/semantic-breaking-change-pr.yml +++ b/.github/workflows/semantic-breaking-change-pr-test.yml @@ -15,7 +15,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/prepare-install - uses: ./.github/actions/breaking-pr-check env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index 8dde6b1ec8fb..e82a1780f359 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,6 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "devDependencies": { - "@actions/core": "^1.10.1", - "@actions/github": "^6.0.0", "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1", "@eslint/compat": "^1.2.4", "@eslint/eslintrc": "^3.2.0", diff --git a/yarn.lock b/yarn.lock index 262252c559d6..3fa95e71e67b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,54 +12,6 @@ __metadata: languageName: node linkType: hard -"@actions/core@npm:^1.10.1": - version: 1.11.1 - resolution: "@actions/core@npm:1.11.1" - dependencies: - "@actions/exec": ^1.1.1 - "@actions/http-client": ^2.0.1 - checksum: 9ac7a3e0b478bfefd862dcb4ddaa1d8c3f9076bb1931d3d280918d1749e7783480c6a009c1b009c8bf5093e2d77d9f4e023d70416145bf246f0071736d4ef839 - languageName: node - linkType: hard - -"@actions/exec@npm:^1.1.1": - version: 1.1.1 - resolution: "@actions/exec@npm:1.1.1" - dependencies: - "@actions/io": ^1.0.1 - checksum: d976e66dd51ab03d76a143da8e1406daa1bcdee06046168e6e0bec681c87a12999eefaad7a81cb81f28e4190610f55a58b8458ae4b82cbaaba13200490f4e8c2 - languageName: node - linkType: hard - -"@actions/github@npm:^6.0.0": - version: 6.0.0 - resolution: "@actions/github@npm:6.0.0" - dependencies: - "@actions/http-client": ^2.2.0 - "@octokit/core": ^5.0.1 - "@octokit/plugin-paginate-rest": ^9.0.0 - "@octokit/plugin-rest-endpoint-methods": ^10.0.0 - checksum: 81831a78377175d8825fc0b94247ff366c0e87ad1dfa48df9b30b8659506f216dcf1e2d3124fcd318839b92c24ba20165e238b3cc11a34db89c69c40825e9ccf - languageName: node - linkType: hard - -"@actions/http-client@npm:^2.0.1, @actions/http-client@npm:^2.2.0": - version: 2.2.0 - resolution: "@actions/http-client@npm:2.2.0" - dependencies: - tunnel: ^0.0.6 - undici: ^5.25.4 - checksum: 075fc21e8c05e865239bfc5cc91ce42aff7ac7877a5828145545cb27c572f74af8f96f90233f3ba2376525a9032bb8eadebd7221c007ce62459b99d5d2362f94 - languageName: node - linkType: hard - -"@actions/io@npm:^1.0.1": - version: 1.1.3 - resolution: "@actions/io@npm:1.1.3" - checksum: 42841ac2b8a7afb29456b9edb5534dbe00148893c794bdbc17d29166847c51c884e2a7c087a489a428250a78e7b54bc761ba3b55eb2f97d9600e9193b60caf0b - languageName: node - linkType: hard - "@algolia/autocomplete-core@npm:1.17.9": version: 1.17.9 resolution: "@algolia/autocomplete-core@npm:1.17.9" @@ -3855,13 +3807,6 @@ __metadata: languageName: node linkType: hard -"@fastify/busboy@npm:^2.0.0": - version: 2.0.0 - resolution: "@fastify/busboy@npm:2.0.0" - checksum: 41879937ce1dee6421ef9cd4da53239830617e1f0bb7a0e843940772cd72827205d05e518af6adabe6e1ea19301285fff432b9d11bad01a531e698bea95c781b - languageName: node - linkType: hard - "@gerrit0/mini-shiki@npm:^3.2.2": version: 3.3.0 resolution: "@gerrit0/mini-shiki@npm:3.3.0" @@ -4406,112 +4351,6 @@ __metadata: languageName: node linkType: hard -"@octokit/auth-token@npm:^4.0.0": - version: 4.0.0 - resolution: "@octokit/auth-token@npm:4.0.0" - checksum: d78f4dc48b214d374aeb39caec4fdbf5c1e4fd8b9fcb18f630b1fe2cbd5a880fca05445f32b4561f41262cb551746aeb0b49e89c95c6dd99299706684d0cae2f - languageName: node - linkType: hard - -"@octokit/core@npm:^5.0.1": - version: 5.0.1 - resolution: "@octokit/core@npm:5.0.1" - dependencies: - "@octokit/auth-token": ^4.0.0 - "@octokit/graphql": ^7.0.0 - "@octokit/request": ^8.0.2 - "@octokit/request-error": ^5.0.0 - "@octokit/types": ^12.0.0 - before-after-hook: ^2.2.0 - universal-user-agent: ^6.0.0 - checksum: 257c5954074f9a1477e25014ce4ac96d73123744b1bfaf28eecb15fea306e2b8454bc6ffec3a0476dd02f76d2ac156b4f7c6aec7d3f7fac955d01f0d62d31e5d - languageName: node - linkType: hard - -"@octokit/endpoint@npm:^9.0.0": - version: 9.0.1 - resolution: "@octokit/endpoint@npm:9.0.1" - dependencies: - "@octokit/types": ^12.0.0 - is-plain-object: ^5.0.0 - universal-user-agent: ^6.0.0 - checksum: 4f700c66829ed0b5ced3c0d018d63de1ecf1a267064095e450b6cfeb6abddecc704947d3f04e4921ac0d4d73595d81d52802d3306945ba7a642f1386fd8db68b - languageName: node - linkType: hard - -"@octokit/graphql@npm:^7.0.0": - version: 7.0.2 - resolution: "@octokit/graphql@npm:7.0.2" - dependencies: - "@octokit/request": ^8.0.1 - "@octokit/types": ^12.0.0 - universal-user-agent: ^6.0.0 - checksum: 05a752c4c2d84fc2900d8e32e1c2d1ee98a5a14349e651cb1109d0741e821e7417a048b1bb40918534ed90a472314aabbda35688868016f248098925f82a3bfa - languageName: node - linkType: hard - -"@octokit/openapi-types@npm:^19.0.0": - version: 19.0.0 - resolution: "@octokit/openapi-types@npm:19.0.0" - checksum: 9a8125ab4e1651ca4b2f734cfa15ca52fe9fa0edd87696e4f57dfa2bcd472767f0f8a99b9324be21f863e6cd91afee423982189f97ac018f3c78a83560e616f5 - languageName: node - linkType: hard - -"@octokit/plugin-paginate-rest@npm:^9.0.0": - version: 9.0.0 - resolution: "@octokit/plugin-paginate-rest@npm:9.0.0" - dependencies: - "@octokit/types": ^12.0.0 - peerDependencies: - "@octokit/core": ">=5" - checksum: 4a8543f3e45c4916f94edc57d66106ee60da9fd4edccd7c3a2ddd00da1fc4eb2e1b2bcb3d6cb981a050edf883100c5004d0b81497568d4ac9138310a2188a458 - languageName: node - linkType: hard - -"@octokit/plugin-rest-endpoint-methods@npm:^10.0.0": - version: 10.0.1 - resolution: "@octokit/plugin-rest-endpoint-methods@npm:10.0.1" - dependencies: - "@octokit/types": ^12.0.0 - peerDependencies: - "@octokit/core": ">=5" - checksum: 4873a76976308dac3a6426d7f4fdd680568f05a3b511dbc47225b7f80feda39771f0cd104ef769dbb7c6fadd2af21a4eab0709f2547fa7f1b55cb9019d93b8e5 - languageName: node - linkType: hard - -"@octokit/request-error@npm:^5.0.0": - version: 5.0.1 - resolution: "@octokit/request-error@npm:5.0.1" - dependencies: - "@octokit/types": ^12.0.0 - deprecation: ^2.0.0 - once: ^1.4.0 - checksum: a681341e43b4da7a8acb19e1a6ba0355b1af146fa0191f2554a98950cf85f898af6ae3ab0b0287d6c871f5465ec57cb38363b96b5019f9f77ba6f30eca39ede5 - languageName: node - linkType: hard - -"@octokit/request@npm:^8.0.1, @octokit/request@npm:^8.0.2": - version: 8.1.4 - resolution: "@octokit/request@npm:8.1.4" - dependencies: - "@octokit/endpoint": ^9.0.0 - "@octokit/request-error": ^5.0.0 - "@octokit/types": ^12.0.0 - is-plain-object: ^5.0.0 - universal-user-agent: ^6.0.0 - checksum: 6a88389b45342c8d773fb157a24a4b06bda6f883e5e91923ea05bf417e1b211e006898c50cdd69c4bd054b65b10a6ca8862cf9eee9c0b07f9a1de8ef43d7d70d - languageName: node - linkType: hard - -"@octokit/types@npm:^12.0.0": - version: 12.0.0 - resolution: "@octokit/types@npm:12.0.0" - dependencies: - "@octokit/openapi-types": ^19.0.0 - checksum: ad55e13cbeef96a63d0088df2ed0a8f3ca764db3f877aa2ecb1693de40b03c1f8e392603bd7fddaaaa74138970ea39f46e4b830d15eeeba74be1671f36440129 - languageName: node - linkType: hard - "@oxc-resolver/binding-darwin-arm64@npm:9.0.2": version: 9.0.2 resolution: "@oxc-resolver/binding-darwin-arm64@npm:9.0.2" @@ -6129,8 +5968,6 @@ __metadata: version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-eslint@workspace:." dependencies: - "@actions/core": ^1.10.1 - "@actions/github": ^6.0.0 "@eslint-community/eslint-plugin-eslint-comments": ^4.4.1 "@eslint/compat": ^1.2.4 "@eslint/eslintrc": ^3.2.0 @@ -7339,13 +7176,6 @@ __metadata: languageName: node linkType: hard -"before-after-hook@npm:^2.2.0": - version: 2.2.2 - resolution: "before-after-hook@npm:2.2.2" - checksum: dc2e1ffe389e5afbef2a46790b1b5a50247ed57aba67649cfa9ec2552d248cc9278f222e72fb5a8ff59bbb39d78fbaa97e7234ead0c6b5e8418b67a8644ce207 - languageName: node - linkType: hard - "big.js@npm:^5.2.2": version: 5.2.2 resolution: "big.js@npm:5.2.2" @@ -9145,13 +8975,6 @@ __metadata: languageName: node linkType: hard -"deprecation@npm:^2.0.0": - version: 2.3.1 - resolution: "deprecation@npm:2.3.1" - checksum: f56a05e182c2c195071385455956b0c4106fe14e36245b00c689ceef8e8ab639235176a96977ba7c74afb173317fac2e0ec6ec7a1c6d1e6eaa401c586c714132 - languageName: node - linkType: hard - "dequal@npm:^2.0.0": version: 2.0.3 resolution: "dequal@npm:2.0.3" @@ -19547,13 +19370,6 @@ __metadata: languageName: node linkType: hard -"tunnel@npm:^0.0.6": - version: 0.0.6 - resolution: "tunnel@npm:0.0.6" - checksum: c362948df9ad34b649b5585e54ce2838fa583aa3037091aaed66793c65b423a264e5229f0d7e9a95513a795ac2bd4cb72cda7e89a74313f182c1e9ae0b0994fa - languageName: node - linkType: hard - "type-check@npm:^0.4.0, type-check@npm:~0.4.0": version: 0.4.0 resolution: "type-check@npm:0.4.0" @@ -19772,15 +19588,6 @@ __metadata: languageName: node linkType: hard -"undici@npm:^5.25.4": - version: 5.26.4 - resolution: "undici@npm:5.26.4" - dependencies: - "@fastify/busboy": ^2.0.0 - checksum: 4d37f14ce56837d332ab1623be751f2a5b439069705671cc60b441133300b05bcb8803668132e7b3f98800db19cd6cb76b48831facbdbc2d73271b12383ab3cd - languageName: node - linkType: hard - "unicode-canonical-property-names-ecmascript@npm:^2.0.0": version: 2.0.0 resolution: "unicode-canonical-property-names-ecmascript@npm:2.0.0" @@ -19937,13 +19744,6 @@ __metadata: languageName: node linkType: hard -"universal-user-agent@npm:^6.0.0": - version: 6.0.0 - resolution: "universal-user-agent@npm:6.0.0" - checksum: 5092bbc80dd0d583cef0b62c17df0043193b74f425112ea6c1f69bc5eda21eeec7a08d8c4f793a277eb2202ffe9b44bec852fa3faff971234cd209874d1b79ef - languageName: node - linkType: hard - "universalify@npm:^2.0.0": version: 2.0.0 resolution: "universalify@npm:2.0.0" From 3a8369d2c5798ef3187c8ff412d409e2d5e17726 Mon Sep 17 00:00:00 2001 From: Younsang Na <77400131+nayounsang@users.noreply.github.com> Date: Mon, 16 Jun 2025 23:01:31 +0900 Subject: [PATCH 045/283] chore(eslint-plugin): switch auto-generated test cases to hand-written in no-base-to-string.test.ts (#11273) * test: flatten dynamic test cases to hand-written * refactor: remove dupe tc in + op --------- Co-authored-by: Josh Goldberg --- .../tests/rules/no-base-to-string.test.ts | 177 +++++++----------- 1 file changed, 63 insertions(+), 114 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts index 340433769679..5a8cd58742ae 100644 --- a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts +++ b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts @@ -13,6 +13,33 @@ const ruleTester = new RuleTester({ }, }); +/** + * ref: https://github.com/typescript-eslint/typescript-eslint/issues/11043 + * Be careful with dynamic test case generation. + * Iterate based on the following cases: + * 1. literalListBasic + * ``` +[ + "''", + "'text'", + 'true', + 'false', + '1', + '1n', + '[]', + '/regex/', +]; + * ``` + * 2. literalListNeedParen + * ``` +[ + "__dirname === 'foobar'", + '{}.constructor()', + '() => {}', + 'function() {}', +]; + * ``` + */ ruleTester.run('no-base-to-string', rule, { valid: [ // template @@ -30,7 +57,6 @@ ruleTester.run('no-base-to-string', rule, { '`${function () {}}`;', // operator + += - "'' + '';", "'' + 'text';", "'' + true;", "'' + false;", @@ -42,8 +68,6 @@ ruleTester.run('no-base-to-string', rule, { "'' + {}.constructor();", "'' + (() => {});", "'' + function () {};", - "'text' + '';", - "'text' + 'text';", "'text' + true;", "'text' + false;", "'text' + 1;", @@ -54,9 +78,6 @@ ruleTester.run('no-base-to-string', rule, { "'text' + {}.constructor();", "'text' + (() => {});", "'text' + function () {};", - "true + '';", - "true + 'text';", - 'true + true;', 'true + false;', 'true + 1;', 'true + 1n;', @@ -66,10 +87,6 @@ ruleTester.run('no-base-to-string', rule, { 'true + {}.constructor();', 'true + (() => {});', 'true + function () {};', - "false + '';", - "false + 'text';", - 'false + true;', - 'false + false;', 'false + 1;', 'false + 1n;', 'false + [];', @@ -78,11 +95,6 @@ ruleTester.run('no-base-to-string', rule, { 'false + {}.constructor();', 'false + (() => {});', 'false + function () {};', - "1 + '';", - "1 + 'text';", - '1 + true;', - '1 + false;', - '1 + 1;', '1 + 1n;', '1 + [];', '1 + /regex/;', @@ -90,90 +102,27 @@ ruleTester.run('no-base-to-string', rule, { '1 + {}.constructor();', '1 + (() => {});', '1 + function () {};', - "1n + '';", - "1n + 'text';", - '1n + true;', - '1n + false;', - '1n + 1;', - '1n + 1n;', '1n + [];', '1n + /regex/;', "1n + (__dirname === 'foobar');", '1n + {}.constructor();', '1n + (() => {});', '1n + function () {};', - "[] + '';", - "[] + 'text';", - '[] + true;', - '[] + false;', - '[] + 1;', - '[] + 1n;', - '[] + [];', '[] + /regex/;', "[] + (__dirname === 'foobar');", '[] + {}.constructor();', '[] + (() => {});', '[] + function () {};', - "/regex/ + '';", - "/regex/ + 'text';", - '/regex/ + true;', - '/regex/ + false;', - '/regex/ + 1;', - '/regex/ + 1n;', - '/regex/ + [];', - '/regex/ + /regex/;', "/regex/ + (__dirname === 'foobar');", '/regex/ + {}.constructor();', '/regex/ + (() => {});', '/regex/ + function () {};', - "(__dirname === 'foobar') + '';", - "(__dirname === 'foobar') + 'text';", - "(__dirname === 'foobar') + true;", - "(__dirname === 'foobar') + false;", - "(__dirname === 'foobar') + 1;", - "(__dirname === 'foobar') + 1n;", - "(__dirname === 'foobar') + [];", - "(__dirname === 'foobar') + /regex/;", - "(__dirname === 'foobar') + (__dirname === 'foobar');", "(__dirname === 'foobar') + {}.constructor();", "(__dirname === 'foobar') + (() => {});", "(__dirname === 'foobar') + function () {};", - "({}).constructor() + '';", - "({}).constructor() + 'text';", - '({}).constructor() + true;', - '({}).constructor() + false;', - '({}).constructor() + 1;', - '({}).constructor() + 1n;', - '({}).constructor() + [];', - '({}).constructor() + /regex/;', - "({}).constructor() + (__dirname === 'foobar');", - '({}).constructor() + {}.constructor();', '({}).constructor() + (() => {});', '({}).constructor() + function () {};', - "(() => {}) + '';", - "(() => {}) + 'text';", - '(() => {}) + true;', - '(() => {}) + false;', - '(() => {}) + 1;', - '(() => {}) + 1n;', - '(() => {}) + [];', - '(() => {}) + /regex/;', - "(() => {}) + (__dirname === 'foobar');", - '(() => {}) + {}.constructor();', - '(() => {}) + (() => {});', '(() => {}) + function () {};', - "(function () {}) + '';", - "(function () {}) + 'text';", - '(function () {}) + true;', - '(function () {}) + false;', - '(function () {}) + 1;', - '(function () {}) + 1n;', - '(function () {}) + [];', - '(function () {}) + /regex/;', - "(function () {}) + (__dirname === 'foobar');", - '(function () {}) + {}.constructor();', - '(function () {}) + (() => {});', - '(function () {}) + function () {};', // toString() "''.toString();", @@ -191,64 +140,64 @@ ruleTester.run('no-base-to-string', rule, { // variable toString() and template ` -let value = ''; -value.toString(); -let text = \`\${value}\`; + let value = ''; + value.toString(); + let text = \`\${value}\`; `, ` -let value = 'text'; -value.toString(); -let text = \`\${value}\`; + let value = 'text'; + value.toString(); + let text = \`\${value}\`; `, ` -let value = true; -value.toString(); -let text = \`\${value}\`; + let value = true; + value.toString(); + let text = \`\${value}\`; `, ` -let value = false; -value.toString(); -let text = \`\${value}\`; + let value = false; + value.toString(); + let text = \`\${value}\`; `, ` -let value = 1; -value.toString(); -let text = \`\${value}\`; + let value = 1; + value.toString(); + let text = \`\${value}\`; `, ` -let value = 1n; -value.toString(); -let text = \`\${value}\`; + let value = 1n; + value.toString(); + let text = \`\${value}\`; `, ` -let value = []; -value.toString(); -let text = \`\${value}\`; + let value = []; + value.toString(); + let text = \`\${value}\`; `, ` -let value = /regex/; -value.toString(); -let text = \`\${value}\`; + let value = /regex/; + value.toString(); + let text = \`\${value}\`; `, ` -let value = __dirname === 'foobar'; -value.toString(); -let text = \`\${value}\`; + let value = __dirname === 'foobar'; + value.toString(); + let text = \`\${value}\`; `, ` -let value = {}.constructor(); -value.toString(); -let text = \`\${value}\`; + let value = {}.constructor(); + value.toString(); + let text = \`\${value}\`; `, ` -let value = () => {}; -value.toString(); -let text = \`\${value}\`; + let value = () => {}; + value.toString(); + let text = \`\${value}\`; `, ` -let value = function () {}; -value.toString(); -let text = \`\${value}\`; + let value = function () {}; + value.toString(); + let text = \`\${value}\`; `, // String() From ccd07914d933c3f7a284c9a7df5b1d6d40495fc5 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 16 Jun 2025 17:19:13 +0000 Subject: [PATCH 046/283] chore(release): publish 8.34.1 --- CHANGELOG.md | 16 ++++ packages/ast-spec/CHANGELOG.md | 12 +++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 6 ++ packages/eslint-plugin/package.json | 16 ++-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 8 +- packages/types/CHANGELOG.md | 12 +++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 8 +- packages/typescript-estree/CHANGELOG.md | 12 +++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 12 +++ packages/visitor-keys/package.json | 4 +- yarn.lock | 94 +++++++++---------- 30 files changed, 220 insertions(+), 96 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82baad46921b..96193f336763 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +## 8.34.1 (2025-06-16) + +### 🩹 Fixes + +- **types:** add 2026/17 to EcmaVersion ([#11304](https://github.com/typescript-eslint/typescript-eslint/pull/11304)) +- **typescript-estree:** emit a Literal instead of Identifier for constructor when the identifier is a string ([#11299](https://github.com/typescript-eslint/typescript-eslint/pull/11299)) +- **visitor-keys:** bump `eslint-visitor-keys` dependency ([#11294](https://github.com/typescript-eslint/typescript-eslint/pull/11294)) + +### ❤️ Thank You + +- David Archibald +- overlookmotel +- Tao + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 222ce18a261e..88b1ab0e897d 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.34.1 (2025-06-16) + +### 🩹 Fixes + +- **typescript-estree:** emit a Literal instead of Identifier for constructor when the identifier is a string ([#11299](https://github.com/typescript-eslint/typescript-eslint/pull/11299)) + +### ❤️ Thank You + +- Tao + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) ### 🩹 Fixes diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index c865d9588fe5..27f5a1986cc0 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.34.0", + "version": "8.34.1", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index d967cf606b04..9b4b00bcac71 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.1 (2025-06-16) + +This was a version bump only for eslint-plugin to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) ### 🩹 Fixes diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 0e0f237f0d53..ae65eb5f3d00 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.34.0", + "version": "8.34.1", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -60,10 +60,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.34.0", - "@typescript-eslint/type-utils": "8.34.0", - "@typescript-eslint/utils": "8.34.0", - "@typescript-eslint/visitor-keys": "8.34.0", + "@typescript-eslint/scope-manager": "8.34.1", + "@typescript-eslint/type-utils": "8.34.1", + "@typescript-eslint/utils": "8.34.1", + "@typescript-eslint/visitor-keys": "8.34.1", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -72,8 +72,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.34.0", - "@typescript-eslint/rule-tester": "8.34.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.34.1", + "@typescript-eslint/rule-tester": "8.34.1", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -93,7 +93,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.34.0", + "@typescript-eslint/parser": "^8.34.1", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 46bc42e708a2..8281e26db6cb 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.1 (2025-06-16) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 774cd5692460..dd04cc45214e 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.34.0", + "version": "8.34.1", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -52,10 +52,10 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.34.0", - "@typescript-eslint/types": "8.34.0", - "@typescript-eslint/typescript-estree": "8.34.0", - "@typescript-eslint/visitor-keys": "8.34.0", + "@typescript-eslint/scope-manager": "8.34.1", + "@typescript-eslint/types": "8.34.1", + "@typescript-eslint/typescript-estree": "8.34.1", + "@typescript-eslint/visitor-keys": "8.34.1", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 76ef76731ce6..dc2f449b4d03 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.1 (2025-06-16) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index d5c25f23a455..e71fd5cfa00a 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.34.0", + "version": "8.34.1", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.34.0", - "@typescript-eslint/types": "^8.34.0", + "@typescript-eslint/tsconfig-utils": "^8.34.1", + "@typescript-eslint/types": "^8.34.1", "debug": "^4.3.4" }, "funding": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index faed4d020889..337a2b682517 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.1 (2025-06-16) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 48be2c1fbcac..92d606990a3c 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.34.0", + "version": "8.34.1", "private": true, "type": "commonjs", "exports": { @@ -33,8 +33,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.34.0", - "@typescript-eslint/utils": "8.34.0", + "@typescript-eslint/type-utils": "8.34.1", + "@typescript-eslint/utils": "8.34.1", "natural-compare": "^1.4.0", "prettier": "^3.2.5" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 0d8670fa6a79..aaa7f7e90948 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.1 (2025-06-16) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index e0c5cdae1b73..3b74fc42f2ba 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.34.0", + "version": "8.34.1", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -45,9 +45,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.34.0", - "@typescript-eslint/typescript-estree": "8.34.0", - "@typescript-eslint/utils": "8.34.0", + "@typescript-eslint/parser": "8.34.1", + "@typescript-eslint/typescript-estree": "8.34.1", + "@typescript-eslint/utils": "8.34.1", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index d0ab44f79f44..af33fdaa5513 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.1 (2025-06-16) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) ### 🩹 Fixes diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 6286550611e0..9582aae7d111 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.34.0", + "version": "8.34.1", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -48,11 +48,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.34.0", - "@typescript-eslint/visitor-keys": "8.34.0" + "@typescript-eslint/types": "8.34.1", + "@typescript-eslint/visitor-keys": "8.34.1" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.34.0", + "@typescript-eslint/typescript-estree": "8.34.1", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "glob": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 3c01fbcc477e..9327b59e1af3 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.1 (2025-06-16) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 97f071a896c9..31f25fb86a62 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.34.0", + "version": "8.34.1", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index ac1cc1204241..21b4779107a3 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.1 (2025-06-16) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) ### 🚀 Features diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 9f3b152efc68..cda0ee7d0d03 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.34.0", + "version": "8.34.1", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -45,8 +45,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/typescript-estree": "8.34.0", - "@typescript-eslint/utils": "8.34.0", + "@typescript-eslint/typescript-estree": "8.34.1", + "@typescript-eslint/utils": "8.34.1", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <5.9.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.34.0", + "@typescript-eslint/parser": "8.34.1", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index ab8fa06d3038..dc4c530278b9 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.34.1 (2025-06-16) + +### 🩹 Fixes + +- **types:** add 2026/17 to EcmaVersion ([#11304](https://github.com/typescript-eslint/typescript-eslint/pull/11304)) + +### ❤️ Thank You + +- David Archibald + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 6761a72cbd78..9ba2d35e516e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.34.0", + "version": "8.34.1", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 577a28bb5b00..53da7c7bf61a 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.1 (2025-06-16) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 8eaff5aa6a74..ef60e5b0caec 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.34.0", + "version": "8.34.1", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -51,9 +51,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.34.0", - "@typescript-eslint/parser": "8.34.0", - "@typescript-eslint/utils": "8.34.0" + "@typescript-eslint/eslint-plugin": "8.34.1", + "@typescript-eslint/parser": "8.34.1", + "@typescript-eslint/utils": "8.34.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index a4d8f790ee02..c6ec46f5d27d 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.34.1 (2025-06-16) + +### 🩹 Fixes + +- **typescript-estree:** emit a Literal instead of Identifier for constructor when the identifier is a string ([#11299](https://github.com/typescript-eslint/typescript-eslint/pull/11299)) + +### ❤️ Thank You + +- Tao + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) ### 🩹 Fixes diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 0d624efcede6..d9cf8f410dca 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.34.0", + "version": "8.34.1", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -53,10 +53,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.34.0", - "@typescript-eslint/tsconfig-utils": "8.34.0", - "@typescript-eslint/types": "8.34.0", - "@typescript-eslint/visitor-keys": "8.34.0", + "@typescript-eslint/project-service": "8.34.1", + "@typescript-eslint/tsconfig-utils": "8.34.1", + "@typescript-eslint/types": "8.34.1", + "@typescript-eslint/visitor-keys": "8.34.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 6ec06c2e10bd..b9767728e1f0 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.34.1 (2025-06-16) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index 33031c95984a..caadf1f717ea 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.34.0", + "version": "8.34.1", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -63,9 +63,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.34.0", - "@typescript-eslint/types": "8.34.0", - "@typescript-eslint/typescript-estree": "8.34.0" + "@typescript-eslint/scope-manager": "8.34.1", + "@typescript-eslint/types": "8.34.1", + "@typescript-eslint/typescript-estree": "8.34.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 5bf112e0cf53..a4093c4a7d19 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.34.1 (2025-06-16) + +### 🩹 Fixes + +- **visitor-keys:** bump `eslint-visitor-keys` dependency ([#11294](https://github.com/typescript-eslint/typescript-eslint/pull/11294)) + +### ❤️ Thank You + +- overlookmotel + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.0 (2025-06-09) ### 🩹 Fixes diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 837dfa0145ae..466f8a499335 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.34.0", + "version": "8.34.1", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -46,7 +46,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.34.0", + "@typescript-eslint/types": "8.34.1", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 3fa95e71e67b..b9ec58cc8516 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5787,19 +5787,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.34.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.34.1, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.34.0 - "@typescript-eslint/rule-tester": 8.34.0 - "@typescript-eslint/scope-manager": 8.34.0 - "@typescript-eslint/type-utils": 8.34.0 - "@typescript-eslint/utils": 8.34.0 - "@typescript-eslint/visitor-keys": 8.34.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.34.1 + "@typescript-eslint/rule-tester": 8.34.1 + "@typescript-eslint/scope-manager": 8.34.1 + "@typescript-eslint/type-utils": 8.34.1 + "@typescript-eslint/utils": 8.34.1 + "@typescript-eslint/visitor-keys": 8.34.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5822,7 +5822,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.34.0 + "@typescript-eslint/parser": ^8.34.1 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" languageName: unknown @@ -5837,14 +5837,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.34.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.34.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.34.0 - "@typescript-eslint/types": 8.34.0 - "@typescript-eslint/typescript-estree": 8.34.0 - "@typescript-eslint/visitor-keys": 8.34.0 + "@typescript-eslint/scope-manager": 8.34.1 + "@typescript-eslint/types": 8.34.1 + "@typescript-eslint/typescript-estree": 8.34.1 + "@typescript-eslint/visitor-keys": 8.34.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 glob: "*" @@ -5857,24 +5857,24 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.34.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.34.1, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.34.0 - "@typescript-eslint/types": ^8.34.0 + "@typescript-eslint/tsconfig-utils": ^8.34.1 + "@typescript-eslint/types": ^8.34.1 debug: ^4.3.4 peerDependencies: typescript: ">=4.8.4 <5.9.0" languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.34.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.34.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.34.0 - "@typescript-eslint/utils": 8.34.0 + "@typescript-eslint/type-utils": 8.34.1 + "@typescript-eslint/utils": 8.34.1 "@vitest/coverage-v8": ^3.1.3 natural-compare: ^1.4.0 prettier: ^3.2.5 @@ -5884,15 +5884,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.34.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.34.1, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.34.0 - "@typescript-eslint/typescript-estree": 8.34.0 - "@typescript-eslint/utils": 8.34.0 + "@typescript-eslint/parser": 8.34.1 + "@typescript-eslint/typescript-estree": 8.34.1 + "@typescript-eslint/utils": 8.34.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5907,13 +5907,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.34.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.34.1, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.34.0 - "@typescript-eslint/typescript-estree": 8.34.0 - "@typescript-eslint/visitor-keys": 8.34.0 + "@typescript-eslint/types": 8.34.1 + "@typescript-eslint/typescript-estree": 8.34.1 + "@typescript-eslint/visitor-keys": 8.34.1 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 glob: "*" @@ -5923,7 +5923,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.34.0, @typescript-eslint/tsconfig-utils@^8.34.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.34.1, @typescript-eslint/tsconfig-utils@^8.34.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" peerDependencies: @@ -5931,13 +5931,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.34.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.34.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.34.0 - "@typescript-eslint/typescript-estree": 8.34.0 - "@typescript-eslint/utils": 8.34.0 + "@typescript-eslint/parser": 8.34.1 + "@typescript-eslint/typescript-estree": 8.34.1 + "@typescript-eslint/utils": 8.34.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -5952,7 +5952,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.34.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.34.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.34.1, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6025,15 +6025,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.34.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.34.1, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.34.0 - "@typescript-eslint/tsconfig-utils": 8.34.0 - "@typescript-eslint/types": 8.34.0 - "@typescript-eslint/visitor-keys": 8.34.0 + "@typescript-eslint/project-service": 8.34.1 + "@typescript-eslint/tsconfig-utils": 8.34.1 + "@typescript-eslint/types": 8.34.1 + "@typescript-eslint/visitor-keys": 8.34.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 fast-glob: ^3.3.2 @@ -6050,14 +6050,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.34.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.34.1, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.34.0 - "@typescript-eslint/types": 8.34.0 - "@typescript-eslint/typescript-estree": 8.34.0 + "@typescript-eslint/scope-manager": 8.34.1 + "@typescript-eslint/types": 8.34.1 + "@typescript-eslint/typescript-estree": 8.34.1 "@vitest/coverage-v8": ^3.1.3 rimraf: "*" typescript: "*" @@ -6068,11 +6068,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.34.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.34.1, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.34.0 + "@typescript-eslint/types": 8.34.1 "@vitest/coverage-v8": ^3.1.3 eslint-visitor-keys: ^4.2.1 rimraf: "*" @@ -19529,9 +19529,9 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.34.0 - "@typescript-eslint/parser": 8.34.0 - "@typescript-eslint/utils": 8.34.0 + "@typescript-eslint/eslint-plugin": 8.34.1 + "@typescript-eslint/parser": 8.34.1 + "@typescript-eslint/utils": 8.34.1 "@vitest/coverage-v8": ^3.1.3 rimraf: "*" typescript: "*" From 76cc62cb37353711b64e3353bb62e2e0a688d629 Mon Sep 17 00:00:00 2001 From: mdm317 Date: Wed, 18 Jun 2025 10:59:50 +0900 Subject: [PATCH 047/283] fix(website): acquired types are shown in the editor but not reflected in linting (#11198) * fix : add rootfile name when create program * fix : not including lib file and fix error * fix: make features work when code is written in an empty playground --- .../src/components/editor/useSandboxServices.ts | 6 +++++- packages/website/src/components/linter/bridge.ts | 10 ++++++++-- .../website/src/components/linter/createLinter.ts | 8 ++++++++ .../website/src/components/linter/createParser.ts | 12 +++++++----- packages/website/src/components/linter/types.ts | 3 +++ 5 files changed, 31 insertions(+), 8 deletions(-) diff --git a/packages/website/src/components/editor/useSandboxServices.ts b/packages/website/src/components/editor/useSandboxServices.ts index d3a6e7fc00e3..9c2b2ff669e3 100644 --- a/packages/website/src/components/editor/useSandboxServices.ts +++ b/packages/website/src/components/editor/useSandboxServices.ts @@ -6,12 +6,13 @@ import semverSatisfies from 'semver/functions/satisfies'; import type { createTypeScriptSandbox } from '../../vendor/sandbox'; import type { CreateLinter } from '../linter/createLinter'; -import type { PlaygroundSystem } from '../linter/types'; +import type { PlaygroundSystem, RegisterFile } from '../linter/types'; import type { RuleDetails } from '../types'; import type { CommonEditorProps } from './types'; import rootPackageJson from '../../../../../package.json'; import { createCompilerOptions } from '../lib/createCompilerOptions'; +import { createEventsBinder } from '../lib/createEventsBinder'; import { createFileSystem } from '../linter/bridge'; import { createLinter } from '../linter/createLinter'; import { createTwoslashInlayProvider } from './createProvideTwoslashInlay'; @@ -79,6 +80,7 @@ export const useSandboxServices = ( sandboxInstance.language, createTwoslashInlayProvider(sandboxInstance), ); + const onModelCreate = createEventsBinder(); const system = createFileSystem(props, sandboxInstance.tsvfs); @@ -89,6 +91,7 @@ export const useSandboxServices = ( } const path = model.uri.path.replace('/file:///', '/'); system.writeFile(path, model.getValue()); + onModelCreate.trigger(path, model.getValue()); }); // Delete files in vfs when a model is disposed in the editor (this is used only for ATA types) sandboxInstance.monaco.editor.onWillDisposeModel(model => { @@ -117,6 +120,7 @@ export const useSandboxServices = ( lintUtils, sandboxInstance.tsvfs, ); + onModelCreate.register(webLinter.registerFile); onLoaded( [...webLinter.rules.values()], diff --git a/packages/website/src/components/linter/bridge.ts b/packages/website/src/components/linter/bridge.ts index 414873484c1a..1f1dec771aa7 100644 --- a/packages/website/src/components/linter/bridge.ts +++ b/packages/website/src/components/linter/bridge.ts @@ -14,7 +14,9 @@ export function createFileSystem( const files = new Map(); files.set(`/.eslintrc`, config.eslintrc); files.set(`/tsconfig.json`, config.tsconfig); - files.set(`/input${config.fileType}`, config.code); + if (config.code !== '') { + files.set(`/input${config.fileType}`, config.code); + } const fileWatcherCallbacks = new Map>(); @@ -78,6 +80,10 @@ export function createFileSystem( const expPath = getPathRegExp(path); return [...files.keys()].filter(fileName => expPath.test(fileName)); }; - + system.getScriptFileNames = (): string[] => { + return [...files.keys()] + .filter(fileName => !fileName.startsWith('/lib.')) + .filter(f => !f.endsWith('/.eslintrc') && !f.endsWith('.json')); + }; return system; } diff --git a/packages/website/src/components/linter/createLinter.ts b/packages/website/src/components/linter/createLinter.ts index 78f001439d87..21620b6dd779 100644 --- a/packages/website/src/components/linter/createLinter.ts +++ b/packages/website/src/components/linter/createLinter.ts @@ -11,6 +11,7 @@ import type { LinterOnLint, LinterOnParse, PlaygroundSystem, + RegisterFile, WebLinterModule, } from './types'; @@ -36,6 +37,7 @@ export interface CreateLinter { triggerFix(filename: string): Linter.FixReport | undefined; triggerLint(filename: string): void; updateParserOptions(sourceType?: SourceType): void; + registerFile: RegisterFile; } export function createLinter( @@ -164,6 +166,11 @@ export function createLinter( } }; + const registerFile = (fileName: string, code: string) => { + parser.registerFile(fileName, code); + triggerLintAll(); + }; + const triggerLintAll = (): void => { system.searchFiles('/input.*').forEach(triggerLint); }; @@ -185,6 +192,7 @@ export function createLinter( configs: [...configs.keys()], onLint: onLint.register, onParse: onParse.register, + registerFile, rules, triggerFix, triggerLint, diff --git a/packages/website/src/components/linter/createParser.ts b/packages/website/src/components/linter/createParser.ts index 89bc7a44735e..9d891ef8d433 100644 --- a/packages/website/src/components/linter/createParser.ts +++ b/packages/website/src/components/linter/createParser.ts @@ -6,6 +6,7 @@ import type * as ts from 'typescript'; import type { ParseSettings, PlaygroundSystem, + RegisterFile, UpdateModel, WebLinterModule, } from './types'; @@ -20,15 +21,14 @@ export function createParser( vfs: typeof tsvfs, ): { updateConfig: (compilerOptions: ts.CompilerOptions) => void; + registerFile: RegisterFile; } & Parser.ParserModule { - const registeredFiles = new Set(); - const createEnv = ( compilerOptions: ts.CompilerOptions, ): tsvfs.VirtualTypeScriptEnvironment => { return vfs.createVirtualTypeScriptEnvironment( system, - [...registeredFiles], + system.getScriptFileNames(), window.ts, compilerOptions, ); @@ -46,10 +46,9 @@ export function createParser( // if text is empty use empty line to avoid error const code = text || '\n'; - if (registeredFiles.has(filePath)) { + if (system.fileExists(filePath)) { compilerHost.updateFile(filePath, code); } else { - registeredFiles.add(filePath); compilerHost.createFile(filePath, code); } @@ -108,6 +107,9 @@ export function createParser( visitorKeys: utils.visitorKeys, }; }, + registerFile(filePath: string, code: string): void { + compilerHost.createFile(filePath, code); + }, updateConfig(compilerOptions): void { compilerHost = createEnv(compilerOptions); }, diff --git a/packages/website/src/components/linter/types.ts b/packages/website/src/components/linter/types.ts index 6e8a046733b7..1bd08c8dc50e 100644 --- a/packages/website/src/components/linter/types.ts +++ b/packages/website/src/components/linter/types.ts @@ -30,6 +30,7 @@ export interface WebLinterModule { export type PlaygroundSystem = { removeFile: (fileName: string) => void; searchFiles: (path: string) => string[]; + getScriptFileNames: () => string[]; } & Required> & ts.System; @@ -39,3 +40,5 @@ export type LinterOnLint = ( ) => void; export type LinterOnParse = (fileName: string, model: UpdateModel) => void; + +export type RegisterFile = (fileName: string, code: string) => void; From 2e35e3a7bf03654730039ec432cbf445819057fd Mon Sep 17 00:00:00 2001 From: Yukihiro Hasegawa <49516827+y-hsgw@users.noreply.github.com> Date: Tue, 24 Jun 2025 01:29:17 +0900 Subject: [PATCH 048/283] chore(eslint-plugin): switch auto-generated test cases to hand-written in consistent-type-assertions.test.ts (#11312) Switch to handwritten test cases --- .../rules/consistent-type-assertions.test.ts | 1589 ++++++++++++++--- 1 file changed, 1333 insertions(+), 256 deletions(-) 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 bbefaa06f4c3..c11949c1e39c 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts @@ -1,322 +1,405 @@ -/* eslint-disable @typescript-eslint/no-deprecated -- TODO - migrate this test away from `batchedSingleLineTests` */ - import type { TSESTree } from '@typescript-eslint/utils'; import * as parser from '@typescript-eslint/parser'; import { RuleTester } from '@typescript-eslint/rule-tester'; -import type { - MessageIds, - Options, -} from '../../src/rules/consistent-type-assertions'; - import rule from '../../src/rules/consistent-type-assertions'; -import { dedupeTestCases } from '../dedupeTestCases'; -import { batchedSingleLineTests } from '../RuleTester'; const ruleTester = new RuleTester(); -const ANGLE_BRACKET_TESTS_EXCEPT_CONST_CASE = ` -const x = new Generic(); -const x = b; -const x = [1]; -const x = ('string'); -const x = !'string'; -const x = a + b; -const x = <(A)>a + (b); -const x = (new Generic()); -const x = new (Generic)(); -const x = new (Generic)('string'); -const x = () => { bar: 5 }; -const x = () => ({ bar: 5 }); -const x = () => bar; -const x = bar\`\${"baz"}\`;`; - -const ANGLE_BRACKET_TESTS = `${ANGLE_BRACKET_TESTS_EXCEPT_CONST_CASE} -const x = { key: 'value' }; -`; - -// Intentionally contains a duplicate in order to mirror ANGLE_BRACKET_TESTS_EXCEPT_CONST_CASE -const AS_TESTS_EXCEPT_CONST_CASE = ` -const x = new Generic() as Foo; -const x = b as A; -const x = [1] as readonly number[]; -const x = 'string' as a | b; -const x = !'string' as A; -const x = (a as A) + b; -const x = (a as A) + (b); -const x = new Generic() as Foo; -const x = new ((Generic) as Foo)(); -const x = new ((Generic) as Foo)('string'); -const x = () => ({ bar: 5 } as Foo); -const x = () => ({ bar: 5 } as Foo); -const x = () => (bar as Foo); -const x = bar\`\${"baz"}\` as Foo;`; - -const AS_TESTS = `${AS_TESTS_EXCEPT_CONST_CASE} -const x = { key: 'value' } as const; -`; - -const OBJECT_LITERAL_AS_CASTS = ` -const x = {} as Foo; -const x = ({}) as a | b; -const x = {} as A + b; -`; -const OBJECT_LITERAL_ANGLE_BRACKET_CASTS = ` -const x = >{}; -const x = ({}); -const x = {} + b; -`; -const OBJECT_LITERAL_ARGUMENT_AS_CASTS = ` -print({ bar: 5 } as Foo) -new print({ bar: 5 } as Foo) -function foo() { throw { bar: 5 } as Foo } -function b(x = {} as Foo.Bar) {} -function c(x = {} as Foo) {} -print?.({ bar: 5 } as Foo) -print?.call({ bar: 5 } as Foo) -print\`\${{ bar: 5 } as Foo}\` -`; -const OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS = ` -print({ bar: 5 }) -new print({ bar: 5 }) -function foo() { throw { bar: 5 } } -print?.({ bar: 5 }) -print?.call({ bar: 5 }) -print\`\${{ bar: 5 }}\` -`; - ruleTester.run('consistent-type-assertions', rule, { valid: [ - ...dedupeTestCases( - batchedSingleLineTests({ - code: AS_TESTS, - options: [ - { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }, - ], - }), - ), - ...batchedSingleLineTests({ - code: ANGLE_BRACKET_TESTS, + { + code: 'const x = new Generic() as Foo;', options: [ { - assertionStyle: 'angle-bracket', + assertionStyle: 'as', objectLiteralTypeAssertions: 'allow', }, ], - }), - ...batchedSingleLineTests({ - code: `${OBJECT_LITERAL_AS_CASTS.trimEnd()}${OBJECT_LITERAL_ARGUMENT_AS_CASTS}`, - options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }], - }), - ...batchedSingleLineTests({ - code: `${OBJECT_LITERAL_ANGLE_BRACKET_CASTS.trimEnd()}${OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS}`, + }, + { + code: 'const x = b as A;', options: [ { - assertionStyle: 'angle-bracket', + assertionStyle: 'as', objectLiteralTypeAssertions: 'allow', }, ], - }), - ...batchedSingleLineTests({ - code: OBJECT_LITERAL_ARGUMENT_AS_CASTS, + }, + { + code: 'const x = [1] as readonly number[];', options: [ { assertionStyle: 'as', - objectLiteralTypeAssertions: 'allow-as-parameter', + objectLiteralTypeAssertions: 'allow', }, ], - }), - ...batchedSingleLineTests({ - code: OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS, + }, + { + code: "const x = 'string' as a | b;", options: [ { - assertionStyle: 'angle-bracket', - objectLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', }, ], - }), + }, { - code: 'const x = [] as string[];', + code: "const x = !'string' as A;", options: [ { assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: "const x = ['a'] as Array;", + code: 'const x = (a as A) + b;', options: [ { assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'const x = [];', + code: 'const x = new Generic() as Foo;', options: [ { - assertionStyle: 'angle-bracket', + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'const x = >[];', + code: 'const x = new (Generic as Foo)();', options: [ { - assertionStyle: 'angle-bracket', + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'print([5] as Foo);', + code: "const x = new (Generic as Foo)('string');", options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: ` -function foo() { - throw [5] as Foo; -} - `, + code: 'const x = () => ({ bar: 5 }) as Foo;', options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'function b(x = [5] as Foo.Bar) {}', + code: 'const x = () => bar as Foo;', options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'print?.([5] as Foo);', + code: "const x = bar`${'baz'}` as Foo;", options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'print?.call([5] as Foo);', + code: "const x = { key: 'value' } as const;", options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'print`${[5] as Foo}`;', + code: 'const x = new Generic();', options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', - assertionStyle: 'as', + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'new Print([5] as Foo);', + code: 'const x = b;', options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', - assertionStyle: 'as', + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'const bar = ;', - languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } }, + code: 'const x = [1];', options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', - assertionStyle: 'as', + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'print([5]);', + code: "const x = 'string';", + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', + }, + ], + }, + { + code: "const x = !'string';", + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', + }, + ], + }, + { + code: 'const x = a + b;', + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', + }, + ], + }, + { + code: 'const x = new Generic();', + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', + }, + ], + }, + { + code: 'const x = new (Generic)();', + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', + }, + ], + }, + { + code: "const x = new (Generic)('string');", + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', + }, + ], + }, + { + code: 'const x = () => { bar: 5 };', + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', + }, + ], + }, + { + code: 'const x = () => bar;', + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', + }, + ], + }, + { + code: "const x = bar`${'baz'}`;", + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', + }, + ], + }, + { + code: "const x = { key: 'value' };", options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', }, ], }, + { + code: 'const x = {} as Foo;', + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }], + }, + { + code: 'const x = {} as a | b;', + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }], + }, + { + code: 'const x = ({} as A) + b;', + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }], + }, + { + code: 'print({ bar: 5 } as Foo);', + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }], + }, + { + code: 'new print({ bar: 5 } as Foo);', + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }], + }, { code: ` function foo() { - throw [5]; + throw { bar: 5 } as Foo; } `, + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }], + }, + { + code: 'function b(x = {} as Foo.Bar) {}', + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }], + }, + { + code: 'function c(x = {} as Foo) {}', + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }], + }, + { + code: 'print?.({ bar: 5 } as Foo);', + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }], + }, + { + code: 'print?.call({ bar: 5 } as Foo);', + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }], + }, + { + code: 'print`${{ bar: 5 } as Foo}`;', + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }], + }, + { + code: 'const x = >{};', options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'function b(x = [5]) {}', + code: 'const x = {};', options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'print?.([5]);', + code: 'const x = {} + b;', options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'print?.call([5]);', + code: 'print({ bar: 5 });', options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'print`${[5]}`;', + code: 'new print({ bar: 5 });', options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', }, ], }, { - code: 'new Print([5]);', + code: ` +function foo() { + throw { bar: 5 }; +} + `, options: [ { - arrayLiteralTypeAssertions: 'allow-as-parameter', assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', }, ], }, - { code: 'const x = [1];', options: [{ assertionStyle: 'never' }] }, - { code: 'const x = [1] as const;', options: [{ assertionStyle: 'never' }] }, { - code: 'const bar = ;', - languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } }, + code: 'print?.({ bar: 5 });', + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', + }, + ], + }, + { + code: 'print?.call({ bar: 5 });', + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', + }, + ], + }, + { + code: 'print`${{ bar: 5 }}`;', + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow', + }, + ], + }, + { + code: 'print({ bar: 5 } as Foo);', + options: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: 'new print({ bar: 5 } as Foo);', + options: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: ` +function foo() { + throw { bar: 5 } as Foo; +} + `, options: [ { assertionStyle: 'as', @@ -325,52 +408,838 @@ function foo() { ], }, { - code: '123;', - languageOptions: { - // simulate a 3rd party parser that doesn't provide parser services - parser: { - parse: (): TSESTree.Program => parser.parse('123;'), + code: 'function b(x = {} as Foo.Bar) {}', + options: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: 'function c(x = {} as Foo) {}', + options: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: 'print?.({ bar: 5 } as Foo);', + options: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: 'print?.call({ bar: 5 } as Foo);', + options: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: 'print`${{ bar: 5 } as Foo}`;', + options: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: 'print({ bar: 5 });', + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: 'new print({ bar: 5 });', + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: ` +function foo() { + throw { bar: 5 }; +} + `, + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: 'print?.({ bar: 5 });', + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: 'print?.call({ bar: 5 });', + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: 'print`${{ bar: 5 }}`;', + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + + { + code: 'const x = [] as string[];', + options: [ + { + assertionStyle: 'as', + }, + ], + }, + { + code: "const x = ['a'] as Array;", + options: [ + { + assertionStyle: 'as', + }, + ], + }, + { + code: 'const x = [];', + options: [ + { + assertionStyle: 'angle-bracket', + }, + ], + }, + { + code: 'const x = >[];', + options: [ + { + assertionStyle: 'angle-bracket', + }, + ], + }, + { + code: 'print([5] as Foo);', + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'as', + }, + ], + }, + { + code: ` +function foo() { + throw [5] as Foo; +} + `, + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'as', + }, + ], + }, + { + code: 'function b(x = [5] as Foo.Bar) {}', + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'as', + }, + ], + }, + { + code: 'print?.([5] as Foo);', + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'as', + }, + ], + }, + { + code: 'print?.call([5] as Foo);', + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'as', + }, + ], + }, + { + code: 'print`${[5] as Foo}`;', + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'as', + }, + ], + }, + { + code: 'new Print([5] as Foo);', + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'as', + }, + ], + }, + { + code: 'const bar = ;', + languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } }, + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'as', + }, + ], + }, + { + code: 'print([5]);', + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'angle-bracket', + }, + ], + }, + { + code: ` +function foo() { + throw [5]; +} + `, + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'angle-bracket', + }, + ], + }, + { + code: 'function b(x = [5]) {}', + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'angle-bracket', + }, + ], + }, + { + code: 'print?.([5]);', + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'angle-bracket', + }, + ], + }, + { + code: 'print?.call([5]);', + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'angle-bracket', + }, + ], + }, + { + code: 'print`${[5]}`;', + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'angle-bracket', + }, + ], + }, + { + code: 'new Print([5]);', + options: [ + { + arrayLiteralTypeAssertions: 'allow-as-parameter', + assertionStyle: 'angle-bracket', + }, + ], + }, + { code: 'const x = [1];', options: [{ assertionStyle: 'never' }] }, + { code: 'const x = [1] as const;', options: [{ assertionStyle: 'never' }] }, + { + code: 'const bar = ;', + languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } }, + options: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: '123;', + languageOptions: { + // simulate a 3rd party parser that doesn't provide parser services + parser: { + parse: (): TSESTree.Program => parser.parse('123;'), + }, + }, + }, + { + code: ` +const x = { key: 'value' } as any; + `, + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], + }, + { + code: ` +const x = { key: 'value' } as unknown; + `, + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], + }, + ], + invalid: [ + { + code: 'const x = new Generic() as Foo;', + errors: [ + { + line: 1, + messageId: 'angle-bracket', + }, + ], + options: [{ assertionStyle: 'angle-bracket' }], + }, + { + code: 'const x = b as A;', + errors: [ + { + line: 1, + messageId: 'angle-bracket', + }, + ], + options: [{ assertionStyle: 'angle-bracket' }], + }, + { + code: 'const x = [1] as readonly number[];', + errors: [ + { + line: 1, + messageId: 'angle-bracket', + }, + ], + options: [{ assertionStyle: 'angle-bracket' }], + }, + { + code: "const x = 'string' as a | b;", + errors: [ + { + line: 1, + messageId: 'angle-bracket', + }, + ], + options: [{ assertionStyle: 'angle-bracket' }], + }, + { + code: "const x = !'string' as A;", + errors: [ + { + line: 1, + messageId: 'angle-bracket', + }, + ], + options: [{ assertionStyle: 'angle-bracket' }], + }, + { + code: 'const x = (a as A) + b;', + errors: [ + { + line: 1, + messageId: 'angle-bracket', + }, + ], + options: [{ assertionStyle: 'angle-bracket' }], + }, + { + code: 'const x = new Generic() as Foo;', + errors: [ + { + line: 1, + messageId: 'angle-bracket', + }, + ], + options: [{ assertionStyle: 'angle-bracket' }], + }, + { + code: 'const x = new (Generic as Foo)();', + errors: [ + { + line: 1, + messageId: 'angle-bracket', + }, + ], + options: [{ assertionStyle: 'angle-bracket' }], + }, + { + code: "const x = new (Generic as Foo)('string');", + errors: [ + { + line: 1, + messageId: 'angle-bracket', + }, + ], + options: [{ assertionStyle: 'angle-bracket' }], + }, + { + code: 'const x = () => ({ bar: 5 }) as Foo;', + errors: [ + { + line: 1, + messageId: 'angle-bracket', + }, + ], + options: [{ assertionStyle: 'angle-bracket' }], + }, + { + code: 'const x = () => bar as Foo;', + errors: [ + { + line: 1, + messageId: 'angle-bracket', + }, + ], + options: [{ assertionStyle: 'angle-bracket' }], + }, + { + code: "const x = bar`${'baz'}` as Foo;", + errors: [ + { + line: 1, + messageId: 'angle-bracket', + }, + ], + options: [{ assertionStyle: 'angle-bracket' }], + }, + { + code: "const x = { key: 'value' } as const;", + errors: [ + { + line: 1, + messageId: 'angle-bracket', + }, + ], + options: [{ assertionStyle: 'angle-bracket' }], + }, + { + code: 'const x = new Generic();', + errors: [ + { + line: 1, + messageId: 'as', + }, + ], + options: [{ assertionStyle: 'as' }], + output: 'const x = new Generic() as Foo;', + }, + { + code: 'const x = b;', + errors: [ + { + line: 1, + messageId: 'as', + }, + ], + options: [{ assertionStyle: 'as' }], + output: 'const x = b as A;', + }, + { + code: 'const x = [1];', + errors: [ + { + line: 1, + messageId: 'as', + }, + ], + options: [{ assertionStyle: 'as' }], + output: 'const x = [1] as readonly number[];', + }, + { + code: "const x = 'string';", + errors: [ + { + line: 1, + messageId: 'as', + }, + ], + options: [{ assertionStyle: 'as' }], + output: "const x = 'string' as a | b;", + }, + { + code: "const x = !'string';", + errors: [ + { + line: 1, + messageId: 'as', + }, + ], + options: [{ assertionStyle: 'as' }], + output: "const x = !'string' as A;", + }, + { + code: 'const x = a + b;', + errors: [ + { + line: 1, + messageId: 'as', + }, + ], + options: [{ assertionStyle: 'as' }], + output: 'const x = (a as A) + b;', + }, + { + code: 'const x = new Generic();', + errors: [ + { + line: 1, + messageId: 'as', + }, + ], + options: [{ assertionStyle: 'as' }], + output: 'const x = new Generic() as Foo;', + }, + { + code: 'const x = new (Generic)();', + errors: [ + { + line: 1, + messageId: 'as', + }, + ], + options: [{ assertionStyle: 'as' }], + output: 'const x = new ((Generic) as Foo)();', + }, + { + code: "const x = new (Generic)('string');", + errors: [ + { + line: 1, + messageId: 'as', + }, + ], + options: [{ assertionStyle: 'as' }], + output: "const x = new ((Generic) as Foo)('string');", + }, + { + code: 'const x = () => { bar: 5 };', + errors: [ + { + line: 1, + messageId: 'as', + }, + ], + options: [{ assertionStyle: 'as' }], + output: 'const x = () => ({ bar: 5 } as Foo);', + }, + { + code: 'const x = () => bar;', + errors: [ + { + line: 1, + messageId: 'as', + }, + ], + options: [{ assertionStyle: 'as' }], + output: 'const x = () => (bar as Foo);', + }, + { + code: "const x = bar`${'baz'}`;", + errors: [ + { + line: 1, + messageId: 'as', + }, + ], + options: [{ assertionStyle: 'as' }], + output: "const x = bar`${'baz'}` as Foo;", + }, + { + code: "const x = { key: 'value' };", + errors: [ + { + line: 1, + messageId: 'as', + }, + ], + options: [{ assertionStyle: 'as' }], + output: "const x = { key: 'value' } as const;", + }, + { + code: 'const x = new Generic() as Foo;', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = b as A;', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = [1] as readonly number[];', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: "const x = 'string' as a | b;", + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: "const x = !'string' as A;", + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = (a as A) + b;', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = new Generic() as Foo;', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = new (Generic as Foo)();', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: "const x = new (Generic as Foo)('string');", + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = () => ({ bar: 5 }) as Foo;', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = () => bar as Foo;', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: "const x = bar`${'baz'}` as Foo;", + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = new Generic();', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = b;', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = [1];', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: "const x = 'string';", + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: "const x = !'string';", + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = a + b;', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = new Generic();', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = new (Generic)();', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: "const x = new (Generic)('string');", + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = () => { bar: 5 };', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: 'const x = () => bar;', + errors: [ + { + line: 1, + messageId: 'never', + }, + ], + options: [{ assertionStyle: 'never' }], + }, + { + code: "const x = bar`${'baz'}`;", + errors: [ + { + line: 1, + messageId: 'never', }, - }, - }, - { - code: ` -const x = { key: 'value' } as any; - `, - options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], + ], + options: [{ assertionStyle: 'never' }], }, { - code: ` -const x = { key: 'value' } as unknown; - `, - options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], - }, - ], - invalid: [ - ...dedupeTestCases( - ( - [ - ['angle-bracket', AS_TESTS], - ['as', ANGLE_BRACKET_TESTS, AS_TESTS], - ['never', AS_TESTS_EXCEPT_CONST_CASE], - ['never', ANGLE_BRACKET_TESTS_EXCEPT_CONST_CASE], - ] as const - ).flatMap(([assertionStyle, code, output]) => - batchedSingleLineTests({ - code, - errors: code - .split(`\n`) - .map((_, i) => ({ line: i + 1, messageId: assertionStyle })), - options: [{ assertionStyle }], - output, - }), - ), - ), - ...batchedSingleLineTests({ - code: OBJECT_LITERAL_AS_CASTS, - errors: [ - { - line: 2, + code: 'const x = {} as Foo;', + errors: [ + { + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { @@ -385,30 +1254,52 @@ const x = { key: 'value' } as unknown; }, ], }, + ], + options: [ { - line: 3, + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: 'const x = {} as a | b;', + errors: [ + { + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'a | b' }, messageId: 'replaceObjectTypeAssertionWithAnnotation', - output: 'const x: a | b = ({});', + output: 'const x: a | b = {};', }, { data: { cast: 'a | b' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'const x = ({}) satisfies a | b;', + output: 'const x = {} satisfies a | b;', }, ], }, + ], + options: [ + { + assertionStyle: 'as', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: 'const x = ({} as A) + b;', + errors: [ { - line: 4, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'A' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'const x = {} satisfies A + b;', + output: 'const x = ({} satisfies A) + b;', }, ], }, @@ -419,12 +1310,12 @@ const x = { key: 'value' } as unknown; objectLiteralTypeAssertions: 'allow-as-parameter', }, ], - }), - ...batchedSingleLineTests({ - code: OBJECT_LITERAL_ANGLE_BRACKET_CASTS, + }, + { + code: 'const x = >{};', errors: [ { - line: 2, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { @@ -439,24 +1330,46 @@ const x = { key: 'value' } as unknown; }, ], }, + ], + options: [ { - line: 3, + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: 'const x = {};', + errors: [ + { + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'a | b' }, messageId: 'replaceObjectTypeAssertionWithAnnotation', - output: 'const x: a | b = ({});', + output: 'const x: a | b = {};', }, { data: { cast: 'a | b' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'const x = ({}) satisfies a | b;', + output: 'const x = {} satisfies a | b;', }, ], }, + ], + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'allow-as-parameter', + }, + ], + }, + { + code: 'const x = {} + b;', + errors: [ { - line: 4, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { @@ -473,12 +1386,12 @@ const x = { key: 'value' } as unknown; objectLiteralTypeAssertions: 'allow-as-parameter', }, ], - }), - ...batchedSingleLineTests({ - code: `${OBJECT_LITERAL_AS_CASTS.trimEnd()}${OBJECT_LITERAL_ARGUMENT_AS_CASTS}`, + }, + { + code: 'const x = {} as Foo;', errors: [ { - line: 2, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { @@ -493,68 +1406,112 @@ const x = { key: 'value' } as unknown; }, ], }, + ], + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], + }, + { + code: 'const x = {} as a | b;', + errors: [ { - line: 3, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'a | b' }, messageId: 'replaceObjectTypeAssertionWithAnnotation', - output: 'const x: a | b = ({});', + output: 'const x: a | b = {};', }, { data: { cast: 'a | b' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'const x = ({}) satisfies a | b;', + output: 'const x = {} satisfies a | b;', }, ], }, + ], + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], + }, + { + code: 'const x = ({} as A) + b;', + errors: [ { - line: 4, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'A' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'const x = {} satisfies A + b;', + output: 'const x = ({} satisfies A) + b;', }, ], }, + ], + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], + }, + { + code: 'print({ bar: 5 } as Foo);', + errors: [ { - line: 5, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'Foo' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'print({ bar: 5 } satisfies Foo)', + output: 'print({ bar: 5 } satisfies Foo);', }, ], }, + ], + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], + }, + { + code: 'new print({ bar: 5 } as Foo);', + errors: [ { - line: 6, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'Foo' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'new print({ bar: 5 } satisfies Foo)', + output: 'new print({ bar: 5 } satisfies Foo);', }, ], }, + ], + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], + }, + { + code: ` +function foo() { + throw { bar: 5 } as Foo; +} + `, + errors: [ { - line: 7, + line: 3, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'Foo' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'function foo() { throw { bar: 5 } satisfies Foo }', + output: ` +function foo() { + throw { bar: 5 } satisfies Foo; +} + `, }, ], }, + ], + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], + }, + { + code: 'function b(x = {} as Foo.Bar) {}', + errors: [ { - line: 8, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { @@ -564,8 +1521,14 @@ const x = { key: 'value' } as unknown; }, ], }, + ], + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], + }, + { + code: 'function c(x = {} as Foo) {}', + errors: [ { - line: 9, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { @@ -575,47 +1538,65 @@ const x = { key: 'value' } as unknown; }, ], }, + ], + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], + }, + { + code: 'print?.({ bar: 5 } as Foo);', + errors: [ { - line: 10, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'Foo' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'print?.({ bar: 5 } satisfies Foo)', + output: 'print?.({ bar: 5 } satisfies Foo);', }, ], }, + ], + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], + }, + { + code: 'print?.call({ bar: 5 } as Foo);', + errors: [ { - line: 11, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'Foo' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'print?.call({ bar: 5 } satisfies Foo)', + output: 'print?.call({ bar: 5 } satisfies Foo);', }, ], }, + ], + options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], + }, + { + code: 'print`${{ bar: 5 } as Foo}`;', + errors: [ { - line: 12, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'Foo' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: `print\`\${{ bar: 5 } satisfies Foo}\``, + output: 'print`${{ bar: 5 } satisfies Foo}`;', }, ], }, ], options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], - }), - ...batchedSingleLineTests({ - code: `${OBJECT_LITERAL_ANGLE_BRACKET_CASTS.trimEnd()}${OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS}`, + }, + { + code: 'const x = >{};', errors: [ { - line: 2, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { @@ -630,24 +1611,46 @@ const x = { key: 'value' } as unknown; }, ], }, + ], + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'never', + }, + ], + }, + { + code: 'const x = {};', + errors: [ { - line: 3, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'a | b' }, messageId: 'replaceObjectTypeAssertionWithAnnotation', - output: 'const x: a | b = ({});', + output: 'const x: a | b = {};', }, { data: { cast: 'a | b' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'const x = ({}) satisfies a | b;', + output: 'const x = {} satisfies a | b;', }, ], }, + ], + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'never', + }, + ], + }, + { + code: 'const x = {} + b;', + errors: [ { - line: 4, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { @@ -657,69 +1660,143 @@ const x = { key: 'value' } as unknown; }, ], }, + ], + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'never', + }, + ], + }, + { + code: 'print({ bar: 5 });', + errors: [ { - line: 5, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'Foo' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'print({ bar: 5 } satisfies Foo)', + output: 'print({ bar: 5 } satisfies Foo);', }, ], }, + ], + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'never', + }, + ], + }, + { + code: 'new print({ bar: 5 });', + errors: [ { - line: 6, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'Foo' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'new print({ bar: 5 } satisfies Foo)', + output: 'new print({ bar: 5 } satisfies Foo);', }, ], }, + ], + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'never', + }, + ], + }, + { + code: ` +function foo() { + throw { bar: 5 }; +} + `, + errors: [ { - line: 7, + line: 3, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'Foo' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'function foo() { throw { bar: 5 } satisfies Foo }', + output: ` +function foo() { + throw { bar: 5 } satisfies Foo; +} + `, }, ], }, + ], + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'never', + }, + ], + }, + { + code: 'print?.({ bar: 5 });', + errors: [ { - line: 8, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'Foo' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'print?.({ bar: 5 } satisfies Foo)', + output: 'print?.({ bar: 5 } satisfies Foo);', }, ], }, + ], + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'never', + }, + ], + }, + { + code: 'print?.call({ bar: 5 });', + errors: [ { - line: 9, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'Foo' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: 'print?.call({ bar: 5 } satisfies Foo)', + output: 'print?.call({ bar: 5 } satisfies Foo);', }, ], }, + ], + options: [ + { + assertionStyle: 'angle-bracket', + objectLiteralTypeAssertions: 'never', + }, + ], + }, + { + code: 'print`${{ bar: 5 }}`;', + errors: [ { - line: 10, + line: 1, messageId: 'unexpectedObjectTypeAssertion', suggestions: [ { data: { cast: 'Foo' }, messageId: 'replaceObjectTypeAssertionWithSatisfies', - output: `print\`\${{ bar: 5 } satisfies Foo}\``, + output: 'print`${{ bar: 5 } satisfies Foo}`;', }, ], }, @@ -730,7 +1807,7 @@ const x = { key: 'value' } as unknown; objectLiteralTypeAssertions: 'never', }, ], - }), + }, { code: 'const foo = ;', errors: [{ line: 1, messageId: 'never' }], From c273e038fbd525232a8896786db28e9705cf205a Mon Sep 17 00:00:00 2001 From: Vinccool96 Date: Mon, 23 Jun 2025 12:56:40 -0400 Subject: [PATCH 049/283] chore(eslint-plugin): switch auto-generated test cases to hand-written in no-unsafe-assignment.test.ts (#11324) Switch to handwritten test cases --- .../tests/rules/no-unsafe-assignment.test.ts | 406 +++++++++++++++--- 1 file changed, 335 insertions(+), 71 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts index 0f2654f22279..c72b71e70b49 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts @@ -1,65 +1,8 @@ -import type { InvalidTestCase } from '@typescript-eslint/rule-tester'; - import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; -import type { - InferMessageIdsTypeFromRule, - InferOptionsTypeFromRule, -} from '../../src/util'; - import rule from '../../src/rules/no-unsafe-assignment'; import { getFixturesRootDir } from '../RuleTester'; -type Options = InferOptionsTypeFromRule; -type MessageIds = InferMessageIdsTypeFromRule; -type InvalidTest = InvalidTestCase; - -const assignmentTest = ( - tests: [string, number, number, boolean?][], -): InvalidTest[] => - tests.flatMap(([assignment, column, endColumn, skipAssignmentExpression]) => [ - // VariableDeclaration - { - code: `const ${assignment}`, - errors: [ - { - column: column + 6, - endColumn: endColumn + 6, - line: 1, - messageId: 'unsafeArrayPatternFromTuple', - }, - ], - }, - // AssignmentPattern - { - code: `function foo(${assignment}) {}`, - errors: [ - { - column: column + 13, - endColumn: endColumn + 13, - line: 1, - messageId: 'unsafeArrayPatternFromTuple', - }, - ], - }, - // AssignmentExpression - ...(skipAssignmentExpression - ? [] - : [ - { - code: `(${assignment})`, - errors: [ - { - column: column + 1, - endColumn: endColumn + 1, - line: 1, - messageId: 'unsafeArrayPatternFromTuple' as const, - }, - ], - }, - ]), - ]); - const ruleTester = new RuleTester({ languageOptions: { parserOptions: { @@ -330,14 +273,193 @@ const [x] = [] as any[]; ], }, - ...assignmentTest([ - ['[x] = [1] as [any]', 2, 3], - ['[[[[x]]]] = [[[[1 as any]]]]', 5, 6], - ['[[[[x]]]] = [1 as any]', 2, 9, true], - ['[{x}] = [{x: 1}] as [{x: any}]', 3, 4], - ['[{["x"]: x}] = [{["x"]: 1}] as [{["x"]: any}]', 10, 11], - ['[{[`x`]: x}] = [{[`x`]: 1}] as [{[`x`]: any}]', 10, 11], - ]), + { + code: 'const [x] = [1] as [any];', + errors: [ + { + column: 8, + endColumn: 9, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: 'function foo([x] = [1] as [any]) {}', + errors: [ + { + column: 15, + endColumn: 16, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: '[x] = [1] as [any];', + errors: [ + { + column: 2, + endColumn: 3, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: 'const [[[[x]]]] = [[[[1 as any]]]];', + errors: [ + { + column: 11, + endColumn: 12, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: 'function foo([[[[x]]]] = [[[[1 as any]]]]) {}', + errors: [ + { + column: 18, + endColumn: 19, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: '[[[[x]]]] = [[[[1 as any]]]];', + errors: [ + { + column: 5, + endColumn: 6, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: 'const [[[[x]]]] = [1 as any];', + errors: [ + { + column: 8, + endColumn: 15, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: 'function foo([[[[x]]]] = [1 as any]) {}', + errors: [ + { + column: 15, + endColumn: 22, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: 'const [{ x }] = [{ x: 1 }] as [{ x: any }];', + errors: [ + { + column: 10, + endColumn: 11, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: 'function foo([{ x }] = [{ x: 1 }] as [{ x: any }]) {}', + errors: [ + { + column: 17, + endColumn: 18, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: '[{ x }] = [{ x: 1 }] as [{ x: any }];', + errors: [ + { + column: 4, + endColumn: 5, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: "const [{ ['x']: x }] = [{ ['x']: 1 }] as [{ ['x']: any }];", + errors: [ + { + column: 17, + endColumn: 18, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: "function foo([{ ['x']: x }] = [{ ['x']: 1 }] as [{ ['x']: any }]) {}", + errors: [ + { + column: 24, + endColumn: 25, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: "[{ ['x']: x }] = [{ ['x']: 1 }] as [{ ['x']: any }];", + errors: [ + { + column: 11, + endColumn: 12, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: 'const [{ [`x`]: x }] = [{ [`x`]: 1 }] as [{ [`x`]: any }];', + errors: [ + { + column: 17, + endColumn: 18, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: 'function foo([{ [`x`]: x }] = [{ [`x`]: 1 }] as [{ [`x`]: any }]) {}', + errors: [ + { + column: 24, + endColumn: 25, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: '[{ [`x`]: x }] = [{ [`x`]: 1 }] as [{ [`x`]: any }];', + errors: [ + { + column: 11, + endColumn: 12, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, { // TS treats the assignment pattern weirdly in this case code: '[[[[x]]]] = [1 as any];', @@ -364,12 +486,154 @@ const x = [...([] as any[])]; errors: [{ messageId: 'unsafeArraySpread' }], }, - ...assignmentTest([ - ['{x} = {x: 1} as {x: any}', 2, 3], - ['{x: y} = {x: 1} as {x: any}', 5, 6], - ['{x: {y}} = {x: {y: 1}} as {x: {y: any}}', 6, 7], - ['{x: [y]} = {x: {y: 1}} as {x: [any]}', 6, 7], - ]), + { + code: 'const { x } = { x: 1 } as { x: any };', + errors: [ + { + column: 9, + endColumn: 10, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: 'function foo({ x } = { x: 1 } as { x: any }) {}', + errors: [ + { + column: 16, + endColumn: 17, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: '({ x } = { x: 1 } as { x: any });', + errors: [ + { + column: 4, + endColumn: 5, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: 'const { x: y } = { x: 1 } as { x: any };', + errors: [ + { + column: 12, + endColumn: 13, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: 'function foo({ x: y } = { x: 1 } as { x: any }) {}', + errors: [ + { + column: 19, + endColumn: 20, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: '({ x: y } = { x: 1 } as { x: any });', + errors: [ + { + column: 7, + endColumn: 8, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: ` +const { + x: { y }, +} = { x: { y: 1 } } as { x: { y: any } }; + `, + errors: [ + { + column: 8, + endColumn: 9, + line: 3, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: 'function foo({ x: { y } } = { x: { y: 1 } } as { x: { y: any } }) {}', + errors: [ + { + column: 21, + endColumn: 22, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: ` +({ + x: { y }, +} = { x: { y: 1 } } as { x: { y: any } }); + `, + errors: [ + { + column: 8, + endColumn: 9, + line: 3, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: ` +const { + x: [y], +} = { x: { y: 1 } } as { x: [any] }; + `, + errors: [ + { + column: 7, + endColumn: 8, + line: 3, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: 'function foo({ x: [y] } = { x: { y: 1 } } as { x: [any] }) {}', + errors: [ + { + column: 20, + endColumn: 21, + line: 1, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, + { + code: ` +({ + x: [y], +} = { x: { y: 1 } } as { x: [any] }); + `, + errors: [ + { + column: 7, + endColumn: 8, + line: 3, + messageId: 'unsafeArrayPatternFromTuple', + }, + ], + }, { code: 'const x = { y: 1 as any };', From 9fb60d2dcad145773dc201528d3675b6fd34ed3e Mon Sep 17 00:00:00 2001 From: Vinccool96 Date: Mon, 23 Jun 2025 13:02:34 -0400 Subject: [PATCH 050/283] chore(eslint-plugin): switch auto-generated test cases to hand-written in ban-tslint-comment.test.ts (#11328) Switch to handwritten test cases --- .../tests/rules/ban-tslint-comment.test.ts | 169 ++++++++++++------ 1 file changed, 115 insertions(+), 54 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/ban-tslint-comment.test.ts b/packages/eslint-plugin/tests/rules/ban-tslint-comment.test.ts index 70ebf3d6f107..227d4f3ab3d8 100644 --- a/packages/eslint-plugin/tests/rules/ban-tslint-comment.test.ts +++ b/packages/eslint-plugin/tests/rules/ban-tslint-comment.test.ts @@ -2,50 +2,6 @@ import { RuleTester } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/ban-tslint-comment'; -interface Testable { - code: string; - column?: number; - line?: number; - output?: string; - text?: string; -} - -const PALANTIR_EXAMPLES: Testable[] = [ - { code: '/* tslint:disable */' }, // Disable all rules for the rest of the file - { code: '/* tslint:enable */' }, // Enable all rules for the rest of the file - { - code: '/* tslint:disable:rule1 rule2 rule3... */', - }, // Disable the listed rules for the rest of the file - { - code: '/* tslint:enable:rule1 rule2 rule3... */', - }, // Enable the listed rules for the rest of the file - { code: '// tslint:disable-next-line' }, // Disables all rules for the following line - { - code: 'someCode(); // tslint:disable-line', - column: 13, - output: 'someCode();', - text: '// tslint:disable-line', - }, // Disables all rules for the current line - { - code: '// tslint:disable-next-line:rule1 rule2 rule3...', - }, // Disables the listed rules for the next line -]; - -// prettier-ignore -const MORE_EXAMPLES: Testable[] = [ - { - code: `const woah = doSomeStuff(); -// tslint:disable-line -console.log(woah); -`, - line: 2, - output: `const woah = doSomeStuff(); -console.log(woah); -`, - text: '// tslint:disable-line', - }, -] - const ruleTester = new RuleTester(); ruleTester.run('ban-tslint-comment', rule, { @@ -66,18 +22,123 @@ ruleTester.run('ban-tslint-comment', rule, { code: '/* another comment that mentions tslint */', }, ], - invalid: [...PALANTIR_EXAMPLES, ...MORE_EXAMPLES].map( - ({ code, column, line, output, text }) => ({ - code, + invalid: [ + { + code: '/* tslint:disable */', + errors: [ + { + column: 1, + data: { + text: '/* tslint:disable */', + }, + line: 1, + messageId: 'commentDetected', + }, + ], + output: '', + }, + { + code: '/* tslint:enable */', + errors: [ + { + column: 1, + data: { + text: '/* tslint:enable */', + }, + line: 1, + messageId: 'commentDetected', + }, + ], + output: '', + }, + { + code: '/* tslint:disable:rule1 rule2 rule3... */', + errors: [ + { + column: 1, + data: { + text: '/* tslint:disable:rule1 rule2 rule3... */', + }, + line: 1, + messageId: 'commentDetected', + }, + ], + output: '', + }, + { + code: '/* tslint:enable:rule1 rule2 rule3... */', + errors: [ + { + column: 1, + data: { + text: '/* tslint:enable:rule1 rule2 rule3... */', + }, + line: 1, + messageId: 'commentDetected', + }, + ], + output: '', + }, + { + code: '// tslint:disable-next-line', + errors: [ + { + column: 1, + data: { + text: '// tslint:disable-next-line', + }, + line: 1, + messageId: 'commentDetected', + }, + ], + output: '', + }, + { + code: 'someCode(); // tslint:disable-line', errors: [ { - column: column ?? 1, - data: { text: text ?? code }, - line: line ?? 1, - messageId: 'commentDetected' as const, + column: 13, + data: { + text: '// tslint:disable-line', + }, + line: 1, + messageId: 'commentDetected', }, ], - output: output ?? '', - }), - ), + output: 'someCode();', + }, + { + code: '// tslint:disable-next-line:rule1 rule2 rule3...', + errors: [ + { + column: 1, + data: { text: '// tslint:disable-next-line:rule1 rule2 rule3...' }, + line: 1, + messageId: 'commentDetected', + }, + ], + output: '', + }, + { + code: ` +const woah = doSomeStuff(); +// tslint:disable-line +console.log(woah); + `, + errors: [ + { + column: 1, + data: { + text: '// tslint:disable-line', + }, + line: 3, + messageId: 'commentDetected', + }, + ], + output: ` +const woah = doSomeStuff(); +console.log(woah); + `, + }, + ], }); From f000a1f0c77c8275ffe7ea92e04a94275e73396d Mon Sep 17 00:00:00 2001 From: Kim Sang Du Date: Tue, 24 Jun 2025 02:10:11 +0900 Subject: [PATCH 051/283] feat(eslint-plugin): [no-base-to-string] add checkUnknown Option (#11128) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add type and option * feat: apply checkUnknown option and test case * fix: ci error * fix: change example code and add test cases * fix: no-base-to-string Rule test fix and update schema * fix: test config revert * Apply suggestions from code review * Formatted and updated snapshots --------- Co-authored-by: Josh Goldberg ✨ --- .../docs/rules/no-base-to-string.mdx | 11 + .../src/rules/no-base-to-string.ts | 16 +- .../no-base-to-string.shot | 6 + .../tests/rules/no-base-to-string.test.ts | 203 +++++++++++++++++- .../schema-snapshots/no-base-to-string.shot | 6 + 5 files changed, 231 insertions(+), 11 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/no-base-to-string.mdx b/packages/eslint-plugin/docs/rules/no-base-to-string.mdx index 8097ca8b7f41..d1927bf69b5b 100644 --- a/packages/eslint-plugin/docs/rules/no-base-to-string.mdx +++ b/packages/eslint-plugin/docs/rules/no-base-to-string.mdx @@ -99,6 +99,17 @@ let text = `${value}`; String(/regex/); ``` +### `checkUnknown` + +{/* insert option description */} + +The following patterns are considered incorrect with the options `{ checkUnknown: true }`: + +```ts option='{ "checkUnknown": true }' showPlaygroundButton +declare const x: unknown; +String(x); +``` + ## When Not To Use It If you don't mind a risk of `"[object Object]"` or incorrect type coercions in your values, then you will not need this rule. diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts index 6617c8d1dea2..26eadce99839 100644 --- a/packages/eslint-plugin/src/rules/no-base-to-string.ts +++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts @@ -21,6 +21,7 @@ enum Usefulness { export type Options = [ { ignoredTypeNames?: string[]; + checkUnknown?: boolean; }, ]; export type MessageIds = 'baseArrayJoin' | 'baseToString'; @@ -46,6 +47,10 @@ export default createRule({ type: 'object', additionalProperties: false, properties: { + checkUnknown: { + type: 'boolean', + description: 'Whether to also check values of type `unknown`', + }, ignoredTypeNames: { type: 'array', description: @@ -60,6 +65,7 @@ export default createRule({ }, defaultOptions: [ { + checkUnknown: false, ignoredTypeNames: ['Error', 'RegExp', 'URL', 'URLSearchParams'], }, ], @@ -76,6 +82,7 @@ export default createRule({ type ?? services.getTypeAtLocation(node), new Set(), ); + if (certainty === Usefulness.Always) { return; } @@ -213,7 +220,7 @@ export default createRule({ return collectToStringCertainty(constraint, visited); } // unconstrained generic means `unknown` - return Usefulness.Always; + return option.checkUnknown ? Usefulness.Sometimes : Usefulness.Always; } // the Boolean type definition missing toString() @@ -251,8 +258,13 @@ export default createRule({ const toString = checker.getPropertyOfType(type, 'toString') ?? checker.getPropertyOfType(type, 'toLocaleString'); + if (!toString) { - // e.g. any/unknown + // unknown + if (option.checkUnknown && type.flags === ts.TypeFlags.Unknown) { + return Usefulness.Sometimes; + } + // e.g. any return Usefulness.Always; } diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-base-to-string.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-base-to-string.shot index ac8bfaecc474..ae8614ebe762 100644 --- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-base-to-string.shot +++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-base-to-string.shot @@ -56,3 +56,9 @@ let value = /regex/; value.toString(); let text = `${value}`; String(/regex/); + +Options: { "checkUnknown": true } + +declare const x: unknown; +String(x); + ~ 'x' may use Object's default stringification format ('[object Object]') when stringified. diff --git a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts index 5a8cd58742ae..8c61eda34e63 100644 --- a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts +++ b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts @@ -626,15 +626,6 @@ declare const bb: ExtendedGuildChannel; bb.toString(); `, ` -function foo(x: T) { - String(x); -} - `, - ` -declare const u: unknown; -String(u); - `, - ` type Value = string | Value[]; declare const v: Value; @@ -662,8 +653,202 @@ String(v); declare const v: ('foo' | 'bar')[][]; String(v); `, + ` +declare const x: unknown; +\`\${x})\`; + `, + ` +declare const x: unknown; +x.toString(); + `, + ` +declare const x: unknown; +x.toLocaleString(); + `, + ` +declare const x: unknown; +'' + x; + `, + ` +declare const x: unknown; +String(x); + `, + ` +declare const x: unknown; +'' += x; + `, + ` +function foo(x: T) { + String(x); +} + `, + ` +declare const x: any; +\`\${x})\`; + `, + ` +declare const x: any; +x.toString(); + `, + ` +declare const x: any; +x.toLocaleString(); + `, + ` +declare const x: any; +'' + x; + `, + ` +declare const x: any; +String(x); + `, + ` +declare const x: any; +'' += x; + `, ], invalid: [ + { + code: ` +declare const x: unknown; +\`\${x})\`; + `, + errors: [ + { + data: { + certainty: 'may', + name: 'x', + }, + messageId: 'baseToString', + }, + ], + options: [ + { + checkUnknown: true, + }, + ], + }, + { + code: ` +declare const x: unknown; +x.toString(); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'x', + }, + messageId: 'baseToString', + }, + ], + options: [ + { + checkUnknown: true, + }, + ], + }, + { + code: ` +declare const x: unknown; +x.toLocaleString(); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'x', + }, + messageId: 'baseToString', + }, + ], + options: [ + { + checkUnknown: true, + }, + ], + }, + { + code: ` +declare const x: unknown; +'' + x; + `, + errors: [ + { + data: { + certainty: 'may', + name: 'x', + }, + messageId: 'baseToString', + }, + ], + options: [ + { + checkUnknown: true, + }, + ], + }, + { + code: ` +declare const x: unknown; +String(x); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'x', + }, + messageId: 'baseToString', + }, + ], + options: [ + { + checkUnknown: true, + }, + ], + }, + { + code: ` +declare const x: unknown; +'' += x; + `, + errors: [ + { + data: { + certainty: 'may', + name: 'x', + }, + messageId: 'baseToString', + }, + ], + options: [ + { + checkUnknown: true, + }, + ], + }, + { + code: ` +function foo(x: T) { + String(x); +} + `, + errors: [ + { + data: { + certainty: 'may', + name: 'x', + }, + messageId: 'baseToString', + }, + ], + options: [ + { + checkUnknown: true, + }, + ], + }, { code: '`${{}})`;', errors: [ diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-base-to-string.shot b/packages/eslint-plugin/tests/schema-snapshots/no-base-to-string.shot index fe2577cd6329..207398f5c070 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-base-to-string.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-base-to-string.shot @@ -5,6 +5,10 @@ { "additionalProperties": false, "properties": { + "checkUnknown": { + "description": "Whether to also check values of type `unknown`", + "type": "boolean" + }, "ignoredTypeNames": { "description": "Stringified regular expressions of type names to ignore.", "items": { @@ -22,6 +26,8 @@ type Options = [ { + /** Whether to also check values of type `unknown` */ + checkUnknown?: boolean; /** Stringified regular expressions of type names to ignore. */ ignoredTypeNames?: string[]; }, From d19c9f383a2e345656b601aa42ec250293609019 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 23 Jun 2025 17:19:20 +0000 Subject: [PATCH 052/283] chore(release): publish 8.35.0 --- CHANGELOG.md | 17 ++++ packages/ast-spec/CHANGELOG.md | 6 ++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 12 +++ packages/eslint-plugin/package.json | 16 ++-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 8 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 8 +- packages/typescript-estree/CHANGELOG.md | 6 ++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 94 +++++++++---------- 30 files changed, 203 insertions(+), 96 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96193f336763..a34e891d5c39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +## 8.35.0 (2025-06-23) + +### 🚀 Features + +- **eslint-plugin:** [no-base-to-string] add checkUnknown Option ([#11128](https://github.com/typescript-eslint/typescript-eslint/pull/11128)) + +### 🩹 Fixes + +- **website:** acquired types are shown in the editor but not reflected in linting ([#11198](https://github.com/typescript-eslint/typescript-eslint/pull/11198)) + +### ❤️ Thank You + +- Kim Sang Du @developer-bandi +- mdm317 + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) ### 🩹 Fixes diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 88b1ab0e897d..3879a406972b 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.0 (2025-06-23) + +This was a version bump only for ast-spec to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) ### 🩹 Fixes diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 27f5a1986cc0..1e121201cc2b 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.34.1", + "version": "8.35.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 9b4b00bcac71..8decb02a1530 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.35.0 (2025-06-23) + +### 🚀 Features + +- **eslint-plugin:** [no-base-to-string] add checkUnknown Option ([#11128](https://github.com/typescript-eslint/typescript-eslint/pull/11128)) + +### ❤️ Thank You + +- Kim Sang Du @developer-bandi + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) This was a version bump only for eslint-plugin to align it with other projects, there were no code changes. diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index ae65eb5f3d00..7ac8d1630627 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.34.1", + "version": "8.35.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -60,10 +60,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.34.1", - "@typescript-eslint/type-utils": "8.34.1", - "@typescript-eslint/utils": "8.34.1", - "@typescript-eslint/visitor-keys": "8.34.1", + "@typescript-eslint/scope-manager": "8.35.0", + "@typescript-eslint/type-utils": "8.35.0", + "@typescript-eslint/utils": "8.35.0", + "@typescript-eslint/visitor-keys": "8.35.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -72,8 +72,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.34.1", - "@typescript-eslint/rule-tester": "8.34.1", + "@typescript-eslint/rule-schema-to-typescript-types": "8.35.0", + "@typescript-eslint/rule-tester": "8.35.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -93,7 +93,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.34.1", + "@typescript-eslint/parser": "^8.35.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 8281e26db6cb..10fe64296419 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.0 (2025-06-23) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index dd04cc45214e..f3e1bb0f93d1 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.34.1", + "version": "8.35.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -52,10 +52,10 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.34.1", - "@typescript-eslint/types": "8.34.1", - "@typescript-eslint/typescript-estree": "8.34.1", - "@typescript-eslint/visitor-keys": "8.34.1", + "@typescript-eslint/scope-manager": "8.35.0", + "@typescript-eslint/types": "8.35.0", + "@typescript-eslint/typescript-estree": "8.35.0", + "@typescript-eslint/visitor-keys": "8.35.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index dc2f449b4d03..ba0649dfc905 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.0 (2025-06-23) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index e71fd5cfa00a..7eaef033a3cf 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.34.1", + "version": "8.35.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.34.1", - "@typescript-eslint/types": "^8.34.1", + "@typescript-eslint/tsconfig-utils": "^8.35.0", + "@typescript-eslint/types": "^8.35.0", "debug": "^4.3.4" }, "funding": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 337a2b682517..3443e64a5d63 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.0 (2025-06-23) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 92d606990a3c..4113b1dd4826 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.34.1", + "version": "8.35.0", "private": true, "type": "commonjs", "exports": { @@ -33,8 +33,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.34.1", - "@typescript-eslint/utils": "8.34.1", + "@typescript-eslint/type-utils": "8.35.0", + "@typescript-eslint/utils": "8.35.0", "natural-compare": "^1.4.0", "prettier": "^3.2.5" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index aaa7f7e90948..0d96a517721a 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.0 (2025-06-23) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 3b74fc42f2ba..71d325bd9036 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.34.1", + "version": "8.35.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -45,9 +45,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.34.1", - "@typescript-eslint/typescript-estree": "8.34.1", - "@typescript-eslint/utils": "8.34.1", + "@typescript-eslint/parser": "8.35.0", + "@typescript-eslint/typescript-estree": "8.35.0", + "@typescript-eslint/utils": "8.35.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index af33fdaa5513..0b355046a24a 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.0 (2025-06-23) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 9582aae7d111..1e4eb43cf11c 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.34.1", + "version": "8.35.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -48,11 +48,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.34.1", - "@typescript-eslint/visitor-keys": "8.34.1" + "@typescript-eslint/types": "8.35.0", + "@typescript-eslint/visitor-keys": "8.35.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.34.1", + "@typescript-eslint/typescript-estree": "8.35.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "glob": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 9327b59e1af3..c457bc2189cf 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.0 (2025-06-23) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 31f25fb86a62..76edc2730815 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.34.1", + "version": "8.35.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 21b4779107a3..b5da282f89ee 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.0 (2025-06-23) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index cda0ee7d0d03..6fc5ec5f9be0 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.34.1", + "version": "8.35.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -45,8 +45,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/typescript-estree": "8.34.1", - "@typescript-eslint/utils": "8.34.1", + "@typescript-eslint/typescript-estree": "8.35.0", + "@typescript-eslint/utils": "8.35.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <5.9.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.34.1", + "@typescript-eslint/parser": "8.35.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index dc4c530278b9..523b7902d6da 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.0 (2025-06-23) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) ### 🩹 Fixes diff --git a/packages/types/package.json b/packages/types/package.json index 9ba2d35e516e..7539ea5caff1 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.34.1", + "version": "8.35.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 53da7c7bf61a..9aac2eb94550 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.0 (2025-06-23) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index ef60e5b0caec..1024207d03ac 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.34.1", + "version": "8.35.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -51,9 +51,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.34.1", - "@typescript-eslint/parser": "8.34.1", - "@typescript-eslint/utils": "8.34.1" + "@typescript-eslint/eslint-plugin": "8.35.0", + "@typescript-eslint/parser": "8.35.0", + "@typescript-eslint/utils": "8.35.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index c6ec46f5d27d..a2728531133c 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.0 (2025-06-23) + +This was a version bump only for typescript-estree to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) ### 🩹 Fixes diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index d9cf8f410dca..b1f485a799f1 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.34.1", + "version": "8.35.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -53,10 +53,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.34.1", - "@typescript-eslint/tsconfig-utils": "8.34.1", - "@typescript-eslint/types": "8.34.1", - "@typescript-eslint/visitor-keys": "8.34.1", + "@typescript-eslint/project-service": "8.35.0", + "@typescript-eslint/tsconfig-utils": "8.35.0", + "@typescript-eslint/types": "8.35.0", + "@typescript-eslint/visitor-keys": "8.35.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index b9767728e1f0..fd7537d0e16b 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.0 (2025-06-23) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index caadf1f717ea..aebab162aaa1 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.34.1", + "version": "8.35.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -63,9 +63,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.34.1", - "@typescript-eslint/types": "8.34.1", - "@typescript-eslint/typescript-estree": "8.34.1" + "@typescript-eslint/scope-manager": "8.35.0", + "@typescript-eslint/types": "8.35.0", + "@typescript-eslint/typescript-estree": "8.35.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index a4093c4a7d19..636fe232df68 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.0 (2025-06-23) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.34.1 (2025-06-16) ### 🩹 Fixes diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 466f8a499335..518d3b566618 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.34.1", + "version": "8.35.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -46,7 +46,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.34.1", + "@typescript-eslint/types": "8.35.0", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index b9ec58cc8516..084dcf161536 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5787,19 +5787,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.34.1, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.35.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.34.1 - "@typescript-eslint/rule-tester": 8.34.1 - "@typescript-eslint/scope-manager": 8.34.1 - "@typescript-eslint/type-utils": 8.34.1 - "@typescript-eslint/utils": 8.34.1 - "@typescript-eslint/visitor-keys": 8.34.1 + "@typescript-eslint/rule-schema-to-typescript-types": 8.35.0 + "@typescript-eslint/rule-tester": 8.35.0 + "@typescript-eslint/scope-manager": 8.35.0 + "@typescript-eslint/type-utils": 8.35.0 + "@typescript-eslint/utils": 8.35.0 + "@typescript-eslint/visitor-keys": 8.35.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5822,7 +5822,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.34.1 + "@typescript-eslint/parser": ^8.35.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" languageName: unknown @@ -5837,14 +5837,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.34.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.35.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.34.1 - "@typescript-eslint/types": 8.34.1 - "@typescript-eslint/typescript-estree": 8.34.1 - "@typescript-eslint/visitor-keys": 8.34.1 + "@typescript-eslint/scope-manager": 8.35.0 + "@typescript-eslint/types": 8.35.0 + "@typescript-eslint/typescript-estree": 8.35.0 + "@typescript-eslint/visitor-keys": 8.35.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 glob: "*" @@ -5857,24 +5857,24 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.34.1, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.35.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.34.1 - "@typescript-eslint/types": ^8.34.1 + "@typescript-eslint/tsconfig-utils": ^8.35.0 + "@typescript-eslint/types": ^8.35.0 debug: ^4.3.4 peerDependencies: typescript: ">=4.8.4 <5.9.0" languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.34.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.35.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.34.1 - "@typescript-eslint/utils": 8.34.1 + "@typescript-eslint/type-utils": 8.35.0 + "@typescript-eslint/utils": 8.35.0 "@vitest/coverage-v8": ^3.1.3 natural-compare: ^1.4.0 prettier: ^3.2.5 @@ -5884,15 +5884,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.34.1, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.35.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.34.1 - "@typescript-eslint/typescript-estree": 8.34.1 - "@typescript-eslint/utils": 8.34.1 + "@typescript-eslint/parser": 8.35.0 + "@typescript-eslint/typescript-estree": 8.35.0 + "@typescript-eslint/utils": 8.35.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5907,13 +5907,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.34.1, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.35.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.34.1 - "@typescript-eslint/typescript-estree": 8.34.1 - "@typescript-eslint/visitor-keys": 8.34.1 + "@typescript-eslint/types": 8.35.0 + "@typescript-eslint/typescript-estree": 8.35.0 + "@typescript-eslint/visitor-keys": 8.35.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 glob: "*" @@ -5923,7 +5923,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.34.1, @typescript-eslint/tsconfig-utils@^8.34.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.35.0, @typescript-eslint/tsconfig-utils@^8.35.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" peerDependencies: @@ -5931,13 +5931,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.34.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.35.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.34.1 - "@typescript-eslint/typescript-estree": 8.34.1 - "@typescript-eslint/utils": 8.34.1 + "@typescript-eslint/parser": 8.35.0 + "@typescript-eslint/typescript-estree": 8.35.0 + "@typescript-eslint/utils": 8.35.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -5952,7 +5952,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.34.1, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.35.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.35.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6025,15 +6025,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.34.1, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.35.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.34.1 - "@typescript-eslint/tsconfig-utils": 8.34.1 - "@typescript-eslint/types": 8.34.1 - "@typescript-eslint/visitor-keys": 8.34.1 + "@typescript-eslint/project-service": 8.35.0 + "@typescript-eslint/tsconfig-utils": 8.35.0 + "@typescript-eslint/types": 8.35.0 + "@typescript-eslint/visitor-keys": 8.35.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 fast-glob: ^3.3.2 @@ -6050,14 +6050,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.34.1, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.35.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.34.1 - "@typescript-eslint/types": 8.34.1 - "@typescript-eslint/typescript-estree": 8.34.1 + "@typescript-eslint/scope-manager": 8.35.0 + "@typescript-eslint/types": 8.35.0 + "@typescript-eslint/typescript-estree": 8.35.0 "@vitest/coverage-v8": ^3.1.3 rimraf: "*" typescript: "*" @@ -6068,11 +6068,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.34.1, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.35.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.34.1 + "@typescript-eslint/types": 8.35.0 "@vitest/coverage-v8": ^3.1.3 eslint-visitor-keys: ^4.2.1 rimraf: "*" @@ -19529,9 +19529,9 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.34.1 - "@typescript-eslint/parser": 8.34.1 - "@typescript-eslint/utils": 8.34.1 + "@typescript-eslint/eslint-plugin": 8.35.0 + "@typescript-eslint/parser": 8.35.0 + "@typescript-eslint/utils": 8.35.0 "@vitest/coverage-v8": ^3.1.3 rimraf: "*" typescript: "*" From 3ecb96f2d2203b65ce0f2e2eb48c1ff5e875bdae Mon Sep 17 00:00:00 2001 From: Abhijeet Singh Date: Wed, 25 Jun 2025 03:30:31 +0530 Subject: [PATCH 053/283] docs: remove legacy note about __dirname (#11315) * docs: remove legacy notes about CJS extensions and __dirname * revert: add CJS notes back --- docs/getting-started/Typed_Linting.mdx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs/getting-started/Typed_Linting.mdx b/docs/getting-started/Typed_Linting.mdx index 56d02afed969..95f225038dd3 100644 --- a/docs/getting-started/Typed_Linting.mdx +++ b/docs/getting-started/Typed_Linting.mdx @@ -40,11 +40,6 @@ export default tseslint.config( ); ``` -:::note -[`import.meta.dirname`](https://nodejs.org/api/esm.html#importmetadirname) is only present for ESM files in Node.js >=20.11.0 / >= 21.2.0.
-For CommonJS modules and/or older versions of Node.js, [use `__dirname` or an alternative](https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-js-when-using-es6-modules). -::: - In more detail: - `tseslint.configs.recommendedTypeChecked` is a [shared configuration](../users/Shared_Configurations.mdx). It contains recommended rules that additionally require type information. From 9dc91aaff7c55082a7a768788664d625f8283500 Mon Sep 17 00:00:00 2001 From: Abhijeet Singh Date: Wed, 25 Jun 2025 03:39:18 +0530 Subject: [PATCH 054/283] chore(rule-tester): correct typo in test (#11338) test: correct null output test in RuleTester Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- packages/rule-tester/tests/RuleTester.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/rule-tester/tests/RuleTester.test.ts b/packages/rule-tester/tests/RuleTester.test.ts index 594dd3c7e5a1..a2d4b83c44e6 100644 --- a/packages/rule-tester/tests/RuleTester.test.ts +++ b/packages/rule-tester/tests/RuleTester.test.ts @@ -1327,6 +1327,7 @@ describe('RuleTester - multipass fixer', () => { { code: 'foo', errors: [{ messageId: 'error' }], + output: null, }, ], valid: [], From 3e545207f0e34611f528128fc699b25091bc40b3 Mon Sep 17 00:00:00 2001 From: Abhijeet Singh Date: Wed, 25 Jun 2025 17:29:43 +0530 Subject: [PATCH 055/283] fix: remove prettier from eslint-plugin (#11339) --- packages/eslint-plugin/package.json | 1 - yarn.lock | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 7ac8d1630627..8e118c44c185 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -84,7 +84,6 @@ "mdast-util-from-markdown": "^2.0.0", "mdast-util-mdx": "^3.0.0", "micromark-extension-mdxjs": "^3.0.0", - "prettier": "^3.5.3", "rimraf": "*", "title-case": "^4.0.0", "tsx": "*", diff --git a/yarn.lock b/yarn.lock index 084dcf161536..9db662cb2b6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5813,7 +5813,6 @@ __metadata: mdast-util-mdx: ^3.0.0 micromark-extension-mdxjs: ^3.0.0 natural-compare: ^1.4.0 - prettier: ^3.5.3 rimraf: "*" title-case: ^4.0.0 ts-api-utils: ^2.1.0 From 20f8564b82b225c8d685f5f06284516f1f22b32a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Thu, 26 Jun 2025 09:00:50 -0400 Subject: [PATCH 056/283] chore: replace custom CONTRIBUTORS.md with GitHub's graphs/contributors (#11341) --- .cspell.json | 1 - .prettierignore | 1 - CONTRIBUTORS.md | 99 ------------- README.md | 2 +- package.json | 2 - tools/scripts/generate-contributors.mts | 186 ------------------------ 6 files changed, 1 insertion(+), 290 deletions(-) delete mode 100644 CONTRIBUTORS.md delete mode 100644 tools/scripts/generate-contributors.mts diff --git a/.cspell.json b/.cspell.json index e064c26d4d53..265533fa0454 100644 --- a/.cspell.json +++ b/.cspell.json @@ -15,7 +15,6 @@ ".vscode/*.json", "**/*.{json,snap}", "**/**/CHANGELOG.md", - "**/**/CONTRIBUTORS.md", "**/**/TSLINT_RULE_ALTERNATIVES.md", "**/coverage/**", "**/dist/**", diff --git a/.prettierignore b/.prettierignore index 500bc3eaf91a..942cf2d47b6e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,7 +3,6 @@ **/.vscode **/.nyc_output **/.vs -CONTRIBUTORS.md .yarn/plugins .yarn/releases diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md deleted file mode 100644 index 7c60ad27e4ce..000000000000 --- a/CONTRIBUTORS.md +++ /dev/null @@ -1,99 +0,0 @@ - - -# Contributors - -Thanks goes to these wonderful people: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Josh Goldberg ✨

Brad Zacher

James Henry

Armano

YeonJuan

Kirk Waiblinger

auvred

Abraham Guo

Joshua Chen

Oleksandr T.

Michaël De Boey

SUZUKI Sosuke

Reyad Attiyat

Gareth Jones

Patricio Trevino

Yukihiro Hasegawa

Nicholas C. Zakas

Kim Sang Du

Jed Fox

Arya Emami

Rafael Santana

fisker Cheung

Mark de Dios

Yosuke Ota

Bryan Mishkin

Emma

Simen Bekkhus

Flo Edelmann

JounQin

Jake Bailey

Danny Fritz

Tiger Oakes

Lauren Yim

Zzzen

Kanitkorn Sujautra

mdm317

kmin-jeong

Susisu

ldrick

Cparros

Arka Pratim Chaudhuri

Sukka

Niles Salter

Yuri Pieters

Tim Kraut

Yuya Yoshioka

zz

Anthony Fu

fregante

Ray

Daniel Cassidy

Dimitri Mitropoulos

Edwin Kofler

Hao Cheng

Ricardo Fernández Serrata
- - - - -This list is auto-generated using `yarn generate-contributors`. It shows the top 100 contributors with > 3 contributions. diff --git a/README.md b/README.md index 1656a4bc2c6d..56ec6bf32ead 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This project exists thanks to the awesome people who contribute code and documen
Gallery of all contributors' profile photos -🙏 An extra special thanks goes out to the wonderful people listed in [`CONTRIBUTORS.md`](./CONTRIBUTORS.md) +🙏 An extra special thanks goes out to the wonderful people listed in . ## Financial Contributors diff --git a/package.json b/package.json index e82a1780f359..d1e3b4219aa9 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "format": "prettier --ignore-path=$PROJECT_CWD/.prettierignore --config=$PROJECT_CWD/.prettierrc.json --write $INIT_CWD", "generate-breaking-changes": "nx run eslint-plugin:generate-breaking-changes", "generate-configs": "tsx tools/scripts/generate-configs.mts", - "generate-contributors": "tsx tools/scripts/generate-contributors.mts", "generate-lib": "tsx tools/scripts/generate-lib.mts", "generate-sponsors": "tsx tools/scripts/generate-sponsors.mts", "generate-website-dts": "nx run website:generate-website-dts", @@ -123,7 +122,6 @@ "name": "repo", "includedScripts": [ "generate-configs", - "generate-contributors", "generate-lib", "generate-sponsors" ], diff --git a/tools/scripts/generate-contributors.mts b/tools/scripts/generate-contributors.mts deleted file mode 100644 index c3c08d7a9435..000000000000 --- a/tools/scripts/generate-contributors.mts +++ /dev/null @@ -1,186 +0,0 @@ -// this script uses the github api to fetch a list of contributors -// https://developer.github.com/v3/repos/#list-contributors -// this endpoint returns a list of contributors sorted by number of contributions - -import fetch from 'cross-fetch'; -import fs from 'node:fs'; -import path from 'node:path'; - -import { REPO_ROOT } from './paths.mts'; - -const IGNORED_USERS = new Set([ - 'dependabot[bot]', - 'eslint[bot]', - 'greenkeeper[bot]', - 'semantic-release-bot', -]); - -const COMPLETELY_ARBITRARY_CONTRIBUTION_COUNT = 3; -const PAGE_LIMIT = 100; -// arbitrary limit -- this means we can only fetch 10*100=1000 contributors but it means we don't ever loop forever -const MATCH_PAGE_NUMBER = 10; -const contributorsApiUrl = `https://api.github.com/repos/typescript-eslint/typescript-eslint/contributors?per_page=${PAGE_LIMIT}`; - -interface Contributor { - avatar_url?: string; - contributions: number; - html_url?: string; - login?: string; - type: string; - url?: string; -} -interface User { - avatar_url: string; - html_url: string; - login: string; - name: string; -} - -// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters -- intentional 'unsafe' single generic in return type -async function getData( - url: string, -): Promise<{ body: T; linkHeader: string | null }>; -// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters -- intentional 'unsafe' single generic in return type -async function getData( - url: string | undefined, -): Promise<{ body: T; linkHeader: string | null } | null>; -async function getData( - url: string | undefined, -): Promise<{ body: T; linkHeader: string | null } | null> { - if (url == null) { - return null; - } - - const response = await fetch(url, { - headers: { - Accept: 'application/vnd.github.v3+json', - // Authorization: 'token ghp_xxxx', // if needed, replace this with your token - }, - method: 'GET', - }); - - const linkHeader = response.headers.get('link'); - - return { - body: (await response.json()) as T, - linkHeader, - }; -} - -async function* fetchUsers(page = 1): AsyncIterableIterator { - while (page <= MATCH_PAGE_NUMBER) { - console.log(`Fetching page ${page} of contributors...`); - const contributors = await getData( - `${contributorsApiUrl}&page=${page}`, - ); - - if (!Array.isArray(contributors.body)) { - throw new Error(contributors.body.message); - } - - const thresholdedContributors = contributors.body.filter( - user => user.contributions >= COMPLETELY_ARBITRARY_CONTRIBUTION_COUNT, - ); - yield thresholdedContributors; - - if ( - // https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api?apiVersion=2022-11-28#using-link-headers - // > The URL for the next page is followed by rel="next". - // > the link to the last page won't be included if it can't be calculated. - // i.e. if there's no "next" link then there's no next page and we're at the end - !contributors.linkHeader?.includes('rel="next"') - ) { - break; - } - - page += 1; - } -} - -function writeTable(contributors: User[], perLine = 5): void { - const columns = contributors.length > perLine ? perLine : contributors.length; - - const lines = [ - '', - '', - '# Contributors', - '', - 'Thanks goes to these wonderful people:', - '', - '', - '', - '', - ]; - - let i = 0; - for (const usr of contributors) { - if (i % columns === 0) { - if (i !== 0) { - lines.push(' '); - } - lines.push(' '); - } - - const image = ``; - const name = `${usr.name || usr.login}`; - - lines.push( - ` `, - ); - ++i; - } - if (i % columns !== 0) { - lines.push(' '); - } - - lines.push(' '); - lines.push('
${image}
${name}
'); - lines.push(''); - lines.push(''); - lines.push(''); - lines.push(''); - lines.push( - `This list is auto-generated using \`yarn generate-contributors\`. It shows the top ${PAGE_LIMIT} contributors with > ${COMPLETELY_ARBITRARY_CONTRIBUTION_COUNT} contributions.`, - ); - lines.push(''); - - fs.writeFileSync(path.join(REPO_ROOT, 'CONTRIBUTORS.md'), lines.join('\n')); -} - -const githubContributors: Contributor[] = []; - -// fetch all of the contributor info -for await (const lastUsers of fetchUsers()) { - githubContributors.push(...lastUsers); -} - -// fetch the user info -console.log(`Fetching user information...`); -const users = await Promise.allSettled( - githubContributors - // remove ignored users and bots - .filter( - usr => usr.login && usr.type !== 'Bot' && !IGNORED_USERS.has(usr.login), - ) - // fetch the in-depth information for each user - .map(c => getData(c.url)), -); - -writeTable( - users - .map(result => { - if (result.status === 'fulfilled') { - return result.value?.body; - } - return null; - }) - .filter((c): c is User => c?.login != null), - 5, -); From db32b8a82d58eddb29be207a5f4476644973abbf Mon Sep 17 00:00:00 2001 From: Mark de Dios <99303358+peanutenthusiast@users.noreply.github.com> Date: Thu, 26 Jun 2025 06:32:41 -0700 Subject: [PATCH 057/283] docs: update only-throw-error documentation allowRethrowing (#11346) --- packages/eslint-plugin/docs/rules/only-throw-error.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/only-throw-error.mdx b/packages/eslint-plugin/docs/rules/only-throw-error.mdx index e30f67a0869b..fe7fbdb20e53 100644 --- a/packages/eslint-plugin/docs/rules/only-throw-error.mdx +++ b/packages/eslint-plugin/docs/rules/only-throw-error.mdx @@ -141,7 +141,7 @@ interface Options { const defaultOptions: Options = { allow: [], - allowRethrowing: false, + allowRethrowing: true, allowThrowingAny: true, allowThrowingUnknown: true, }; From 02ee81b32f50422c44563f0f8b37f6d55b0e863c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Sat, 28 Jun 2025 23:24:31 -0400 Subject: [PATCH 058/283] docs: mention ESLint's defineConfig() (#11335) --- docs/getting-started/Quickstart.mdx | 23 +++++++++++++++++------ docs/packages/TypeScript_ESLint.mdx | 13 +++++++++++-- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/docs/getting-started/Quickstart.mdx b/docs/getting-started/Quickstart.mdx index 79e65c2b9915..232fe15966d5 100644 --- a/docs/getting-started/Quickstart.mdx +++ b/docs/getting-started/Quickstart.mdx @@ -45,18 +45,29 @@ export default tseslint.config( This code will enable our [recommended configuration](../users/Shared_Configurations.mdx) for linting. +#### Details + +- `tseslint.config(...)` is an **_optional_** helper function — see [`typescript-eslint`'s `config(...)`](../packages/TypeScript_ESLint.mdx#config). +- `'@eslint/js'` / `eslint.configs.recommended` turns on [eslint's recommended config](https://www.npmjs.com/package/@eslint/js). +- `tseslint.configs.recommended` turns on [our recommended config](../users/Shared_Configurations.mdx#recommended). +
-Aside on file extensions +Aside on ESLint's `defineConfig()` -The `.mjs` extension makes the file use the [ES modules (ESM)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) format. Node interprets `.js` files in the [CommonJS (CJS)](https://nodejs.org/api/modules.html) format by default, but if you have `"type": "module"` in your `package.json`, you can also use `eslint.config.js`. +ESLint also provides a `defineConfig()` helper similar to `tseslint.config()`. +However, there is a types incompatibility issue that causes type errors to incorrectly be reported when mixing typescript-eslint's configs and `defineConfig()`. +For now we recommend using `tseslint.config()` for use with typescript-eslint's configs. + +See [typescript-eslint#10899](https://github.com/typescript-eslint/typescript-eslint/issues/10899) for more details.
-#### Details +
+Aside on file extensions -- `tseslint.config(...)` is an **_optional_** helper function — see [`typescript-eslint`'s `config(...)`](../packages/TypeScript_ESLint.mdx#config). -- `'@eslint/js'` / `eslint.configs.recommended` turns on [eslint's recommended config](https://www.npmjs.com/package/@eslint/js). -- `tseslint.configs.recommended` turns on [our recommended config](../users/Shared_Configurations.mdx#recommended). +The `.mjs` extension makes the file use the [ES modules (ESM)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) format. Node interprets `.js` files in the [CommonJS (CJS)](https://nodejs.org/api/modules.html) format by default, but if you have `"type": "module"` in your `package.json`, you can also use `eslint.config.js`. + +
### Step 3: Running ESLint diff --git a/docs/packages/TypeScript_ESLint.mdx b/docs/packages/TypeScript_ESLint.mdx index f4e7106bf9ac..9fc886d872bd 100644 --- a/docs/packages/TypeScript_ESLint.mdx +++ b/docs/packages/TypeScript_ESLint.mdx @@ -31,7 +31,7 @@ npm i typescript-eslint ## Usage -We recommend getting started by using `tseslint.config` helper function in your ESLint config: +We recommend getting started by using the `tseslint.config()` helper function in your ESLint config: ```js title="eslint.config.mjs" // @ts-check @@ -47,6 +47,15 @@ export default tseslint.config( This config file exports a flat config that enables both the [core ESLint recommended config](https://www.npmjs.com/package/@eslint/js) and [our recommended config](../users/Shared_Configurations.mdx#recommended). +:::note +ESLint also provides a `defineConfig()` helper similar to `tseslint.config()`. +However, there is a types incompatibility issue that causes type errors to incorrectly be reported when mixing typescript-eslint's configs and `defineConfig()`. +For now we recommend using `tseslint.config()` for use with typescript-eslint configs. + +See [typescript-eslint#10899](https://github.com/typescript-eslint/typescript-eslint/issues/10899) for more details. + +::: + ### `config(...)` `tseslint.config(...)` takes in any number of ESLint config objects, each of which may additionally include an `extends` array of configs to extend. @@ -105,7 +114,7 @@ Otherwise it _will not_ impact your ability to use our tooling. #### Flat config `extends` -The `tseslint.config` utility function also adds handling for the `extends` property on flat config objects. +The `tseslint.config()` utility function also adds handling for the `extends` property on flat config objects. This allows you to more easily extend shared configs for specific file patterns whilst also overriding rules/options provided by those configs: ```js From b9318f3bc4189db8fc6633ba97279e05559abea7 Mon Sep 17 00:00:00 2001 From: mdm317 Date: Tue, 1 Jul 2025 01:41:10 +0900 Subject: [PATCH 059/283] fix(website): did not find a source file error if url hash doesn't contain fileType (#11350) fix: check file existence using compilerHost instead of system --- packages/website/src/components/linter/createParser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/src/components/linter/createParser.ts b/packages/website/src/components/linter/createParser.ts index 9d891ef8d433..8305d8ae8d88 100644 --- a/packages/website/src/components/linter/createParser.ts +++ b/packages/website/src/components/linter/createParser.ts @@ -46,7 +46,7 @@ export function createParser( // if text is empty use empty line to avoid error const code = text || '\n'; - if (system.fileExists(filePath)) { + if (compilerHost.getSourceFile(filePath)) { compilerHost.updateFile(filePath, code); } else { compilerHost.createFile(filePath, code); From 941e584a0d4dc24078efcdc8ee2e446a25488ed3 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 30 Jun 2025 11:16:00 -0600 Subject: [PATCH 060/283] chore: add Vitest to recommended VS Code extensions (#11358) --- .vscode/extensions.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index d4d111dbe6e4..44d398701588 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -6,7 +6,8 @@ "esbenp.prettier-vscode", "streetsidesoftware.code-spell-checker", "tlent.jest-snapshot-language-support", - "mrmlnc.vscode-json5" + "mrmlnc.vscode-json5", + "vitest.explorer" ], "unwantedRecommendations": ["hookyqr.beautify", "dbaeumer.jshint"] } From f9bd7d86fc39eb2957de7eefdcd3ab9b6c9dc4a7 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 30 Jun 2025 17:18:41 +0000 Subject: [PATCH 061/283] chore(release): publish 8.35.1 --- CHANGELOG.md | 14 +++ packages/ast-spec/CHANGELOG.md | 6 ++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 12 +++ packages/eslint-plugin/package.json | 16 ++-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 8 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 8 +- packages/typescript-estree/CHANGELOG.md | 6 ++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 94 +++++++++---------- 30 files changed, 200 insertions(+), 96 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a34e891d5c39..a644b23a5395 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## 8.35.1 (2025-06-30) + +### 🩹 Fixes + +- remove prettier from eslint-plugin ([#11339](https://github.com/typescript-eslint/typescript-eslint/pull/11339)) +- **website:** did not find a source file error if url hash doesn't contain fileType ([#11350](https://github.com/typescript-eslint/typescript-eslint/pull/11350)) + +### ❤️ Thank You + +- Abhijeet Singh @cseas +- mdm317 + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 3879a406972b..df5461274c6b 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.1 (2025-06-30) + +This was a version bump only for ast-spec to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) This was a version bump only for ast-spec to align it with other projects, there were no code changes. diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 1e121201cc2b..0038e004d06b 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.35.0", + "version": "8.35.1", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 8decb02a1530..6e5160bdf25d 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.35.1 (2025-06-30) + +### 🩹 Fixes + +- remove prettier from eslint-plugin ([#11339](https://github.com/typescript-eslint/typescript-eslint/pull/11339)) + +### ❤️ Thank You + +- Abhijeet Singh @cseas + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) ### 🚀 Features diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 8e118c44c185..e6622edca60d 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.35.0", + "version": "8.35.1", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -60,10 +60,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.35.0", - "@typescript-eslint/type-utils": "8.35.0", - "@typescript-eslint/utils": "8.35.0", - "@typescript-eslint/visitor-keys": "8.35.0", + "@typescript-eslint/scope-manager": "8.35.1", + "@typescript-eslint/type-utils": "8.35.1", + "@typescript-eslint/utils": "8.35.1", + "@typescript-eslint/visitor-keys": "8.35.1", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -72,8 +72,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.35.0", - "@typescript-eslint/rule-tester": "8.35.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.35.1", + "@typescript-eslint/rule-tester": "8.35.1", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.35.0", + "@typescript-eslint/parser": "^8.35.1", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 10fe64296419..8bd584085402 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.1 (2025-06-30) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index f3e1bb0f93d1..9c9a93266915 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.35.0", + "version": "8.35.1", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -52,10 +52,10 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.35.0", - "@typescript-eslint/types": "8.35.0", - "@typescript-eslint/typescript-estree": "8.35.0", - "@typescript-eslint/visitor-keys": "8.35.0", + "@typescript-eslint/scope-manager": "8.35.1", + "@typescript-eslint/types": "8.35.1", + "@typescript-eslint/typescript-estree": "8.35.1", + "@typescript-eslint/visitor-keys": "8.35.1", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index ba0649dfc905..8d26073813d9 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.1 (2025-06-30) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 7eaef033a3cf..084f4236b345 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.35.0", + "version": "8.35.1", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.35.0", - "@typescript-eslint/types": "^8.35.0", + "@typescript-eslint/tsconfig-utils": "^8.35.1", + "@typescript-eslint/types": "^8.35.1", "debug": "^4.3.4" }, "funding": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 3443e64a5d63..997749be23b6 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.1 (2025-06-30) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 4113b1dd4826..b16413400e67 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.35.0", + "version": "8.35.1", "private": true, "type": "commonjs", "exports": { @@ -33,8 +33,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.35.0", - "@typescript-eslint/utils": "8.35.0", + "@typescript-eslint/type-utils": "8.35.1", + "@typescript-eslint/utils": "8.35.1", "natural-compare": "^1.4.0", "prettier": "^3.2.5" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 0d96a517721a..159c1b94d346 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.1 (2025-06-30) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 71d325bd9036..49f05fe79109 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.35.0", + "version": "8.35.1", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -45,9 +45,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.35.0", - "@typescript-eslint/typescript-estree": "8.35.0", - "@typescript-eslint/utils": "8.35.0", + "@typescript-eslint/parser": "8.35.1", + "@typescript-eslint/typescript-estree": "8.35.1", + "@typescript-eslint/utils": "8.35.1", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 0b355046a24a..9154b7ee863c 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.1 (2025-06-30) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 1e4eb43cf11c..e84ae367d833 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.35.0", + "version": "8.35.1", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -48,11 +48,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.35.0", - "@typescript-eslint/visitor-keys": "8.35.0" + "@typescript-eslint/types": "8.35.1", + "@typescript-eslint/visitor-keys": "8.35.1" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.35.0", + "@typescript-eslint/typescript-estree": "8.35.1", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "glob": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index c457bc2189cf..31d610aec291 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.1 (2025-06-30) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 76edc2730815..a9746fdccfe6 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.35.0", + "version": "8.35.1", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index b5da282f89ee..bdea330e7710 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.1 (2025-06-30) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 6fc5ec5f9be0..18b965950f8e 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.35.0", + "version": "8.35.1", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -45,8 +45,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/typescript-estree": "8.35.0", - "@typescript-eslint/utils": "8.35.0", + "@typescript-eslint/typescript-estree": "8.35.1", + "@typescript-eslint/utils": "8.35.1", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <5.9.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.35.0", + "@typescript-eslint/parser": "8.35.1", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 523b7902d6da..c316e55650b1 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.1 (2025-06-30) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 7539ea5caff1..e40eeded301e 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.35.0", + "version": "8.35.1", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 9aac2eb94550..9823b029262b 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.1 (2025-06-30) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 1024207d03ac..f06dff760d50 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.35.0", + "version": "8.35.1", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -51,9 +51,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.35.0", - "@typescript-eslint/parser": "8.35.0", - "@typescript-eslint/utils": "8.35.0" + "@typescript-eslint/eslint-plugin": "8.35.1", + "@typescript-eslint/parser": "8.35.1", + "@typescript-eslint/utils": "8.35.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index a2728531133c..76d0b6992df2 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.1 (2025-06-30) + +This was a version bump only for typescript-estree to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) This was a version bump only for typescript-estree to align it with other projects, there were no code changes. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index b1f485a799f1..32c5f6987977 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.35.0", + "version": "8.35.1", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -53,10 +53,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.35.0", - "@typescript-eslint/tsconfig-utils": "8.35.0", - "@typescript-eslint/types": "8.35.0", - "@typescript-eslint/visitor-keys": "8.35.0", + "@typescript-eslint/project-service": "8.35.1", + "@typescript-eslint/tsconfig-utils": "8.35.1", + "@typescript-eslint/types": "8.35.1", + "@typescript-eslint/visitor-keys": "8.35.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index fd7537d0e16b..f88599567731 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.1 (2025-06-30) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index aebab162aaa1..d2aa43d309e9 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.35.0", + "version": "8.35.1", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -63,9 +63,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.35.0", - "@typescript-eslint/types": "8.35.0", - "@typescript-eslint/typescript-estree": "8.35.0" + "@typescript-eslint/scope-manager": "8.35.1", + "@typescript-eslint/types": "8.35.1", + "@typescript-eslint/typescript-estree": "8.35.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 636fe232df68..0c0b0ec58b1a 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.35.1 (2025-06-30) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.0 (2025-06-23) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 518d3b566618..3dc5f9672fc5 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.35.0", + "version": "8.35.1", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -46,7 +46,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.35.0", + "@typescript-eslint/types": "8.35.1", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 9db662cb2b6d..2883983caf19 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5787,19 +5787,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.35.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.35.1, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.35.0 - "@typescript-eslint/rule-tester": 8.35.0 - "@typescript-eslint/scope-manager": 8.35.0 - "@typescript-eslint/type-utils": 8.35.0 - "@typescript-eslint/utils": 8.35.0 - "@typescript-eslint/visitor-keys": 8.35.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.35.1 + "@typescript-eslint/rule-tester": 8.35.1 + "@typescript-eslint/scope-manager": 8.35.1 + "@typescript-eslint/type-utils": 8.35.1 + "@typescript-eslint/utils": 8.35.1 + "@typescript-eslint/visitor-keys": 8.35.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5821,7 +5821,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.35.0 + "@typescript-eslint/parser": ^8.35.1 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" languageName: unknown @@ -5836,14 +5836,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.35.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.35.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.35.0 - "@typescript-eslint/types": 8.35.0 - "@typescript-eslint/typescript-estree": 8.35.0 - "@typescript-eslint/visitor-keys": 8.35.0 + "@typescript-eslint/scope-manager": 8.35.1 + "@typescript-eslint/types": 8.35.1 + "@typescript-eslint/typescript-estree": 8.35.1 + "@typescript-eslint/visitor-keys": 8.35.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 glob: "*" @@ -5856,24 +5856,24 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.35.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.35.1, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.35.0 - "@typescript-eslint/types": ^8.35.0 + "@typescript-eslint/tsconfig-utils": ^8.35.1 + "@typescript-eslint/types": ^8.35.1 debug: ^4.3.4 peerDependencies: typescript: ">=4.8.4 <5.9.0" languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.35.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.35.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.35.0 - "@typescript-eslint/utils": 8.35.0 + "@typescript-eslint/type-utils": 8.35.1 + "@typescript-eslint/utils": 8.35.1 "@vitest/coverage-v8": ^3.1.3 natural-compare: ^1.4.0 prettier: ^3.2.5 @@ -5883,15 +5883,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.35.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.35.1, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.35.0 - "@typescript-eslint/typescript-estree": 8.35.0 - "@typescript-eslint/utils": 8.35.0 + "@typescript-eslint/parser": 8.35.1 + "@typescript-eslint/typescript-estree": 8.35.1 + "@typescript-eslint/utils": 8.35.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5906,13 +5906,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.35.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.35.1, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.35.0 - "@typescript-eslint/typescript-estree": 8.35.0 - "@typescript-eslint/visitor-keys": 8.35.0 + "@typescript-eslint/types": 8.35.1 + "@typescript-eslint/typescript-estree": 8.35.1 + "@typescript-eslint/visitor-keys": 8.35.1 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 glob: "*" @@ -5922,7 +5922,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.35.0, @typescript-eslint/tsconfig-utils@^8.35.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.35.1, @typescript-eslint/tsconfig-utils@^8.35.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" peerDependencies: @@ -5930,13 +5930,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.35.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.35.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.35.0 - "@typescript-eslint/typescript-estree": 8.35.0 - "@typescript-eslint/utils": 8.35.0 + "@typescript-eslint/parser": 8.35.1 + "@typescript-eslint/typescript-estree": 8.35.1 + "@typescript-eslint/utils": 8.35.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -5951,7 +5951,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.35.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.35.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.35.1, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.35.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6024,15 +6024,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.35.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.35.1, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.35.0 - "@typescript-eslint/tsconfig-utils": 8.35.0 - "@typescript-eslint/types": 8.35.0 - "@typescript-eslint/visitor-keys": 8.35.0 + "@typescript-eslint/project-service": 8.35.1 + "@typescript-eslint/tsconfig-utils": 8.35.1 + "@typescript-eslint/types": 8.35.1 + "@typescript-eslint/visitor-keys": 8.35.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 fast-glob: ^3.3.2 @@ -6049,14 +6049,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.35.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.35.1, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.35.0 - "@typescript-eslint/types": 8.35.0 - "@typescript-eslint/typescript-estree": 8.35.0 + "@typescript-eslint/scope-manager": 8.35.1 + "@typescript-eslint/types": 8.35.1 + "@typescript-eslint/typescript-estree": 8.35.1 "@vitest/coverage-v8": ^3.1.3 rimraf: "*" typescript: "*" @@ -6067,11 +6067,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.35.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.35.1, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.35.0 + "@typescript-eslint/types": 8.35.1 "@vitest/coverage-v8": ^3.1.3 eslint-visitor-keys: ^4.2.1 rimraf: "*" @@ -19528,9 +19528,9 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.35.0 - "@typescript-eslint/parser": 8.35.0 - "@typescript-eslint/utils": 8.35.0 + "@typescript-eslint/eslint-plugin": 8.35.1 + "@typescript-eslint/parser": 8.35.1 + "@typescript-eslint/utils": 8.35.1 "@vitest/coverage-v8": ^3.1.3 rimraf: "*" typescript: "*" From e2ecca60d9e8486bb13e98b3e1a65d529bedef03 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Tue, 1 Jul 2025 04:12:35 -0500 Subject: [PATCH 062/283] chore: fix issues introduced by updated `nx` configuration (#11230) --- .prettierignore | 3 - eslint.config.mjs | 2 - knip.ts | 42 ++- nx.json | 23 +- package.json | 11 +- packages/ast-spec/package.json | 8 +- .../ast-spec/tests/util/serialize-error.ts | 1 + packages/ast-spec/vitest.config.mts | 5 + packages/eslint-plugin-internal/package.json | 11 +- packages/eslint-plugin/package.json | 7 +- packages/integration-tests/package.json | 19 +- .../tests/__snapshots__/vue-sfc.test.ts.snap | 24 +- .../tools/integration-test-base.ts | 5 +- packages/parser/package.json | 9 +- .../package.json | 11 +- packages/rule-tester/package.json | 8 +- packages/rule-tester/vitest.config.mts | 3 +- packages/scope-manager/package.json | 9 +- packages/type-utils/package.json | 8 +- packages/types/package.json | 25 +- packages/types/project.json | 21 -- packages/typescript-eslint/package.json | 9 +- packages/typescript-estree/package.json | 9 +- packages/utils/package.json | 14 +- packages/utils/vitest.config.mts | 5 + packages/visitor-keys/package.json | 9 +- packages/website-eslint/package.json | 22 +- packages/website/package.json | 25 +- vitest.config.base.mts | 4 + yarn.lock | 343 +++++++++--------- 30 files changed, 393 insertions(+), 302 deletions(-) delete mode 100644 packages/types/project.json diff --git a/.prettierignore b/.prettierignore index 942cf2d47b6e..77ec15cde8cf 100644 --- a/.prettierignore +++ b/.prettierignore @@ -34,8 +34,5 @@ CHANGELOG.md packages/website/.docusaurus packages/website/build -# see the file header in eslint-base.test.js for more info -packages/rule-tester/tests/eslint-base - /.nx/cache /.nx/workspace-data diff --git a/eslint.config.mjs b/eslint.config.mjs index 395b8dde0dac..114cea61a45a 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -83,8 +83,6 @@ export default tseslint.config( 'packages/types/src/generated/**/*.ts', // Playground types downloaded from the web 'packages/website/src/vendor/', - // see the file header in eslint-base.test.js for more info - 'packages/rule-tester/tests/eslint-base/', ], name: 'global-ignores', }, diff --git a/knip.ts b/knip.ts index 327290d9019a..52f4866d682b 100644 --- a/knip.ts +++ b/knip.ts @@ -54,35 +54,40 @@ export default { ], }, }, + 'packages/eslint-plugin': { - entry: ['tools/**'], - ignore: [ - 'tests/fixtures/**', - 'typings/eslint-rules.d.ts', - 'typings/typescript.d.ts', - ], - ignoreDependencies: ['tsx'], // used in nx target definitions + ignore: ['typings/eslint-rules.d.ts', 'typings/typescript.d.ts'], + + project: ['src/**/*.ts!', 'tools/**/*.mts'], + + vitest: { + config: ['vitest.config.mts'], + entry: ['tests/**/*.{bench,test,test-d}.?(c|m)ts?(x)'], + project: ['tests/**', '!tests/fixtures/**'], + }, }, + 'packages/eslint-plugin-internal': { ignore: ['tests/fixtures/**'], }, 'packages/integration-tests': { ignore: ['fixtures/**'], }, - 'packages/parser': { - ignore: ['tests/fixtures/**'], + 'packages/parser': { vitest: { config: ['vitest.config.mts'], - entry: ['tests/lib/**/*.{bench,test,test-d}.?(c|m)ts?(x)'], + entry: [ + 'tests/lib/**/*.{bench,test,test-d}.?(c|m)ts?(x)', + 'tests/test-utils/test-utils.ts', + 'tests/test-utils/ts-error-serializer.ts', + ], + project: ['tests/**', '!tests/fixtures/**'], }, }, + 'packages/rule-tester': { ignore: ['typings/eslint.d.ts'], - - mocha: { - entry: ['tests/eslint-base/eslint-base.test.js'], - }, }, 'packages/scope-manager': { ignore: ['tests/fixtures/**'], @@ -109,6 +114,15 @@ export default { ], }, }, + + 'packages/types': { + project: [ + 'src/**/*.ts!', + '!src/generated/**/*.ts', + 'tools/copy-ast-spec.mts', + ], + }, + 'packages/typescript-estree': { entry: ['src/use-at-your-own-risk.ts'], ignore: ['tests/fixtures/**', 'typings/typescript.d.ts'], diff --git a/nx.json b/nx.json index bea912313ce5..df1253f99c70 100644 --- a/nx.json +++ b/nx.json @@ -19,14 +19,8 @@ "plugin": "@nx/vite/plugin", "exclude": ["*"], "options": { - "testTargetName": "test" - } - }, - { - "plugin": "@nx/eslint/plugin", - "include": ["packages/*"], - "options": { - "targetName": "lint" + "testTargetName": "test", + "typecheckTargetName": "vite:typecheck" } } ], @@ -51,7 +45,20 @@ } }, "targetDefaults": { + "lint": { + "cache": false, + "dependsOn": ["eslint-plugin-internal:build", "typescript-eslint:build"], + "options": { + "cwd": "{workspaceRoot}", + "config": "{workspaceRoot}/eslint.config.mjs", + "args": ["{projectRoot}"] + } + }, "test": { + "dependsOn": ["^build"], + "options": { + "config": "vitest.config.mts" + }, "outputs": ["{projectRoot}/coverage"] } }, diff --git a/package.json b/package.json index d1e3b4219aa9..866837f95da8 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,6 @@ "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.26.0", "@nx/devkit": "21.0.3", - "@nx/eslint": "21.0.3", "@nx/js": "21.0.3", "@nx/vite": "21.0.3", "@nx/workspace": "21.0.3", @@ -149,11 +148,11 @@ "cache": true }, "lint": { - "command": "eslint . --ignore-pattern=packages --cache", - "dependsOn": [ - "typescript-eslint:build", - "eslint-plugin-internal:build" - ], + "command": "eslint", + "options": { + "cache": true, + "ignore-pattern": "packages" + }, "cache": false }, "clean": { diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 0038e004d06b..81750ed964f2 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -31,7 +31,6 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"", @@ -82,7 +81,14 @@ ], "cache": true }, + "lint": { + "command": "eslint" + }, "typecheck": { + "outputs": [ + "{workspaceRoot}/dist", + "{projectRoot}/dist" + ], "dependsOn": [ "typescript-estree:build" ] diff --git a/packages/ast-spec/tests/util/serialize-error.ts b/packages/ast-spec/tests/util/serialize-error.ts index 26f296a2b8c3..564f76f4cf0c 100644 --- a/packages/ast-spec/tests/util/serialize-error.ts +++ b/packages/ast-spec/tests/util/serialize-error.ts @@ -1,4 +1,5 @@ import type { ParseError as BabelParseError } from '@babel/parser'; + import { codeFrameColumns } from '@babel/code-frame'; import { TSError } from './parsers/typescript-estree-import'; diff --git a/packages/ast-spec/vitest.config.mts b/packages/ast-spec/vitest.config.mts index d79590018e5b..090170ba88af 100644 --- a/packages/ast-spec/vitest.config.mts +++ b/packages/ast-spec/vitest.config.mts @@ -19,6 +19,11 @@ const vitestConfig = mergeConfig( './tests/util/setupVitest.mts', './tests/util/custom-matchers/custom-matchers.ts', ], + + typecheck: { + enabled: true, + tsconfig: path.join(import.meta.dirname, 'tsconfig.spec.json'), + }, }, }), ); diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 303842fa29ba..16ac9833c45e 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -14,7 +14,6 @@ "homepage": "https://typescript-eslint.io", "license": "MIT", "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", @@ -28,10 +27,11 @@ "@typescript-eslint/scope-manager": "workspace:*", "@typescript-eslint/type-utils": "workspace:*", "@typescript-eslint/utils": "workspace:*", - "prettier": "^3.2.5" + "prettier": "3.5.0" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", + "eslint": "*", "rimraf": "*", "vitest": "^3.1.3" }, @@ -39,6 +39,11 @@ "name": "eslint-plugin-internal", "includedScripts": [ "clean" - ] + ], + "targets": { + "lint": { + "command": "eslint" + } + } } } diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index e6622edca60d..2e723feab492 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -48,12 +48,11 @@ "typescript" ], "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", "generate-breaking-changes": "yarn run -BT nx generate-breaking-changes", - "generate-configs": "yarn run -T generate-configs", + "generate-configs": "yarn run -BT nx generate-configs repo", "lint": "yarn run -BT nx lint", "test": "yarn run -BT nx test", "typecheck": "yarn run -BT nx typecheck" @@ -84,6 +83,7 @@ "mdast-util-from-markdown": "^2.0.0", "mdast-util-mdx": "^3.0.0", "micromark-extension-mdxjs": "^3.0.0", + "prettier": "3.5.0", "rimraf": "*", "title-case": "^4.0.0", "tsx": "*", @@ -114,6 +114,9 @@ "dependsOn": [ "type-utils:build" ] + }, + "lint": { + "command": "eslint" } } } diff --git a/packages/integration-tests/package.json b/packages/integration-tests/package.json index df5b3ff213b8..885cf10496e9 100644 --- a/packages/integration-tests/package.json +++ b/packages/integration-tests/package.json @@ -12,7 +12,6 @@ "homepage": "https://typescript-eslint.io", "license": "MIT", "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "format": "yarn run -T format", "lint": "yarn run -BT nx lint", "test": "yarn run -BT nx test", @@ -20,10 +19,26 @@ }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", + "eslint": "*", "vitest": "^3.1.3" }, "nx": { "name": "integration-tests", - "includedScripts": [] + "includedScripts": [], + "targets": { + "test": { + "dependsOn": [ + { + "projects": [ + "tag:npm:public" + ], + "target": "build" + } + ] + }, + "lint": { + "command": "eslint" + } + } } } 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 2eeb2fa46f59..bc5a5421f36f 100644 --- a/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/vue-sfc.test.ts.snap @@ -68,12 +68,12 @@ export default Vue.extend({ { "message": "ESLint Stylistic now maintains deprecated stylistic core rules.", "plugin": { - "name": "@stylistic/eslint-plugin-js", - "url": "https://eslint.style/packages/js", + "name": "@stylistic/eslint-plugin", + "url": "https://eslint.style", }, "rule": { "name": "semi-spacing", - "url": "https://eslint.style/rules/js/semi-spacing", + "url": "https://eslint.style/rules/semi-spacing", }, "url": "https://eslint.style/guide/migration", }, @@ -81,7 +81,7 @@ export default Vue.extend({ "url": "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", }, "replacedBy": [ - "@stylistic/js/semi-spacing", + "@stylistic/semi-spacing", ], "ruleId": "semi-spacing", }, @@ -130,12 +130,12 @@ export default class Utility { { "message": "ESLint Stylistic now maintains deprecated stylistic core rules.", "plugin": { - "name": "@stylistic/eslint-plugin-js", - "url": "https://eslint.style/packages/js", + "name": "@stylistic/eslint-plugin", + "url": "https://eslint.style", }, "rule": { "name": "semi-spacing", - "url": "https://eslint.style/rules/js/semi-spacing", + "url": "https://eslint.style/rules/semi-spacing", }, "url": "https://eslint.style/guide/migration", }, @@ -143,7 +143,7 @@ export default class Utility { "url": "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", }, "replacedBy": [ - "@stylistic/js/semi-spacing", + "@stylistic/semi-spacing", ], "ruleId": "semi-spacing", }, @@ -209,12 +209,12 @@ export default Vue.extend({ { "message": "ESLint Stylistic now maintains deprecated stylistic core rules.", "plugin": { - "name": "@stylistic/eslint-plugin-js", - "url": "https://eslint.style/packages/js", + "name": "@stylistic/eslint-plugin", + "url": "https://eslint.style", }, "rule": { "name": "semi-spacing", - "url": "https://eslint.style/rules/js/semi-spacing", + "url": "https://eslint.style/rules/semi-spacing", }, "url": "https://eslint.style/guide/migration", }, @@ -222,7 +222,7 @@ export default Vue.extend({ "url": "https://eslint.org/blog/2023/10/deprecating-formatting-rules/", }, "replacedBy": [ - "@stylistic/js/semi-spacing", + "@stylistic/semi-spacing", ], "ruleId": "semi-spacing", }, diff --git a/packages/integration-tests/tools/integration-test-base.ts b/packages/integration-tests/tools/integration-test-base.ts index 8951c11c54e4..bde6a82c8ab7 100644 --- a/packages/integration-tests/tools/integration-test-base.ts +++ b/packages/integration-tests/tools/integration-test-base.ts @@ -74,14 +74,15 @@ export function eslintIntegrationTest( `"filePath": "/${path.relative(testFolder, testFile)}"`, ) .replaceAll(/C:\\\\(usr)\\\\(linked)\\\\(tsconfig.json)/g, '/$1/$2/$3'); + let lintOutput: unknown; try { - const lintOutput = JSON.parse(lintOutputRAW); - expect(lintOutput).toMatchSnapshot(); + lintOutput = JSON.parse(lintOutputRAW); } catch { throw new Error( `Lint output could not be parsed as JSON: \`${lintOutputRAW}\`.`, ); } + expect(lintOutput).toMatchSnapshot(); }); } diff --git a/packages/parser/package.json b/packages/parser/package.json index 9c9a93266915..ab950546ce99 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -39,7 +39,6 @@ "eslint" ], "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", @@ -60,6 +59,7 @@ }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", + "eslint": "*", "glob": "*", "rimraf": "*", "typescript": "*", @@ -73,6 +73,11 @@ "name": "parser", "includedScripts": [ "clean" - ] + ], + "targets": { + "lint": { + "command": "eslint" + } + } } } diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index b16413400e67..c21c61b1f6f9 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -24,7 +24,6 @@ "homepage": "https://typescript-eslint.io", "license": "MIT", "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", @@ -36,10 +35,11 @@ "@typescript-eslint/type-utils": "8.35.1", "@typescript-eslint/utils": "8.35.1", "natural-compare": "^1.4.0", - "prettier": "^3.2.5" + "prettier": "3.5.0" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", + "eslint": "*", "rimraf": "*", "typescript": "*", "vitest": "^3.1.3" @@ -52,6 +52,11 @@ "name": "rule-schema-to-typescript-types", "includedScripts": [ "clean" - ] + ], + "targets": { + "lint": { + "command": "eslint" + } + } } } diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 49f05fe79109..a76f121d340b 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -35,7 +35,6 @@ "estree" ], "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", @@ -76,6 +75,11 @@ "name": "rule-tester", "includedScripts": [ "clean" - ] + ], + "targets": { + "lint": { + "command": "eslint" + } + } } } diff --git a/packages/rule-tester/vitest.config.mts b/packages/rule-tester/vitest.config.mts index 2c5138157942..4c66e879f846 100644 --- a/packages/rule-tester/vitest.config.mts +++ b/packages/rule-tester/vitest.config.mts @@ -1,5 +1,5 @@ import * as path from 'node:path'; -import { defaultExclude, defineProject, mergeConfig } from 'vitest/config'; +import { defineProject, mergeConfig } from 'vitest/config'; import { vitestBaseConfig } from '../../vitest.config.base.mjs'; import packageJson from './package.json' with { type: 'json' }; @@ -61,7 +61,6 @@ const vitestConfig = mergeConfig( test: { dir: path.join(import.meta.dirname, 'tests'), - exclude: [...defaultExclude, 'eslint-base/eslint-base.test.js'], name: packageJson.name.replace('@typescript-eslint/', ''), root: import.meta.dirname, }, diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index e84ae367d833..1b7c67787562 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -37,7 +37,6 @@ "estree" ], "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"", @@ -55,6 +54,7 @@ "@typescript-eslint/typescript-estree": "8.35.1", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", + "eslint": "*", "glob": "*", "rimraf": "*", "typescript": "*", @@ -69,6 +69,11 @@ "includedScripts": [ "clean", "clean-fixtures" - ] + ], + "targets": { + "lint": { + "command": "eslint" + } + } } } diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 18b965950f8e..cae54e22392d 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -36,7 +36,6 @@ "estree" ], "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", @@ -71,6 +70,11 @@ "name": "type-utils", "includedScripts": [ "clean" - ] + ], + "targets": { + "lint": { + "command": "eslint" + } + } } } diff --git a/packages/types/package.json b/packages/types/package.json index e40eeded301e..f0cb835a5f4b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -37,18 +37,18 @@ "estree" ], "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "yarn run -BT nx build", "clean": "rimraf dist/ src/generated/ coverage/", - "copy-ast-spec": "tsx ./tools/copy-ast-spec.mts", + "copy-ast-spec": "yarn run -BT nx copy-ast-spec", "format": "yarn run -T format", - "generate-lib": "yarn run -BT nx run scope-manager:generate-lib", + "generate-lib": "yarn run -BT nx generate-lib repo", "lint": "yarn run -BT nx lint", "test": "yarn run -BT nx test", "typecheck": "yarn run -BT nx typecheck" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", + "eslint": "*", "rimraf": "*", "tsx": "*", "typescript": "*", @@ -70,17 +70,24 @@ ] }, "copy-ast-spec": { - "command": "tsx ./tools/copy-ast-spec.mts", - "options": { - "cwd": "{projectRoot}" - }, + "cache": true, + "command": "tsx tools/copy-ast-spec.mts", "dependsOn": [ "ast-spec:build" ], + "options": { + "cwd": "{projectRoot}" + }, "outputs": [ "{projectRoot}/src/generated" - ], - "cache": true + ] + }, + "lint": { + "command": "eslint", + "dependsOn": [ + "typescript-eslint:build", + "eslint-plugin-internal:build" + ] } } } diff --git a/packages/types/project.json b/packages/types/project.json deleted file mode 100644 index 5b170ee06cc5..000000000000 --- a/packages/types/project.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "types", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "library", - "root": "packages/types", - "sourceRoot": "packages/types/src", - "targets": { - "copy-ast-spec": { - "dependsOn": ["ast-spec:build"], - "outputs": ["{projectRoot}/src/generated"], - "cache": true - }, - "build": { - "dependsOn": ["copy-ast-spec"] - }, - "lint": { - "executor": "@nx/eslint:lint", - "dependsOn": ["typescript-eslint:build", "eslint-plugin-internal:build"] - } - } -} diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index f06dff760d50..32071be2f183 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -42,7 +42,6 @@ "eslint-plugin" ], "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", @@ -61,6 +60,7 @@ }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", + "eslint": "*", "rimraf": "*", "typescript": "*", "vitest": "^3.1.3" @@ -73,6 +73,11 @@ "name": "typescript-eslint", "includedScripts": [ "clean" - ] + ], + "targets": { + "lint": { + "command": "eslint" + } + } } } diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 32c5f6987977..96bbcff65e32 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -44,7 +44,6 @@ "syntax" ], "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", @@ -67,6 +66,7 @@ "devDependencies": { "@types/is-glob": "^4.0.4", "@vitest/coverage-v8": "^3.1.3", + "eslint": "*", "glob": "*", "rimraf": "*", "typescript": "*", @@ -83,6 +83,11 @@ "name": "typescript-estree", "includedScripts": [ "clean" - ] + ], + "targets": { + "lint": { + "command": "eslint" + } + } } } diff --git a/packages/utils/package.json b/packages/utils/package.json index d2aa43d309e9..a5889cbea769 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -53,7 +53,6 @@ "estree" ], "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", @@ -73,6 +72,7 @@ }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", + "eslint": "*", "rimraf": "*", "typescript": "*", "vitest": "^3.1.3" @@ -87,9 +87,19 @@ "clean" ], "targets": { + "lint": { + "command": "eslint" + }, + "typecheck": { + "outputs": [ + "{workspaceRoot}/dist", + "{projectRoot}/dist" + ] + }, "test": { "dependsOn": [ - "^build" + "^build", + "typecheck" ] } } diff --git a/packages/utils/vitest.config.mts b/packages/utils/vitest.config.mts index ddc038f86b56..b29fd6f44121 100644 --- a/packages/utils/vitest.config.mts +++ b/packages/utils/vitest.config.mts @@ -14,6 +14,11 @@ const vitestConfig = mergeConfig( dir: path.join(import.meta.dirname, 'tests'), name: packageJson.name.replace('@typescript-eslint/', ''), root: import.meta.dirname, + + typecheck: { + enabled: true, + tsconfig: path.join(import.meta.dirname, 'tsconfig.spec.json'), + }, }, }), ); diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 3dc5f9672fc5..bec63202ba56 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -37,7 +37,6 @@ "estree" ], "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", "build": "yarn run -BT nx build", "clean": "rimraf dist/ coverage/", "format": "yarn run -T format", @@ -51,6 +50,7 @@ }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", + "eslint": "*", "rimraf": "*", "typescript": "*", "vitest": "^3.1.3" @@ -63,6 +63,11 @@ "name": "visitor-keys", "includedScripts": [ "clean" - ] + ], + "targets": { + "lint": { + "command": "eslint" + } + } } } diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index 2f9ac9855ab4..149eb9cf736e 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -27,8 +27,7 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", - "build": "tsx ./build.mts", + "build": "yarn run -BT nx build", "clean": "rimraf dist/", "format": "yarn run -T format", "lint": "yarn run -BT nx lint", @@ -50,8 +49,21 @@ "nx": { "name": "website-eslint", "includedScripts": [ - "clean", - "build" - ] + "clean" + ], + "targets": { + "build": { + "command": "tsx build.mts", + "dependsOn": [ + "types:copy-ast-spec" + ], + "options": { + "cwd": "{projectRoot}" + } + }, + "lint": { + "command": "eslint" + } + } } } diff --git a/packages/website/package.json b/packages/website/package.json index 4dfbd280da49..f76e99c6f8b6 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -12,8 +12,7 @@ "homepage": "https://typescript-eslint.io", "license": "MIT", "scripts": { - "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", - "build": "docusaurus build", + "build": "yarn run -BT nx build", "clear": "docusaurus clear", "clean": "rimraf dist/ build/ .docusaurus/ && yarn run clear", "format": "yarn run -T format", @@ -43,7 +42,7 @@ "json5": "^2.2.3", "konamimojisplosion": "^0.5.2", "lz-string": "^1.5.0", - "prettier": "^3.2.5", + "prettier": "3.5.0", "prism-react-renderer": "^2.3.1", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -98,23 +97,29 @@ "nx": { "name": "website", "includedScripts": [ - "clean", - "build" + "clean" ], "targets": { "build": { + "command": "docusaurus build", "dependsOn": [ "^build" - ] + ], + "options": { + "cwd": "{projectRoot}" + } + }, + "lint": { + "command": "eslint" }, "start": { "command": "docusaurus start", - "options": { - "cwd": "{projectRoot}" - }, "dependsOn": [ "^build" - ] + ], + "options": { + "cwd": "{projectRoot}" + } } } } diff --git a/vitest.config.base.mts b/vitest.config.base.mts index 75ac38dbf958..caa16009e093 100644 --- a/vitest.config.base.mts +++ b/vitest.config.base.mts @@ -25,6 +25,10 @@ export const vitestBaseConfig = { testTimeout: 10_000, + typecheck: { + include: ['**/*.test-d.?(c|m)ts?(x)'], + }, + watch: false, }, } as const satisfies ViteUserConfig; diff --git a/yarn.lock b/yarn.lock index 2883983caf19..75440ea8db19 100644 --- a/yarn.lock +++ b/yarn.lock @@ -509,7 +509,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.25.4, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": version: 7.27.2 resolution: "@babel/parser@npm:7.27.2" dependencies: @@ -520,17 +520,6 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.25.4": - version: 7.27.1 - resolution: "@babel/parser@npm:7.27.1" - dependencies: - "@babel/types": ^7.27.1 - bin: - parser: ./bin/babel-parser.js - checksum: 36042c744c4648a8cebf5579a0f8dc6c056648a5b017c1f1c896ce99468764dad91dfc3dd215684e0e4e648a28b62cdd2e6537b34f4a83dda01cb97a846166b0 - languageName: node - linkType: hard - "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.25.9": version: 7.25.9 resolution: "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.25.9" @@ -4185,25 +4174,6 @@ __metadata: languageName: node linkType: hard -"@nx/eslint@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/eslint@npm:21.0.3" - dependencies: - "@nx/devkit": 21.0.3 - "@nx/js": 21.0.3 - semver: ^7.5.3 - tslib: ^2.3.0 - typescript: ~5.7.2 - peerDependencies: - "@zkochan/js-yaml": 0.0.7 - eslint: ^8.0.0 || ^9.0.0 - peerDependenciesMeta: - "@zkochan/js-yaml": - optional: true - checksum: 1520df77239618e9a3d4475b426d2c851a1ac649672ee1ecadad6c6654eeacaa69c8876f47fac8308e2b019153cc28556f4fc01a03489f63a7441290607e70a1 - languageName: node - linkType: hard - "@nx/js@npm:21.0.3": version: 21.0.3 resolution: "@nx/js@npm:21.0.3" @@ -4572,142 +4542,142 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.40.2" +"@rollup/rollup-android-arm-eabi@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.41.0" conditions: os=android & cpu=arm languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-android-arm64@npm:4.40.2" +"@rollup/rollup-android-arm64@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-android-arm64@npm:4.41.0" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-darwin-arm64@npm:4.40.2" +"@rollup/rollup-darwin-arm64@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-darwin-arm64@npm:4.41.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-darwin-x64@npm:4.40.2" +"@rollup/rollup-darwin-x64@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-darwin-x64@npm:4.41.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-freebsd-arm64@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-freebsd-arm64@npm:4.40.2" +"@rollup/rollup-freebsd-arm64@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-freebsd-arm64@npm:4.41.0" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-freebsd-x64@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-freebsd-x64@npm:4.40.2" +"@rollup/rollup-freebsd-x64@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-freebsd-x64@npm:4.41.0" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.40.2" +"@rollup/rollup-linux-arm-gnueabihf@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.41.0" conditions: os=linux & cpu=arm & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.40.2" +"@rollup/rollup-linux-arm-musleabihf@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.41.0" conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.40.2" +"@rollup/rollup-linux-arm64-gnu@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.41.0" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.40.2" +"@rollup/rollup-linux-arm64-musl@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.41.0" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-loongarch64-gnu@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.40.2" +"@rollup/rollup-linux-loongarch64-gnu@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.41.0" conditions: os=linux & cpu=loong64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.40.2" +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.41.0" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.40.2" +"@rollup/rollup-linux-riscv64-gnu@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.41.0" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-musl@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.40.2" +"@rollup/rollup-linux-riscv64-musl@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.41.0" conditions: os=linux & cpu=riscv64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.40.2" +"@rollup/rollup-linux-s390x-gnu@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.41.0" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.40.2" +"@rollup/rollup-linux-x64-gnu@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.41.0" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.40.2" +"@rollup/rollup-linux-x64-musl@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.41.0" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.40.2" +"@rollup/rollup-win32-arm64-msvc@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.41.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.40.2" +"@rollup/rollup-win32-ia32-msvc@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.41.0" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.40.2": - version: 4.40.2 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.40.2" +"@rollup/rollup-win32-x64-msvc@npm:4.41.0": + version: 4.41.0 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.41.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -5781,7 +5751,8 @@ __metadata: "@typescript-eslint/type-utils": "workspace:*" "@typescript-eslint/utils": "workspace:*" "@vitest/coverage-v8": ^3.1.3 - prettier: ^3.2.5 + eslint: "*" + prettier: 3.5.0 rimraf: "*" vitest: ^3.1.3 languageName: unknown @@ -5813,6 +5784,7 @@ __metadata: mdast-util-mdx: ^3.0.0 micromark-extension-mdxjs: ^3.0.0 natural-compare: ^1.4.0 + prettier: 3.5.0 rimraf: "*" title-case: ^4.0.0 ts-api-utils: ^2.1.0 @@ -5832,6 +5804,7 @@ __metadata: resolution: "@typescript-eslint/integration-tests@workspace:packages/integration-tests" dependencies: "@vitest/coverage-v8": ^3.1.3 + eslint: "*" vitest: ^3.1.3 languageName: unknown linkType: soft @@ -5846,6 +5819,7 @@ __metadata: "@typescript-eslint/visitor-keys": 8.35.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 + eslint: "*" glob: "*" rimraf: "*" typescript: "*" @@ -5875,8 +5849,9 @@ __metadata: "@typescript-eslint/type-utils": 8.35.1 "@typescript-eslint/utils": 8.35.1 "@vitest/coverage-v8": ^3.1.3 + eslint: "*" natural-compare: ^1.4.0 - prettier: ^3.2.5 + prettier: 3.5.0 rimraf: "*" typescript: "*" vitest: ^3.1.3 @@ -5915,6 +5890,7 @@ __metadata: "@typescript-eslint/visitor-keys": 8.35.1 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 + eslint: "*" glob: "*" rimraf: "*" typescript: "*" @@ -5956,6 +5932,7 @@ __metadata: resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: "@vitest/coverage-v8": ^3.1.3 + eslint: "*" rimraf: "*" tsx: "*" typescript: "*" @@ -5972,7 +5949,6 @@ __metadata: "@eslint/eslintrc": ^3.2.0 "@eslint/js": ^9.26.0 "@nx/devkit": 21.0.3 - "@nx/eslint": 21.0.3 "@nx/js": 21.0.3 "@nx/vite": 21.0.3 "@nx/workspace": 21.0.3 @@ -6035,6 +6011,7 @@ __metadata: "@typescript-eslint/visitor-keys": 8.35.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 + eslint: "*" fast-glob: ^3.3.2 glob: "*" is-glob: ^4.0.3 @@ -6049,7 +6026,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.35.1, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.35.1, @typescript-eslint/utils@^8.24.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: @@ -6058,6 +6035,7 @@ __metadata: "@typescript-eslint/types": 8.35.1 "@typescript-eslint/typescript-estree": 8.35.1 "@vitest/coverage-v8": ^3.1.3 + eslint: "*" rimraf: "*" typescript: "*" vitest: ^3.1.3 @@ -6073,6 +6051,7 @@ __metadata: dependencies: "@typescript-eslint/types": 8.35.1 "@vitest/coverage-v8": ^3.1.3 + eslint: "*" eslint-visitor-keys: ^4.2.1 rimraf: "*" typescript: "*" @@ -6119,8 +6098,8 @@ __metadata: linkType: hard "@vitest/coverage-v8@npm:^3.1.3": - version: 3.1.3 - resolution: "@vitest/coverage-v8@npm:3.1.3" + version: 3.1.4 + resolution: "@vitest/coverage-v8@npm:3.1.4" dependencies: "@ampproject/remapping": ^2.3.0 "@bcoe/v8-coverage": ^1.0.2 @@ -6135,20 +6114,21 @@ __metadata: test-exclude: ^7.0.1 tinyrainbow: ^2.0.0 peerDependencies: - "@vitest/browser": 3.1.3 - vitest: 3.1.3 + "@vitest/browser": 3.1.4 + vitest: 3.1.4 peerDependenciesMeta: "@vitest/browser": optional: true - checksum: 647d9d43335349db076b507eb374a364e96e4367f00ed610afff357b6d00d49ea22d30a00f046f088392c68bb3968a5f780ce8ee9a39f14e968b35fcc7fc7e69 + checksum: 745c8e7e7898ff54b97bdcc917606d488aa195701d4be3eeae0b4e5c1d4ff16af723e2837f050f7bdbd69fd3d37e131962f19f837e34dd7e0f0fa6dd8fae9c8d languageName: node linkType: hard "@vitest/eslint-plugin@npm:^1.1.44": - version: 1.1.44 - resolution: "@vitest/eslint-plugin@npm:1.1.44" + version: 1.2.0 + resolution: "@vitest/eslint-plugin@npm:1.2.0" + dependencies: + "@typescript-eslint/utils": ^8.24.0 peerDependencies: - "@typescript-eslint/utils": ">= 8.24.0" eslint: ">= 8.57.0" typescript: ">= 5.0.0" vitest: "*" @@ -6157,27 +6137,27 @@ __metadata: optional: true vitest: optional: true - checksum: bd78c75c01cb964888b0fb8c468469bbef3a4dcc25ed9618b82fd6b83c236ac54fad9dd9aa67d3da892796d4c982b9bcee37fa16a412744f50fc9a27ece3bb1f + checksum: cf5fe6ed81869b942e9f44cbc63caaec86807d11c4a9d9ad6800df76a90b054573101b8cb2feafca2489bc4a6bd9abb3e953a070963ca80e64014734d07f88e7 languageName: node linkType: hard -"@vitest/expect@npm:3.1.3": - version: 3.1.3 - resolution: "@vitest/expect@npm:3.1.3" +"@vitest/expect@npm:3.1.4": + version: 3.1.4 + resolution: "@vitest/expect@npm:3.1.4" dependencies: - "@vitest/spy": 3.1.3 - "@vitest/utils": 3.1.3 + "@vitest/spy": 3.1.4 + "@vitest/utils": 3.1.4 chai: ^5.2.0 tinyrainbow: ^2.0.0 - checksum: 5c83ed7c7b429217363be15e361fe5128684aed422f3424b9a994f5a1116b06293d4c4bf117a9670c311e73e8a9d55b99adafdf63dfce88e15417814087d1eec + checksum: 996f67c0608fce0176283cb629b9f15d39781840a3b8ba026baa2f86762559373a963cec14e6eec42c5a6655b3152705319dccefce8014b42cbd42c968ad03e5 languageName: node linkType: hard -"@vitest/mocker@npm:3.1.3": - version: 3.1.3 - resolution: "@vitest/mocker@npm:3.1.3" +"@vitest/mocker@npm:3.1.4": + version: 3.1.4 + resolution: "@vitest/mocker@npm:3.1.4" dependencies: - "@vitest/spy": 3.1.3 + "@vitest/spy": 3.1.4 estree-walker: ^3.0.3 magic-string: ^0.30.17 peerDependencies: @@ -6188,57 +6168,57 @@ __metadata: optional: true vite: optional: true - checksum: f4550db48d9e3f009db56af4c8bb3d15de5eb26bdcfa1a19b703deb284f3a4c04b89c4ac0d6ad139cc70a3d893260852742b1ad1eb8af0e7f11711bed4427ee4 + checksum: 8b96137af3575e71369e84b0b1f000a801e8ccf5649495e9d86a1c93a7e5cbec3660553cba5d7450b443212d7c93039530b210b7ede07f1f017f7ad2d8fa7857 languageName: node linkType: hard -"@vitest/pretty-format@npm:3.1.3, @vitest/pretty-format@npm:^3.1.3": - version: 3.1.3 - resolution: "@vitest/pretty-format@npm:3.1.3" +"@vitest/pretty-format@npm:3.1.4, @vitest/pretty-format@npm:^3.1.3, @vitest/pretty-format@npm:^3.1.4": + version: 3.1.4 + resolution: "@vitest/pretty-format@npm:3.1.4" dependencies: tinyrainbow: ^2.0.0 - checksum: c27594a4c33e27d4c16ed73940d9c2399a71dfbcd3e70d459152853c051097d72414af1449226250b5be039d859565b278584d42a4ac088c9e4b5e7a929e86fc + checksum: 5468fd433e59c12d11dee36f507360da6b5032ef061c6b4bf8f97d7339f9a488e3de46aaaf3c75fb6044f5faa36fae51436b102b67e60ad74b26abfc48536119 languageName: node linkType: hard -"@vitest/runner@npm:3.1.3": - version: 3.1.3 - resolution: "@vitest/runner@npm:3.1.3" +"@vitest/runner@npm:3.1.4": + version: 3.1.4 + resolution: "@vitest/runner@npm:3.1.4" dependencies: - "@vitest/utils": 3.1.3 + "@vitest/utils": 3.1.4 pathe: ^2.0.3 - checksum: 263363ffaa4102361ac94c1c0cec88e63511ecab3b995f1bdbe307493d4b991c41528afaea0a4dbbd8d880fb35deb30c0b9bf2178deacda15c7ea15ad28a284d + checksum: 9e2b25d7eafd04171ee9b2609e3435998fe4d0c82122b426a576504c3c2937a20460f8f8ee8a4cfd267620fcc4d4c7bfb8bfc6610288b5ca5f252ad6c5bae6f4 languageName: node linkType: hard -"@vitest/snapshot@npm:3.1.3": - version: 3.1.3 - resolution: "@vitest/snapshot@npm:3.1.3" +"@vitest/snapshot@npm:3.1.4": + version: 3.1.4 + resolution: "@vitest/snapshot@npm:3.1.4" dependencies: - "@vitest/pretty-format": 3.1.3 + "@vitest/pretty-format": 3.1.4 magic-string: ^0.30.17 pathe: ^2.0.3 - checksum: d128f8fba53e8703f4453e461bb53ca5e3f2deb48c43a37e9489f85bbef693e0daafec44611c1449ed0d2eb370a8fd0dabf16538c74325e760bda4c01e8443b9 + checksum: 4893c5c64518659db31d8b5e6e1bf0fedd320fbc26b9173004a733ad99cb2db8978e83ee7e0b8f81fed36668f6b5b22ed709ab4437a6803451dd541d07b16f3f languageName: node linkType: hard -"@vitest/spy@npm:3.1.3": - version: 3.1.3 - resolution: "@vitest/spy@npm:3.1.3" +"@vitest/spy@npm:3.1.4": + version: 3.1.4 + resolution: "@vitest/spy@npm:3.1.4" dependencies: tinyspy: ^3.0.2 - checksum: 89093542e1677c37c4ef8f86fb30abafd61d98e1fa908fb403acd7dfaf03e3ab67a84ef3b4b8f75685ba68aa2c8b6eb7b1274938822c7c19c3250cdadfb45457 + checksum: ea957b3b1afe9d33f445b91b446aeffa6e55f57d25801754e3d0206db045405dd6013545d2cb11ab6febd3dcbb3adc9580ec20f0d08ca458d21cfc7eebf9caa8 languageName: node linkType: hard -"@vitest/utils@npm:3.1.3, @vitest/utils@npm:^3.1.3": - version: 3.1.3 - resolution: "@vitest/utils@npm:3.1.3" +"@vitest/utils@npm:3.1.4, @vitest/utils@npm:^3.1.3": + version: 3.1.4 + resolution: "@vitest/utils@npm:3.1.4" dependencies: - "@vitest/pretty-format": 3.1.3 + "@vitest/pretty-format": 3.1.4 loupe: ^3.1.3 tinyrainbow: ^2.0.0 - checksum: ba6bfa548e96c1f3493e47c027c03d1e800127446a7c60663817c67bb97f54d83ac9f4133b2c4334bce32925765d2db89f4d6c8b58b4d355d4107100b59e6603 + checksum: 51939f0f1a50dc277f10c81a944a104cdaf7c0cde4c3e192d5605ac34115debf0f8fca1c031483c77fb430595883324a86810070533a5623c0fd95bb4bf0259c languageName: node linkType: hard @@ -17701,29 +17681,29 @@ __metadata: linkType: hard "rollup@npm:^4.34.9": - version: 4.40.2 - resolution: "rollup@npm:4.40.2" - dependencies: - "@rollup/rollup-android-arm-eabi": 4.40.2 - "@rollup/rollup-android-arm64": 4.40.2 - "@rollup/rollup-darwin-arm64": 4.40.2 - "@rollup/rollup-darwin-x64": 4.40.2 - "@rollup/rollup-freebsd-arm64": 4.40.2 - "@rollup/rollup-freebsd-x64": 4.40.2 - "@rollup/rollup-linux-arm-gnueabihf": 4.40.2 - "@rollup/rollup-linux-arm-musleabihf": 4.40.2 - "@rollup/rollup-linux-arm64-gnu": 4.40.2 - "@rollup/rollup-linux-arm64-musl": 4.40.2 - "@rollup/rollup-linux-loongarch64-gnu": 4.40.2 - "@rollup/rollup-linux-powerpc64le-gnu": 4.40.2 - "@rollup/rollup-linux-riscv64-gnu": 4.40.2 - "@rollup/rollup-linux-riscv64-musl": 4.40.2 - "@rollup/rollup-linux-s390x-gnu": 4.40.2 - "@rollup/rollup-linux-x64-gnu": 4.40.2 - "@rollup/rollup-linux-x64-musl": 4.40.2 - "@rollup/rollup-win32-arm64-msvc": 4.40.2 - "@rollup/rollup-win32-ia32-msvc": 4.40.2 - "@rollup/rollup-win32-x64-msvc": 4.40.2 + version: 4.41.0 + resolution: "rollup@npm:4.41.0" + dependencies: + "@rollup/rollup-android-arm-eabi": 4.41.0 + "@rollup/rollup-android-arm64": 4.41.0 + "@rollup/rollup-darwin-arm64": 4.41.0 + "@rollup/rollup-darwin-x64": 4.41.0 + "@rollup/rollup-freebsd-arm64": 4.41.0 + "@rollup/rollup-freebsd-x64": 4.41.0 + "@rollup/rollup-linux-arm-gnueabihf": 4.41.0 + "@rollup/rollup-linux-arm-musleabihf": 4.41.0 + "@rollup/rollup-linux-arm64-gnu": 4.41.0 + "@rollup/rollup-linux-arm64-musl": 4.41.0 + "@rollup/rollup-linux-loongarch64-gnu": 4.41.0 + "@rollup/rollup-linux-powerpc64le-gnu": 4.41.0 + "@rollup/rollup-linux-riscv64-gnu": 4.41.0 + "@rollup/rollup-linux-riscv64-musl": 4.41.0 + "@rollup/rollup-linux-s390x-gnu": 4.41.0 + "@rollup/rollup-linux-x64-gnu": 4.41.0 + "@rollup/rollup-linux-x64-musl": 4.41.0 + "@rollup/rollup-win32-arm64-msvc": 4.41.0 + "@rollup/rollup-win32-ia32-msvc": 4.41.0 + "@rollup/rollup-win32-x64-msvc": 4.41.0 "@types/estree": 1.0.7 fsevents: ~2.3.2 dependenciesMeta: @@ -17771,7 +17751,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: d2bb0428df6d88892348c9c0405df6b38fcb4841b196711cc986ac177d62c8bf983a8f3a61b834a47b016c41152ae7a75239705a929b40cabba0e33fbb09ff03 + checksum: b055892342db9e62d3b84539c2ef1e209a2d053a710c8e42432ba4f200c4d6464172f955c45574a29a500ce72f53c96e54029eb9bbacef5e0731338cf20f3857 languageName: node linkType: hard @@ -19532,6 +19512,7 @@ __metadata: "@typescript-eslint/parser": 8.35.1 "@typescript-eslint/utils": 8.35.1 "@vitest/coverage-v8": ^3.1.3 + eslint: "*" rimraf: "*" typescript: "*" vitest: ^3.1.3 @@ -19917,9 +19898,9 @@ __metadata: languageName: node linkType: hard -"vite-node@npm:3.1.3": - version: 3.1.3 - resolution: "vite-node@npm:3.1.3" +"vite-node@npm:3.1.4": + version: 3.1.4 + resolution: "vite-node@npm:3.1.4" dependencies: cac: ^6.7.14 debug: ^4.4.0 @@ -19928,7 +19909,7 @@ __metadata: vite: ^5.0.0 || ^6.0.0 bin: vite-node: vite-node.mjs - checksum: 69975ebd3acce54b0c708818f2a11cb5c4375888d4aab834253c89d0a19438528ccc8abe983ee73af19a69bf8d4a64ed475dca9cec717319c03191ac139c4bca + checksum: b3103543b1f7d9ab85a321b771954657931ceb0b4f9f7de62694d2f2c26aeed850e707314d5ffede5d62fa7cec10ba47be8855eee4597c3dce1edf9f2c3cfb26 languageName: node linkType: hard @@ -19988,16 +19969,16 @@ __metadata: linkType: hard "vitest@npm:^3.1.3": - version: 3.1.3 - resolution: "vitest@npm:3.1.3" - dependencies: - "@vitest/expect": 3.1.3 - "@vitest/mocker": 3.1.3 - "@vitest/pretty-format": ^3.1.3 - "@vitest/runner": 3.1.3 - "@vitest/snapshot": 3.1.3 - "@vitest/spy": 3.1.3 - "@vitest/utils": 3.1.3 + version: 3.1.4 + resolution: "vitest@npm:3.1.4" + dependencies: + "@vitest/expect": 3.1.4 + "@vitest/mocker": 3.1.4 + "@vitest/pretty-format": ^3.1.4 + "@vitest/runner": 3.1.4 + "@vitest/snapshot": 3.1.4 + "@vitest/spy": 3.1.4 + "@vitest/utils": 3.1.4 chai: ^5.2.0 debug: ^4.4.0 expect-type: ^1.2.1 @@ -20010,14 +19991,14 @@ __metadata: tinypool: ^1.0.2 tinyrainbow: ^2.0.0 vite: ^5.0.0 || ^6.0.0 - vite-node: 3.1.3 + vite-node: 3.1.4 why-is-node-running: ^2.3.0 peerDependencies: "@edge-runtime/vm": "*" "@types/debug": ^4.1.12 "@types/node": ^18.0.0 || ^20.0.0 || >=22.0.0 - "@vitest/browser": 3.1.3 - "@vitest/ui": 3.1.3 + "@vitest/browser": 3.1.4 + "@vitest/ui": 3.1.4 happy-dom: "*" jsdom: "*" peerDependenciesMeta: @@ -20037,7 +20018,7 @@ __metadata: optional: true bin: vitest: vitest.mjs - checksum: 4ebcc8bc3c8e23a894632a70851aa3e21646bce8aca4b406d3a5e0fb2aef84fb42c85eea951f9c1bf8b1415e1b3131c4d96ab26d4c1b5df64df9055024c1344d + checksum: 72002a50ea9f86f37c0f96d6e61029d0fe973cc11010d3f75c73168a552d5e52149148542af07f4880bbadc177baeeb13d08422c99d6ecb26202a481be14b534 languageName: node linkType: hard @@ -20316,7 +20297,7 @@ __metadata: mdast-util-from-markdown: ^2.0.1 mdast-util-mdx: ^3.0.0 monaco-editor: ~0.52.0 - prettier: ^3.2.5 + prettier: 3.5.0 prism-react-renderer: ^2.3.1 raw-loader: ^4.0.2 react: ^18.2.0 From 1e2d1fb19ac10f15ad5cf2be2095a26966dbe745 Mon Sep 17 00:00:00 2001 From: James Henry Date: Tue, 1 Jul 2025 14:26:28 +0400 Subject: [PATCH 063/283] chore: migrate to nx-cloud-id (#11364) --- nx.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx.json b/nx.json index df1253f99c70..e5ad6a8e612f 100644 --- a/nx.json +++ b/nx.json @@ -1,6 +1,5 @@ { "$schema": "./node_modules/nx/schemas/nx-schema.json", - "nxCloudAccessToken": "YjIzMmMxMWItMjhiMS00NWY2LTk1NWYtYWU3YWQ0YjE4YjBlfHJlYWQ=", "plugins": [ { "plugin": "@nx/js/typescript", @@ -84,5 +83,6 @@ "!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/vitest.config.mts" ] - } + }, + "nxCloudId": "60b38765e74d975e3faae5ad" } From f391560ce3edeeecde056420284799124ef1d244 Mon Sep 17 00:00:00 2001 From: James Henry Date: Tue, 1 Jul 2025 15:01:53 +0400 Subject: [PATCH 064/283] chore: nx cloud token test (#11365) --- nx.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx.json b/nx.json index e5ad6a8e612f..b0ac6867484c 100644 --- a/nx.json +++ b/nx.json @@ -69,10 +69,10 @@ "runtime": "node -v" }, { - "runtime": "echo $NETLIFY" + "runtime": "yarn -v" }, { - "runtime": "yarn -v" + "runtime": "echo $NETLIFY" } ], "production": [ From 50a3ab6ea8ea44691ff8fbe16c1a4f46950fca34 Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Tue, 1 Jul 2025 15:18:25 +0400 Subject: [PATCH 065/283] chore: update NX_CLOUD_ACCESS_TOKEN env value --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0a6b9885b08..5a091b0f72fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,8 @@ concurrency: env: PRIMARY_NODE_VERSION: 20 - # Only set the read-write token if we are on the main branch - NX_CLOUD_ACCESS_TOKEN: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') && secrets.NX_CLOUD_ACCESS_TOKEN || '' }} + # Value will be controlled via main environment secret, will be read-write for main branch, read-only for other branches + NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} # This increases the verbosity of the logs for everything, including Nx Cloud, but will hopefully surface more info about recent lint failures NX_VERBOSE_LOGGING: false From cefd4a93d80f67a9b8a892529dee4ff96adafcfd Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Tue, 1 Jul 2025 15:24:41 +0400 Subject: [PATCH 066/283] chore: change to test github env secret --- .github/workflows/a11y-alt-bot.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/a11y-alt-bot.yml b/.github/workflows/a11y-alt-bot.yml index 3ba37a7d9759..10afa17f6b1b 100644 --- a/.github/workflows/a11y-alt-bot.yml +++ b/.github/workflows/a11y-alt-bot.yml @@ -5,8 +5,7 @@ on: pull_request: types: [opened, edited] issue_comment: - # nx bot and netlify bot edit their comments regularly - # this floods our action queue with this action + # nx bot and netlify bot edit their comments regularly, this floods our action queue with this action # it's rare that someone edits a comment to add an image so to save our queue we ignore the edit types: [created] discussion: From 6f7cfd697d3cd05d6ab76f90168fe4ee5aa12965 Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Tue, 1 Jul 2025 15:52:35 +0400 Subject: [PATCH 067/283] chore: try top level environment config --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a091b0f72fd..fba368b546c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,8 @@ concurrency: group: '${{ github.workflow }} - ${{ github.head_ref || github.ref }}' cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} +environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} + env: PRIMARY_NODE_VERSION: 20 # Value will be controlled via main environment secret, will be read-write for main branch, read-only for other branches From 69040d09a1439c4bb087bdc63854db58da185356 Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Tue, 1 Jul 2025 15:54:12 +0400 Subject: [PATCH 068/283] chore: try job level environment config with env var --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fba368b546c9..b85584e82dbf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,11 +13,10 @@ concurrency: group: '${{ github.workflow }} - ${{ github.head_ref || github.ref }}' cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} -environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} - env: PRIMARY_NODE_VERSION: 20 # Value will be controlled via main environment secret, will be read-write for main branch, read-only for other branches + GITHUB_ENVIRONMENT: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} # This increases the verbosity of the logs for everything, including Nx Cloud, but will hopefully surface more info about recent lint failures NX_VERBOSE_LOGGING: false @@ -40,6 +39,7 @@ permissions: jobs: install: name: Checkout and Install + environment: ${{ env.GITHUB_ENVIRONMENT }} runs-on: ubuntu-latest env: NX_CI_EXECUTION_ENV: 'ubuntu-latest' @@ -53,6 +53,7 @@ jobs: build: name: Build All Packages + environment: ${{ env.GITHUB_ENVIRONMENT }} needs: [install] runs-on: ubuntu-latest env: From c14c98e8f7487d7cd13551b34f039dc278a40092 Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Tue, 1 Jul 2025 15:55:35 +0400 Subject: [PATCH 069/283] chore: try job level environment config with env var --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b85584e82dbf..0357fb602e24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ permissions: jobs: install: name: Checkout and Install - environment: ${{ env.GITHUB_ENVIRONMENT }} + environment: 'main' runs-on: ubuntu-latest env: NX_CI_EXECUTION_ENV: 'ubuntu-latest' @@ -53,7 +53,7 @@ jobs: build: name: Build All Packages - environment: ${{ env.GITHUB_ENVIRONMENT }} + environment: 'main' needs: [install] runs-on: ubuntu-latest env: From 719213b8514aeca71855e79153760e1f8d9f54de Mon Sep 17 00:00:00 2001 From: James Henry Date: Tue, 1 Jul 2025 16:24:32 +0400 Subject: [PATCH 070/283] chore: try branch with environment main set (#11366) --- .github/workflows/ci.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0357fb602e24..bc7c9d47147e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,7 @@ concurrency: env: PRIMARY_NODE_VERSION: 20 - # Value will be controlled via main environment secret, will be read-write for main branch, read-only for other branches - GITHUB_ENVIRONMENT: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} + # Value will be controlled via GitHub environment (called "main") secret, will be read-write for main branch, read-only for other branches NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} # This increases the verbosity of the logs for everything, including Nx Cloud, but will hopefully surface more info about recent lint failures NX_VERBOSE_LOGGING: false @@ -39,7 +38,7 @@ permissions: jobs: install: name: Checkout and Install - environment: 'main' + environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job runs-on: ubuntu-latest env: NX_CI_EXECUTION_ENV: 'ubuntu-latest' @@ -53,7 +52,7 @@ jobs: build: name: Build All Packages - environment: 'main' + environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job needs: [install] runs-on: ubuntu-latest env: @@ -70,6 +69,7 @@ jobs: generate_configs: name: Generate Configs + environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job needs: [build] runs-on: ubuntu-latest env: @@ -88,6 +88,7 @@ jobs: lint_without_build: name: Lint without build + environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job needs: [install] runs-on: ubuntu-latest strategy: @@ -108,6 +109,7 @@ jobs: lint_with_build: name: Lint with build + environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job # because we lint with our own tooling, we need to build needs: [build] runs-on: ubuntu-latest @@ -133,6 +135,7 @@ jobs: stylelint: name: Stylelint + environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job needs: [install] runs-on: ubuntu-latest env: @@ -150,6 +153,7 @@ jobs: integration_tests: name: Run integration tests on primary Node.js version + environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job needs: [build] runs-on: ubuntu-latest env: @@ -171,6 +175,7 @@ jobs: unit_tests: name: Run Unit Tests + environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job needs: [build] runs-on: ${{ matrix.os }} strategy: @@ -236,6 +241,7 @@ jobs: unit_tests_project_service: name: Run Unit Tests with Project Service + environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job needs: [build] runs-on: ubuntu-latest strategy: @@ -264,6 +270,7 @@ jobs: upload_coverage: name: Upload Codecov Coverage + environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job needs: [unit_tests] runs-on: ubuntu-latest steps: @@ -285,6 +292,7 @@ jobs: publish_canary_version: name: Publish the latest code as a canary version + environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job runs-on: ubuntu-latest permissions: id-token: write @@ -313,5 +321,6 @@ jobs: run: npx nx release publish --tag canary --verbose env: NX_CLOUD_DISTRIBUTED_EXECUTION: false + # This secret is only accessible on the GitHub environment "main" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true From 5b378e290e56eefe638f22444d55bc5c0744c28c Mon Sep 17 00:00:00 2001 From: James Henry Date: Tue, 1 Jul 2025 17:42:54 +0400 Subject: [PATCH 071/283] chore: make copy-ast-spec non cacheable (#11367) --- packages/types/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/package.json b/packages/types/package.json index f0cb835a5f4b..57de27243842 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -70,7 +70,7 @@ ] }, "copy-ast-spec": { - "cache": true, + "cache": false, "command": "tsx tools/copy-ast-spec.mts", "dependsOn": [ "ast-spec:build" From a8e038fe34a919944ac1ce45cb497fadecd15c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Fri, 4 Jul 2025 06:40:01 -0500 Subject: [PATCH 072/283] docs: overhaul homepage (#11345) * docs: overhaul homepage * Update packages/website/plugins/recent-blog-posts/index.ts * recent-blog-posts/index.ts in knip * Remove unused variable * Deduplicate Zod * Small CSS tweaks * Better balanced .details --- .gitignore | 1 + README.md | 2 +- docs/maintenance/Branding.mdx | 2 +- knip.ts | 1 + packages/website/docusaurus.config.mts | 4 +- packages/website/package.json | 5 +- .../plugins/recent-blog-posts/index.ts | 46 ++++ .../FinancialContributors/index.tsx | 65 ------ .../home/ExplainerSpotlight/index.tsx | 26 +++ .../home/ExplainerSpotlight/styles.module.css | 28 +++ .../src/components/home/Explainers/index.tsx | 83 ++++++++ .../home/Explainers/styles.module.css | 56 +++++ .../src/components/home/Feature.module.css | 6 + .../home/FinancialContributors/index.tsx | 77 +++++++ .../FinancialContributors/styles.module.css | 21 +- .../{ => home}/FinancialContributors/types.ts | 0 .../components/home/RecentBlogPosts/index.tsx | 48 +++++ .../home/RecentBlogPosts/styles.module.css | 84 ++++++++ .../Sponsor.tsx => home/Sponsor/index.tsx} | 2 +- .../components/home/Sponsor/styles.module.css | 12 ++ .../Sponsors/index.tsx | 2 +- .../Sponsors/styles.module.css | 0 packages/website/src/pages/index.tsx | 199 +++--------------- packages/website/src/pages/styles.module.css | 64 +++--- packages/website/static/manifest.json | 2 +- yarn.lock | 11 +- 26 files changed, 568 insertions(+), 279 deletions(-) create mode 100644 packages/website/plugins/recent-blog-posts/index.ts delete mode 100644 packages/website/src/components/FinancialContributors/index.tsx create mode 100644 packages/website/src/components/home/ExplainerSpotlight/index.tsx create mode 100644 packages/website/src/components/home/ExplainerSpotlight/styles.module.css create mode 100644 packages/website/src/components/home/Explainers/index.tsx create mode 100644 packages/website/src/components/home/Explainers/styles.module.css create mode 100644 packages/website/src/components/home/Feature.module.css create mode 100644 packages/website/src/components/home/FinancialContributors/index.tsx rename packages/website/src/components/{ => home}/FinancialContributors/styles.module.css (78%) rename packages/website/src/components/{ => home}/FinancialContributors/types.ts (100%) create mode 100644 packages/website/src/components/home/RecentBlogPosts/index.tsx create mode 100644 packages/website/src/components/home/RecentBlogPosts/styles.module.css rename packages/website/src/components/{FinancialContributors/Sponsor.tsx => home/Sponsor/index.tsx} (90%) create mode 100644 packages/website/src/components/home/Sponsor/styles.module.css rename packages/website/src/components/{FinancialContributors => home}/Sponsors/index.tsx (91%) rename packages/website/src/components/{FinancialContributors => home}/Sponsors/styles.module.css (100%) diff --git a/.gitignore b/.gitignore index 20ab952ba246..bf83f8f9300a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ docs/packages/*/generated packages/website/.docusaurus packages/website/.cache-loader packages/website/build +packages/website/data/recent-blog-posts.json packages/website/static/sandbox # Runtime data diff --git a/README.md b/README.md index 56ec6bf32ead..fde6040f8c7e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

typescript-eslint

-

Monorepo for the tooling that enables ESLint and Prettier to support TypeScript

+

Monorepo for typescript-eslint: powerful static analysis for JavaScript and TypeScript

CI diff --git a/docs/maintenance/Branding.mdx b/docs/maintenance/Branding.mdx index d4e84d90deae..5ab5af30f691 100644 --- a/docs/maintenance/Branding.mdx +++ b/docs/maintenance/Branding.mdx @@ -22,7 +22,7 @@ Combining lowercase with a dash helps differentiate us. ### Slogan -> The tooling that enables ESLint and Prettier to support TypeScript. +> Powerful static analysis for JavaScript and TypeScript. ## Visuals diff --git a/knip.ts b/knip.ts index 52f4866d682b..2756c39029ba 100644 --- a/knip.ts +++ b/knip.ts @@ -151,6 +151,7 @@ export default { 'src/components/**/*.tsx', // used by Docusaurus + 'plugins/recent-blog-posts/index.ts', 'src/theme/**/*.tsx', 'src/theme/prism-include-languages.js', ], diff --git a/packages/website/docusaurus.config.mts b/packages/website/docusaurus.config.mts index 3fb7fe565efa..3e6ff8e252f4 100644 --- a/packages/website/docusaurus.config.mts +++ b/packages/website/docusaurus.config.mts @@ -351,8 +351,7 @@ const redirects: PluginRedirectOptions = { const config: Config = { baseUrl: '/', - tagline: - 'The tooling that enables ESLint and Prettier to support TypeScript.', + tagline: 'Powerful static analysis for JavaScript and TypeScript.', title: 'typescript-eslint', url: 'https://typescript-eslint.io', @@ -368,6 +367,7 @@ const config: Config = { onBrokenMarkdownLinks: 'throw', organizationName: 'typescript-eslint', plugins: [ + './plugins/recent-blog-posts/index.ts', ...['ast-spec', 'project-service', 'tsconfig-utils', 'type-utils'].map( packageName => [ 'docusaurus-plugin-typedoc', diff --git a/packages/website/package.json b/packages/website/package.json index f76e99c6f8b6..117723cf3ace 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -39,6 +39,7 @@ "clsx": "^2.1.0", "docusaurus-plugin-typedoc": "^1.4.0", "eslint": "^9.15.0", + "gray-matter": "^4.0.3", "json5": "^2.2.3", "konamimojisplosion": "^0.5.2", "lz-string": "^1.5.0", @@ -48,10 +49,12 @@ "react-dom": "^18.2.0", "react-markdown": "^10.0.0", "react-resizable-panels": "^3.0.0", + "reading-time": "^1.5.0", "semver": "^7.6.0", "typedoc": "^0.28.4", "typedoc-plugin-markdown": "^4.6.3", - "typescript": "*" + "typescript": "*", + "zod": "^3.25.67" }, "devDependencies": { "@docusaurus/module-type-aliases": "~3.7.0", diff --git a/packages/website/plugins/recent-blog-posts/index.ts b/packages/website/plugins/recent-blog-posts/index.ts new file mode 100644 index 000000000000..a3f37b8b0d27 --- /dev/null +++ b/packages/website/plugins/recent-blog-posts/index.ts @@ -0,0 +1,46 @@ +import type { Plugin } from '@docusaurus/types'; + +import matter from 'gray-matter'; +import * as fs from 'node:fs/promises'; +import readingTime from 'reading-time'; +import { z } from 'zod'; + +const storageFile = `data/recent-blog-posts.json`; + +const matterSchema = z.object({ + description: z.string(), + slug: z.string(), + title: z.string(), +}); + +export default async function blogPluginEnhanced(): Promise { + const blogHandles = (await fs.readdir('blog', { withFileTypes: true })) + .filter(handle => handle.isFile() && /.mdx?$/.test(handle.name)) + .map(handle => ({ + date: new Date(/\d+-\d+-\d+/.exec(handle.name)?.[0] || '1970-01-01'), + handle, + })) + .sort((a, b) => b.date.getTime() - a.date.getTime()) + .slice(0, 3); + + const blogPosts = await Promise.all( + blogHandles.map(async ({ date, handle }) => { + const content = await fs.readFile(`blog/${handle.name}`, 'utf-8'); + const data = matterSchema.parse(matter(content).data); + + return { + date, + description: data.description, + readingTime: Math.round(readingTime(content).minutes), + slug: data.slug, + title: data.title, + }; + }), + ); + + await fs.writeFile(storageFile, JSON.stringify(blogPosts, null, 2)); + + return { + name: 'recent-blog-posts', + }; +} diff --git a/packages/website/src/components/FinancialContributors/index.tsx b/packages/website/src/components/FinancialContributors/index.tsx deleted file mode 100644 index 03190cd70e13..000000000000 --- a/packages/website/src/components/FinancialContributors/index.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import Link from '@docusaurus/Link'; -import sponsors from '@site/data/sponsors.json'; -import clsx from 'clsx'; -import React from 'react'; - -import { Sponsors } from './Sponsors'; -import styles from './styles.module.css'; - -export function FinancialContributors(): React.JSX.Element { - return ( - <> -

- The typescript-eslint project would not be possible without the generous - support of our financial contributors. -

-
- - - -
-
- - Become a financial sponsor - -
- - See all financial sponsors - - - Docs - -
-
- - ); -} diff --git a/packages/website/src/components/home/ExplainerSpotlight/index.tsx b/packages/website/src/components/home/ExplainerSpotlight/index.tsx new file mode 100644 index 000000000000..56fc2b5874a1 --- /dev/null +++ b/packages/website/src/components/home/ExplainerSpotlight/index.tsx @@ -0,0 +1,26 @@ +import Heading from '@theme/Heading'; +import React from 'react'; + +import styles from './styles.module.css'; + +export interface ExplainerSpotlightProps extends React.PropsWithChildren { + header: string; + emoji: string; + href: string; +} + +export function ExplainerSpotlight({ + children, + emoji, + header, + href, +}: ExplainerSpotlightProps): React.JSX.Element { + return ( + + + {header} {emoji} + +
{children}
+
+ ); +} diff --git a/packages/website/src/components/home/ExplainerSpotlight/styles.module.css b/packages/website/src/components/home/ExplainerSpotlight/styles.module.css new file mode 100644 index 000000000000..97d9bb447a70 --- /dev/null +++ b/packages/website/src/components/home/ExplainerSpotlight/styles.module.css @@ -0,0 +1,28 @@ +.explainerSpotlight { + background: var(--ifm-color-emphasis-100); + border-radius: var(--ifm-global-radius); + color: var(--ifm-heading-color); + padding: 1rem 1.5rem; + text-decoration: none; + transition: box-shadow 0.3s ease; + width: 100%; +} + +[data-theme='dark'] .explainerSpotlight { + background: var(--ifm-color-emphasis-200); +} + +.explainerSpotlight:hover { + color: var(--ifm-heading-color); + text-decoration: none; + box-shadow: 0 3px 3px 0 var(--gray-border-shadow); +} + +.heading { + display: flex; + justify-content: space-between; +} + +.emoji { + user-select: none; +} diff --git a/packages/website/src/components/home/Explainers/index.tsx b/packages/website/src/components/home/Explainers/index.tsx new file mode 100644 index 000000000000..9545ebc6552c --- /dev/null +++ b/packages/website/src/components/home/Explainers/index.tsx @@ -0,0 +1,83 @@ +import Link from '@docusaurus/Link'; +import useBaseUrl from '@docusaurus/useBaseUrl'; +import Heading from '@theme/Heading'; +import clsx from 'clsx'; +import React from 'react'; + +import { ExplainerSpotlight } from '../ExplainerSpotlight'; +import styles from './styles.module.css'; + +const explanations = [ + { + children: + 'The parser and services for linting TypeScript code with ESLint, as well as how tools such as Prettier read TypeScript code.', + emoji: '⚙️', + header: 'Language Support', + href: '/getting-started', + }, + { + children: + 'Over 100 rules that check for best practices, likely bugs, and stylistic consistency in modern JavaScript and TypeScript codebases.', + emoji: '🧠', + header: 'Standard Rules', + href: '/rules', + }, + { + children: + "Industry-leading services that use TypeScript's type APIs to make a more powerful breed of lint rules for deeper insights into code.", + emoji: '⚡️', + header: 'Typed Linting', + href: '/getting-started/typed-linting', + }, +]; + +export function Explainers(): React.JSX.Element { + return ( +
+ + typescript-eslint enables ESLint, Prettier, and more to + support TypeScript code. + +
    + {explanations.map(({ header, ...rest }) => ( + + ))} +
+
+

+ ESLint is a linter. It runs a set of rules to find + likely problems and suggested fixes to improve your code. +

+

+ TypeScript is a language and a type checker. The + language adds syntax for types to JavaScript. +
+ The type checker analyzes code to find mismatches between uses of + values and types. +

+

+ typescript-eslint is necessary for JavaScript tools + such as ESLint to work with TypeScript's new syntax. +
+ It also adds lint rules for TypeScript, including many that use the + power of types to better analyze code. +

+
+ +
+ + Learn More + + + See the Rules + +
+
+ ); +} diff --git a/packages/website/src/components/home/Explainers/styles.module.css b/packages/website/src/components/home/Explainers/styles.module.css new file mode 100644 index 000000000000..6e7e07c7488a --- /dev/null +++ b/packages/website/src/components/home/Explainers/styles.module.css @@ -0,0 +1,56 @@ +.explainers { + --ifm-button-size-multiplier: 1.3; + + align-items: center; + display: flex; + flex-direction: column; + margin: 1rem; +} + +.explainerTexts { + font-size: 1.1rem; + margin: 1rem 2rem; + text-align: left; + display: flex; + gap: 1rem; + flex-direction: column; +} + +.explainerTexts p { + margin: 0; +} + +.explainerSpotlights { + display: flex; + flex-direction: column; + gap: 1rem; + margin: 2rem auto 2.5rem; +} + +.buttons { + margin: 1rem auto 0; + display: flex; + flex-direction: column; + gap: 1rem; +} + +@media (width >= 996px) { + .explainers { + margin-bottom: 2rem; + } + + .explainerSpotlights { + flex-direction: row; + max-width: var(--ifm-container-width); + } + + .explainerTexts { + margin: 0.5rem 2rem 2rem; + text-align: center; + } + + .buttons { + flex-direction: row; + gap: 2rem; + } +} diff --git a/packages/website/src/components/home/Feature.module.css b/packages/website/src/components/home/Feature.module.css new file mode 100644 index 000000000000..e807de939ad6 --- /dev/null +++ b/packages/website/src/components/home/Feature.module.css @@ -0,0 +1,6 @@ +.buttons { + align-items: center; + display: flex; + width: 100%; + justify-content: center; +} diff --git a/packages/website/src/components/home/FinancialContributors/index.tsx b/packages/website/src/components/home/FinancialContributors/index.tsx new file mode 100644 index 000000000000..2efdc0976fe2 --- /dev/null +++ b/packages/website/src/components/home/FinancialContributors/index.tsx @@ -0,0 +1,77 @@ +import Link from '@docusaurus/Link'; +import sponsors from '@site/data/sponsors.json'; +import Heading from '@theme/Heading'; +import clsx from 'clsx'; +import React from 'react'; + +import { Sponsors } from '../Sponsors'; +import styles from './styles.module.css'; + +export function FinancialContributors(): React.JSX.Element { + return ( +
+
+ + Financial Contributors + +

+ The typescript-eslint project would not be possible without the + generous support of our financial contributors. +

+
+ + + +
+

+ Financial sponsors allow us to keep development of typescript-eslint + going, including maintaining and improving the project, providing + support to users, and pushing web ecosystem static analysis forward + with advances in typed linting. +

+
+ + Become a financial sponsor + +
+ + All sponsors + + + Sponsorship docs + +
+
+
+
+ ); +} diff --git a/packages/website/src/components/FinancialContributors/styles.module.css b/packages/website/src/components/home/FinancialContributors/styles.module.css similarity index 78% rename from packages/website/src/components/FinancialContributors/styles.module.css rename to packages/website/src/components/home/FinancialContributors/styles.module.css index c30c1163c341..95fee5fd1f69 100644 --- a/packages/website/src/components/FinancialContributors/styles.module.css +++ b/packages/website/src/components/home/FinancialContributors/styles.module.css @@ -1,8 +1,15 @@ -.sponsorLink { - display: inline-flex; - flex-direction: column; - gap: 8px; - height: 100%; +.financialContributors { + align-items: center; + background: var(--ifm-color-emphasis-0); + display: flex; + text-align: center; + width: 100%; +} + +.details { + font-size: 1.2rem; + max-width: min(70vw, 70rem); + margin: 2rem auto; } .linksArea { @@ -57,10 +64,6 @@ grid-area: 2 / 2 / 3 / 3; } - .sponsorLink { - display: flex; - } - .linksArea { margin: 24px; } diff --git a/packages/website/src/components/FinancialContributors/types.ts b/packages/website/src/components/home/FinancialContributors/types.ts similarity index 100% rename from packages/website/src/components/FinancialContributors/types.ts rename to packages/website/src/components/home/FinancialContributors/types.ts diff --git a/packages/website/src/components/home/RecentBlogPosts/index.tsx b/packages/website/src/components/home/RecentBlogPosts/index.tsx new file mode 100644 index 000000000000..94ccd1929217 --- /dev/null +++ b/packages/website/src/components/home/RecentBlogPosts/index.tsx @@ -0,0 +1,48 @@ +import Link from '@docusaurus/Link'; +import recentPosts from '@site/data/recent-blog-posts.json'; +import Heading from '@theme/Heading'; +import clsx from 'clsx'; +import React from 'react'; +import Markdown from 'react-markdown'; + +import styles from './styles.module.css'; + +export function RecentBlogPosts(): React.JSX.Element { + return ( +
+ +
+ ); +} diff --git a/packages/website/src/components/home/RecentBlogPosts/styles.module.css b/packages/website/src/components/home/RecentBlogPosts/styles.module.css new file mode 100644 index 000000000000..26478b682905 --- /dev/null +++ b/packages/website/src/components/home/RecentBlogPosts/styles.module.css @@ -0,0 +1,84 @@ +.blogPosts { + background: var(--ifm-color-emphasis-100); + padding: 1rem 0; +} + +.postsList { + display: flex; + flex-direction: column; + gap: 1rem; + list-style: none; + margin: 2.5rem 0 1.5rem; + padding-left: 0; +} + +.post { + background: var(--ifm-color-emphasis-0); + border-radius: var(--ifm-global-radius); + display: flex; + flex-direction: column; + flex: 1; + padding: 1rem; + text-align: left; + transition: box-shadow 0.3s ease; +} + +[data-theme='dark'] .post { + background: var(--ifm-color-emphasis-200); +} + +.post:hover { + color: var(--ifm-heading-color); + text-decoration: none; + box-shadow: 0 3px 3px 0 var(--gray-border-shadow); +} + +.postLink, +.postLink:focus, +.postLink:hover { + color: initial; + text-decoration: none; + display: contents; +} + +.post p { + margin: 0; +} + +.postTitle { + font-weight: bold; + font-size: 1.2rem; + line-height: 1.25; + margin-bottom: 0.5rem; +} + +.postTiming { + align-items: flex-end; + display: flex; + flex-grow: 2; + font-size: 0.75rem; + font-style: italic; + gap: 0.35rem; + margin-top: 0.5rem; +} + +.seeAll { + font-size: 1.25rem; + padding: 0.75rem 1.75rem; + margin-top: 1.5rem; +} + +@media (width >= 996px) { + .blogPosts { + padding: 1rem 0 2rem; + } + + .postsList { + flex-direction: row; + gap: 2rem; + } + + .postTitle { + margin-bottom: 1rem; + } +} diff --git a/packages/website/src/components/FinancialContributors/Sponsor.tsx b/packages/website/src/components/home/Sponsor/index.tsx similarity index 90% rename from packages/website/src/components/FinancialContributors/Sponsor.tsx rename to packages/website/src/components/home/Sponsor/index.tsx index 3f3ce6d8036f..a2c90f871b02 100644 --- a/packages/website/src/components/FinancialContributors/Sponsor.tsx +++ b/packages/website/src/components/home/Sponsor/index.tsx @@ -1,7 +1,7 @@ import Link from '@docusaurus/Link'; import React from 'react'; -import type { SponsorData } from './types'; +import type { SponsorData } from '../FinancialContributors/types'; import styles from './styles.module.css'; diff --git a/packages/website/src/components/home/Sponsor/styles.module.css b/packages/website/src/components/home/Sponsor/styles.module.css new file mode 100644 index 000000000000..c722560fd076 --- /dev/null +++ b/packages/website/src/components/home/Sponsor/styles.module.css @@ -0,0 +1,12 @@ +.sponsorLink { + display: inline-flex; + flex-direction: column; + gap: 8px; + height: 100%; +} + +@media screen and (width >= 1150px) { + .sponsorLink { + display: flex; + } +} diff --git a/packages/website/src/components/FinancialContributors/Sponsors/index.tsx b/packages/website/src/components/home/Sponsors/index.tsx similarity index 91% rename from packages/website/src/components/FinancialContributors/Sponsors/index.tsx rename to packages/website/src/components/home/Sponsors/index.tsx index 68fc7cac4bfe..b3cf28471467 100644 --- a/packages/website/src/components/FinancialContributors/Sponsors/index.tsx +++ b/packages/website/src/components/home/Sponsors/index.tsx @@ -1,7 +1,7 @@ import clsx from 'clsx'; import React from 'react'; -import type { SponsorData } from '../types'; +import type { SponsorData } from '../FinancialContributors/types'; import { Sponsor } from '../Sponsor'; import styles from './styles.module.css'; diff --git a/packages/website/src/components/FinancialContributors/Sponsors/styles.module.css b/packages/website/src/components/home/Sponsors/styles.module.css similarity index 100% rename from packages/website/src/components/FinancialContributors/Sponsors/styles.module.css rename to packages/website/src/components/home/Sponsors/styles.module.css diff --git a/packages/website/src/pages/index.tsx b/packages/website/src/pages/index.tsx index 68befd7f8db2..5fd5fb883df0 100644 --- a/packages/website/src/pages/index.tsx +++ b/packages/website/src/pages/index.tsx @@ -1,188 +1,55 @@ import Link from '@docusaurus/Link'; import useBaseUrl from '@docusaurus/useBaseUrl'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import Heading from '@theme/Heading'; import Layout from '@theme/Layout'; import clsx from 'clsx'; import React from 'react'; -import { FinancialContributors } from '../components/FinancialContributors'; +import { Explainers } from '../components/home/Explainers'; +import { FinancialContributors } from '../components/home/FinancialContributors'; +import { RecentBlogPosts } from '../components/home/RecentBlogPosts'; import styles from './styles.module.css'; -interface FeatureItem { - description: React.JSX.Element; - imageUrl?: string; - title: string; -} - -const features: FeatureItem[] = [ - { - description: ( - <> -
-
- eslint -
-
-

- ESLint is an awesome linter for JavaScript code. -

-

- ESLint statically analyzes your code to quickly find problems. It - allows creating a series of assertions called lint rules around - what your code should look or behave like, as well as auto-fixer - suggestions to improve your code for you, and loading in lint - rules from shared plugins. -

-
-
-
-
- TypeScript -
-
-

- TypeScript is a strongly typed programming language that - builds on JavaScript. -

-

- TypeScript adds additional syntax to JavaScript that allows you to - declare the shapes of objects and functions in code. It provides a - set of language services that allow for running powerful - inferences and automations with that type information. -

-
-
- - ), - title: 'What are ESLint and TypeScript, and how do they compare?', - }, - { - description: ( -
-
-

- - typescript-eslint enables ESLint to run on TypeScript code. - {' '} - It brings in the best of both tools to help you write the best - JavaScript or TypeScript code you possibly can. -

-
-
-

- ESLint and TypeScript represent code differently internally. - ESLint's default JavaScript parser cannot natively read in - TypeScript-specific syntax and its rules don't natively have access - to TypeScript's type information. -

-
-
- typescript-eslint: -
    -
  • allows ESLint to parse TypeScript syntax
  • -
  • - creates a set of tools for ESLint rules to be able to use - TypeScript's type information -
  • -
  • - provides a large list of lint rules that are specific to - TypeScript and/or use that type information -
  • -
-
-
- ), - title: 'Why does this project exist?', - }, -]; - -function Feature({ description, title }: FeatureItem): React.JSX.Element { - return ( -
-
- - {title} - -
- {description} -
- - Get Started - -
-
- ); -} - function Home(): React.JSX.Element { const { siteConfig } = useDocusaurusContext(); return (
-
- Hero Logo -

{siteConfig.title}

-

{siteConfig.tagline}

-
- - Get Started - - - Playground - +
+
+

{siteConfig.title}

+

+ {siteConfig.tagline.replace(' code', '')} +

+
+ + Get Started + + + Playground + +
+
+
+ Hero Logo
- {features.map((props, idx) => ( -
-
-
- -
-
-
- ))} -
-
- - Financial Contributors - - -
-
+ + +
); diff --git a/packages/website/src/pages/styles.module.css b/packages/website/src/pages/styles.module.css index ee93e62557c6..2198015cabf8 100644 --- a/packages/website/src/pages/styles.module.css +++ b/packages/website/src/pages/styles.module.css @@ -18,9 +18,13 @@ text-align: center; } -.hero__logo { - height: 10rem; - width: 10rem; +.heroContainer { + display: flex; + justify-content: center; +} + +.heroRight { + display: none; } .hero__subtitle { @@ -34,17 +38,12 @@ flex-wrap: wrap; align-items: center; justify-content: center; + gap: 1rem; } .buttons a { --ifm-font-color-base: var(--ifm-color-white); --ifm-button-color: var(--ifm-color-white); - - margin: 1rem; -} - -.buttonCentered { - margin: auto; } .buttonPrimary { @@ -59,22 +58,33 @@ border: var(--ifm-button-border-width) solid var(--ifm-button-color); } -.lightBackground { - background: var(--ifm-color-emphasis-100); -} - -.features, -.sponsors { - display: flex; - align-items: center; - width: 100%; -} - -.sponsors { - text-align: center; -} - -.featureImage { - height: 7rem; - width: 7rem; +@media (width >= 996px) { + .heroContainer { + flex-direction: row; + gap: clamp(1rem, 10vw, 6rem); + } + + .heroLeft { + display: flex; + flex-direction: column; + justify-content: center; + text-align: left; + padding-bottom: 1rem; + } + + .buttons { + justify-content: flex-start; + } + + .heroRight { + display: initial; + } + + .heroLogo { + --hero-logo-size: clamp(5rem, 15vw, 15rem); + + height: var(--hero-logo-size); + user-select: none; + width: var(--hero-logo-size); + } } diff --git a/packages/website/static/manifest.json b/packages/website/static/manifest.json index 3eccbd4b2369..1b482ca36b80 100644 --- a/packages/website/static/manifest.json +++ b/packages/website/static/manifest.json @@ -1,6 +1,6 @@ { "background_color": "#443FD4", - "description": "Documentation for typescript-eslint: the tooling that enables ESLint to support TypeScript.", + "description": "Documentation for typescript-eslint: powerful static analysis for JavaScript and TypeScript.", "display": "standalone", "icons": [ { diff --git a/yarn.lock b/yarn.lock index 75440ea8db19..400a0f938286 100644 --- a/yarn.lock +++ b/yarn.lock @@ -20289,6 +20289,7 @@ __metadata: cross-fetch: "*" docusaurus-plugin-typedoc: ^1.4.0 eslint: ^9.15.0 + gray-matter: ^4.0.3 history: ^4.9.0 json5: ^2.2.3 konamimojisplosion: ^0.5.2 @@ -20304,6 +20305,7 @@ __metadata: react-dom: ^18.2.0 react-markdown: ^10.0.0 react-resizable-panels: ^3.0.0 + reading-time: ^1.5.0 rimraf: "*" semver: ^7.6.0 stylelint: ^16.3.1 @@ -20317,6 +20319,7 @@ __metadata: unified: ^11.0.4 vfile: ^6.0.1 webpack: ^5.91.0 + zod: ^3.25.67 languageName: unknown linkType: soft @@ -20869,10 +20872,10 @@ __metadata: languageName: node linkType: hard -"zod@npm:^3.22.4, zod@npm:^3.23.8, zod@npm:^3.24.2": - version: 3.24.3 - resolution: "zod@npm:3.24.3" - checksum: 9c3976e61cec25908f3405502abdf28ab1893afd5182c6739a30375c5c6bf4b9b6ea7e78735324e5ac63571c160ce607ebe320ff389b044223c357ccc2f8c94c +"zod@npm:^3.22.4, zod@npm:^3.23.8, zod@npm:^3.24.2, zod@npm:^3.25.67": + version: 3.25.67 + resolution: "zod@npm:3.25.67" + checksum: 56ab904d33b1cd00041ce64ae05b0628fcbfeb7e707fa31cd498a97b540135e4dfe685200c9c62aea307695ee132870b4bc34f035228ea728aa75cc96a4954cb languageName: node linkType: hard From 43135d88640041725ba2a3316609262a69b347c9 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 4 Jul 2025 09:30:35 -0400 Subject: [PATCH 073/283] chore: fix generate-sponsors complaint --- tools/scripts/generate-sponsors.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/generate-sponsors.mts b/tools/scripts/generate-sponsors.mts index 1bdb3b094c4c..f56d128d27dc 100644 --- a/tools/scripts/generate-sponsors.mts +++ b/tools/scripts/generate-sponsors.mts @@ -1,4 +1,4 @@ -import type { SponsorData } from 'website/src/components/FinancialContributors/types.ts'; +import type { SponsorData } from 'website/src/components/home/FinancialContributors/types.ts'; import fetch from 'cross-fetch'; import * as fs from 'node:fs'; From 7ec793193d7b9c6c9928191e462c54b10b177723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Sat, 5 Jul 2025 12:09:55 -0500 Subject: [PATCH 074/283] chore: fix website lint task to rely on build (#11377) --- packages/website/package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/website/package.json b/packages/website/package.json index 117723cf3ace..528850f495fd 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -113,7 +113,10 @@ } }, "lint": { - "command": "eslint" + "command": "eslint", + "dependsOn": [ + "build" + ] }, "start": { "command": "docusaurus start", From 1ca81c14ba904e52be6726eb20c79bbcab57243c Mon Sep 17 00:00:00 2001 From: Vinccool96 Date: Sun, 6 Jul 2025 18:14:40 -0400 Subject: [PATCH 075/283] chore(eslint-plugin): switch auto-generated test cases to hand-written in no-unused-expressions.test.ts (#11347) Switch to handwritten test cases and fixed messageId --- .../tests/rules/no-unused-expressions.test.ts | 229 +++++++++--------- .../eslint-plugin/typings/eslint-rules.d.ts | 2 +- 2 files changed, 120 insertions(+), 111 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts b/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts index 567b206a42ad..fa3159a96aa2 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts @@ -1,6 +1,4 @@ -import type { TestCaseError } from '@typescript-eslint/rule-tester'; - -import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; +import { RuleTester } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/no-unused-expressions'; @@ -12,20 +10,6 @@ const ruleTester = new RuleTester({ }, }); -type RuleTestCaseError = Omit, 'messageId'>; - -// the base rule doesn't have messageIds -function error( - messages: RuleTestCaseError[], - // eslint-disable-next-line @typescript-eslint/no-explicit-any -): any[] { - return messages.map(message => ({ - ...message, - message: - 'Expected an assignment or function call and instead saw an expression.', - })); -} - ruleTester.run('no-unused-expressions', rule, { valid: [ ` @@ -91,37 +75,40 @@ ruleTester.run('no-unused-expressions', rule, { ], invalid: [ { - code: ` -if (0) 0; - `, - errors: error([ + code: 'if (0) 0;', + errors: [ { column: 8, - line: 2, + endColumn: 10, + endLine: 1, + line: 1, + messageId: 'unusedExpression', }, - ]), + ], }, { - code: ` -f(0), {}; - `, - errors: error([ + code: 'f(0), {};', + errors: [ { column: 1, - line: 2, + endColumn: 10, + endLine: 1, + line: 1, + messageId: 'unusedExpression', }, - ]), + ], }, { - code: ` -a, b(); - `, - errors: error([ + code: 'a, b();', + errors: [ { column: 1, - line: 2, + endColumn: 8, + endLine: 1, + line: 1, + messageId: 'unusedExpression', }, - ]), + ], }, { code: ` @@ -130,100 +117,111 @@ a() && f(); }; `, - errors: error([ + errors: [ { column: 1, + endColumn: 5, + endLine: 5, line: 2, + messageId: 'unusedExpression', }, - ]), + ], }, { - code: ` -a?.b; - `, - errors: error([ + code: 'a?.b;', + errors: [ { column: 1, - line: 2, + endColumn: 6, + endLine: 1, + line: 1, + messageId: 'unusedExpression', }, - ]), + ], }, { - code: ` -(a?.b).c; - `, - errors: error([ + code: '(a?.b).c;', + errors: [ { column: 1, - line: 2, + endColumn: 10, + endLine: 1, + line: 1, + messageId: 'unusedExpression', }, - ]), + ], }, { - code: ` -a?.['b']; - `, - errors: error([ + code: "a?.['b'];", + errors: [ { column: 1, - line: 2, + endColumn: 10, + endLine: 1, + line: 1, + messageId: 'unusedExpression', }, - ]), + ], }, { - code: ` -(a?.['b']).c; - `, - errors: error([ + code: "(a?.['b']).c;", + errors: [ { column: 1, - line: 2, + endColumn: 14, + endLine: 1, + line: 1, + messageId: 'unusedExpression', }, - ]), + ], }, { - code: ` -a?.b()?.c; - `, - errors: error([ + code: 'a?.b()?.c;', + errors: [ { column: 1, - line: 2, + endColumn: 11, + endLine: 1, + line: 1, + messageId: 'unusedExpression', }, - ]), + ], }, { - code: ` -(a?.b()).c; - `, - errors: error([ + code: '(a?.b()).c;', + errors: [ { column: 1, - line: 2, + endColumn: 12, + endLine: 1, + line: 1, + messageId: 'unusedExpression', }, - ]), + ], }, { - code: ` -one[2]?.[3][4]; - `, - errors: error([ + code: 'one[2]?.[3][4];', + errors: [ { column: 1, - line: 2, + endColumn: 16, + endLine: 1, + line: 1, + messageId: 'unusedExpression', }, - ]), + ], }, { - code: ` -one.two?.three.four; - `, - errors: error([ + code: 'one.two?.three.four;', + errors: [ { column: 1, - line: 2, + endColumn: 21, + endLine: 1, + line: 1, + messageId: 'unusedExpression', }, - ]), + ], }, { code: ` @@ -232,14 +230,15 @@ module Foo { 'use strict'; } `, - errors: error([ + errors: [ { column: 3, endColumn: 16, endLine: 4, line: 4, + messageId: 'unusedExpression', }, - ]), + ], }, { code: ` @@ -250,54 +249,58 @@ namespace Foo { 'use strict'; } `, - errors: error([ + errors: [ { column: 3, endColumn: 16, endLine: 6, line: 6, + messageId: 'unusedExpression', }, - ]), + ], }, { - code: noFormat` + code: ` function foo() { const foo = true; - 'use strict'; + ('use strict'); } `, - errors: error([ + errors: [ { column: 3, - endColumn: 16, + endColumn: 18, endLine: 5, line: 5, + messageId: 'unusedExpression', }, - ]), + ], }, { code: 'foo && foo?.bar;', - errors: error([ + errors: [ { column: 1, endColumn: 17, endLine: 1, line: 1, + messageId: 'unusedExpression', }, - ]), + ], options: [{ allowShortCircuit: true }], }, { code: 'foo ? foo?.bar : bar.baz;', - errors: error([ + errors: [ { column: 1, endColumn: 26, endLine: 1, line: 1, + messageId: 'unusedExpression', }, - ]), + ], options: [{ allowTernary: true }], }, { @@ -305,81 +308,87 @@ function foo() { class Foo {} Foo; `, - errors: error([ + errors: [ { column: 1, endColumn: 13, endLine: 3, line: 3, + messageId: 'unusedExpression', }, - ]), + ], }, { code: 'Map;', - errors: error([ + errors: [ { column: 1, endColumn: 21, endLine: 1, line: 1, + messageId: 'unusedExpression', }, - ]), + ], }, { code: ` declare const foo: number | undefined; foo; `, - errors: error([ + errors: [ { column: 1, endColumn: 5, endLine: 3, line: 3, + messageId: 'unusedExpression', }, - ]), + ], }, { code: ` declare const foo: number | undefined; foo as any; `, - errors: error([ + errors: [ { column: 1, endColumn: 12, endLine: 3, line: 3, + messageId: 'unusedExpression', }, - ]), + ], }, { code: ` declare const foo: number | undefined; foo; `, - errors: error([ + errors: [ { column: 1, endColumn: 10, endLine: 3, line: 3, + messageId: 'unusedExpression', }, - ]), + ], }, { code: ` declare const foo: number | undefined; foo!; `, - errors: error([ + errors: [ { column: 1, endColumn: 6, endLine: 3, line: 3, + messageId: 'unusedExpression', }, - ]), + ], }, ], }); diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts index 0a72f5b1ed80..b7a830094823 100644 --- a/packages/eslint-plugin/typings/eslint-rules.d.ts +++ b/packages/eslint-plugin/typings/eslint-rules.d.ts @@ -345,7 +345,7 @@ declare module 'eslint/lib/rules/no-unused-expressions' { import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< - 'expected', + 'unusedExpression', [ { allowShortCircuit?: boolean; From 4a60d3e96cba7a4b8c2721c2d5fd15a68076bf4e Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Sun, 6 Jul 2025 16:31:37 -0600 Subject: [PATCH 076/283] docs(eslint-plugin): [only-throw-error] document options (#11348) * docs(eslint-plugin): [only-throw-error] document options * wording --- .../docs/rules/only-throw-error.mdx | 155 +++++++++++++++--- .../only-throw-error.shot | 105 +++++++++--- 2 files changed, 206 insertions(+), 54 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/only-throw-error.mdx b/packages/eslint-plugin/docs/rules/only-throw-error.mdx index fe7fbdb20e53..f3b97a91a625 100644 --- a/packages/eslint-plugin/docs/rules/only-throw-error.mdx +++ b/packages/eslint-plugin/docs/rules/only-throw-error.mdx @@ -23,7 +23,7 @@ The new name is a drop-in replacement with identical functionality. ## Examples -This rule is aimed at maintaining consistency when throwing exception by disallowing to throw literals and other expressions which cannot possibly be an `Error` object. +This rule is aimed at maintaining consistency when throwing exceptions by disallowing throwing values that are not `Error` objects. @@ -35,26 +35,20 @@ throw 0; throw undefined; -throw null; - -const err = new Error(); -throw 'an ' + err; - -const err = new Error(); -throw `${err}`; - -const err = ''; -throw err; - -function getError() { +function getErrorString(): string { return ''; } -throw getError(); +throw getErrorString(); const foo = { - bar: '', + bar: 'error string', }; throw foo.bar; + +class SomeClass { + // ... +} +throw new SomeClass(); ``` @@ -68,15 +62,6 @@ throw new Error('error'); const e = new Error('error'); throw e; -try { - throw new Error('error'); -} catch (e) { - throw e; -} - -const err = new Error(); -throw err; - function getError() { return new Error(); } @@ -108,16 +93,16 @@ interface Options { allow?: ( | { from: 'file'; - name: [string, ...string[]] | string; + name: string[] | string; path?: string; } | { from: 'lib'; - name: [string, ...string[]] | string; + name: string[] | string; } | { from: 'package'; - name: [string, ...string[]] | string; + name: string[] | string; package: string; } | string @@ -147,4 +132,120 @@ const defaultOptions: Options = { }; ``` +### allowThrowingAny + +When set to `true`, this option allows throwing values typed as `any`. + +Examples of **correct** code with `{ allowThrowingAny: true }`: + +```ts option='{ "allowThrowingAny": true }' showPlaygroundButton +function throwAny(value: any) { + throw value; +} +``` + +### allowThrowingUnknown + +When set to `true`, this option allows throwing values typed as `unknown`. + +Examples of **correct** code with `{ allowThrowingUnknown: true }`: + +```ts option='{ "allowThrowingUnknown": true }' showPlaygroundButton +function throwUnknown(value: unknown) { + throw value; +} +``` + +### allowRethrowing + +When set to `true`, this option allows throwing caught values. +This is intended to be used in order to make patterns involving rethrowing exceptions less painful for users who set `allowThrowingAny`/`allowThrowingUnknown` to `false`. + +Examples of **correct** code with `{ allowRethrowing: true, allowThrowingAny: false, allowThrowingUnknown: false }`: + +```ts option='{ "allowRethrowing": true, "allowThrowingAny": false, "allowThrowingUnknown": false }' showPlaygroundButton +declare function mightThrow(): void; +declare class SomeSpecificError extends Error { + // ... +} + +function foo() { + try { + mightThrow(); + } catch (e) { + if (e instanceof SomeSpecificError) { + // handle specific error ... + return; + } + + // unexpected error that we shouldn't catch. + throw e; + } +} + +declare function mightReject(): Promise; + +mightReject().catch(e => { + if (e instanceof SomeSpecificError) { + // handle specific error ... + return; + } + + // unexpected error that we can't handle + throw e; +}); + +declare function log(message: string): void; + +function bar() { + log('starting bar()'); + let wasError = false; + try { + // ... + } catch (e) { + wasError = true; + throw e; + } finally { + log(`completed bar() ${wasError ? 'with error' : 'successfully'}`); + } +} +``` + +:::note + +While it makes sense to rethrow errors in some cases, it is likely more common that one would want to create a new `Error` and set its [`cause`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause) appropriately. + +```ts +function foo() { + try { + // ... + } catch (e) { + throw new Error('Could not complete foo()', { cause: e }); + } +} +``` + +::: + +### allow + +This option takes the shared [`TypeOrValueSpecifier` format](/packages/type-utils/type-or-value-specifier) to allow throwing values that are not `Error` objects. +While we strongly recommend that you only create custom error classes that extend `Error`, this option can be useful for throwing errors defined by libraries that do not follow this convention. + +Examples of code for this rule with: + +```jsonc +{ + "allow": [{ "from": "file", "name": "CustomError" }], +} +``` + +```ts option='{ "allow": [{ "from": "file", "name": "CustomError" }] }' showPlaygroundButton +class CustomError /* does NOT extend Error */ { + // ... +} + +throw new CustomError(); +``` + {/* Intentionally Omitted: When Not To Use It */} diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/only-throw-error.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/only-throw-error.shot index a80221b72f8e..b91ec3c08a90 100644 --- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/only-throw-error.shot +++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/only-throw-error.shot @@ -9,32 +9,24 @@ throw 0; throw undefined; ~~~~~~~~~ Do not throw undefined. -throw null; - ~~~~ Expected an error object to be thrown. - -const err = new Error(); -throw 'an ' + err; - ~~~~~~~~~~~ Expected an error object to be thrown. - -const err = new Error(); -throw `${err}`; - ~~~~~~~~ Expected an error object to be thrown. - -const err = ''; -throw err; - -function getError() { +function getErrorString(): string { return ''; } -throw getError(); - ~~~~~~~~~~ Expected an error object to be thrown. +throw getErrorString(); + ~~~~~~~~~~~~~~~~ Expected an error object to be thrown. const foo = { - bar: '', + bar: 'error string', }; throw foo.bar; ~~~~~~~ Expected an error object to be thrown. +class SomeClass { + // ... +} +throw new SomeClass(); + ~~~~~~~~~~~~~~~ Expected an error object to be thrown. + Correct throw new Error(); @@ -44,15 +36,6 @@ throw new Error('error'); const e = new Error('error'); throw e; -try { - throw new Error('error'); -} catch (e) { - throw e; -} - -const err = new Error(); -throw err; - function getError() { return new Error(); } @@ -67,3 +50,71 @@ class CustomError extends Error { // ... } throw new CustomError(); + +Options: { "allowThrowingAny": true } + +function throwAny(value: any) { + throw value; +} + +Options: { "allowThrowingUnknown": true } + +function throwUnknown(value: unknown) { + throw value; +} + +Options: { "allowRethrowing": true, "allowThrowingAny": false, "allowThrowingUnknown": false } + +declare function mightThrow(): void; +declare class SomeSpecificError extends Error { + // ... +} + +function foo() { + try { + mightThrow(); + } catch (e) { + if (e instanceof SomeSpecificError) { + // handle specific error ... + return; + } + + // unexpected error that we shouldn't catch. + throw e; + } +} + +declare function mightReject(): Promise; + +mightReject().catch(e => { + if (e instanceof SomeSpecificError) { + // handle specific error ... + return; + } + + // unexpected error that we can't handle + throw e; +}); + +declare function log(message: string): void; + +function bar() { + log('starting bar()'); + let wasError = false; + try { + // ... + } catch (e) { + wasError = true; + throw e; + } finally { + log(`completed bar() ${wasError ? 'with error' : 'successfully'}`); + } +} + +Options: { "allow": [{ "from": "file", "name": "CustomError" }] } + +class CustomError /* does NOT extend Error */ { + // ... +} + +throw new CustomError(); From c81ba15ab439b6880157dd2bd41fc830f903e8b5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 6 Jul 2025 17:31:54 -0600 Subject: [PATCH 077/283] chore(deps): update dependency globals to v16.1.0 (#11215) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 400a0f938286..28c7328d83d7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11185,9 +11185,9 @@ __metadata: linkType: hard "globals@npm:^16.0.0": - version: 16.0.0 - resolution: "globals@npm:16.0.0" - checksum: 41df1cb6f86c36dfdf8fb6c270247105c85cc3aec8d8238c5e691b0d2aad9eed8ff390d1035f4b5a27ee24bf75b095c7b84717e9d2050d2122e61f37d9c6131a + version: 16.1.0 + resolution: "globals@npm:16.1.0" + checksum: b6ed722b61a6c37c057a71d9433c08196ad57cd1e86ed160a82f5a488310b2d85cc593f17414bad00bf88f1e6f4f8387d2014f9ac859a16ccf2a0df77a1aac45 languageName: node linkType: hard From 25728c230968d09164483e29e0eddfc0e663055f Mon Sep 17 00:00:00 2001 From: Kim Sang Du Date: Mon, 7 Jul 2025 21:27:47 +0900 Subject: [PATCH 078/283] chore(website): show tsconfig parsing errors in tab (#10991) * WIP * feat: add tsconfig error * fix: remove console.log & not use code * fix: fix code review --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .../website/src/components/ErrorsViewer.tsx | 2 +- .../website/src/components/Playground.tsx | 14 +++++-- .../src/components/editor/LoadedEditor.tsx | 19 ++++++++- .../website/src/components/editor/types.ts | 4 +- .../components/editor/useSandboxServices.ts | 1 + .../src/components/linter/createLinter.ts | 42 ++++++++++++++++++- packages/website/src/components/types.ts | 4 +- 7 files changed, 75 insertions(+), 11 deletions(-) diff --git a/packages/website/src/components/ErrorsViewer.tsx b/packages/website/src/components/ErrorsViewer.tsx index b9f6528672be..b37597f69483 100644 --- a/packages/website/src/components/ErrorsViewer.tsx +++ b/packages/website/src/components/ErrorsViewer.tsx @@ -86,7 +86,7 @@ function ErrorBlock({ )} - {item.suggestions.length > 0 && ( + {item.suggestions && item.suggestions.length > 0 && (
{item.suggestions.map((fixer, index) => (
(); - const [markers, setMarkers] = useState(); + const [markers, setMarkers] = useState>({ + code: [], + eslintrc: [], + tsconfig: [], + }); const [ruleNames, setRuleNames] = useState([]); const [isLoading, setIsLoading] = useState(true); const [tsVersions, setTSVersion] = useState([]); @@ -165,8 +169,10 @@ function Playground(): React.JSX.Element { active={state.showAST ?? false} additionalTabsInfo={{ Errors: - markers?.reduce((prev, cur) => prev + cur.items.length, 0) || - 0, + markers[activeTab].reduce( + (prev, cur) => prev + cur.items.length, + 0, + ) || 0, }} change={showAST => setState({ showAST })} tabs={detailTabs} @@ -216,7 +222,7 @@ function Playground(): React.JSX.Element { /> ) ) : ( - + )}
diff --git a/packages/website/src/components/editor/LoadedEditor.tsx b/packages/website/src/components/editor/LoadedEditor.tsx index 0cc5dbe16299..1b7937e5244a 100644 --- a/packages/website/src/components/editor/LoadedEditor.tsx +++ b/packages/website/src/components/editor/LoadedEditor.tsx @@ -83,8 +83,23 @@ export const LoadedEditor: React.FC = ({ const markers = monaco.editor.getModelMarkers({ resource: model.uri, }); - onMarkersChange(parseMarkers(markers, codeActions, editor)); - }, [codeActions, onMarkersChange, editor, monaco.editor]); + + const errors = parseMarkers(markers, codeActions, editor); + + onMarkersChange(prev => { + const tsconfigErrors = + activeTab === 'tsconfig' && + !errors.length && + Object.values(prev[activeTab]).filter( + error => error.group === 'TypeScript', + ); + + return { + ...prev, + [activeTab]: tsconfigErrors || errors, + }; + }); + }, [activeTab, codeActions, onMarkersChange, editor, monaco.editor]); useEffect(() => { webLinter.updateParserOptions(sourceType); diff --git a/packages/website/src/components/editor/types.ts b/packages/website/src/components/editor/types.ts index 3b8b41a67944..932f7cf5d9ad 100644 --- a/packages/website/src/components/editor/types.ts +++ b/packages/website/src/components/editor/types.ts @@ -5,7 +5,9 @@ export interface CommonEditorProps extends ConfigModel { readonly activeTab: TabType; readonly onASTChange: (value: UpdateModel | undefined) => void; readonly onChange: (cfg: Partial) => void; - readonly onMarkersChange: (value: ErrorGroup[]) => void; + readonly onMarkersChange: React.Dispatch< + React.SetStateAction> + >; readonly onSelect: (position?: number) => void; readonly selectedRange?: SelectedRange; } diff --git a/packages/website/src/components/editor/useSandboxServices.ts b/packages/website/src/components/editor/useSandboxServices.ts index 9c2b2ff669e3..0e46551a2350 100644 --- a/packages/website/src/components/editor/useSandboxServices.ts +++ b/packages/website/src/components/editor/useSandboxServices.ts @@ -119,6 +119,7 @@ export const useSandboxServices = ( system, lintUtils, sandboxInstance.tsvfs, + props.onMarkersChange, ); onModelCreate.register(webLinter.registerFile); diff --git a/packages/website/src/components/linter/createLinter.ts b/packages/website/src/components/linter/createLinter.ts index 21620b6dd779..eefd1b0e4287 100644 --- a/packages/website/src/components/linter/createLinter.ts +++ b/packages/website/src/components/linter/createLinter.ts @@ -7,6 +7,10 @@ import type { } from '@typescript-eslint/utils/ts-eslint'; import type * as ts from 'typescript'; +import type { + ErrorGroup, + TabType, +} from '../../../../website/src/components/types'; import type { LinterOnLint, LinterOnParse, @@ -44,6 +48,9 @@ export function createLinter( system: PlaygroundSystem, webLinterModule: WebLinterModule, vfs: typeof tsvfs, + onMarkersChange: React.Dispatch< + React.SetStateAction> + >, ): CreateLinter { const rules: CreateLinter['rules'] = new Map(); const configs = new Map(Object.entries(webLinterModule.configs)); @@ -155,6 +162,8 @@ export function createLinter( }; const applyTSConfig = (fileName: string): void => { + let error: ErrorGroup | null = null; + try { const file = system.readFile(fileName) ?? '{}'; const parsed = parseTSConfig(file).compilerOptions; @@ -162,7 +171,38 @@ export function createLinter( console.log('[Editor] Updating', fileName, compilerOptions); parser.updateConfig(compilerOptions); } catch (e) { - console.error(e); + if (e instanceof Error) { + error = { + group: 'TypeScript', + items: e.message + .trim() + .split('\n') + .map((message: string) => { + return { + message, + severity: 8, // MarkerSeverity.Error + }; + }), + uri: undefined, + }; + } + } finally { + onMarkersChange(prev => { + const activeTabErrors = Object.fromEntries( + prev.tsconfig.map(error => [error.group, error]), + ); + + if (error) { + activeTabErrors.TypeScript = error; + } else { + delete activeTabErrors.TypeScript; + } + + return { + ...prev, + tsconfig: Object.values(activeTabErrors), + }; + }); } }; diff --git a/packages/website/src/components/types.ts b/packages/website/src/components/types.ts index 181e1e5de39b..7dc1e913b1f1 100644 --- a/packages/website/src/components/types.ts +++ b/packages/website/src/components/types.ts @@ -40,10 +40,10 @@ export type SelectedRange = [number, number]; export interface ErrorItem { fixer?: { fix(): void; message: string }; - location: string; + location?: string; message: string; severity: number; - suggestions: { fix(): void; message: string }[]; + suggestions?: { fix(): void; message: string }[]; } export interface ErrorGroup { From 5e3288a94b4029f26aec983cc910b9146626dc28 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Mon, 7 Jul 2025 07:29:08 -0500 Subject: [PATCH 079/283] chore(project-service): sync `vitest` config with latest setup (#11237) * chore(`project-service`): sync `vitest` config with latest setup * revert dependency changes --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- packages/project-service/package.json | 6 + .../getParsedConfigFileFromTSServer.test.ts | 2 +- packages/project-service/tsconfig.build.json | 12 +- packages/project-service/tsconfig.json | 3 - packages/project-service/tsconfig.spec.json | 6 +- packages/project-service/tsconfig.tools.json | 10 - packages/project-service/vitest.config.mts | 1 - packages/tsconfig-utils/package.json | 6 + yarn.lock | 355 ++++++++++++++++-- 9 files changed, 339 insertions(+), 62 deletions(-) delete mode 100644 packages/project-service/tsconfig.tools.json diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 084f4236b345..4ab1ee398189 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -53,6 +53,12 @@ "@typescript-eslint/types": "^8.35.1", "debug": "^4.3.4" }, + "devDependencies": { + "@vitest/coverage-v8": "^3.1.3", + "rimraf": "*", + "typescript": "*", + "vitest": "^3.1.3" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" diff --git a/packages/project-service/tests/getParsedConfigFileFromTSServer.test.ts b/packages/project-service/tests/getParsedConfigFileFromTSServer.test.ts index f6f868bd0096..422ac4e743e5 100644 --- a/packages/project-service/tests/getParsedConfigFileFromTSServer.test.ts +++ b/packages/project-service/tests/getParsedConfigFileFromTSServer.test.ts @@ -1,6 +1,6 @@ import type * as ts from 'typescript/lib/tsserverlibrary'; -import { getParsedConfigFileFromTSServer } from '../src/getParsedConfigFileFromTSServer'; +import { getParsedConfigFileFromTSServer } from '../src/getParsedConfigFileFromTSServer.js'; const mockGetParsedConfigFile = vi.fn(); diff --git a/packages/project-service/tsconfig.build.json b/packages/project-service/tsconfig.build.json index d9cc02f3ba7c..d42ee3d2bef0 100644 --- a/packages/project-service/tsconfig.build.json +++ b/packages/project-service/tsconfig.build.json @@ -1,14 +1,6 @@ { - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "baseUrl": ".", - "rootDir": "src", - "outDir": "dist", - "tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo", - "emitDeclarationOnly": false, - "types": ["node"] - }, - "include": ["src/**/*.ts"], + "extends": "../../tsconfig.build.json", + "compilerOptions": {}, "references": [ { "path": "../tsconfig-utils/tsconfig.build.json" diff --git a/packages/project-service/tsconfig.json b/packages/project-service/tsconfig.json index 7d8d748caa17..8029bc0ac19d 100644 --- a/packages/project-service/tsconfig.json +++ b/packages/project-service/tsconfig.json @@ -12,9 +12,6 @@ { "path": "./tsconfig.build.json" }, - { - "path": "./tsconfig.tools.json" - }, { "path": "./tsconfig.spec.json" } diff --git a/packages/project-service/tsconfig.spec.json b/packages/project-service/tsconfig.spec.json index 872d3c655b27..ea9b824aaa01 100644 --- a/packages/project-service/tsconfig.spec.json +++ b/packages/project-service/tsconfig.spec.json @@ -1,12 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc/packages/types/vitest", - "resolveJsonModule": true, - "types": ["vitest/globals", "vitest/importMeta"] + "outDir": "../../dist/packages/project-service" }, - "include": ["vitest.config.mts", "package.json", "tests"], - "exclude": ["**/fixtures/**"], "references": [ { "path": "./tsconfig.build.json" diff --git a/packages/project-service/tsconfig.tools.json b/packages/project-service/tsconfig.tools.json deleted file mode 100644 index cf7f584666a9..000000000000 --- a/packages/project-service/tsconfig.tools.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "../../dist/out-tsc/packages/types/tools", - "module": "NodeNext", - "types": ["node"] - }, - "include": ["tools"], - "references": [] -} diff --git a/packages/project-service/vitest.config.mts b/packages/project-service/vitest.config.mts index 136e4f77b392..e2307404d05d 100644 --- a/packages/project-service/vitest.config.mts +++ b/packages/project-service/vitest.config.mts @@ -13,7 +13,6 @@ const vitestConfig = mergeConfig( test: { dir: path.join(import.meta.dirname, 'tests'), name: packageJson.name.replace('@typescript-eslint/', ''), - passWithNoTests: true, root: import.meta.dirname, }, }), diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index a9746fdccfe6..c098eebc3fc7 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -47,6 +47,12 @@ "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" }, + "devDependencies": { + "@vitest/coverage-v8": "^3.1.3", + "rimraf": "*", + "typescript": "*", + "vitest": "^3.1.3" + }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" diff --git a/yarn.lock b/yarn.lock index 28c7328d83d7..cb0861a27a57 100644 --- a/yarn.lock +++ b/yarn.lock @@ -509,7 +509,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.25.4, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": version: 7.27.2 resolution: "@babel/parser@npm:7.27.2" dependencies: @@ -520,6 +520,17 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.25.4": + version: 7.27.3 + resolution: "@babel/parser@npm:7.27.3" + dependencies: + "@babel/types": ^7.27.3 + bin: + parser: ./bin/babel-parser.js + checksum: aef2cfd154e47a639615d173d3f05a8ce8007fcc5a0ade013c953adee71a8bc19465a147e060cc67388fd748b62a3b42bf3b5cc3e83d4f8add526b3b722e2231 + languageName: node + linkType: hard + "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.25.9": version: 7.25.9 resolution: "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.25.9" @@ -1527,7 +1538,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.3, @babel/types@npm:^7.25.4, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0, @babel/types@npm:^7.27.1, @babel/types@npm:^7.4.4": +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.3, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0, @babel/types@npm:^7.27.1, @babel/types@npm:^7.4.4": version: 7.27.1 resolution: "@babel/types@npm:7.27.1" dependencies: @@ -1537,6 +1548,16 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.25.4, @babel/types@npm:^7.27.3": + version: 7.27.3 + resolution: "@babel/types@npm:7.27.3" + dependencies: + "@babel/helper-string-parser": ^7.27.1 + "@babel/helper-validator-identifier": ^7.27.1 + checksum: f0d43c0231f3ebc118480e149292dcd92ea128e2650285ced99ff2e5610db2171305f59aa07406ba0cb36af8e4331a53a69576d6b0c3f3176144dd3ad514b9ae + languageName: node + linkType: hard + "@bcoe/v8-coverage@npm:^1.0.2": version: 1.0.2 resolution: "@bcoe/v8-coverage@npm:1.0.2" @@ -3364,6 +3385,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/aix-ppc64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/aix-ppc64@npm:0.25.5" + conditions: os=aix & cpu=ppc64 + languageName: node + linkType: hard + "@esbuild/android-arm64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/android-arm64@npm:0.20.2" @@ -3378,6 +3406,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/android-arm64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/android-arm64@npm:0.25.5" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/android-arm@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/android-arm@npm:0.20.2" @@ -3392,6 +3427,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/android-arm@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/android-arm@npm:0.25.5" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + "@esbuild/android-x64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/android-x64@npm:0.20.2" @@ -3406,6 +3448,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/android-x64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/android-x64@npm:0.25.5" + conditions: os=android & cpu=x64 + languageName: node + linkType: hard + "@esbuild/darwin-arm64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/darwin-arm64@npm:0.20.2" @@ -3420,6 +3469,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/darwin-arm64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/darwin-arm64@npm:0.25.5" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/darwin-x64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/darwin-x64@npm:0.20.2" @@ -3434,6 +3490,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/darwin-x64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/darwin-x64@npm:0.25.5" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + "@esbuild/freebsd-arm64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/freebsd-arm64@npm:0.20.2" @@ -3448,6 +3511,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/freebsd-arm64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/freebsd-arm64@npm:0.25.5" + conditions: os=freebsd & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/freebsd-x64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/freebsd-x64@npm:0.20.2" @@ -3462,6 +3532,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/freebsd-x64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/freebsd-x64@npm:0.25.5" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + "@esbuild/linux-arm64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/linux-arm64@npm:0.20.2" @@ -3476,6 +3553,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-arm64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/linux-arm64@npm:0.25.5" + conditions: os=linux & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/linux-arm@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/linux-arm@npm:0.20.2" @@ -3490,6 +3574,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-arm@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/linux-arm@npm:0.25.5" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + "@esbuild/linux-ia32@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/linux-ia32@npm:0.20.2" @@ -3504,6 +3595,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-ia32@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/linux-ia32@npm:0.25.5" + conditions: os=linux & cpu=ia32 + languageName: node + linkType: hard + "@esbuild/linux-loong64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/linux-loong64@npm:0.20.2" @@ -3518,6 +3616,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-loong64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/linux-loong64@npm:0.25.5" + conditions: os=linux & cpu=loong64 + languageName: node + linkType: hard + "@esbuild/linux-mips64el@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/linux-mips64el@npm:0.20.2" @@ -3532,6 +3637,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-mips64el@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/linux-mips64el@npm:0.25.5" + conditions: os=linux & cpu=mips64el + languageName: node + linkType: hard + "@esbuild/linux-ppc64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/linux-ppc64@npm:0.20.2" @@ -3546,6 +3658,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-ppc64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/linux-ppc64@npm:0.25.5" + conditions: os=linux & cpu=ppc64 + languageName: node + linkType: hard + "@esbuild/linux-riscv64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/linux-riscv64@npm:0.20.2" @@ -3560,6 +3679,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-riscv64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/linux-riscv64@npm:0.25.5" + conditions: os=linux & cpu=riscv64 + languageName: node + linkType: hard + "@esbuild/linux-s390x@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/linux-s390x@npm:0.20.2" @@ -3574,6 +3700,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-s390x@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/linux-s390x@npm:0.25.5" + conditions: os=linux & cpu=s390x + languageName: node + linkType: hard + "@esbuild/linux-x64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/linux-x64@npm:0.20.2" @@ -3588,6 +3721,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/linux-x64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/linux-x64@npm:0.25.5" + conditions: os=linux & cpu=x64 + languageName: node + linkType: hard + "@esbuild/netbsd-arm64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/netbsd-arm64@npm:0.25.4" @@ -3595,6 +3735,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/netbsd-arm64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/netbsd-arm64@npm:0.25.5" + conditions: os=netbsd & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/netbsd-x64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/netbsd-x64@npm:0.20.2" @@ -3609,6 +3756,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/netbsd-x64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/netbsd-x64@npm:0.25.5" + conditions: os=netbsd & cpu=x64 + languageName: node + linkType: hard + "@esbuild/openbsd-arm64@npm:0.25.4": version: 0.25.4 resolution: "@esbuild/openbsd-arm64@npm:0.25.4" @@ -3616,6 +3770,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/openbsd-arm64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/openbsd-arm64@npm:0.25.5" + conditions: os=openbsd & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/openbsd-x64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/openbsd-x64@npm:0.20.2" @@ -3630,6 +3791,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/openbsd-x64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/openbsd-x64@npm:0.25.5" + conditions: os=openbsd & cpu=x64 + languageName: node + linkType: hard + "@esbuild/sunos-x64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/sunos-x64@npm:0.20.2" @@ -3644,6 +3812,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/sunos-x64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/sunos-x64@npm:0.25.5" + conditions: os=sunos & cpu=x64 + languageName: node + linkType: hard + "@esbuild/win32-arm64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/win32-arm64@npm:0.20.2" @@ -3658,6 +3833,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/win32-arm64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/win32-arm64@npm:0.25.5" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + "@esbuild/win32-ia32@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/win32-ia32@npm:0.20.2" @@ -3672,6 +3854,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/win32-ia32@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/win32-ia32@npm:0.25.5" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + "@esbuild/win32-x64@npm:0.20.2": version: 0.20.2 resolution: "@esbuild/win32-x64@npm:0.20.2" @@ -3686,6 +3875,13 @@ __metadata: languageName: node linkType: hard +"@esbuild/win32-x64@npm:0.25.5": + version: 0.25.5 + resolution: "@esbuild/win32-x64@npm:0.25.5" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@eslint-community/eslint-plugin-eslint-comments@npm:^4.4.1": version: 4.5.0 resolution: "@eslint-community/eslint-plugin-eslint-comments@npm:4.5.0" @@ -5836,7 +6032,11 @@ __metadata: dependencies: "@typescript-eslint/tsconfig-utils": ^8.35.1 "@typescript-eslint/types": ^8.35.1 + "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 + rimraf: "*" + typescript: "*" + vitest: ^3.1.3 peerDependencies: typescript: ">=4.8.4 <5.9.0" languageName: unknown @@ -5901,6 +6101,11 @@ __metadata: "@typescript-eslint/tsconfig-utils@8.35.1, @typescript-eslint/tsconfig-utils@^8.35.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" + dependencies: + "@vitest/coverage-v8": ^3.1.3 + rimraf: "*" + typescript: "*" + vitest: ^3.1.3 peerDependencies: typescript: ">=4.8.4 <5.9.0" languageName: unknown @@ -9525,35 +9730,35 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.25.0, esbuild@npm:~0.25.0": - version: 0.25.4 - resolution: "esbuild@npm:0.25.4" - dependencies: - "@esbuild/aix-ppc64": 0.25.4 - "@esbuild/android-arm": 0.25.4 - "@esbuild/android-arm64": 0.25.4 - "@esbuild/android-x64": 0.25.4 - "@esbuild/darwin-arm64": 0.25.4 - "@esbuild/darwin-x64": 0.25.4 - "@esbuild/freebsd-arm64": 0.25.4 - "@esbuild/freebsd-x64": 0.25.4 - "@esbuild/linux-arm": 0.25.4 - "@esbuild/linux-arm64": 0.25.4 - "@esbuild/linux-ia32": 0.25.4 - "@esbuild/linux-loong64": 0.25.4 - "@esbuild/linux-mips64el": 0.25.4 - "@esbuild/linux-ppc64": 0.25.4 - "@esbuild/linux-riscv64": 0.25.4 - "@esbuild/linux-s390x": 0.25.4 - "@esbuild/linux-x64": 0.25.4 - "@esbuild/netbsd-arm64": 0.25.4 - "@esbuild/netbsd-x64": 0.25.4 - "@esbuild/openbsd-arm64": 0.25.4 - "@esbuild/openbsd-x64": 0.25.4 - "@esbuild/sunos-x64": 0.25.4 - "@esbuild/win32-arm64": 0.25.4 - "@esbuild/win32-ia32": 0.25.4 - "@esbuild/win32-x64": 0.25.4 +"esbuild@npm:^0.25.0": + version: 0.25.5 + resolution: "esbuild@npm:0.25.5" + dependencies: + "@esbuild/aix-ppc64": 0.25.5 + "@esbuild/android-arm": 0.25.5 + "@esbuild/android-arm64": 0.25.5 + "@esbuild/android-x64": 0.25.5 + "@esbuild/darwin-arm64": 0.25.5 + "@esbuild/darwin-x64": 0.25.5 + "@esbuild/freebsd-arm64": 0.25.5 + "@esbuild/freebsd-x64": 0.25.5 + "@esbuild/linux-arm": 0.25.5 + "@esbuild/linux-arm64": 0.25.5 + "@esbuild/linux-ia32": 0.25.5 + "@esbuild/linux-loong64": 0.25.5 + "@esbuild/linux-mips64el": 0.25.5 + "@esbuild/linux-ppc64": 0.25.5 + "@esbuild/linux-riscv64": 0.25.5 + "@esbuild/linux-s390x": 0.25.5 + "@esbuild/linux-x64": 0.25.5 + "@esbuild/netbsd-arm64": 0.25.5 + "@esbuild/netbsd-x64": 0.25.5 + "@esbuild/openbsd-arm64": 0.25.5 + "@esbuild/openbsd-x64": 0.25.5 + "@esbuild/sunos-x64": 0.25.5 + "@esbuild/win32-arm64": 0.25.5 + "@esbuild/win32-ia32": 0.25.5 + "@esbuild/win32-x64": 0.25.5 dependenciesMeta: "@esbuild/aix-ppc64": optional: true @@ -9607,7 +9812,7 @@ __metadata: optional: true bin: esbuild: bin/esbuild - checksum: cd39e0236ba9ab39d28e5ba0aab9b63b3f7f3fdcd449422bfcaff087aedcf4fa0e754cb89fba37d96c67874e995e3c02634ef392f09928cdf4a5daf4dddd0171 + checksum: 2aa6f47c27a2f0fbf1e2eeed1df6c5449750ef598b9b49c95d8b654ec04423b70064de4f85a9e879c363402eb4f2fad59f37c996c329df1dc514b10f8ae76dd0 languageName: node linkType: hard @@ -9691,6 +9896,92 @@ __metadata: languageName: node linkType: hard +"esbuild@npm:~0.25.0": + version: 0.25.4 + resolution: "esbuild@npm:0.25.4" + dependencies: + "@esbuild/aix-ppc64": 0.25.4 + "@esbuild/android-arm": 0.25.4 + "@esbuild/android-arm64": 0.25.4 + "@esbuild/android-x64": 0.25.4 + "@esbuild/darwin-arm64": 0.25.4 + "@esbuild/darwin-x64": 0.25.4 + "@esbuild/freebsd-arm64": 0.25.4 + "@esbuild/freebsd-x64": 0.25.4 + "@esbuild/linux-arm": 0.25.4 + "@esbuild/linux-arm64": 0.25.4 + "@esbuild/linux-ia32": 0.25.4 + "@esbuild/linux-loong64": 0.25.4 + "@esbuild/linux-mips64el": 0.25.4 + "@esbuild/linux-ppc64": 0.25.4 + "@esbuild/linux-riscv64": 0.25.4 + "@esbuild/linux-s390x": 0.25.4 + "@esbuild/linux-x64": 0.25.4 + "@esbuild/netbsd-arm64": 0.25.4 + "@esbuild/netbsd-x64": 0.25.4 + "@esbuild/openbsd-arm64": 0.25.4 + "@esbuild/openbsd-x64": 0.25.4 + "@esbuild/sunos-x64": 0.25.4 + "@esbuild/win32-arm64": 0.25.4 + "@esbuild/win32-ia32": 0.25.4 + "@esbuild/win32-x64": 0.25.4 + dependenciesMeta: + "@esbuild/aix-ppc64": + optional: true + "@esbuild/android-arm": + optional: true + "@esbuild/android-arm64": + optional: true + "@esbuild/android-x64": + optional: true + "@esbuild/darwin-arm64": + optional: true + "@esbuild/darwin-x64": + optional: true + "@esbuild/freebsd-arm64": + optional: true + "@esbuild/freebsd-x64": + optional: true + "@esbuild/linux-arm": + optional: true + "@esbuild/linux-arm64": + optional: true + "@esbuild/linux-ia32": + optional: true + "@esbuild/linux-loong64": + optional: true + "@esbuild/linux-mips64el": + optional: true + "@esbuild/linux-ppc64": + optional: true + "@esbuild/linux-riscv64": + optional: true + "@esbuild/linux-s390x": + optional: true + "@esbuild/linux-x64": + optional: true + "@esbuild/netbsd-arm64": + optional: true + "@esbuild/netbsd-x64": + optional: true + "@esbuild/openbsd-arm64": + optional: true + "@esbuild/openbsd-x64": + optional: true + "@esbuild/sunos-x64": + optional: true + "@esbuild/win32-arm64": + optional: true + "@esbuild/win32-ia32": + optional: true + "@esbuild/win32-x64": + optional: true + bin: + esbuild: bin/esbuild + checksum: cd39e0236ba9ab39d28e5ba0aab9b63b3f7f3fdcd449422bfcaff087aedcf4fa0e754cb89fba37d96c67874e995e3c02634ef392f09928cdf4a5daf4dddd0171 + languageName: node + linkType: hard + "escalade@npm:^3.1.1, escalade@npm:^3.2.0": version: 3.2.0 resolution: "escalade@npm:3.2.0" From d1388fc0c9cd40dc3a32787e7ab04cb78bc904c9 Mon Sep 17 00:00:00 2001 From: Yukihiro Hasegawa <49516827+y-hsgw@users.noreply.github.com> Date: Mon, 7 Jul 2025 22:05:32 +0900 Subject: [PATCH 080/283] fix(eslint-plugin): [no-deprecated] should allow ignoring of deprecated value (#10670) * feat: create valueMatchesSomeSpecifier function * fix: ignore deprecated value * test: add test * test: add test * refactor: use AST node narrowing * feat: support package * test: add test * test: add test * test: add test for typeMatchesSomeSpecifier function * test: add test for valueMatchesSomeSpecifier function * refactor: remove default empty array from specifiers * Revert "refactor: remove default empty array from specifiers" This reverts commit 3673d2160c3f9c1317de6485d3f3228b700245df. * test: add test case with undefined argument * fix: sync workspace * feat: support PrivateIdentifier * feat: support literal case * feat: support dynamic import * test: add no-deprecated test * fix: sync workspace * refactor: use named functions instead of string descriptions in describe blocks * fix: lint fix --------- Co-authored-by: Josh Goldberg --- .../eslint-plugin/src/rules/no-deprecated.ts | 6 +- .../tests/rules/no-deprecated.test.ts | 101 ++++++ .../type-utils/src/TypeOrValueSpecifier.ts | 68 ++++ .../tests/TypeOrValueSpecifier.test.ts | 320 +++++++++++++++++- 4 files changed, 493 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-deprecated.ts b/packages/eslint-plugin/src/rules/no-deprecated.ts index 725ddaf3fce9..880708a866c3 100644 --- a/packages/eslint-plugin/src/rules/no-deprecated.ts +++ b/packages/eslint-plugin/src/rules/no-deprecated.ts @@ -12,6 +12,7 @@ import { nullThrows, typeOrValueSpecifiersSchema, typeMatchesSomeSpecifier, + valueMatchesSomeSpecifier, } from '../util'; type IdentifierLike = @@ -375,7 +376,10 @@ export default createRule({ } const type = services.getTypeAtLocation(node); - if (typeMatchesSomeSpecifier(type, allow, services.program)) { + if ( + typeMatchesSomeSpecifier(type, allow, services.program) || + valueMatchesSomeSpecifier(node, allow, services.program, type) + ) { return; } diff --git a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts index 1c8f354886df..6231f9404944 100644 --- a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts +++ b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts @@ -332,6 +332,21 @@ ruleTester.run('no-deprecated', rule, { { code: ` /** @deprecated */ +function A() { + return
; +} + +const a = ; + `, + options: [ + { + allow: [{ from: 'file', name: 'A' }], + }, + ], + }, + { + code: ` +/** @deprecated */ declare class A {} new A(); @@ -344,7 +359,62 @@ new A(); }, { code: ` +/** @deprecated */ +const deprecatedValue = 45; +const bar = deprecatedValue; + `, + options: [ + { + allow: [{ from: 'file', name: 'deprecatedValue' }], + }, + ], + }, + { + code: ` +class MyClass { + /** @deprecated */ + #privateProp = 42; + value = this.#privateProp; +} + `, + options: [ + { + allow: [{ from: 'file', name: 'privateProp' }], + }, + ], + }, + { + code: ` +/** @deprecated */ +const deprecatedValue = 45; +const bar = deprecatedValue; + `, + options: [ + { + allow: ['deprecatedValue'], + }, + ], + }, + { + code: ` import { exists } from 'fs'; +exists('/foo'); + `, + options: [ + { + allow: [ + { + from: 'package', + name: 'exists', + package: 'fs', + }, + ], + }, + ], + }, + { + code: ` +const { exists } = import('fs'); exists('/foo'); `, options: [ @@ -2915,6 +2985,37 @@ class B extends A { }, ], }, + { + code: ` +import { exists } from 'fs'; +exists('/foo'); + `, + errors: [ + { + column: 1, + data: { + name: 'exists', + reason: + 'Since v1.0.0 - Use {@link stat} or {@link access} instead.', + }, + endColumn: 7, + endLine: 3, + line: 3, + messageId: 'deprecatedWithReason', + }, + ], + options: [ + { + allow: [ + { + from: 'package', + name: 'exists', + package: 'hoge', + }, + ], + }, + ], + }, { code: ` declare class A { diff --git a/packages/type-utils/src/TypeOrValueSpecifier.ts b/packages/type-utils/src/TypeOrValueSpecifier.ts index 4c8f1211a8be..bbfb99ddcc78 100644 --- a/packages/type-utils/src/TypeOrValueSpecifier.ts +++ b/packages/type-utils/src/TypeOrValueSpecifier.ts @@ -1,6 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; import type * as ts from 'typescript'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; import * as tsutils from 'ts-api-utils'; import { specifierNameMatches } from './typeOrValueSpecifiers/specifierNameMatches'; @@ -219,3 +221,69 @@ export const typeMatchesSomeSpecifier = ( program: ts.Program, ): boolean => specifiers.some(specifier => typeMatchesSpecifier(type, specifier, program)); + +const getSpecifierNames = (specifierName: string | string[]): string[] => { + return typeof specifierName === 'string' ? [specifierName] : specifierName; +}; + +const getStaticName = (node: TSESTree.Node): string | undefined => { + if ( + node.type === AST_NODE_TYPES.Identifier || + node.type === AST_NODE_TYPES.JSXIdentifier || + node.type === AST_NODE_TYPES.PrivateIdentifier + ) { + return node.name; + } + + if (node.type === AST_NODE_TYPES.Literal && typeof node.value === 'string') { + return node.value; + } + + return undefined; +}; + +export function valueMatchesSpecifier( + node: TSESTree.Node, + specifier: TypeOrValueSpecifier, + program: ts.Program, + type: ts.Type, +): boolean { + const staticName = getStaticName(node); + if (!staticName) { + return false; + } + + if (typeof specifier === 'string') { + return specifier === staticName; + } + + if (!getSpecifierNames(specifier.name).includes(staticName)) { + return false; + } + + if (specifier.from === 'package') { + const symbol = type.getSymbol() ?? type.aliasSymbol; + const declarations = symbol?.getDeclarations() ?? []; + const declarationFiles = declarations.map(declaration => + declaration.getSourceFile(), + ); + return typeDeclaredInPackageDeclarationFile( + specifier.package, + declarations, + declarationFiles, + program, + ); + } + + return true; +} + +export const valueMatchesSomeSpecifier = ( + node: TSESTree.Node, + specifiers: TypeOrValueSpecifier[] = [], + program: ts.Program, + type: ts.Type, +): boolean => + specifiers.some(specifier => + valueMatchesSpecifier(node, specifier, program, type), + ); diff --git a/packages/type-utils/tests/TypeOrValueSpecifier.test.ts b/packages/type-utils/tests/TypeOrValueSpecifier.test.ts index 8aee949efb37..ed9c5614b209 100644 --- a/packages/type-utils/tests/TypeOrValueSpecifier.test.ts +++ b/packages/type-utils/tests/TypeOrValueSpecifier.test.ts @@ -1,8 +1,17 @@ +import type { TSESTree } from '@typescript-eslint/utils'; + +import { parseForESLint } from '@typescript-eslint/parser'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as path from 'node:path'; import type { TypeOrValueSpecifier } from '../src/index.js'; -import { typeMatchesSpecifier } from '../src/index.js'; +import { + typeMatchesSomeSpecifier, + typeMatchesSpecifier, + valueMatchesSomeSpecifier, + valueMatchesSpecifier, +} from '../src/index.js'; const ROOT_DIR = path.posix.join( ...path.relative(process.cwd(), path.join(__dirname, '..')).split(path.sep), @@ -628,4 +637,313 @@ describe('TypeOrValueSpecifier', () => { }, ); }); + + describe(valueMatchesSpecifier, () => { + function parseCode(code: string) { + const rootDir = path.join(__dirname, 'fixtures'); + const { ast, services } = parseForESLint(code, { + disallowAutomaticSingleRunInference: true, + filePath: path.join(rootDir, 'file.ts'), + project: './tsconfig.json', + tsconfigRootDir: rootDir, + }); + assert.isNotNull(services.program); + + return { ast, services }; + } + + describe(AST_NODE_TYPES.VariableDeclaration, () => { + function runTests( + code: string, + specifier: TypeOrValueSpecifier, + expected: boolean, + ) { + const { ast, services } = parseCode(code); + const declaration = ast.body.at(-1) as TSESTree.VariableDeclaration; + const { id, init } = declaration.declarations[0]; + const type = services.getTypeAtLocation(id); + expect( + valueMatchesSpecifier(init!, specifier, services.program, type), + ).toBe(expected); + } + + function runTestPositive( + code: string, + specifier: TypeOrValueSpecifier, + ): void { + runTests(code, specifier, true); + } + + function runTestNegative( + code: string, + specifier: TypeOrValueSpecifier, + ): void { + runTests(code, specifier, false); + } + + it.each<[string, TypeOrValueSpecifier]>([ + ['const value = 45;', 'value'], + ['let value = 45;', 'value'], + ['var value = 45;', 'value'], + ])( + 'does not match for non-Identifier or non-JSXIdentifier node: %s', + runTestNegative, + ); + + it.each<[string, TypeOrValueSpecifier]>([ + ['const value = 45; const hoge = value;', 'value'], + ['let value = 45; const hoge = value;', 'value'], + ['var value = 45; const hoge = value;', 'value'], + ])('matches a matching universal string specifier: %s', runTestPositive); + + it.each<[string, TypeOrValueSpecifier]>([ + ['const value = 45; const hoge = value;', 'incorrect'], + ])( + "doesn't match a mismatched universal string specifier: %s", + runTestNegative, + ); + + it.each<[string, TypeOrValueSpecifier]>([ + [ + 'const value = 45; const hoge = value;', + { from: 'file', name: 'value' }, + ], + [ + 'const value = 45; const hoge = value;', + { from: 'file', name: ['value', 'hoge'] }, + ], + [ + 'let value = 45; const hoge = value;', + { from: 'file', name: 'value' }, + ], + [ + 'var value = 45; const hoge = value;', + { from: 'file', name: 'value' }, + ], + ])('matches a matching file specifier: %s', runTestPositive); + + it.each<[string, TypeOrValueSpecifier]>([ + [ + 'const value = 45; const hoge = value;', + { from: 'file', name: 'incorrect' }, + ], + [ + 'const value = 45; const hoge = value;', + { from: 'file', name: ['incorrect', 'invalid'] }, + ], + ])("doesn't match a mismatched file specifier: %s", runTestNegative); + + it.each<[string, TypeOrValueSpecifier]>([ + ['const value = console', { from: 'lib', name: 'console' }], + ['const value = console', { from: 'lib', name: ['console', 'hoge'] }], + ['let value = console', { from: 'lib', name: 'console' }], + ['var value = console', { from: 'lib', name: 'console' }], + ])('matches a matching lib specifier: %s', runTestPositive); + + it.each<[string, TypeOrValueSpecifier]>([ + ['const value = console', { from: 'lib', name: 'incorrect' }], + [ + 'const value = console', + { from: 'lib', name: ['incorrect', 'window'] }, + ], + ])("doesn't match a mismatched lib specifier: %s", runTestNegative); + + it.each<[string, TypeOrValueSpecifier]>([ + [ + 'import { mock } from "node:test"; const hoge = mock;', + { from: 'package', name: 'mock', package: 'node:test' }, + ], + [ + 'import { mock } from "node:test"; const hoge = mock;', + { from: 'package', name: ['mock', 'hoge'], package: 'node:test' }, + ], + [ + `const fs: typeof import("fs"); const module = fs;`, + { from: 'package', name: 'fs', package: 'fs' }, + ], + ])('matches a matching package specifier: %s', runTestPositive); + + it.each<[string, TypeOrValueSpecifier]>([ + [ + 'import { mock } from "node:test"; const hoge = mock;', + { from: 'package', name: 'hoge', package: 'node:test' }, + ], + [ + 'import { mock } from "node"; const hoge = mock;', + { from: 'package', name: 'mock', package: 'node:test' }, + ], + [ + 'const mock = 42; const hoge = mock;', + { from: 'package', name: 'mock', package: 'node:test' }, + ], + ])("doesn't match a mismatched package specifier: %s", runTestNegative); + }); + + describe(AST_NODE_TYPES.ClassDeclaration, () => { + function runTests( + code: string, + specifier: TypeOrValueSpecifier, + expected: boolean, + ) { + const { ast, services } = parseCode(code); + const declaration = ast.body.at(-1) as TSESTree.ClassDeclaration; + const definition = declaration.body.body.at( + -1, + ) as TSESTree.PropertyDefinition; + const { property } = definition.value as TSESTree.MemberExpression; + const type = services.getTypeAtLocation(property); + expect( + valueMatchesSpecifier(property, specifier, services.program, type), + ).toBe(expected); + } + + function runTestPositive( + code: string, + specifier: TypeOrValueSpecifier, + ): void { + runTests(code, specifier, true); + } + + function runTestNegative( + code: string, + specifier: TypeOrValueSpecifier, + ): void { + runTests(code, specifier, false); + } + + it.each<[string, TypeOrValueSpecifier]>([ + [ + `class MyClass { + #privateProp = 42; + value = this.#privateProp; + }`, + 'privateProp', + ], + [ + ` + class MyClass { + ['computed prop'] = 42; + value = this['computed prop']; + }`, + `computed prop`, + ], + ])('matches a matching universal string specifier: %s', runTestPositive); + + it.each<[string, TypeOrValueSpecifier]>([ + [ + `class MyClass { + #privateProp = 42; + value = this.#privateProp; + }`, + 'incorrect', + ], + ])('matches a matching universal string specifier: %s', runTestNegative); + }); + }); + + describe(typeMatchesSomeSpecifier, () => { + function runTests( + code: string, + specifiers: TypeOrValueSpecifier[], + expected: boolean, + ): void { + const rootDir = path.join(__dirname, 'fixtures'); + const { ast, services } = parseForESLint(code, { + disallowAutomaticSingleRunInference: true, + filePath: path.join(rootDir, 'file.ts'), + project: './tsconfig.json', + tsconfigRootDir: rootDir, + }); + const type = services + .program!.getTypeChecker() + .getTypeAtLocation( + services.esTreeNodeToTSNodeMap.get( + (ast.body[ast.body.length - 1] as TSESTree.TSTypeAliasDeclaration) + .id, + ), + ); + expect( + typeMatchesSomeSpecifier(type, specifiers, services.program!), + ).toBe(expected); + } + + function runTestPositive( + code: string, + specifiers: TypeOrValueSpecifier[], + ): void { + runTests(code, specifiers, true); + } + + function runTestNegative( + code: string, + specifiers: TypeOrValueSpecifier[], + ): void { + runTests(code, specifiers, false); + } + + it.each<[string, TypeOrValueSpecifier[]]>([ + ['interface Foo {prop: string}; type Test = Foo;', ['Foo', 'Hoge']], + ['type Test = RegExp;', ['RegExp', 'BigInt']], + ])('matches a matching universal string specifiers', runTestPositive); + + it.each<[string, TypeOrValueSpecifier[]]>([ + ['interface Foo {prop: string}; type Test = Foo;', ['Bar', 'Hoge']], + ['type Test = RegExp;', ['Foo', 'BigInt']], + ])( + "doesn't match a mismatched universal string specifiers", + runTestNegative, + ); + }); + + describe(valueMatchesSomeSpecifier, () => { + function runTests( + code: string, + specifiers: TypeOrValueSpecifier[] | undefined, + expected: boolean, + ): void { + const rootDir = path.join(__dirname, 'fixtures'); + const { ast, services } = parseForESLint(code, { + disallowAutomaticSingleRunInference: true, + filePath: path.join(rootDir, 'file.ts'), + project: './tsconfig.json', + tsconfigRootDir: rootDir, + }); + assert.isNotNull(services.program); + + const declaration = ast.body.at(-1) as TSESTree.VariableDeclaration; + const { id, init } = declaration.declarations[0]; + const type = services.getTypeAtLocation(id); + expect( + valueMatchesSomeSpecifier(init!, specifiers, services.program, type), + ).toBe(expected); + } + + function runTestPositive( + code: string, + specifiers: TypeOrValueSpecifier[], + ): void { + runTests(code, specifiers, true); + } + + function runTestNegative( + code: string, + specifiers: TypeOrValueSpecifier[] | undefined, + ): void { + runTests(code, specifiers, false); + } + + it.each<[string, TypeOrValueSpecifier[]]>([ + ['const value = 45; const hoge = value;', ['value', 'hoge']], + ['let value = 45; const hoge = value;', ['value', 'hoge']], + ['var value = 45; const hoge = value;', ['value', 'hoge']], + ])('matches a matching universal string specifiers: %s', runTestPositive); + + it.each<[string, TypeOrValueSpecifier[] | undefined]>([ + ['const value = 45; const hoge = value;', ['incorrect', 'invalid']], + ['const value = 45; const hoge = value;', undefined], + ])( + "doesn't match a mismatched universal string specifiers: %s", + runTestNegative, + ); + }); }); From 0c40c7a5dc827902e55093f53259fbad348d4603 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 7 Jul 2025 10:27:18 -0600 Subject: [PATCH 081/283] feat(typescript-eslint): support `basePath` in `tseslint.config()` (#11357) * feat(typescript-eslint): support `basePath` in `tseslint.config()` * since * fixup * fixup fixup * fixup since * Move definition of `basePath` to the correct place --- .../typescript-eslint/src/config-helper.ts | 18 +++++++- .../tests/config-helper.test.ts | 42 +++++++++++++++++++ packages/utils/src/ts-eslint/Config.ts | 9 ++++ packages/utils/tests/ts-eslint/ESLint.test.ts | 9 ++++ 4 files changed, 76 insertions(+), 2 deletions(-) diff --git a/packages/typescript-eslint/src/config-helper.ts b/packages/typescript-eslint/src/config-helper.ts index ce5d4ea806ed..fab062012487 100644 --- a/packages/typescript-eslint/src/config-helper.ts +++ b/packages/typescript-eslint/src/config-helper.ts @@ -120,6 +120,7 @@ function configImpl(...configs: unknown[]): ConfigArray { extends?: unknown; files?: unknown; ignores?: unknown; + basePath?: unknown; }; if (extendsArr == null) { @@ -163,11 +164,20 @@ function configImpl(...configs: unknown[]): ConfigArray { } if (extension == null || typeof extension !== 'object') { nonObjectExtensions.push(extensionIndex); + continue; + } + + // https://github.com/eslint/rewrite/blob/82d07fd0e8e06780b552a41f8bcbe2a4f8741d42/packages/config-helpers/src/define-config.js#L448-L450 + if ('basePath' in extension) { + throw new TypeError( + `tseslint.config(): Config at index ${configIndex}${nameErrorPhrase} has an 'extends' array that contains a config with a 'basePath' property at index ${extensionIndex}.` + + ` 'basePath' in 'extends' is not allowed.`, + ); } } if (nonObjectExtensions.length > 0) { const extensionIndices = nonObjectExtensions.join(', '); - throw new Error( + throw new TypeError( `tseslint.config(): Config at index ${configIndex}${nameErrorPhrase} contains non-object` + ` extensions at the following indices: ${extensionIndices}.`, ); @@ -181,6 +191,7 @@ function configImpl(...configs: unknown[]): ConfigArray { files?: unknown; ignores?: unknown; }; + const resolvedConfigName = [name, extension.name] .filter(Boolean) .join('__'); @@ -195,6 +206,7 @@ function configImpl(...configs: unknown[]): ConfigArray { ...extension, ...(config.files ? { files: config.files } : {}), ...(config.ignores ? { ignores: config.ignores } : {}), + ...(config.basePath ? { basePath: config.basePath } : {}), ...(resolvedConfigName !== '' ? { name: resolvedConfigName } : {}), }); } @@ -218,5 +230,7 @@ function configImpl(...configs: unknown[]): ConfigArray { * the return value can still be true. */ function isPossiblyGlobalIgnores(config: object): boolean { - return Object.keys(config).every(key => ['name', 'ignores'].includes(key)); + return Object.keys(config).every(key => + ['name', 'ignores', 'basePath'].includes(key), + ); } diff --git a/packages/typescript-eslint/tests/config-helper.test.ts b/packages/typescript-eslint/tests/config-helper.test.ts index 748f67626266..b075170bcff7 100644 --- a/packages/typescript-eslint/tests/config-helper.test.ts +++ b/packages/typescript-eslint/tests/config-helper.test.ts @@ -374,4 +374,46 @@ describe('config helper', () => { "tseslint.config(): Config at index 0 has a 'name' property that is not a string.", ); }); + + it('basePath works with unextended config', () => { + expect( + tseslint.config({ + basePath: 'base/path', + rules: { rule1: 'error' }, + }), + ).toStrictEqual([ + { + basePath: 'base/path', + rules: { rule1: 'error' }, + }, + ]); + }); + + it('basePath works with extended config', () => { + expect( + tseslint.config({ + basePath: 'base/path', + extends: [{ rules: { rule1: 'error' } }, { rules: { rule2: 'error' } }], + }), + ).toStrictEqual([ + { + basePath: 'base/path', + rules: { rule1: 'error' }, + }, + { + basePath: 'base/path', + rules: { rule2: 'error' }, + }, + ]); + }); + + it('basePath cannot be used in an extension', () => { + expect(() => { + tseslint.config({ + extends: [{ basePath: 'base/path', rules: { rule1: 'error' } }], + }); + }).toThrow( + "tseslint.config(): Config at index 0 (anonymous) has an 'extends' array that contains a config with a 'basePath' property at index 0. 'basePath' in 'extends' is not allowed.", + ); + }); }); diff --git a/packages/utils/src/ts-eslint/Config.ts b/packages/utils/src/ts-eslint/Config.ts index 8dc9b80c9e28..c9eaee06d71c 100644 --- a/packages/utils/src/ts-eslint/Config.ts +++ b/packages/utils/src/ts-eslint/Config.ts @@ -255,6 +255,15 @@ export namespace FlatConfig { // it's not a json schema so it's nowhere near as nice to read and convert... // https://github.com/eslint/eslint/blob/v8.45.0/lib/config/flat-config-schema.js export interface Config { + /** + * The base path for files and ignores. + * + * Note that this is not permitted inside an `extends` array. + * + * Since ESLint 9.30.0 + */ + basePath?: string; + /** * An array of glob patterns indicating the files that the configuration object should apply to. * If not specified, the configuration object applies to all files matched by any other configuration object. diff --git a/packages/utils/tests/ts-eslint/ESLint.test.ts b/packages/utils/tests/ts-eslint/ESLint.test.ts index cce64f5a743e..1abf895cfafa 100644 --- a/packages/utils/tests/ts-eslint/ESLint.test.ts +++ b/packages/utils/tests/ts-eslint/ESLint.test.ts @@ -1,5 +1,7 @@ import { FlatESLint, LegacyESLint } from 'eslint/use-at-your-own-risk'; +import type { FlatConfig } from '../../src/ts-eslint'; + import * as ESLint from '../../src/ts-eslint/ESLint'; describe('ESLint', () => { @@ -12,6 +14,7 @@ describe('ESLint', () => { }); expect(eslint).toBeInstanceOf(FlatESLint); }); + it('legacy', () => { // eslint-disable-next-line @typescript-eslint/no-deprecated const eslint = new ESLint.LegacyESLint({ @@ -27,5 +30,11 @@ describe('ESLint', () => { }); expect(eslint).toBeInstanceOf(LegacyESLint); }); + + it('config type permits basePath (type test)', () => { + const __config: FlatConfig.Config = { + basePath: 'some/path', + }; + }); }); }); From 84b7a2e905c2a82fda3015f01683525d019c9c3c Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 7 Jul 2025 17:19:22 +0000 Subject: [PATCH 082/283] chore(release): publish 8.36.0 --- CHANGELOG.md | 12 +++ packages/ast-spec/CHANGELOG.md | 6 ++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 6 ++ packages/eslint-plugin/package.json | 16 ++-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 8 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 12 +++ packages/typescript-eslint/package.json | 8 +- packages/typescript-estree/CHANGELOG.md | 6 ++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 12 +++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 94 +++++++++---------- 30 files changed, 204 insertions(+), 96 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a644b23a5395..e52716e7bc5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.36.0 (2025-07-07) + +### 🚀 Features + +- **typescript-eslint:** support `basePath` in `tseslint.config()` ([#11357](https://github.com/typescript-eslint/typescript-eslint/pull/11357)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) ### 🩹 Fixes diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index df5461274c6b..959ad63c7b1a 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.36.0 (2025-07-07) + +This was a version bump only for ast-spec to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) This was a version bump only for ast-spec to align it with other projects, there were no code changes. diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 81750ed964f2..35cf51480a19 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.35.1", + "version": "8.36.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 6e5160bdf25d..0593f74c8109 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.36.0 (2025-07-07) + +This was a version bump only for eslint-plugin to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) ### 🩹 Fixes diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 2e723feab492..c8da12112bae 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.35.1", + "version": "8.36.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.35.1", - "@typescript-eslint/type-utils": "8.35.1", - "@typescript-eslint/utils": "8.35.1", - "@typescript-eslint/visitor-keys": "8.35.1", + "@typescript-eslint/scope-manager": "8.36.0", + "@typescript-eslint/type-utils": "8.36.0", + "@typescript-eslint/utils": "8.36.0", + "@typescript-eslint/visitor-keys": "8.36.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.35.1", - "@typescript-eslint/rule-tester": "8.35.1", + "@typescript-eslint/rule-schema-to-typescript-types": "8.36.0", + "@typescript-eslint/rule-tester": "8.36.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.35.1", + "@typescript-eslint/parser": "^8.36.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 8bd584085402..54f9c7078c73 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.36.0 (2025-07-07) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index ab950546ce99..9f3a938f54ad 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.35.1", + "version": "8.36.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.35.1", - "@typescript-eslint/types": "8.35.1", - "@typescript-eslint/typescript-estree": "8.35.1", - "@typescript-eslint/visitor-keys": "8.35.1", + "@typescript-eslint/scope-manager": "8.36.0", + "@typescript-eslint/types": "8.36.0", + "@typescript-eslint/typescript-estree": "8.36.0", + "@typescript-eslint/visitor-keys": "8.36.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 8d26073813d9..065cd5129af3 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.36.0 (2025-07-07) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 4ab1ee398189..3cb705bdfb6a 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.35.1", + "version": "8.36.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.35.1", - "@typescript-eslint/types": "^8.35.1", + "@typescript-eslint/tsconfig-utils": "^8.36.0", + "@typescript-eslint/types": "^8.36.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 997749be23b6..7112eb593577 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.36.0 (2025-07-07) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index c21c61b1f6f9..425ae27c9822 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.35.1", + "version": "8.36.0", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.35.1", - "@typescript-eslint/utils": "8.35.1", + "@typescript-eslint/type-utils": "8.36.0", + "@typescript-eslint/utils": "8.36.0", "natural-compare": "^1.4.0", "prettier": "3.5.0" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 159c1b94d346..9d1c1b676d18 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.36.0 (2025-07-07) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index a76f121d340b..f89f0da7efda 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.35.1", + "version": "8.36.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.35.1", - "@typescript-eslint/typescript-estree": "8.35.1", - "@typescript-eslint/utils": "8.35.1", + "@typescript-eslint/parser": "8.36.0", + "@typescript-eslint/typescript-estree": "8.36.0", + "@typescript-eslint/utils": "8.36.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 9154b7ee863c..96c098b65cbb 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.36.0 (2025-07-07) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 1b7c67787562..c56ab44fb9d0 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.35.1", + "version": "8.36.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.35.1", - "@typescript-eslint/visitor-keys": "8.35.1" + "@typescript-eslint/types": "8.36.0", + "@typescript-eslint/visitor-keys": "8.36.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.35.1", + "@typescript-eslint/typescript-estree": "8.36.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 31d610aec291..6501e5c4e83b 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.36.0 (2025-07-07) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index c098eebc3fc7..d71f4cb22e4b 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.35.1", + "version": "8.36.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index bdea330e7710..6daf9e58d6f4 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.36.0 (2025-07-07) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index cae54e22392d..4729824e671c 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.35.1", + "version": "8.36.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,8 +44,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/typescript-estree": "8.35.1", - "@typescript-eslint/utils": "8.35.1", + "@typescript-eslint/typescript-estree": "8.36.0", + "@typescript-eslint/utils": "8.36.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -54,7 +54,7 @@ "typescript": ">=4.8.4 <5.9.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.35.1", + "@typescript-eslint/parser": "8.36.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index c316e55650b1..70f2c76071f5 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.36.0 (2025-07-07) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 57de27243842..ff4ed08e3a7f 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.35.1", + "version": "8.36.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 9823b029262b..d482fadbab3c 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.36.0 (2025-07-07) + +### 🚀 Features + +- **typescript-eslint:** support `basePath` in `tseslint.config()` ([#11357](https://github.com/typescript-eslint/typescript-eslint/pull/11357)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 32071be2f183..f68c8c9991b7 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.35.1", + "version": "8.36.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,9 +50,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.35.1", - "@typescript-eslint/parser": "8.35.1", - "@typescript-eslint/utils": "8.35.1" + "@typescript-eslint/eslint-plugin": "8.36.0", + "@typescript-eslint/parser": "8.36.0", + "@typescript-eslint/utils": "8.36.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 76d0b6992df2..54bb60294099 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.36.0 (2025-07-07) + +This was a version bump only for typescript-estree to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) This was a version bump only for typescript-estree to align it with other projects, there were no code changes. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 96bbcff65e32..b6a2ff8b2468 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.35.1", + "version": "8.36.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.35.1", - "@typescript-eslint/tsconfig-utils": "8.35.1", - "@typescript-eslint/types": "8.35.1", - "@typescript-eslint/visitor-keys": "8.35.1", + "@typescript-eslint/project-service": "8.36.0", + "@typescript-eslint/tsconfig-utils": "8.36.0", + "@typescript-eslint/types": "8.36.0", + "@typescript-eslint/visitor-keys": "8.36.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index f88599567731..3610bb6a0919 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.36.0 (2025-07-07) + +### 🚀 Features + +- **typescript-eslint:** support `basePath` in `tseslint.config()` ([#11357](https://github.com/typescript-eslint/typescript-eslint/pull/11357)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index a5889cbea769..57e7560e56eb 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.35.1", + "version": "8.36.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.35.1", - "@typescript-eslint/types": "8.35.1", - "@typescript-eslint/typescript-estree": "8.35.1" + "@typescript-eslint/scope-manager": "8.36.0", + "@typescript-eslint/types": "8.36.0", + "@typescript-eslint/typescript-estree": "8.36.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 0c0b0ec58b1a..711631022f1c 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.36.0 (2025-07-07) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.35.1 (2025-06-30) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index bec63202ba56..4f88db2781b7 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.35.1", + "version": "8.36.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.35.1", + "@typescript-eslint/types": "8.36.0", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index cb0861a27a57..0a6d4edf45c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5954,19 +5954,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.35.1, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.36.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.35.1 - "@typescript-eslint/rule-tester": 8.35.1 - "@typescript-eslint/scope-manager": 8.35.1 - "@typescript-eslint/type-utils": 8.35.1 - "@typescript-eslint/utils": 8.35.1 - "@typescript-eslint/visitor-keys": 8.35.1 + "@typescript-eslint/rule-schema-to-typescript-types": 8.36.0 + "@typescript-eslint/rule-tester": 8.36.0 + "@typescript-eslint/scope-manager": 8.36.0 + "@typescript-eslint/type-utils": 8.36.0 + "@typescript-eslint/utils": 8.36.0 + "@typescript-eslint/visitor-keys": 8.36.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5989,7 +5989,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.35.1 + "@typescript-eslint/parser": ^8.36.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" languageName: unknown @@ -6005,14 +6005,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.35.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.36.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.35.1 - "@typescript-eslint/types": 8.35.1 - "@typescript-eslint/typescript-estree": 8.35.1 - "@typescript-eslint/visitor-keys": 8.35.1 + "@typescript-eslint/scope-manager": 8.36.0 + "@typescript-eslint/types": 8.36.0 + "@typescript-eslint/typescript-estree": 8.36.0 + "@typescript-eslint/visitor-keys": 8.36.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6026,12 +6026,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.35.1, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.36.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.35.1 - "@typescript-eslint/types": ^8.35.1 + "@typescript-eslint/tsconfig-utils": ^8.36.0 + "@typescript-eslint/types": ^8.36.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -6042,12 +6042,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.35.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.36.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.35.1 - "@typescript-eslint/utils": 8.35.1 + "@typescript-eslint/type-utils": 8.36.0 + "@typescript-eslint/utils": 8.36.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -6058,15 +6058,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.35.1, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.36.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.35.1 - "@typescript-eslint/typescript-estree": 8.35.1 - "@typescript-eslint/utils": 8.35.1 + "@typescript-eslint/parser": 8.36.0 + "@typescript-eslint/typescript-estree": 8.36.0 + "@typescript-eslint/utils": 8.36.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -6081,13 +6081,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.35.1, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.36.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.35.1 - "@typescript-eslint/typescript-estree": 8.35.1 - "@typescript-eslint/visitor-keys": 8.35.1 + "@typescript-eslint/types": 8.36.0 + "@typescript-eslint/typescript-estree": 8.36.0 + "@typescript-eslint/visitor-keys": 8.36.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -6098,7 +6098,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.35.1, @typescript-eslint/tsconfig-utils@^8.35.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.36.0, @typescript-eslint/tsconfig-utils@^8.36.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -6111,13 +6111,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.35.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.36.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.35.1 - "@typescript-eslint/typescript-estree": 8.35.1 - "@typescript-eslint/utils": 8.35.1 + "@typescript-eslint/parser": 8.36.0 + "@typescript-eslint/typescript-estree": 8.36.0 + "@typescript-eslint/utils": 8.36.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6132,7 +6132,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.35.1, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.35.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.36.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.36.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6205,15 +6205,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.35.1, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.36.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.35.1 - "@typescript-eslint/tsconfig-utils": 8.35.1 - "@typescript-eslint/types": 8.35.1 - "@typescript-eslint/visitor-keys": 8.35.1 + "@typescript-eslint/project-service": 8.36.0 + "@typescript-eslint/tsconfig-utils": 8.36.0 + "@typescript-eslint/types": 8.36.0 + "@typescript-eslint/visitor-keys": 8.36.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6231,14 +6231,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.35.1, @typescript-eslint/utils@^8.24.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.36.0, @typescript-eslint/utils@^8.24.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.35.1 - "@typescript-eslint/types": 8.35.1 - "@typescript-eslint/typescript-estree": 8.35.1 + "@typescript-eslint/scope-manager": 8.36.0 + "@typescript-eslint/types": 8.36.0 + "@typescript-eslint/typescript-estree": 8.36.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6250,11 +6250,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.35.1, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.36.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.35.1 + "@typescript-eslint/types": 8.36.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19799,9 +19799,9 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.35.1 - "@typescript-eslint/parser": 8.35.1 - "@typescript-eslint/utils": 8.35.1 + "@typescript-eslint/eslint-plugin": 8.36.0 + "@typescript-eslint/parser": 8.36.0 + "@typescript-eslint/utils": 8.36.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From 5c5e3d5c3853ab613e06be0d77a40e970017b3fc Mon Sep 17 00:00:00 2001 From: Bill Collins Date: Tue, 8 Jul 2025 10:38:08 +0100 Subject: [PATCH 083/283] fix(type-utils): add missing 'types' dependency to 'type-utils' (#11383) Add missing 'types' dependency to 'type-utils' --- packages/type-utils/package.json | 1 + yarn.lock | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 4729824e671c..d4f86dd9269a 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -44,6 +44,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { + "@typescript-eslint/types": "8.36.0", "@typescript-eslint/typescript-estree": "8.36.0", "@typescript-eslint/utils": "8.36.0", "debug": "^4.3.4", diff --git a/yarn.lock b/yarn.lock index 0a6d4edf45c1..a4ac6c4b95ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6116,6 +6116,7 @@ __metadata: resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: "@typescript-eslint/parser": 8.36.0 + "@typescript-eslint/types": 8.36.0 "@typescript-eslint/typescript-estree": 8.36.0 "@typescript-eslint/utils": 8.36.0 "@vitest/coverage-v8": ^3.1.3 From 16c344ec7d274ea542157e0f19682dd1930ab838 Mon Sep 17 00:00:00 2001 From: Abhijeet Singh Date: Wed, 9 Jul 2025 19:16:05 +0530 Subject: [PATCH 084/283] docs(website): remove stale list of checked expressions (#11384) --- .../eslint-plugin/docs/rules/no-unnecessary-condition.mdx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.mdx b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.mdx index 55ed0d531a1e..ab7871fdcba8 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.mdx +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.mdx @@ -12,13 +12,6 @@ import TabItem from '@theme/TabItem'; Any expression being used as a condition must be able to evaluate as truthy or falsy in order to be considered "necessary". Conversely, any expression that always evaluates to truthy or always evaluates to falsy, as determined by the type of the expression, is considered unnecessary and will be flagged by this rule. -The following expressions are checked: - -- Arguments to the `&&`, `||` and `?:` (ternary) operators -- Conditions for `if`, `for`, `while`, and `do-while` statements -- `case`s in `switch` statements -- Base values of optional chain expressions - ## Examples From 7126c3a970d606ae36000a5ca8039373ce2df8fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Mon, 14 Jul 2025 06:37:38 -0500 Subject: [PATCH 085/283] feat(typescript-estree): infer tsconfigRootDir from call stack (#11370) * feat(typescript-estree): infer tsconfigRootDir from call stack * rename * Adjust for Windows * lint * Unit tested the candidate detection * mv * rm packages/website/data/recent-blog-posts.json * chore: have website lint depend on its build * Add file:/// testing back * Add doc link * dep * Heh, wrong paackage * yarn test -u --- packages/typescript-eslint/package.json | 1 + .../src/getTSConfigRootDirFromStack.ts | 16 ++++++ packages/typescript-eslint/src/index.ts | 35 +++++++++++- .../typescript-eslint/tests/configs.test.ts | 49 +++++++++++++++++ .../tests/getTsconfigRootDirFromStack.test.ts | 54 +++++++++++++++++++ .../typescript-eslint/tsconfig.build.json | 3 ++ packages/typescript-eslint/tsconfig.json | 3 ++ .../typescript-estree/src/clear-caches.ts | 2 + packages/typescript-estree/src/index.ts | 4 ++ .../candidateTSConfigRootDirs.ts | 31 +++++++++++ .../src/parseSettings/createParseSettings.ts | 3 +- .../lib/candidateTSConfigRootDirs.test.ts | 40 ++++++++++++++ .../tests/lib/createParseSettings.test.ts | 36 +++++++++++++ yarn.lock | 1 + 14 files changed, 275 insertions(+), 3 deletions(-) create mode 100644 packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts create mode 100644 packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts create mode 100644 packages/typescript-estree/src/parseSettings/candidateTSConfigRootDirs.ts create mode 100644 packages/typescript-estree/tests/lib/candidateTSConfigRootDirs.test.ts diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index f68c8c9991b7..6c0144e06b20 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -52,6 +52,7 @@ "dependencies": { "@typescript-eslint/eslint-plugin": "8.36.0", "@typescript-eslint/parser": "8.36.0", + "@typescript-eslint/typescript-estree": "8.36.0", "@typescript-eslint/utils": "8.36.0" }, "peerDependencies": { diff --git a/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts b/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts new file mode 100644 index 000000000000..01378b1618f3 --- /dev/null +++ b/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts @@ -0,0 +1,16 @@ +import { fileURLToPath } from 'node:url'; + +export function getTSConfigRootDirFromStack(stack: string): string | undefined { + for (const line of stack.split('\n').map(line => line.trim())) { + const candidate = /(\S+)eslint\.config\.(c|m)?(j|t)s/.exec(line)?.[1]; + if (!candidate) { + continue; + } + + return candidate.startsWith('file://') + ? fileURLToPath(candidate) + : candidate; + } + + return undefined; +} diff --git a/packages/typescript-eslint/src/index.ts b/packages/typescript-eslint/src/index.ts index 86870c855cd0..9892ede6065a 100644 --- a/packages/typescript-eslint/src/index.ts +++ b/packages/typescript-eslint/src/index.ts @@ -3,8 +3,10 @@ import type { TSESLint } from '@typescript-eslint/utils'; import pluginBase from '@typescript-eslint/eslint-plugin'; import rawPlugin from '@typescript-eslint/eslint-plugin/use-at-your-own-risk/raw-plugin'; +import { addCandidateTSConfigRootDir } from '@typescript-eslint/typescript-estree'; import { config } from './config-helper'; +import { getTSConfigRootDirFromStack } from './getTSConfigRootDirFromStack'; export const parser: TSESLint.FlatConfig.Parser = rawPlugin.parser; @@ -36,7 +38,7 @@ export const plugin: TSESLint.FlatConfig.Plugin = pluginBase as Omit< 'configs' >; -export const configs = { +export const configs = createConfigsGetters({ /** * Enables each the rules provided as a part of typescript-eslint. Note that many rules are not applicable in all codebases, or are meant to be configured. * @see {@link https://typescript-eslint.io/users/configs#all} @@ -120,7 +122,36 @@ export const configs = { */ stylisticTypeCheckedOnly: rawPlugin.flatConfigs['flat/stylistic-type-checked-only'], -}; +}); + +function createConfigsGetters(values: T): T { + const configs = {}; + + Object.defineProperties( + configs, + Object.fromEntries( + Object.entries(values).map(([key, value]: [string, unknown]) => [ + key, + { + enumerable: true, + get: () => { + const candidateRootDir = getTSConfigRootDirFromStack( + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + new Error().stack!, + ); + if (candidateRootDir) { + addCandidateTSConfigRootDir(candidateRootDir); + } + + return value; + }, + }, + ]), + ), + ); + + return configs as T; +} export type Config = TSESLint.FlatConfig.ConfigFile; diff --git a/packages/typescript-eslint/tests/configs.test.ts b/packages/typescript-eslint/tests/configs.test.ts index fea7a41196f4..cac7e4f46bd6 100644 --- a/packages/typescript-eslint/tests/configs.test.ts +++ b/packages/typescript-eslint/tests/configs.test.ts @@ -4,9 +4,25 @@ import type { } from '@typescript-eslint/utils/ts-eslint'; import rules from '@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules'; +import { clearCandidateTSConfigRootDirs } from '@typescript-eslint/typescript-estree'; import tseslint from '../src/index.js'; +vi.mock('@typescript-eslint/typescript-estree', async () => ({ + ...(await vi.importActual('@typescript-eslint/typescript-estree')), + get addCandidateTSConfigRootDir() { + return mockAddCandidateTSConfigRootDir; + }, +})); + +const mockGetTSConfigRootDirFromStack = vi.fn(); + +vi.mock('../src/getTSConfigRootDirFromStack', () => ({ + get getTSConfigRootDirFromStack() { + return mockGetTSConfigRootDirFromStack; + }, +})); + const RULE_NAME_PREFIX = '@typescript-eslint/'; const EXTENSION_RULES = Object.entries(rules) .filter(([, rule]) => rule.meta.docs.extendsBaseRule) @@ -384,3 +400,36 @@ describe('stylistic-type-checked-only.ts', () => { }, ); }); + +const mockAddCandidateTSConfigRootDir = vi.fn(); + +describe('Candidate tsconfigRootDirs', () => { + beforeEach(() => { + clearCandidateTSConfigRootDirs(); + mockAddCandidateTSConfigRootDir.mockClear(); + }); + + describe.each(Object.keys(tseslint.configs))('%s', configKey => { + it('does not populate a candidate tsconfigRootDir when accessed and one cannot be inferred from the stack', () => { + mockGetTSConfigRootDirFromStack.mockReturnValue(undefined); + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + tseslint.configs[configKey as keyof typeof tseslint.configs]; + + expect(mockAddCandidateTSConfigRootDir).not.toHaveBeenCalled(); + }); + + it('populates a candidate tsconfigRootDir when accessed and one can be inferred from the stack', () => { + const tsconfigRootDir = 'a/b/c/'; + + mockGetTSConfigRootDirFromStack.mockReturnValue(tsconfigRootDir); + + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + tseslint.configs[configKey as keyof typeof tseslint.configs]; + + expect(mockAddCandidateTSConfigRootDir).toHaveBeenCalledWith( + tsconfigRootDir, + ); + }); + }); +}); diff --git a/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts b/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts new file mode 100644 index 000000000000..57a3b0b5f2a3 --- /dev/null +++ b/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts @@ -0,0 +1,54 @@ +import path from 'node:path'; + +import { getTSConfigRootDirFromStack } from '../src/getTSConfigRootDirFromStack'; + +const isWindows = process.platform === 'win32'; + +describe(getTSConfigRootDirFromStack, () => { + it('returns undefined when no file path seems to be an ESLint config', () => { + const actual = getTSConfigRootDirFromStack( + [ + `Error`, + ' at file:///other.config.js', + ' at ModuleJob.run', + 'at async NodeHfs.walk(...)', + ].join('\n'), + ); + + expect(actual).toBeUndefined(); + }); + + it.runIf(!isWindows)( + 'returns a Posix config file path when a file:// path to an ESLint config is in the stack', + () => { + const actual = getTSConfigRootDirFromStack( + [ + `Error`, + ' at file:///path/to/file/eslint.config.js', + ' at ModuleJob.run', + 'at async NodeHfs.walk(...)', + ].join('\n'), + ); + + expect(actual).toBe('/path/to/file/'); + }, + ); + + it.each(['cjs', 'cts', 'js', 'mjs', 'mts', 'ts'])( + 'returns the path to the config file when its extension is %s', + extension => { + const expected = isWindows ? 'C:\\path\\to\\file\\' : '/path/to/file/'; + + const actual = getTSConfigRootDirFromStack( + [ + `Error`, + ` at ${path.join(expected, `eslint.config.${extension}`)}`, + ' at ModuleJob.run', + 'at async NodeHfs.walk(...)', + ].join('\n'), + ); + + expect(actual).toBe(expected); + }, + ); +}); diff --git a/packages/typescript-eslint/tsconfig.build.json b/packages/typescript-eslint/tsconfig.build.json index c41d1d4c30ed..8f377becd3cd 100644 --- a/packages/typescript-eslint/tsconfig.build.json +++ b/packages/typescript-eslint/tsconfig.build.json @@ -2,6 +2,9 @@ "extends": "../../tsconfig.build.json", "compilerOptions": {}, "references": [ + { + "path": "../typescript-estree/tsconfig.build.json" + }, { "path": "../utils/tsconfig.build.json" }, diff --git a/packages/typescript-eslint/tsconfig.json b/packages/typescript-eslint/tsconfig.json index d12794a533bf..f94f467e0b00 100644 --- a/packages/typescript-eslint/tsconfig.json +++ b/packages/typescript-eslint/tsconfig.json @@ -3,6 +3,9 @@ "files": [], "include": [], "references": [ + { + "path": "../typescript-estree" + }, { "path": "../utils" }, diff --git a/packages/typescript-estree/src/clear-caches.ts b/packages/typescript-estree/src/clear-caches.ts index 5e9867d3beab..3d5897953b70 100644 --- a/packages/typescript-estree/src/clear-caches.ts +++ b/packages/typescript-estree/src/clear-caches.ts @@ -3,6 +3,7 @@ import { clearDefaultProjectMatchedFiles, clearProgramCache as clearProgramCacheOriginal, } from './parser'; +import { clearCandidateTSConfigRootDirs } from './parseSettings/candidateTSConfigRootDirs'; import { clearTSConfigMatchCache, clearTSServerProjectService, @@ -17,6 +18,7 @@ import { clearGlobCache } from './parseSettings/resolveProjectList'; * - In custom lint tooling that iteratively lints one project at a time to prevent OOMs. */ export function clearCaches(): void { + clearCandidateTSConfigRootDirs(); clearDefaultProjectMatchedFiles(); clearProgramCacheOriginal(); clearWatchCaches(); diff --git a/packages/typescript-estree/src/index.ts b/packages/typescript-estree/src/index.ts index 39e921e8762a..654ea73982d2 100644 --- a/packages/typescript-estree/src/index.ts +++ b/packages/typescript-estree/src/index.ts @@ -16,6 +16,10 @@ export type { ParserServicesWithTypeInformation, TSESTreeOptions, } from './parser-options'; +export { + addCandidateTSConfigRootDir, + clearCandidateTSConfigRootDirs, +} from './parseSettings/candidateTSConfigRootDirs'; export { simpleTraverse } from './simple-traverse'; export * from './ts-estree'; export { typescriptVersionIsAtLeast } from './version-check'; diff --git a/packages/typescript-estree/src/parseSettings/candidateTSConfigRootDirs.ts b/packages/typescript-estree/src/parseSettings/candidateTSConfigRootDirs.ts new file mode 100644 index 000000000000..13e19c8aac8a --- /dev/null +++ b/packages/typescript-estree/src/parseSettings/candidateTSConfigRootDirs.ts @@ -0,0 +1,31 @@ +const candidateTSConfigRootDirs = new Set(); + +export function addCandidateTSConfigRootDir(candidate: string): void { + candidateTSConfigRootDirs.add(candidate); +} + +export function clearCandidateTSConfigRootDirs(): void { + candidateTSConfigRootDirs.clear(); +} + +export function getInferredTSConfigRootDir(): string { + const entries = [...candidateTSConfigRootDirs]; + + switch (entries.length) { + case 0: + return process.cwd(); + + case 1: + return entries[0]; + + default: + throw new Error( + [ + 'No tsconfigRootDir was set, and multiple candidate TSConfigRootDirs are present:', + ...entries.map(candidate => ` - ${candidate}`), + "You'll need to explicitly set tsconfigRootDir in your parser options.", + 'See: https://typescript-eslint.io/packages/parser/#tsconfigrootdir', + ].join('\n'), + ); + } +} diff --git a/packages/typescript-estree/src/parseSettings/createParseSettings.ts b/packages/typescript-estree/src/parseSettings/createParseSettings.ts index 678b771ac3a5..6710e36b870f 100644 --- a/packages/typescript-estree/src/parseSettings/createParseSettings.ts +++ b/packages/typescript-estree/src/parseSettings/createParseSettings.ts @@ -15,6 +15,7 @@ import type { MutableParseSettings } from './index'; import { ensureAbsolutePath } from '../create-program/shared'; import { validateDefaultProjectForFilesGlob } from '../create-program/validateDefaultProjectForFilesGlob'; import { isSourceFile } from '../source-files'; +import { getInferredTSConfigRootDir } from './candidateTSConfigRootDirs'; import { DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS, ExpiringCache, @@ -52,7 +53,7 @@ export function createParseSettings( const tsconfigRootDir = typeof tsestreeOptions.tsconfigRootDir === 'string' ? tsestreeOptions.tsconfigRootDir - : process.cwd(); + : getInferredTSConfigRootDir(); const passedLoggerFn = typeof tsestreeOptions.loggerFn === 'function'; const filePath = ensureAbsolutePath( typeof tsestreeOptions.filePath === 'string' && diff --git a/packages/typescript-estree/tests/lib/candidateTSConfigRootDirs.test.ts b/packages/typescript-estree/tests/lib/candidateTSConfigRootDirs.test.ts new file mode 100644 index 000000000000..7536d56a205d --- /dev/null +++ b/packages/typescript-estree/tests/lib/candidateTSConfigRootDirs.test.ts @@ -0,0 +1,40 @@ +import { addCandidateTSConfigRootDir } from '../../src'; +import { + clearCandidateTSConfigRootDirs, + getInferredTSConfigRootDir, +} from '../../src/parseSettings/candidateTSConfigRootDirs'; + +describe(getInferredTSConfigRootDir, () => { + beforeEach(() => { + clearCandidateTSConfigRootDirs(); + }); + + it('returns process.cwd() when there are no candidates', () => { + const actual = getInferredTSConfigRootDir(); + + expect(actual).toBe(process.cwd()); + }); + + it('returns the candidate when there is one candidate', () => { + const candidate = 'a/b/c'; + addCandidateTSConfigRootDir(candidate); + + const actual = getInferredTSConfigRootDir(); + + expect(actual).toBe(candidate); + }); + + it('throws an error when there are multiple candidates', () => { + addCandidateTSConfigRootDir('a'); + addCandidateTSConfigRootDir('b'); + + expect(() => getInferredTSConfigRootDir()) + .toThrowErrorMatchingInlineSnapshot(` + [Error: No tsconfigRootDir was set, and multiple candidate TSConfigRootDirs are present: + - a + - b + You'll need to explicitly set tsconfigRootDir in your parser options. + See: https://typescript-eslint.io/packages/parser/#tsconfigrootdir] + `); + }); +}); diff --git a/packages/typescript-estree/tests/lib/createParseSettings.test.ts b/packages/typescript-estree/tests/lib/createParseSettings.test.ts index ccb210fd8dbd..d3f5fea99819 100644 --- a/packages/typescript-estree/tests/lib/createParseSettings.test.ts +++ b/packages/typescript-estree/tests/lib/createParseSettings.test.ts @@ -1,3 +1,7 @@ +import { + addCandidateTSConfigRootDir, + clearCandidateTSConfigRootDirs, +} from '../../src/parseSettings/candidateTSConfigRootDirs'; import { createParseSettings } from '../../src/parseSettings/createParseSettings'; const projectService = { service: true }; @@ -61,4 +65,36 @@ describe(createParseSettings, () => { ); }); }); + + describe('tsconfigRootDir', () => { + beforeEach(() => { + clearCandidateTSConfigRootDirs(); + }); + + it('uses the provided tsconfigRootDir when it exists and no candidates exist', () => { + const tsconfigRootDir = 'a/b/c'; + + const parseSettings = createParseSettings('', { tsconfigRootDir }); + + expect(parseSettings.tsconfigRootDir).toBe(tsconfigRootDir); + }); + + it('uses the provided tsconfigRootDir when it exists and a candidate exists', () => { + addCandidateTSConfigRootDir('candidate'); + const tsconfigRootDir = 'a/b/c'; + + const parseSettings = createParseSettings('', { tsconfigRootDir }); + + expect(parseSettings.tsconfigRootDir).toBe(tsconfigRootDir); + }); + + it('uses the inferred candidate when no tsconfigRootDir is provided and a candidate exists', () => { + const tsconfigRootDir = 'a/b/c'; + addCandidateTSConfigRootDir(tsconfigRootDir); + + const parseSettings = createParseSettings(''); + + expect(parseSettings.tsconfigRootDir).toBe(tsconfigRootDir); + }); + }); }); diff --git a/yarn.lock b/yarn.lock index a4ac6c4b95ec..08bde6338a88 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19802,6 +19802,7 @@ __metadata: dependencies: "@typescript-eslint/eslint-plugin": 8.36.0 "@typescript-eslint/parser": 8.36.0 + "@typescript-eslint/typescript-estree": 8.36.0 "@typescript-eslint/utils": 8.36.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" From bef907bf9deeaae2fa7d4e7594bb8526636ddf44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= Date: Mon, 14 Jul 2025 12:40:03 +0100 Subject: [PATCH 086/283] fix(type-utils): handle namespaced exports in specifier matching (#11380) --- .../typeDeclaredInPackageDeclarationFile.ts | 7 +++++-- packages/type-utils/tests/TypeOrValueSpecifier.test.ts | 8 ++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/type-utils/src/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.ts b/packages/type-utils/src/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.ts index cb0b303bafac..e0da69700a83 100644 --- a/packages/type-utils/src/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.ts +++ b/packages/type-utils/src/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.ts @@ -5,14 +5,17 @@ function findParentModuleDeclaration( ): ts.ModuleDeclaration | undefined { switch (node.kind) { case ts.SyntaxKind.ModuleDeclaration: + // "namespace x {...}" should be ignored here + if (node.flags & ts.NodeFlags.Namespace) { + break; + } return ts.isStringLiteral((node as ts.ModuleDeclaration).name) ? (node as ts.ModuleDeclaration) : undefined; case ts.SyntaxKind.SourceFile: return undefined; - default: - return findParentModuleDeclaration(node.parent); } + return findParentModuleDeclaration(node.parent); } function typeDeclaredInDeclareModule( diff --git a/packages/type-utils/tests/TypeOrValueSpecifier.test.ts b/packages/type-utils/tests/TypeOrValueSpecifier.test.ts index ed9c5614b209..29fbd97ac36f 100644 --- a/packages/type-utils/tests/TypeOrValueSpecifier.test.ts +++ b/packages/type-utils/tests/TypeOrValueSpecifier.test.ts @@ -414,6 +414,14 @@ describe('TypeOrValueSpecifier', () => { package: 'node:test', }, ], + [ + 'import { fail } from "node:assert"; type Test = typeof fail;', + { + from: 'package', + name: 'fail', + package: 'assert', + }, + ], ] as const satisfies [string, TypeOrValueSpecifier][])( 'matches a matching package specifier: %s\n\t%s', ([code, typeOrValueSpecifier], { expect }) => { From e1b310c24504dcd1ce817f0a0b9f30d7e0520d8f Mon Sep 17 00:00:00 2001 From: Yukihiro Hasegawa <49516827+y-hsgw@users.noreply.github.com> Date: Mon, 14 Jul 2025 20:44:24 +0900 Subject: [PATCH 087/283] fix(eslint-plugin): [unified-signatures] fix false positives for ignoreOverloadsWithDifferentJSDoc option (#11381) * fix: improve comment comparison logic for overload unification * test: add cases for overloads with different comments and class methods --- .../src/rules/unified-signatures.ts | 13 +++++-- .../tests/rules/unified-signatures.test.ts | 37 +++++++++++++++++++ 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin/src/rules/unified-signatures.ts b/packages/eslint-plugin/src/rules/unified-signatures.ts index 809b19dd1aa6..47e148197f1b 100644 --- a/packages/eslint-plugin/src/rules/unified-signatures.ts +++ b/packages/eslint-plugin/src/rules/unified-signatures.ts @@ -241,9 +241,8 @@ export default createRule({ } if (ignoreOverloadsWithDifferentJSDoc) { - const aComment = getBlockCommentForNode(getExportingNode(a) ?? a); - const bComment = getBlockCommentForNode(getExportingNode(b) ?? b); - + const aComment = getBlockCommentForNode(getCommentTargetNode(a)); + const bComment = getBlockCommentForNode(getCommentTargetNode(b)); if (aComment?.value !== bComment?.value) { return false; } @@ -657,6 +656,14 @@ export default createRule({ }, }); +function getCommentTargetNode(node: SignatureDefinition) { + if (node.type === AST_NODE_TYPES.TSEmptyBodyFunctionExpression) { + return node.parent; + } + + return getExportingNode(node) ?? node; +} + function getExportingNode( node: SignatureDefinition, ): diff --git a/packages/eslint-plugin/tests/rules/unified-signatures.test.ts b/packages/eslint-plugin/tests/rules/unified-signatures.test.ts index 30952ddebb0f..871507e24ad2 100644 --- a/packages/eslint-plugin/tests/rules/unified-signatures.test.ts +++ b/packages/eslint-plugin/tests/rules/unified-signatures.test.ts @@ -378,6 +378,19 @@ declare function f(x: boolean): unknown; declare function f(x: number): unknown; declare function f(x: boolean): unknown; `, + + options: [{ ignoreOverloadsWithDifferentJSDoc: true }], + }, + { + code: ` +class C { + a(b: string): void; + /** + * @deprecate + */ + a(b: number): void; +} + `, options: [{ ignoreOverloadsWithDifferentJSDoc: true }], }, ` @@ -833,6 +846,30 @@ abstract class Foo { }, ], }, + { + code: ` +abstract class C { + a(b: string): void; + /** + * @deprecate + */ + a(b: number): void; +} + `, + errors: [ + { + column: 5, + data: { + failureStringStart: + 'These overloads can be combined into one signature', + type1: 'string', + type2: 'number', + }, + line: 7, + messageId: 'singleParameterDifference', + }, + ], + }, { // Works with literals code: ` From 816be172ce475f5f15373d70fb20c5e87b53c915 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 14 Jul 2025 17:21:03 +0000 Subject: [PATCH 088/283] chore(release): publish 8.37.0 --- CHANGELOG.md | 21 ++++ packages/ast-spec/CHANGELOG.md | 6 ++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 12 +++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 14 +++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 12 +++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 12 +++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 231 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e52716e7bc5f..d2df46b80dd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +## 8.37.0 (2025-07-14) + +### 🚀 Features + +- **typescript-estree:** infer tsconfigRootDir from call stack ([#11370](https://github.com/typescript-eslint/typescript-eslint/pull/11370)) + +### 🩹 Fixes + +- **eslint-plugin:** [unified-signatures] fix false positives for ignoreOverloadsWithDifferentJSDoc option ([#11381](https://github.com/typescript-eslint/typescript-eslint/pull/11381)) +- **type-utils:** add missing 'types' dependency to 'type-utils' ([#11383](https://github.com/typescript-eslint/typescript-eslint/pull/11383)) +- **type-utils:** handle namespaced exports in specifier matching ([#11380](https://github.com/typescript-eslint/typescript-eslint/pull/11380)) + +### ❤️ Thank You + +- Bill Collins +- Josh Goldberg ✨ +- René @Renegade334 +- Yukihiro Hasegawa @y-hsgw + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 959ad63c7b1a..f526c7d328f8 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.37.0 (2025-07-14) + +This was a version bump only for ast-spec to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) This was a version bump only for ast-spec to align it with other projects, there were no code changes. diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 35cf51480a19..c19afac7b4a5 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.36.0", + "version": "8.37.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 0593f74c8109..28a98c667217 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.37.0 (2025-07-14) + +### 🩹 Fixes + +- **eslint-plugin:** [unified-signatures] fix false positives for ignoreOverloadsWithDifferentJSDoc option ([#11381](https://github.com/typescript-eslint/typescript-eslint/pull/11381)) + +### ❤️ Thank You + +- Yukihiro Hasegawa @y-hsgw + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) This was a version bump only for eslint-plugin to align it with other projects, there were no code changes. diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index c8da12112bae..050b7f0a6736 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.36.0", + "version": "8.37.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.36.0", - "@typescript-eslint/type-utils": "8.36.0", - "@typescript-eslint/utils": "8.36.0", - "@typescript-eslint/visitor-keys": "8.36.0", + "@typescript-eslint/scope-manager": "8.37.0", + "@typescript-eslint/type-utils": "8.37.0", + "@typescript-eslint/utils": "8.37.0", + "@typescript-eslint/visitor-keys": "8.37.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.36.0", - "@typescript-eslint/rule-tester": "8.36.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.37.0", + "@typescript-eslint/rule-tester": "8.37.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.36.0", + "@typescript-eslint/parser": "^8.37.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 54f9c7078c73..be88e2ac776d 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.37.0 (2025-07-14) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 9f3a938f54ad..35fd3a636b6d 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.36.0", + "version": "8.37.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.36.0", - "@typescript-eslint/types": "8.36.0", - "@typescript-eslint/typescript-estree": "8.36.0", - "@typescript-eslint/visitor-keys": "8.36.0", + "@typescript-eslint/scope-manager": "8.37.0", + "@typescript-eslint/types": "8.37.0", + "@typescript-eslint/typescript-estree": "8.37.0", + "@typescript-eslint/visitor-keys": "8.37.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 065cd5129af3..435224397b79 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.37.0 (2025-07-14) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 3cb705bdfb6a..76c566ccb0bf 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.36.0", + "version": "8.37.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.36.0", - "@typescript-eslint/types": "^8.36.0", + "@typescript-eslint/tsconfig-utils": "^8.37.0", + "@typescript-eslint/types": "^8.37.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 7112eb593577..31d7e872ffaf 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.37.0 (2025-07-14) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 425ae27c9822..2e0089add902 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.36.0", + "version": "8.37.0", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.36.0", - "@typescript-eslint/utils": "8.36.0", + "@typescript-eslint/type-utils": "8.37.0", + "@typescript-eslint/utils": "8.37.0", "natural-compare": "^1.4.0", "prettier": "3.5.0" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 9d1c1b676d18..89c587e5625d 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.37.0 (2025-07-14) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index f89f0da7efda..a20b6981bc5b 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.36.0", + "version": "8.37.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.36.0", - "@typescript-eslint/typescript-estree": "8.36.0", - "@typescript-eslint/utils": "8.36.0", + "@typescript-eslint/parser": "8.37.0", + "@typescript-eslint/typescript-estree": "8.37.0", + "@typescript-eslint/utils": "8.37.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 96c098b65cbb..5a4cf4d94b80 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.37.0 (2025-07-14) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index c56ab44fb9d0..826c54d45bb3 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.36.0", + "version": "8.37.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.36.0", - "@typescript-eslint/visitor-keys": "8.36.0" + "@typescript-eslint/types": "8.37.0", + "@typescript-eslint/visitor-keys": "8.37.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.36.0", + "@typescript-eslint/typescript-estree": "8.37.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 6501e5c4e83b..97e2d9f284b3 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.37.0 (2025-07-14) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index d71f4cb22e4b..74105bcd3679 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.36.0", + "version": "8.37.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 6daf9e58d6f4..849896c3c20b 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,17 @@ +## 8.37.0 (2025-07-14) + +### 🩹 Fixes + +- **type-utils:** handle namespaced exports in specifier matching ([#11380](https://github.com/typescript-eslint/typescript-eslint/pull/11380)) +- **type-utils:** add missing 'types' dependency to 'type-utils' ([#11383](https://github.com/typescript-eslint/typescript-eslint/pull/11383)) + +### ❤️ Thank You + +- Bill Collins +- René @Renegade334 + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index d4f86dd9269a..0a841c7d7b09 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.36.0", + "version": "8.37.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.36.0", - "@typescript-eslint/typescript-estree": "8.36.0", - "@typescript-eslint/utils": "8.36.0", + "@typescript-eslint/types": "8.37.0", + "@typescript-eslint/typescript-estree": "8.37.0", + "@typescript-eslint/utils": "8.37.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <5.9.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.36.0", + "@typescript-eslint/parser": "8.37.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 70f2c76071f5..dd01ef09238a 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.37.0 (2025-07-14) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index ff4ed08e3a7f..65e7cb13c9e0 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.36.0", + "version": "8.37.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index d482fadbab3c..d1a0e17c8392 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.37.0 (2025-07-14) + +### 🚀 Features + +- **typescript-estree:** infer tsconfigRootDir from call stack ([#11370](https://github.com/typescript-eslint/typescript-eslint/pull/11370)) + +### ❤️ Thank You + +- Josh Goldberg ✨ + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) ### 🚀 Features diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 6c0144e06b20..960b087a873e 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.36.0", + "version": "8.37.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.36.0", - "@typescript-eslint/parser": "8.36.0", - "@typescript-eslint/typescript-estree": "8.36.0", - "@typescript-eslint/utils": "8.36.0" + "@typescript-eslint/eslint-plugin": "8.37.0", + "@typescript-eslint/parser": "8.37.0", + "@typescript-eslint/typescript-estree": "8.37.0", + "@typescript-eslint/utils": "8.37.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 54bb60294099..d087e6d8b727 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.37.0 (2025-07-14) + +### 🚀 Features + +- **typescript-estree:** infer tsconfigRootDir from call stack ([#11370](https://github.com/typescript-eslint/typescript-eslint/pull/11370)) + +### ❤️ Thank You + +- Josh Goldberg ✨ + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) This was a version bump only for typescript-estree to align it with other projects, there were no code changes. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index b6a2ff8b2468..a5fb3509ed12 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.36.0", + "version": "8.37.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.36.0", - "@typescript-eslint/tsconfig-utils": "8.36.0", - "@typescript-eslint/types": "8.36.0", - "@typescript-eslint/visitor-keys": "8.36.0", + "@typescript-eslint/project-service": "8.37.0", + "@typescript-eslint/tsconfig-utils": "8.37.0", + "@typescript-eslint/types": "8.37.0", + "@typescript-eslint/visitor-keys": "8.37.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 3610bb6a0919..e3fe13f97b56 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.37.0 (2025-07-14) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) ### 🚀 Features diff --git a/packages/utils/package.json b/packages/utils/package.json index 57e7560e56eb..868c42f0ab73 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.36.0", + "version": "8.37.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.36.0", - "@typescript-eslint/types": "8.36.0", - "@typescript-eslint/typescript-estree": "8.36.0" + "@typescript-eslint/scope-manager": "8.37.0", + "@typescript-eslint/types": "8.37.0", + "@typescript-eslint/typescript-estree": "8.37.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 711631022f1c..062e1ba8c16c 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.37.0 (2025-07-14) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.36.0 (2025-07-07) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 4f88db2781b7..22a7f00d02ca 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.36.0", + "version": "8.37.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.36.0", + "@typescript-eslint/types": "8.37.0", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 08bde6338a88..5cfb0b47eb02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5954,19 +5954,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.36.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.37.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.36.0 - "@typescript-eslint/rule-tester": 8.36.0 - "@typescript-eslint/scope-manager": 8.36.0 - "@typescript-eslint/type-utils": 8.36.0 - "@typescript-eslint/utils": 8.36.0 - "@typescript-eslint/visitor-keys": 8.36.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.37.0 + "@typescript-eslint/rule-tester": 8.37.0 + "@typescript-eslint/scope-manager": 8.37.0 + "@typescript-eslint/type-utils": 8.37.0 + "@typescript-eslint/utils": 8.37.0 + "@typescript-eslint/visitor-keys": 8.37.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5989,7 +5989,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.36.0 + "@typescript-eslint/parser": ^8.37.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" languageName: unknown @@ -6005,14 +6005,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.36.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.37.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.36.0 - "@typescript-eslint/types": 8.36.0 - "@typescript-eslint/typescript-estree": 8.36.0 - "@typescript-eslint/visitor-keys": 8.36.0 + "@typescript-eslint/scope-manager": 8.37.0 + "@typescript-eslint/types": 8.37.0 + "@typescript-eslint/typescript-estree": 8.37.0 + "@typescript-eslint/visitor-keys": 8.37.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6026,12 +6026,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.36.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.37.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.36.0 - "@typescript-eslint/types": ^8.36.0 + "@typescript-eslint/tsconfig-utils": ^8.37.0 + "@typescript-eslint/types": ^8.37.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -6042,12 +6042,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.36.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.37.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.36.0 - "@typescript-eslint/utils": 8.36.0 + "@typescript-eslint/type-utils": 8.37.0 + "@typescript-eslint/utils": 8.37.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -6058,15 +6058,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.36.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.37.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.36.0 - "@typescript-eslint/typescript-estree": 8.36.0 - "@typescript-eslint/utils": 8.36.0 + "@typescript-eslint/parser": 8.37.0 + "@typescript-eslint/typescript-estree": 8.37.0 + "@typescript-eslint/utils": 8.37.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -6081,13 +6081,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.36.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.37.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.36.0 - "@typescript-eslint/typescript-estree": 8.36.0 - "@typescript-eslint/visitor-keys": 8.36.0 + "@typescript-eslint/types": 8.37.0 + "@typescript-eslint/typescript-estree": 8.37.0 + "@typescript-eslint/visitor-keys": 8.37.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -6098,7 +6098,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.36.0, @typescript-eslint/tsconfig-utils@^8.36.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.37.0, @typescript-eslint/tsconfig-utils@^8.37.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -6111,14 +6111,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.36.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.37.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.36.0 - "@typescript-eslint/types": 8.36.0 - "@typescript-eslint/typescript-estree": 8.36.0 - "@typescript-eslint/utils": 8.36.0 + "@typescript-eslint/parser": 8.37.0 + "@typescript-eslint/types": 8.37.0 + "@typescript-eslint/typescript-estree": 8.37.0 + "@typescript-eslint/utils": 8.37.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6133,7 +6133,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.36.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.36.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.37.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.37.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6206,15 +6206,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.36.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.37.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.36.0 - "@typescript-eslint/tsconfig-utils": 8.36.0 - "@typescript-eslint/types": 8.36.0 - "@typescript-eslint/visitor-keys": 8.36.0 + "@typescript-eslint/project-service": 8.37.0 + "@typescript-eslint/tsconfig-utils": 8.37.0 + "@typescript-eslint/types": 8.37.0 + "@typescript-eslint/visitor-keys": 8.37.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6232,14 +6232,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.36.0, @typescript-eslint/utils@^8.24.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.37.0, @typescript-eslint/utils@^8.24.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.36.0 - "@typescript-eslint/types": 8.36.0 - "@typescript-eslint/typescript-estree": 8.36.0 + "@typescript-eslint/scope-manager": 8.37.0 + "@typescript-eslint/types": 8.37.0 + "@typescript-eslint/typescript-estree": 8.37.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6251,11 +6251,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.36.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.37.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.36.0 + "@typescript-eslint/types": 8.37.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19800,10 +19800,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.36.0 - "@typescript-eslint/parser": 8.36.0 - "@typescript-eslint/typescript-estree": 8.36.0 - "@typescript-eslint/utils": 8.36.0 + "@typescript-eslint/eslint-plugin": 8.37.0 + "@typescript-eslint/parser": 8.37.0 + "@typescript-eslint/typescript-estree": 8.37.0 + "@typescript-eslint/utils": 8.37.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From 9ab05682b7a9685b7088335697608bd2da33e171 Mon Sep 17 00:00:00 2001 From: James Henry Date: Tue, 15 Jul 2025 15:27:59 +0400 Subject: [PATCH 089/283] chore: update to nx 21.2.3 (#11400) --- .gitignore | 5 ++ .vscode/settings.json | 1 + package.json | 10 +-- yarn.lock | 145 +++++++++++++++++++++--------------------- 4 files changed, 84 insertions(+), 77 deletions(-) diff --git a/.gitignore b/.gitignore index bf83f8f9300a..94d644e2544a 100644 --- a/.gitignore +++ b/.gitignore @@ -96,3 +96,8 @@ packages/**/.yarn # Vitest type tests tsconfig*.vitest-temp.json + +# Leave these AI agent files up to individual contributors for now +.cursor/mcp.json +.cursor/rules/nx-rules.mdc +.github/instructions/nx.instructions.md diff --git a/.vscode/settings.json b/.vscode/settings.json index 896fbaebbb3a..23eb7b35f04c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -34,4 +34,5 @@ "extends": "jest_snapshot" }, ], + "nxConsole.generateAiAgentRules": true, } diff --git a/package.json b/package.json index 866837f95da8..33567c469efa 100644 --- a/package.json +++ b/package.json @@ -54,10 +54,10 @@ "@eslint/compat": "^1.2.4", "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.26.0", - "@nx/devkit": "21.0.3", - "@nx/js": "21.0.3", - "@nx/vite": "21.0.3", - "@nx/workspace": "21.0.3", + "@nx/devkit": "21.2.3", + "@nx/js": "21.2.3", + "@nx/vite": "21.2.3", + "@nx/workspace": "21.2.3", "@swc/core": "^1.4.12", "@types/debug": "^4.1.12", "@types/eslint-plugin-jsx-a11y": "^6.10.0", @@ -93,7 +93,7 @@ "knip": "^5.41.1", "lint-staged": "^15.2.2", "markdownlint-cli": "^0.44.0", - "nx": "21.0.3", + "nx": "21.2.3", "prettier": "3.5.0", "rimraf": "^5.0.5", "semver": "7.7.0", diff --git a/yarn.lock b/yarn.lock index 5cfb0b47eb02..4b24883fa03d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4352,9 +4352,9 @@ __metadata: languageName: node linkType: hard -"@nx/devkit@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/devkit@npm:21.0.3" +"@nx/devkit@npm:21.2.3": + version: 21.2.3 + resolution: "@nx/devkit@npm:21.2.3" dependencies: ejs: ^3.1.7 enquirer: ~2.3.6 @@ -4365,14 +4365,14 @@ __metadata: tslib: ^2.3.0 yargs-parser: 21.1.1 peerDependencies: - nx: 21.0.3 - checksum: a742dce7d5103b585d0cb13fc2cf11fb41ad5b031b5bb2ff6c7a6f0c837a287123866a0809d411974e4f03a41b057b14b46c8b226231755563267f6a46d3c611 + nx: 21.2.3 + checksum: 3db18a83a29d5577e89266880d6449d9e1677512adc47bdf0a2fd4448809247a964658555a809ca8f8c3197560e5f08ae3cf12244b9b87329cea6399406ca25a languageName: node linkType: hard -"@nx/js@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/js@npm:21.0.3" +"@nx/js@npm:21.2.3": + version: 21.2.3 + resolution: "@nx/js@npm:21.2.3" dependencies: "@babel/core": ^7.23.2 "@babel/plugin-proposal-decorators": ^7.22.7 @@ -4381,8 +4381,8 @@ __metadata: "@babel/preset-env": ^7.23.2 "@babel/preset-typescript": ^7.22.5 "@babel/runtime": ^7.22.6 - "@nx/devkit": 21.0.3 - "@nx/workspace": 21.0.3 + "@nx/devkit": 21.2.3 + "@nx/workspace": 21.2.3 "@zkochan/js-yaml": 0.0.7 babel-plugin-const-enum: ^1.0.1 babel-plugin-macros: ^3.1.0 @@ -4408,88 +4408,89 @@ __metadata: peerDependenciesMeta: verdaccio: optional: true - checksum: 97af3d23ef58484011ba7e0667656c4ab15e38935176d29310c926ba42d3b78aa50724ae293c15e2f565a9752bcbee3b4007197e778d43a33329d8bd38773bb7 + checksum: d2a79a4ca57bd6251362c8853dddc52f6ea51b7da96913611f73ae44e24d562d9f9d8afa002822932d3e246b605f69e363c5c22db8962d14d5e210eae84a9693 languageName: node linkType: hard -"@nx/nx-darwin-arm64@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/nx-darwin-arm64@npm:21.0.3" +"@nx/nx-darwin-arm64@npm:21.2.3": + version: 21.2.3 + resolution: "@nx/nx-darwin-arm64@npm:21.2.3" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@nx/nx-darwin-x64@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/nx-darwin-x64@npm:21.0.3" +"@nx/nx-darwin-x64@npm:21.2.3": + version: 21.2.3 + resolution: "@nx/nx-darwin-x64@npm:21.2.3" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@nx/nx-freebsd-x64@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/nx-freebsd-x64@npm:21.0.3" +"@nx/nx-freebsd-x64@npm:21.2.3": + version: 21.2.3 + resolution: "@nx/nx-freebsd-x64@npm:21.2.3" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@nx/nx-linux-arm-gnueabihf@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/nx-linux-arm-gnueabihf@npm:21.0.3" +"@nx/nx-linux-arm-gnueabihf@npm:21.2.3": + version: 21.2.3 + resolution: "@nx/nx-linux-arm-gnueabihf@npm:21.2.3" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@nx/nx-linux-arm64-gnu@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/nx-linux-arm64-gnu@npm:21.0.3" +"@nx/nx-linux-arm64-gnu@npm:21.2.3": + version: 21.2.3 + resolution: "@nx/nx-linux-arm64-gnu@npm:21.2.3" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@nx/nx-linux-arm64-musl@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/nx-linux-arm64-musl@npm:21.0.3" +"@nx/nx-linux-arm64-musl@npm:21.2.3": + version: 21.2.3 + resolution: "@nx/nx-linux-arm64-musl@npm:21.2.3" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@nx/nx-linux-x64-gnu@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/nx-linux-x64-gnu@npm:21.0.3" +"@nx/nx-linux-x64-gnu@npm:21.2.3": + version: 21.2.3 + resolution: "@nx/nx-linux-x64-gnu@npm:21.2.3" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@nx/nx-linux-x64-musl@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/nx-linux-x64-musl@npm:21.0.3" +"@nx/nx-linux-x64-musl@npm:21.2.3": + version: 21.2.3 + resolution: "@nx/nx-linux-x64-musl@npm:21.2.3" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@nx/nx-win32-arm64-msvc@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/nx-win32-arm64-msvc@npm:21.0.3" +"@nx/nx-win32-arm64-msvc@npm:21.2.3": + version: 21.2.3 + resolution: "@nx/nx-win32-arm64-msvc@npm:21.2.3" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@nx/nx-win32-x64-msvc@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/nx-win32-x64-msvc@npm:21.0.3" +"@nx/nx-win32-x64-msvc@npm:21.2.3": + version: 21.2.3 + resolution: "@nx/nx-win32-x64-msvc@npm:21.2.3" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@nx/vite@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/vite@npm:21.0.3" +"@nx/vite@npm:21.2.3": + version: 21.2.3 + resolution: "@nx/vite@npm:21.2.3" dependencies: - "@nx/devkit": 21.0.3 - "@nx/js": 21.0.3 + "@nx/devkit": 21.2.3 + "@nx/js": 21.2.3 "@phenomnomnominal/tsquery": ~5.0.1 "@swc/helpers": ~0.5.0 + ajv: ^8.0.0 enquirer: ~2.3.6 picomatch: 4.0.2 semver: ^7.6.3 @@ -4497,23 +4498,23 @@ __metadata: peerDependencies: vite: ^5.0.0 || ^6.0.0 vitest: ^1.3.1 || ^2.0.0 || ^3.0.0 - checksum: 4195276b94cfd310650d5fd68172e00a025b2df75424f1e930923a8703178bc8c1887d3d3854cd4cad2b5b15d70ed4331b9f2aadfba1d172f2d33bc49f098e36 + checksum: cc274da699980816d52927ac037e9f206978853fc4d97c98a08eef8ae542b8ec392e19cf39a2c66889da392853d1553f2179dd8fb223833b3729dcfd8cd68e75 languageName: node linkType: hard -"@nx/workspace@npm:21.0.3": - version: 21.0.3 - resolution: "@nx/workspace@npm:21.0.3" +"@nx/workspace@npm:21.2.3": + version: 21.2.3 + resolution: "@nx/workspace@npm:21.2.3" dependencies: - "@nx/devkit": 21.0.3 + "@nx/devkit": 21.2.3 "@zkochan/js-yaml": 0.0.7 chalk: ^4.1.0 enquirer: ~2.3.6 - nx: 21.0.3 + nx: 21.2.3 picomatch: 4.0.2 tslib: ^2.3.0 yargs-parser: 21.1.1 - checksum: 20c4051faa3a61c28acd8578b04afb4e991da23b382ff8e70aa907d88ea2f553e4b39759a21da893fdf36814ce809a1dce97fc95683576cfb37bf7278f38efc9 + checksum: 6381eb146a0b9b4786452161f7179fcb5f1301b2aa0608ab522b02a0a8e73cdf80097ba68f454dbea94aae31c3b2eb7b23572152fb6cfb6df31b1d6f5a42b4f2 languageName: node linkType: hard @@ -6154,10 +6155,10 @@ __metadata: "@eslint/compat": ^1.2.4 "@eslint/eslintrc": ^3.2.0 "@eslint/js": ^9.26.0 - "@nx/devkit": 21.0.3 - "@nx/js": 21.0.3 - "@nx/vite": 21.0.3 - "@nx/workspace": 21.0.3 + "@nx/devkit": 21.2.3 + "@nx/js": 21.2.3 + "@nx/vite": 21.2.3 + "@nx/workspace": 21.2.3 "@swc/core": ^1.4.12 "@types/debug": ^4.1.12 "@types/eslint-plugin-jsx-a11y": ^6.10.0 @@ -6193,7 +6194,7 @@ __metadata: knip: ^5.41.1 lint-staged: ^15.2.2 markdownlint-cli: ^0.44.0 - nx: 21.0.3 + nx: 21.2.3 prettier: 3.5.0 rimraf: ^5.0.5 semver: 7.7.0 @@ -15289,21 +15290,21 @@ __metadata: languageName: node linkType: hard -"nx@npm:21.0.3": - version: 21.0.3 - resolution: "nx@npm:21.0.3" +"nx@npm:21.2.3": + version: 21.2.3 + resolution: "nx@npm:21.2.3" dependencies: "@napi-rs/wasm-runtime": 0.2.4 - "@nx/nx-darwin-arm64": 21.0.3 - "@nx/nx-darwin-x64": 21.0.3 - "@nx/nx-freebsd-x64": 21.0.3 - "@nx/nx-linux-arm-gnueabihf": 21.0.3 - "@nx/nx-linux-arm64-gnu": 21.0.3 - "@nx/nx-linux-arm64-musl": 21.0.3 - "@nx/nx-linux-x64-gnu": 21.0.3 - "@nx/nx-linux-x64-musl": 21.0.3 - "@nx/nx-win32-arm64-msvc": 21.0.3 - "@nx/nx-win32-x64-msvc": 21.0.3 + "@nx/nx-darwin-arm64": 21.2.3 + "@nx/nx-darwin-x64": 21.2.3 + "@nx/nx-freebsd-x64": 21.2.3 + "@nx/nx-linux-arm-gnueabihf": 21.2.3 + "@nx/nx-linux-arm64-gnu": 21.2.3 + "@nx/nx-linux-arm64-musl": 21.2.3 + "@nx/nx-linux-x64-gnu": 21.2.3 + "@nx/nx-linux-x64-musl": 21.2.3 + "@nx/nx-win32-arm64-msvc": 21.2.3 + "@nx/nx-win32-x64-msvc": 21.2.3 "@yarnpkg/lockfile": ^1.1.0 "@yarnpkg/parsers": 3.0.2 "@zkochan/js-yaml": 0.0.7 @@ -15370,7 +15371,7 @@ __metadata: bin: nx: bin/nx.js nx-cloud: bin/nx-cloud.js - checksum: 9b3ae238d5df6265bff3430e4e0680762fc3236fb2cd3aed4d3177f64f12586fa19aa8dc4f60f9f5674fb035c46dcf6e0dcad3744d717e84f4a70775aaa10d1b + checksum: faaef03d763f6da739f8108c3f8fe4ad5dd30926d15b279508266e8a272164b5d53598fb3ff5b636ee665bb8e9782ccc2a3134cb6c977b577c5c16d5f20722bd languageName: node linkType: hard From 3f58afe010b150a51ca7bcda023c82a50026ea59 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Tue, 15 Jul 2025 07:23:01 -0500 Subject: [PATCH 090/283] chore(tsconfig-utils): sync `vitest` config with latest setup (#11239) * chore(`tsconfig-utils`): sync `vitest` config with latest setup * revert dependency changes --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .../{lib => }/getParsedConfigFile.test.ts | 22 +++++++++---------- packages/tsconfig-utils/tsconfig.build.json | 13 ++--------- packages/tsconfig-utils/tsconfig.spec.json | 14 +----------- packages/tsconfig-utils/vitest.config.mts | 5 ----- 4 files changed, 14 insertions(+), 40 deletions(-) rename packages/tsconfig-utils/tests/{lib => }/getParsedConfigFile.test.ts (88%) diff --git a/packages/tsconfig-utils/tests/lib/getParsedConfigFile.test.ts b/packages/tsconfig-utils/tests/getParsedConfigFile.test.ts similarity index 88% rename from packages/tsconfig-utils/tests/lib/getParsedConfigFile.test.ts rename to packages/tsconfig-utils/tests/getParsedConfigFile.test.ts index d26919b52b5c..661c84dcb6b0 100644 --- a/packages/tsconfig-utils/tests/lib/getParsedConfigFile.test.ts +++ b/packages/tsconfig-utils/tests/getParsedConfigFile.test.ts @@ -1,7 +1,7 @@ -import path from 'node:path'; +import * as path from 'node:path'; import * as ts from 'typescript'; -import { getParsedConfigFile } from '../../src/getParsedConfigFile'; +import { getParsedConfigFile } from '../src/getParsedConfigFile.js'; const mockGetParsedCommandLineOfConfigFile = vi.fn(); @@ -22,9 +22,9 @@ describe(getParsedConfigFile, () => { }); it('throws an error when tsserver.sys is undefined', () => { - expect(() => - getParsedConfigFile({} as typeof ts, './tsconfig.json'), - ).toThrow( + expect(() => { + getParsedConfigFile({} as typeof ts, './tsconfig.json'); + }).toThrow( '`getParsedConfigFile` is only supported in a Node-like environment.', ); }); @@ -72,9 +72,9 @@ describe(getParsedConfigFile, () => { }, ] satisfies ts.Diagnostic[], }); - expect(() => getParsedConfigFile(mockTsserver, './tsconfig.json')).toThrow( - /.+ error TS1234: Oh no!/, - ); + expect(() => { + getParsedConfigFile(mockTsserver, './tsconfig.json'); + }).toThrow(/.+ error TS1234: Oh no!/); }); it('throws a diagnostic error when getParsedCommandLineOfConfigFile throws an error', () => { @@ -96,9 +96,9 @@ describe(getParsedConfigFile, () => { } satisfies ts.Diagnostic); }, ); - expect(() => getParsedConfigFile(mockTsserver, './tsconfig.json')).toThrow( - /.+ error TS1234: Oh no!/, - ); + expect(() => { + getParsedConfigFile(mockTsserver, './tsconfig.json'); + }).toThrow(/.+ error TS1234: Oh no!/); }); it('uses compiler options when parsing a config file succeeds', () => { diff --git a/packages/tsconfig-utils/tsconfig.build.json b/packages/tsconfig-utils/tsconfig.build.json index 2250b25126e4..4a1f19accacd 100644 --- a/packages/tsconfig-utils/tsconfig.build.json +++ b/packages/tsconfig-utils/tsconfig.build.json @@ -1,14 +1,5 @@ { - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "baseUrl": ".", - "rootDir": "src", - "outDir": "dist", - "tsBuildInfoFile": "dist/tsconfig.build.tsbuildinfo", - "emitDeclarationOnly": false, - "types": ["node"] - }, - "include": ["src/**/*.ts", "typings"], - "exclude": ["vitest.config.mts", "src/**/*.spec.ts", "src/**/*.test.ts"], + "extends": "../../tsconfig.build.json", + "compilerOptions": {}, "references": [] } diff --git a/packages/tsconfig-utils/tsconfig.spec.json b/packages/tsconfig-utils/tsconfig.spec.json index 21fcf7e24f3f..29124fc697d3 100644 --- a/packages/tsconfig-utils/tsconfig.spec.json +++ b/packages/tsconfig-utils/tsconfig.spec.json @@ -1,20 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "../../dist/out-tsc/packages/tsconfig-utils", - "module": "NodeNext", - "resolveJsonModule": true, - "types": ["node", "vitest/globals", "vitest/importMeta"] + "outDir": "../../dist/packages/tsconfig-utils" }, - "include": [ - "vitest.config.mts", - "package.json", - "src/**/*.test.ts", - "src/**/*.spec.ts", - "src/**/*.d.ts", - "tests" - ], - "exclude": ["**/fixtures/**"], "references": [ { "path": "./tsconfig.build.json" diff --git a/packages/tsconfig-utils/vitest.config.mts b/packages/tsconfig-utils/vitest.config.mts index 9cadb9dea2bb..ddc038f86b56 100644 --- a/packages/tsconfig-utils/vitest.config.mts +++ b/packages/tsconfig-utils/vitest.config.mts @@ -11,14 +11,9 @@ const vitestConfig = mergeConfig( root: import.meta.dirname, test: { - diff: { - maxDepth: 1, - }, - dir: path.join(import.meta.dirname, 'tests'), name: packageJson.name.replace('@typescript-eslint/', ''), root: import.meta.dirname, - testTimeout: 10_000, }, }), ); From 0e884c7cbd08b1cd071a67a4faef61a7a8d3ba68 Mon Sep 17 00:00:00 2001 From: Younsang Na <77400131+nayounsang@users.noreply.github.com> Date: Wed, 16 Jul 2025 23:05:10 +0900 Subject: [PATCH 091/283] fix(eslint-plugin): [consistent-generic-constructors] resolve conflict with `isolatedDeclarations` if enabled in `constructor` option (#11351) * test: add tc * fix: ignore constructor report when id is enabled --- .../src/rules/consistent-generic-constructors.ts | 3 ++- .../rules/consistent-generic-constructors.test.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts b/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts index f2a4808d25dd..a26f1422460e 100644 --- a/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts +++ b/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts @@ -123,7 +123,8 @@ export default createRule({ return; } - if (lhs?.typeArguments && !rhs.typeArguments) { + const isolatedDeclarations = context.parserOptions.isolatedDeclarations; + if (!isolatedDeclarations && lhs?.typeArguments && !rhs.typeArguments) { const hasParens = context.sourceCode.getTokenAfter(rhs.callee)?.value === '('; const extraComments = new Set( diff --git a/packages/eslint-plugin/tests/rules/consistent-generic-constructors.test.ts b/packages/eslint-plugin/tests/rules/consistent-generic-constructors.test.ts index 4d0403a85a87..1a573186b1ae 100644 --- a/packages/eslint-plugin/tests/rules/consistent-generic-constructors.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-generic-constructors.test.ts @@ -45,6 +45,16 @@ class A { ` const a = function (a: Foo = new Foo()) {}; `, + { + code: ` +const foo: Foo = new Foo(); + `, + languageOptions: { + parserOptions: { + isolatedDeclarations: true, + }, + }, + }, // type-annotation { code: 'const a = new Foo();', From f08d08fb48694eea85b38504cc69a5256d1f790e Mon Sep 17 00:00:00 2001 From: MK <19619718+asdf93074@users.noreply.github.com> Date: Fri, 18 Jul 2025 18:07:46 +0500 Subject: [PATCH 092/283] feat(typescript-estree): forbid optional chain in `TemplateTaggedLiteral` (#11391) --- .../_error_/optional-nested-function-tag/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 7 +++++++ .../snapshots/2-Babel-Error.shot | 8 ++++++++ .../snapshots/3-Alignment-Error.shot | 4 ++++ .../fixtures/_error_/optional-nested-tag/fixture.ts | 1 + .../optional-nested-tag/snapshots/1-TSESTree-Error.shot | 7 +++++++ .../optional-nested-tag/snapshots/2-Babel-Error.shot | 8 ++++++++ .../optional-nested-tag/snapshots/3-Alignment-Error.shot | 4 ++++ .../fixtures/_error_/optional-tag/fixture.ts | 1 + .../_error_/optional-tag/snapshots/1-TSESTree-Error.shot | 7 +++++++ .../_error_/optional-tag/snapshots/2-Babel-Error.shot | 8 ++++++++ .../optional-tag/snapshots/3-Alignment-Error.shot | 4 ++++ packages/typescript-estree/src/convert.ts | 9 ++++++++- 13 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/fixture.ts create mode 100644 packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/fixture.ts create mode 100644 packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/fixture.ts create mode 100644 packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/3-Alignment-Error.shot diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/fixture.ts b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/fixture.ts new file mode 100644 index 000000000000..7fc56660a355 --- /dev/null +++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/fixture.ts @@ -0,0 +1 @@ +a?.b()`...` diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..e096b5f6d715 --- /dev/null +++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-nested-function-tag > TSESTree - Error`] +TSError +> 1 | a?.b()`...` + | ^^^^^^^^^^^ Tagged template expressions are not permitted in an optional chain. + 2 | diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..69c9ea2f84ea --- /dev/null +++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-nested-function-tag > Babel - Error`] +BabelError +> 1 | a?.b()`...` + | ^ Tagged Template Literals are not allowed in optionalChain. (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..11aea0c55d48 --- /dev/null +++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-nested-function-tag > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/fixture.ts b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/fixture.ts new file mode 100644 index 000000000000..d6e041652e3d --- /dev/null +++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/fixture.ts @@ -0,0 +1 @@ +a?.b.c`...` diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..3be80a77ffb4 --- /dev/null +++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-nested-tag > TSESTree - Error`] +TSError +> 1 | a?.b.c`...` + | ^^^^^^^^^^^ Tagged template expressions are not permitted in an optional chain. + 2 | diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..e27266628424 --- /dev/null +++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-nested-tag > Babel - Error`] +BabelError +> 1 | a?.b.c`...` + | ^ Tagged Template Literals are not allowed in optionalChain. (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..87a5ea5117c6 --- /dev/null +++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-nested-tag > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/fixture.ts b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/fixture.ts new file mode 100644 index 000000000000..fb8c8604a1d5 --- /dev/null +++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/fixture.ts @@ -0,0 +1 @@ +a?.b`...` diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..b7909f67ed9e --- /dev/null +++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,7 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-tag > TSESTree - Error`] +TSError +> 1 | a?.b`...` + | ^^^^^^^^^ Tagged template expressions are not permitted in an optional chain. + 2 | diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..23079d1b071e --- /dev/null +++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/2-Babel-Error.shot @@ -0,0 +1,8 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-tag > Babel - Error`] +BabelError +> 1 | a?.b`...` + | ^ Tagged Template Literals are not allowed in optionalChain. (1:0) + 2 | + diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..d32839672fdb --- /dev/null +++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-tag > Error Alignment`] +Both errored diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index f2a504aa4a1d..7ebc034afdec 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1917,7 +1917,13 @@ export class Converter { return result; } - case SyntaxKind.TaggedTemplateExpression: + case SyntaxKind.TaggedTemplateExpression: { + if (node.tag.flags & ts.NodeFlags.OptionalChain) { + this.#throwError( + node, + 'Tagged template expressions are not permitted in an optional chain.', + ); + } return this.createNode(node, { type: AST_NODE_TYPES.TaggedTemplateExpression, quasi: this.convertChild(node.template), @@ -1929,6 +1935,7 @@ export class Converter { node, ), }); + } case SyntaxKind.TemplateHead: case SyntaxKind.TemplateMiddle: From 47f73916cb34363a0358dadd9705ffeeb39077a1 Mon Sep 17 00:00:00 2001 From: tao <2471314@gmail.com> Date: Fri, 18 Jul 2025 21:08:55 +0800 Subject: [PATCH 093/283] fix(typescript-estree): ensure the token type of the property name is Identifier (#11329) --- packages/typescript-estree/src/node-utils.ts | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 16054dfc9960..640b493d63bb 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -480,25 +480,6 @@ export function getTokenType( if (token.kind === SyntaxKind.NullKeyword) { return AST_TOKEN_TYPES.Null; } - let keywordKind: ts.SyntaxKind | undefined; - if (isAtLeast50 && token.kind === SyntaxKind.Identifier) { - keywordKind = ts.identifierToKeywordKind(token as ts.Identifier); - } else if ('originalKeywordKind' in token) { - // @ts-expect-error -- intentional fallback for older TS versions <=4.9 - keywordKind = token.originalKeywordKind; - } - if (keywordKind) { - if (keywordKind === SyntaxKind.NullKeyword) { - return AST_TOKEN_TYPES.Null; - } - if ( - keywordKind >= SyntaxKind.FirstFutureReservedWord && - keywordKind <= SyntaxKind.LastKeyword - ) { - return AST_TOKEN_TYPES.Identifier; - } - return AST_TOKEN_TYPES.Keyword; - } if ( token.kind >= SyntaxKind.FirstKeyword && From ca007144147e5b39d469b9ef850bd309f240341a Mon Sep 17 00:00:00 2001 From: Lauren Yim <31467609+cherryblossom000@users.noreply.github.com> Date: Sat, 19 Jul 2025 17:02:24 +1000 Subject: [PATCH 094/283] chore: fix default value in JSDoc for reportUnusedDisableDirectives (#11409) chore: fix default value in jsdoc for reportUnusedDisableDirectives --- packages/utils/src/ts-eslint/Config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/src/ts-eslint/Config.ts b/packages/utils/src/ts-eslint/Config.ts index c9eaee06d71c..95ab05d9f2f2 100644 --- a/packages/utils/src/ts-eslint/Config.ts +++ b/packages/utils/src/ts-eslint/Config.ts @@ -194,7 +194,7 @@ export namespace FlatConfig { * A severity string indicating if and how unused disable and enable * directives should be tracked and reported. For legacy compatibility, `true` * is equivalent to `"warn"` and `false` is equivalent to `"off"`. - * @default "off" + * @default "warn" */ reportUnusedDisableDirectives?: | boolean From 5ec8c589bf9742bcce72367f2fb195964cfa166a Mon Sep 17 00:00:00 2001 From: Andrew Kazakov Date: Sat, 19 Jul 2025 10:03:07 +0300 Subject: [PATCH 095/283] fix: disallow extra properties in rule options (#11397) * fix: disallow extra properties in rule options * chore: regenerate schema snapshots * fix: linter errors --- packages/eslint-plugin/src/rules/prefer-destructuring.ts | 1 + packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts | 1 + .../tests/schema-snapshots/prefer-destructuring.shot | 2 +- .../tests/schema-snapshots/prefer-nullish-coalescing.shot | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/src/rules/prefer-destructuring.ts b/packages/eslint-plugin/src/rules/prefer-destructuring.ts index 5934573e3350..a3afb125a301 100644 --- a/packages/eslint-plugin/src/rules/prefer-destructuring.ts +++ b/packages/eslint-plugin/src/rules/prefer-destructuring.ts @@ -52,6 +52,7 @@ const schema: readonly JSONSchema4[] = [ }, { type: 'object', + additionalProperties: false, properties: { enforceForDeclarationWithTypeAnnotation: { type: 'boolean', diff --git a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts index 3e8c5914fa9f..d611e7b079a9 100644 --- a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts +++ b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts @@ -123,6 +123,7 @@ export default createRule({ oneOf: [ { type: 'object', + additionalProperties: false, description: 'Which primitives types may be ignored.', properties: { bigint: { diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-destructuring.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-destructuring.shot index 61036ced3fda..d99ed3d30301 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/prefer-destructuring.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-destructuring.shot @@ -49,6 +49,7 @@ ] }, { + "additionalProperties": false, "properties": { "enforceForDeclarationWithTypeAnnotation": { "description": "Whether to enforce destructuring on variable declarations with type annotations.", @@ -88,6 +89,5 @@ type Options = [ enforceForDeclarationWithTypeAnnotation?: boolean; /** Whether to enforce destructuring that use a different variable name than the property name. */ enforceForRenamedProperties?: boolean; - [k: string]: unknown; }, ]; diff --git a/packages/eslint-plugin/tests/schema-snapshots/prefer-nullish-coalescing.shot b/packages/eslint-plugin/tests/schema-snapshots/prefer-nullish-coalescing.shot index 18b7da68ac53..5a8ea93c4ed6 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/prefer-nullish-coalescing.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/prefer-nullish-coalescing.shot @@ -29,6 +29,7 @@ "description": "Whether to ignore all (`true`) or some (an object with properties) primitive types.", "oneOf": [ { + "additionalProperties": false, "description": "Which primitives types may be ignored.", "properties": { "bigint": { @@ -95,7 +96,6 @@ type Options = [ number?: boolean; /** Ignore string primitive types. */ string?: boolean; - [k: string]: unknown; } /** Ignore all primitive types. */ | true; From abb7c4de8cae95da11791610171108840141f4f2 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 21 Jul 2025 04:28:06 -0600 Subject: [PATCH 096/283] fix(typescript-eslint): infer tsconfigRootDir with v8 API (#11412) * infer tsconfigRootDir with v8 API * fix up test * fixup * ensure that test works with broken stack trace * remove unnecessary defensive coding * remove AI-looking comment --- .../src/getTSConfigRootDirFromStack.ts | 41 +++++++++--- packages/typescript-eslint/src/index.ts | 5 +- .../tests/getTsconfigRootDirFromStack.test.ts | 66 ++++++------------- .../normal-folder/eslint.config.cts | 10 +++ .../not-an-eslint.config.cts | 10 +++ .../folder that has a space/eslint.config.cts | 10 +++ 6 files changed, 84 insertions(+), 58 deletions(-) create mode 100644 packages/typescript-eslint/tests/path-test-fixtures/tsconfigRootDirInference-normal/normal-folder/eslint.config.cts create mode 100644 packages/typescript-eslint/tests/path-test-fixtures/tsconfigRootDirInference-not-eslint-config/not-an-eslint.config.cts create mode 100644 packages/typescript-eslint/tests/path-test-fixtures/tsconfigRootDirInference-space/folder that has a space/eslint.config.cts diff --git a/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts b/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts index 01378b1618f3..b4ac708ea3ba 100644 --- a/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts +++ b/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts @@ -1,15 +1,40 @@ -import { fileURLToPath } from 'node:url'; +import path from 'node:path'; -export function getTSConfigRootDirFromStack(stack: string): string | undefined { - for (const line of stack.split('\n').map(line => line.trim())) { - const candidate = /(\S+)eslint\.config\.(c|m)?(j|t)s/.exec(line)?.[1]; - if (!candidate) { +/** + * Infers the `tsconfigRootDir` from the current call stack, using the V8 API. + * + * See https://v8.dev/docs/stack-trace-api + * + * This API is implemented in Deno and Bun as well. + */ +export function getTSConfigRootDirFromStack(): string | undefined { + function getStack(): NodeJS.CallSite[] { + const stackTraceLimit = Error.stackTraceLimit; + Error.stackTraceLimit = Infinity; + const prepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = (_, structuredStackTrace) => structuredStackTrace; + + const dummyObject: { stack?: NodeJS.CallSite[] } = {}; + Error.captureStackTrace(dummyObject, getTSConfigRootDirFromStack); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- stack is set by captureStackTrace + const rv = dummyObject.stack!; + + Error.prepareStackTrace = prepareStackTrace; + Error.stackTraceLimit = stackTraceLimit; + + return rv; + } + + for (const callSite of getStack()) { + const stackFrameFilePath = callSite.getFileName(); + if (!stackFrameFilePath) { continue; } - return candidate.startsWith('file://') - ? fileURLToPath(candidate) - : candidate; + const parsedPath = path.parse(stackFrameFilePath); + if (/^eslint\.config\.(c|m)?(j|t)s$/.test(parsedPath.base)) { + return parsedPath.dir; + } } return undefined; diff --git a/packages/typescript-eslint/src/index.ts b/packages/typescript-eslint/src/index.ts index 9892ede6065a..b123d80b4db2 100644 --- a/packages/typescript-eslint/src/index.ts +++ b/packages/typescript-eslint/src/index.ts @@ -135,10 +135,7 @@ function createConfigsGetters(values: T): T { { enumerable: true, get: () => { - const candidateRootDir = getTSConfigRootDirFromStack( - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - new Error().stack!, - ); + const candidateRootDir = getTSConfigRootDirFromStack(); if (candidateRootDir) { addCandidateTSConfigRootDir(candidateRootDir); } diff --git a/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts b/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts index 57a3b0b5f2a3..a9c169785c65 100644 --- a/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts +++ b/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts @@ -1,54 +1,28 @@ -import path from 'node:path'; - import { getTSConfigRootDirFromStack } from '../src/getTSConfigRootDirFromStack'; - -const isWindows = process.platform === 'win32'; +import * as normalFolder from './path-test-fixtures/tsconfigRootDirInference-normal/normal-folder/eslint.config.cjs'; +import * as notEslintConfig from './path-test-fixtures/tsconfigRootDirInference-not-eslint-config/not-an-eslint.config.cjs'; +import * as folderThatHasASpace from './path-test-fixtures/tsconfigRootDirInference-space/folder that has a space/eslint.config.cjs'; describe(getTSConfigRootDirFromStack, () => { - it('returns undefined when no file path seems to be an ESLint config', () => { - const actual = getTSConfigRootDirFromStack( - [ - `Error`, - ' at file:///other.config.js', - ' at ModuleJob.run', - 'at async NodeHfs.walk(...)', - ].join('\n'), - ); - - expect(actual).toBeUndefined(); + it('does stack analysis right for normal folder', () => { + expect(normalFolder.get()).toBe(normalFolder.dirname()); }); - it.runIf(!isWindows)( - 'returns a Posix config file path when a file:// path to an ESLint config is in the stack', - () => { - const actual = getTSConfigRootDirFromStack( - [ - `Error`, - ' at file:///path/to/file/eslint.config.js', - ' at ModuleJob.run', - 'at async NodeHfs.walk(...)', - ].join('\n'), - ); - - expect(actual).toBe('/path/to/file/'); - }, - ); - - it.each(['cjs', 'cts', 'js', 'mjs', 'mts', 'ts'])( - 'returns the path to the config file when its extension is %s', - extension => { - const expected = isWindows ? 'C:\\path\\to\\file\\' : '/path/to/file/'; + it('does stack analysis right for folder that has a space', () => { + expect(folderThatHasASpace.get()).toBe(folderThatHasASpace.dirname()); + }); - const actual = getTSConfigRootDirFromStack( - [ - `Error`, - ` at ${path.join(expected, `eslint.config.${extension}`)}`, - ' at ModuleJob.run', - 'at async NodeHfs.walk(...)', - ].join('\n'), - ); + it("doesn't get tricked by a file that is not an ESLint config", () => { + expect(notEslintConfig.get()).toBeUndefined(); + }); - expect(actual).toBe(expected); - }, - ); + it('should work in the presence of a messed up strack trace string', () => { + const prepareStackTrace = Error.prepareStackTrace; + const dummyFunction = () => {}; + Error.prepareStackTrace = dummyFunction; + expect(new Error().stack).toBeUndefined(); + expect(normalFolder.get()).toBe(normalFolder.dirname()); + expect(Error.prepareStackTrace).toBe(dummyFunction); + Error.prepareStackTrace = prepareStackTrace; + }); }); diff --git a/packages/typescript-eslint/tests/path-test-fixtures/tsconfigRootDirInference-normal/normal-folder/eslint.config.cts b/packages/typescript-eslint/tests/path-test-fixtures/tsconfigRootDirInference-normal/normal-folder/eslint.config.cts new file mode 100644 index 000000000000..39678798c6dc --- /dev/null +++ b/packages/typescript-eslint/tests/path-test-fixtures/tsconfigRootDirInference-normal/normal-folder/eslint.config.cts @@ -0,0 +1,10 @@ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +import { getTSConfigRootDirFromStack } from './../../../../src/getTSConfigRootDirFromStack'; + +export function get() { + return getTSConfigRootDirFromStack(); +} + +export function dirname() { + return __dirname; +} diff --git a/packages/typescript-eslint/tests/path-test-fixtures/tsconfigRootDirInference-not-eslint-config/not-an-eslint.config.cts b/packages/typescript-eslint/tests/path-test-fixtures/tsconfigRootDirInference-not-eslint-config/not-an-eslint.config.cts new file mode 100644 index 000000000000..16f159971d9e --- /dev/null +++ b/packages/typescript-eslint/tests/path-test-fixtures/tsconfigRootDirInference-not-eslint-config/not-an-eslint.config.cts @@ -0,0 +1,10 @@ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +import { getTSConfigRootDirFromStack } from '../../../src/getTSConfigRootDirFromStack'; + +export function get() { + return getTSConfigRootDirFromStack(); +} + +export function dirname() { + return __dirname; +} diff --git a/packages/typescript-eslint/tests/path-test-fixtures/tsconfigRootDirInference-space/folder that has a space/eslint.config.cts b/packages/typescript-eslint/tests/path-test-fixtures/tsconfigRootDirInference-space/folder that has a space/eslint.config.cts new file mode 100644 index 000000000000..ba723627ffad --- /dev/null +++ b/packages/typescript-eslint/tests/path-test-fixtures/tsconfigRootDirInference-space/folder that has a space/eslint.config.cts @@ -0,0 +1,10 @@ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +import { getTSConfigRootDirFromStack } from '../../../../src/getTSConfigRootDirFromStack'; + +export function get() { + return getTSConfigRootDirFromStack(); +} + +export function dirname() { + return __dirname; +} From 6d8fae941019f0381e99d6e0df01626f1c17b749 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 21 Jul 2025 09:18:53 -0600 Subject: [PATCH 097/283] fix(typescript-eslint): error on nested `extends` in `tseslint.config()` (#11361) * feat(typescript-eslint): support `basePath` in `tseslint.config()` * since * fixup * fixup fixup * fixup since * Move definition of `basePath` to the correct place * fix(typescript-eslint): Error on nested `extends` in `tseslint.config()` --- packages/typescript-eslint/src/config-helper.ts | 7 +++++++ .../typescript-eslint/tests/config-helper.test.ts | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/packages/typescript-eslint/src/config-helper.ts b/packages/typescript-eslint/src/config-helper.ts index fab062012487..51456475734f 100644 --- a/packages/typescript-eslint/src/config-helper.ts +++ b/packages/typescript-eslint/src/config-helper.ts @@ -174,6 +174,13 @@ function configImpl(...configs: unknown[]): ConfigArray { ` 'basePath' in 'extends' is not allowed.`, ); } + + if ('extends' in extension) { + throw new TypeError( + `tseslint.config(): Config at index ${configIndex}${nameErrorPhrase} has an 'extends' array that contains a config with an 'extends' property at index ${extensionIndex}.` + + ` Nested 'extends' is not allowed.`, + ); + } } if (nonObjectExtensions.length > 0) { const extensionIndices = nonObjectExtensions.join(', '); diff --git a/packages/typescript-eslint/tests/config-helper.test.ts b/packages/typescript-eslint/tests/config-helper.test.ts index b075170bcff7..8b4a151a32cf 100644 --- a/packages/typescript-eslint/tests/config-helper.test.ts +++ b/packages/typescript-eslint/tests/config-helper.test.ts @@ -416,4 +416,19 @@ describe('config helper', () => { "tseslint.config(): Config at index 0 (anonymous) has an 'extends' array that contains a config with a 'basePath' property at index 0. 'basePath' in 'extends' is not allowed.", ); }); + + it('should error when trying to use nested extends', () => { + expect(() => { + tseslint.config({ + extends: [ + { + extends: [ + { rules: { rule1: 'error' } }, + { rules: { rule2: 'error' } }, + ], + }, + ], + }); + }).toThrow(); + }); }); From d11e79e9c9edc9f6f5e66306e3b3d65f3149a760 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 21 Jul 2025 17:21:42 +0000 Subject: [PATCH 098/283] chore(release): publish 8.38.0 --- CHANGELOG.md | 24 +++++ packages/ast-spec/CHANGELOG.md | 12 +++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 14 +++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 13 +++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 17 ++++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 240 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2df46b80dd5..4fc35a618ac2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,27 @@ +## 8.38.0 (2025-07-21) + +### 🚀 Features + +- **typescript-estree:** forbid optional chain in `TemplateTaggedLiteral` ([#11391](https://github.com/typescript-eslint/typescript-eslint/pull/11391)) + +### 🩹 Fixes + +- disallow extra properties in rule options ([#11397](https://github.com/typescript-eslint/typescript-eslint/pull/11397)) +- **eslint-plugin:** [consistent-generic-constructors] resolve conflict with `isolatedDeclarations` if enabled in `constructor` option ([#11351](https://github.com/typescript-eslint/typescript-eslint/pull/11351)) +- **typescript-eslint:** infer tsconfigRootDir with v8 API ([#11412](https://github.com/typescript-eslint/typescript-eslint/pull/11412)) +- **typescript-eslint:** error on nested `extends` in `tseslint.config()` ([#11361](https://github.com/typescript-eslint/typescript-eslint/pull/11361)) +- **typescript-estree:** ensure the token type of the property name is Identifier ([#11329](https://github.com/typescript-eslint/typescript-eslint/pull/11329)) + +### ❤️ Thank You + +- Andrew Kazakov @andreww2012 +- Kirk Waiblinger @kirkwaiblinger +- MK @asdf93074 +- tao +- Younsang Na @nayounsang + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index f526c7d328f8..e8521d2d1873 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.38.0 (2025-07-21) + +### 🚀 Features + +- **typescript-estree:** forbid optional chain in `TemplateTaggedLiteral` ([#11391](https://github.com/typescript-eslint/typescript-eslint/pull/11391)) + +### ❤️ Thank You + +- MK @asdf93074 + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) This was a version bump only for ast-spec to align it with other projects, there were no code changes. diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index c19afac7b4a5..4a998776122a 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.37.0", + "version": "8.38.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 28a98c667217..3d95f6d98077 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,17 @@ +## 8.38.0 (2025-07-21) + +### 🩹 Fixes + +- disallow extra properties in rule options ([#11397](https://github.com/typescript-eslint/typescript-eslint/pull/11397)) +- **eslint-plugin:** [consistent-generic-constructors] resolve conflict with `isolatedDeclarations` if enabled in `constructor` option ([#11351](https://github.com/typescript-eslint/typescript-eslint/pull/11351)) + +### ❤️ Thank You + +- Andrew Kazakov @andreww2012 +- Younsang Na @nayounsang + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) ### 🩹 Fixes diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 050b7f0a6736..414b1934c311 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.37.0", + "version": "8.38.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.37.0", - "@typescript-eslint/type-utils": "8.37.0", - "@typescript-eslint/utils": "8.37.0", - "@typescript-eslint/visitor-keys": "8.37.0", + "@typescript-eslint/scope-manager": "8.38.0", + "@typescript-eslint/type-utils": "8.38.0", + "@typescript-eslint/utils": "8.38.0", + "@typescript-eslint/visitor-keys": "8.38.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.37.0", - "@typescript-eslint/rule-tester": "8.37.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.38.0", + "@typescript-eslint/rule-tester": "8.38.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.37.0", + "@typescript-eslint/parser": "^8.38.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index be88e2ac776d..f60e62dae6d1 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.38.0 (2025-07-21) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 35fd3a636b6d..83d0fe1499f8 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.37.0", + "version": "8.38.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.37.0", - "@typescript-eslint/types": "8.37.0", - "@typescript-eslint/typescript-estree": "8.37.0", - "@typescript-eslint/visitor-keys": "8.37.0", + "@typescript-eslint/scope-manager": "8.38.0", + "@typescript-eslint/types": "8.38.0", + "@typescript-eslint/typescript-estree": "8.38.0", + "@typescript-eslint/visitor-keys": "8.38.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 435224397b79..5390dc0080b1 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.38.0 (2025-07-21) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 76c566ccb0bf..c74ab6d96c3e 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.37.0", + "version": "8.38.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <5.9.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.37.0", - "@typescript-eslint/types": "^8.37.0", + "@typescript-eslint/tsconfig-utils": "^8.38.0", + "@typescript-eslint/types": "^8.38.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 31d7e872ffaf..b4fa33f66420 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.38.0 (2025-07-21) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 2e0089add902..f9b50559c3bd 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.37.0", + "version": "8.38.0", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.37.0", - "@typescript-eslint/utils": "8.37.0", + "@typescript-eslint/type-utils": "8.38.0", + "@typescript-eslint/utils": "8.38.0", "natural-compare": "^1.4.0", "prettier": "3.5.0" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 89c587e5625d..8f74f2fe9b17 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.38.0 (2025-07-21) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index a20b6981bc5b..e6f9af825a51 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.37.0", + "version": "8.38.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.37.0", - "@typescript-eslint/typescript-estree": "8.37.0", - "@typescript-eslint/utils": "8.37.0", + "@typescript-eslint/parser": "8.38.0", + "@typescript-eslint/typescript-estree": "8.38.0", + "@typescript-eslint/utils": "8.38.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 5a4cf4d94b80..2e2cbc0b546d 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.38.0 (2025-07-21) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 826c54d45bb3..b23260130d87 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.37.0", + "version": "8.38.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.37.0", - "@typescript-eslint/visitor-keys": "8.37.0" + "@typescript-eslint/types": "8.38.0", + "@typescript-eslint/visitor-keys": "8.38.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.37.0", + "@typescript-eslint/typescript-estree": "8.38.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 97e2d9f284b3..d6b86ffae289 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.38.0 (2025-07-21) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 74105bcd3679..4ffee83ef6bc 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.37.0", + "version": "8.38.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 849896c3c20b..6933f3251555 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.38.0 (2025-07-21) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) ### 🩹 Fixes diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 0a841c7d7b09..519a9c639b8b 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.37.0", + "version": "8.38.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.37.0", - "@typescript-eslint/typescript-estree": "8.37.0", - "@typescript-eslint/utils": "8.37.0", + "@typescript-eslint/types": "8.38.0", + "@typescript-eslint/typescript-estree": "8.38.0", + "@typescript-eslint/utils": "8.38.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <5.9.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.37.0", + "@typescript-eslint/parser": "8.38.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index dd01ef09238a..d7d95719f448 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.38.0 (2025-07-21) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 65e7cb13c9e0..ee0dc3efc5cb 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.37.0", + "version": "8.38.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index d1a0e17c8392..5643448c16a2 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,16 @@ +## 8.38.0 (2025-07-21) + +### 🩹 Fixes + +- **typescript-eslint:** error on nested `extends` in `tseslint.config()` ([#11361](https://github.com/typescript-eslint/typescript-eslint/pull/11361)) +- **typescript-eslint:** infer tsconfigRootDir with v8 API ([#11412](https://github.com/typescript-eslint/typescript-eslint/pull/11412)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) ### 🚀 Features diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 960b087a873e..7396e05a7644 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.37.0", + "version": "8.38.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.37.0", - "@typescript-eslint/parser": "8.37.0", - "@typescript-eslint/typescript-estree": "8.37.0", - "@typescript-eslint/utils": "8.37.0" + "@typescript-eslint/eslint-plugin": "8.38.0", + "@typescript-eslint/parser": "8.38.0", + "@typescript-eslint/typescript-estree": "8.38.0", + "@typescript-eslint/utils": "8.38.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index d087e6d8b727..019910777dd8 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,20 @@ +## 8.38.0 (2025-07-21) + +### 🚀 Features + +- **typescript-estree:** forbid optional chain in `TemplateTaggedLiteral` ([#11391](https://github.com/typescript-eslint/typescript-eslint/pull/11391)) + +### 🩹 Fixes + +- **typescript-estree:** ensure the token type of the property name is Identifier ([#11329](https://github.com/typescript-eslint/typescript-eslint/pull/11329)) + +### ❤️ Thank You + +- MK @asdf93074 +- tao + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) ### 🚀 Features diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index a5fb3509ed12..ce6d4b54e5b3 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.37.0", + "version": "8.38.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.37.0", - "@typescript-eslint/tsconfig-utils": "8.37.0", - "@typescript-eslint/types": "8.37.0", - "@typescript-eslint/visitor-keys": "8.37.0", + "@typescript-eslint/project-service": "8.38.0", + "@typescript-eslint/tsconfig-utils": "8.38.0", + "@typescript-eslint/types": "8.38.0", + "@typescript-eslint/visitor-keys": "8.38.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index e3fe13f97b56..a3d48e647c5f 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.38.0 (2025-07-21) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index 868c42f0ab73..06f8448a8cdb 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.37.0", + "version": "8.38.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.37.0", - "@typescript-eslint/types": "8.37.0", - "@typescript-eslint/typescript-estree": "8.37.0" + "@typescript-eslint/scope-manager": "8.38.0", + "@typescript-eslint/types": "8.38.0", + "@typescript-eslint/typescript-estree": "8.38.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 062e1ba8c16c..79679da51f0d 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.38.0 (2025-07-21) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.37.0 (2025-07-14) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 22a7f00d02ca..f3a18a014ec0 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.37.0", + "version": "8.38.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.37.0", + "@typescript-eslint/types": "8.38.0", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 4b24883fa03d..25ffc632519d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5955,19 +5955,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.37.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.38.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.37.0 - "@typescript-eslint/rule-tester": 8.37.0 - "@typescript-eslint/scope-manager": 8.37.0 - "@typescript-eslint/type-utils": 8.37.0 - "@typescript-eslint/utils": 8.37.0 - "@typescript-eslint/visitor-keys": 8.37.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.38.0 + "@typescript-eslint/rule-tester": 8.38.0 + "@typescript-eslint/scope-manager": 8.38.0 + "@typescript-eslint/type-utils": 8.38.0 + "@typescript-eslint/utils": 8.38.0 + "@typescript-eslint/visitor-keys": 8.38.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5990,7 +5990,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.37.0 + "@typescript-eslint/parser": ^8.38.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <5.9.0" languageName: unknown @@ -6006,14 +6006,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.37.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.38.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.37.0 - "@typescript-eslint/types": 8.37.0 - "@typescript-eslint/typescript-estree": 8.37.0 - "@typescript-eslint/visitor-keys": 8.37.0 + "@typescript-eslint/scope-manager": 8.38.0 + "@typescript-eslint/types": 8.38.0 + "@typescript-eslint/typescript-estree": 8.38.0 + "@typescript-eslint/visitor-keys": 8.38.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6027,12 +6027,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.37.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.38.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.37.0 - "@typescript-eslint/types": ^8.37.0 + "@typescript-eslint/tsconfig-utils": ^8.38.0 + "@typescript-eslint/types": ^8.38.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -6043,12 +6043,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.37.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.38.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.37.0 - "@typescript-eslint/utils": 8.37.0 + "@typescript-eslint/type-utils": 8.38.0 + "@typescript-eslint/utils": 8.38.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -6059,15 +6059,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.37.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.38.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.37.0 - "@typescript-eslint/typescript-estree": 8.37.0 - "@typescript-eslint/utils": 8.37.0 + "@typescript-eslint/parser": 8.38.0 + "@typescript-eslint/typescript-estree": 8.38.0 + "@typescript-eslint/utils": 8.38.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -6082,13 +6082,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.37.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.38.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.37.0 - "@typescript-eslint/typescript-estree": 8.37.0 - "@typescript-eslint/visitor-keys": 8.37.0 + "@typescript-eslint/types": 8.38.0 + "@typescript-eslint/typescript-estree": 8.38.0 + "@typescript-eslint/visitor-keys": 8.38.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -6099,7 +6099,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.37.0, @typescript-eslint/tsconfig-utils@^8.37.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.38.0, @typescript-eslint/tsconfig-utils@^8.38.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -6112,14 +6112,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.37.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.38.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.37.0 - "@typescript-eslint/types": 8.37.0 - "@typescript-eslint/typescript-estree": 8.37.0 - "@typescript-eslint/utils": 8.37.0 + "@typescript-eslint/parser": 8.38.0 + "@typescript-eslint/types": 8.38.0 + "@typescript-eslint/typescript-estree": 8.38.0 + "@typescript-eslint/utils": 8.38.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6134,7 +6134,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.37.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.37.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.38.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.38.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6207,15 +6207,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.37.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.38.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.37.0 - "@typescript-eslint/tsconfig-utils": 8.37.0 - "@typescript-eslint/types": 8.37.0 - "@typescript-eslint/visitor-keys": 8.37.0 + "@typescript-eslint/project-service": 8.38.0 + "@typescript-eslint/tsconfig-utils": 8.38.0 + "@typescript-eslint/types": 8.38.0 + "@typescript-eslint/visitor-keys": 8.38.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6233,14 +6233,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.37.0, @typescript-eslint/utils@^8.24.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.38.0, @typescript-eslint/utils@^8.24.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.37.0 - "@typescript-eslint/types": 8.37.0 - "@typescript-eslint/typescript-estree": 8.37.0 + "@typescript-eslint/scope-manager": 8.38.0 + "@typescript-eslint/types": 8.38.0 + "@typescript-eslint/typescript-estree": 8.38.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6252,11 +6252,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.37.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.38.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.37.0 + "@typescript-eslint/types": 8.38.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19801,10 +19801,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.37.0 - "@typescript-eslint/parser": 8.37.0 - "@typescript-eslint/typescript-estree": 8.37.0 - "@typescript-eslint/utils": 8.37.0 + "@typescript-eslint/eslint-plugin": 8.38.0 + "@typescript-eslint/parser": 8.38.0 + "@typescript-eslint/typescript-estree": 8.38.0 + "@typescript-eslint/utils": 8.38.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From 22119593223c7776ee99abfdbbb13a400d5b3196 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:29:45 -0600 Subject: [PATCH 099/283] chore: fix integration test failure with eslint stylistic plugin deprecation warning (#11436) fix up stylistic plugin --- .../flat-config-types-@types__eslint-v9/eslint.config.js | 4 ++-- .../flat-config-types-@types__eslint-v9.test.ts.snap | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/integration-tests/fixtures/flat-config-types-@types__eslint-v9/eslint.config.js b/packages/integration-tests/fixtures/flat-config-types-@types__eslint-v9/eslint.config.js index 2a31589bc03c..6df54219e488 100644 --- a/packages/integration-tests/fixtures/flat-config-types-@types__eslint-v9/eslint.config.js +++ b/packages/integration-tests/fixtures/flat-config-types-@types__eslint-v9/eslint.config.js @@ -31,7 +31,7 @@ export default tseslint.config( }, eslint.configs.recommended, ...tseslint.configs.recommended, - stylisticPlugin.configs['recommended-flat'], + stylisticPlugin.configs.recommended, ); // wrapped in a function so they aren't executed at lint time @@ -48,7 +48,7 @@ function _otherCases() { tseslint.config( eslint.configs.recommended, ...tseslint.configs.recommended, - stylisticPlugin.configs['recommended-flat'], + stylisticPlugin.configs.recommended, vitestPlugin.configs.recommended, ); tseslint.config( diff --git a/packages/integration-tests/tests/__snapshots__/flat-config-types-@types__eslint-v9.test.ts.snap b/packages/integration-tests/tests/__snapshots__/flat-config-types-@types__eslint-v9.test.ts.snap index fa2a75464d2c..6360f2c81c8b 100644 --- a/packages/integration-tests/tests/__snapshots__/flat-config-types-@types__eslint-v9.test.ts.snap +++ b/packages/integration-tests/tests/__snapshots__/flat-config-types-@types__eslint-v9.test.ts.snap @@ -76,7 +76,7 @@ export default tseslint.config( }, eslint.configs.recommended, ...tseslint.configs.recommended, - stylisticPlugin.configs['recommended-flat'], + stylisticPlugin.configs.recommended, ) // wrapped in a function so they aren't executed at lint time @@ -93,7 +93,7 @@ function _otherCases() { tseslint.config( eslint.configs.recommended, ...tseslint.configs.recommended, - stylisticPlugin.configs['recommended-flat'], + stylisticPlugin.configs.recommended, vitestPlugin.configs.recommended, ) tseslint.config( From 9232c0cad35b4ccdd976022da357b96b3820fefb Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Thu, 31 Jul 2025 16:29:59 -0600 Subject: [PATCH 100/283] chore: upgrade @prettier/sync to fix CI lint failures (#11439) upgrade @prettier/sync --- packages/eslint-plugin-internal/package.json | 2 +- yarn.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 16ac9833c45e..20c9d4f6be11 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -22,7 +22,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@prettier/sync": "^0.5.1", + "@prettier/sync": "^0.6.1", "@typescript-eslint/rule-tester": "workspace:*", "@typescript-eslint/scope-manager": "workspace:*", "@typescript-eslint/type-utils": "workspace:*", diff --git a/yarn.lock b/yarn.lock index 25ffc632519d..5557a5f5f1f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4670,14 +4670,14 @@ __metadata: languageName: node linkType: hard -"@prettier/sync@npm:^0.5.1": - version: 0.5.2 - resolution: "@prettier/sync@npm:0.5.2" +"@prettier/sync@npm:^0.6.1": + version: 0.6.1 + resolution: "@prettier/sync@npm:0.6.1" dependencies: - make-synchronized: ^0.2.8 + make-synchronized: ^0.8.0 peerDependencies: prettier: "*" - checksum: 172cdc62f4103b022f8e8d0a63839350d97bc51468ea476594bce651c2cda311e4810417f16a3c967941a8493a68468a5df27beea4c85eaeaa37e84be3acf399 + checksum: 2c53cd4ee718e2ebd2fb31aa5ec4773f743b9c29fcc6db6794dc3553bc87aa8fe7db47b51add6809cab655520b7550329d1cce2ca837f6f4643991eff44abad1 languageName: node linkType: hard @@ -5942,7 +5942,7 @@ __metadata: version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin-internal@workspace:packages/eslint-plugin-internal" dependencies: - "@prettier/sync": ^0.5.1 + "@prettier/sync": ^0.6.1 "@typescript-eslint/rule-tester": "workspace:*" "@typescript-eslint/scope-manager": "workspace:*" "@typescript-eslint/type-utils": "workspace:*" @@ -13747,10 +13747,10 @@ __metadata: languageName: node linkType: hard -"make-synchronized@npm:^0.2.8": - version: 0.2.8 - resolution: "make-synchronized@npm:0.2.8" - checksum: fa5e0a7dadbf03c9b0b00707acf6ef6379d5926c7ba2b2c8e9a60163bf4195e3acafbdabdc09e88a87fe1cb611927d9808c5a9b8a8c97a8973f74554b9434f1e +"make-synchronized@npm:^0.8.0": + version: 0.8.0 + resolution: "make-synchronized@npm:0.8.0" + checksum: 303cb607ec555e297763bda44893f6ceb1a23fc2776d5d5d838c7f51a3ad339b2b7d922a8c7d9e515c161acf18829a1d9d5792224e418ee11c8d1bafac21a4ca languageName: node linkType: hard From 12e6961429c87ff80eb79ea34daac8bb73ee7be3 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Fri, 1 Aug 2025 16:15:07 -0600 Subject: [PATCH 101/283] chore: update AST snapshots (#11443) fix ast snapshots --- .../snapshots/2-TSESTree-Tokens.shot | 4 +- .../snapshots/6-AST-Alignment-Tokens.shot | 6 +-- .../snapshots/2-TSESTree-Tokens.shot | 4 +- .../snapshots/6-AST-Alignment-Tokens.shot | 6 +-- .../snapshots/2-TSESTree-Tokens.shot | 28 ++++++------- .../snapshots/6-AST-Alignment-Tokens.shot | 42 +++++++------------ .../snapshots/2-TSESTree-Tokens.shot | 8 ++-- .../snapshots/6-AST-Alignment-Tokens.shot | 12 ++---- 8 files changed, 44 insertions(+), 66 deletions(-) diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/2-TSESTree-Tokens.shot index 573d00dfabbf..c7bbf886221e 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/2-TSESTree-Tokens.shot @@ -79,8 +79,8 @@ end: { column: 29, line: 4 }, }, }, - Keyword { - type: "Keyword", + Identifier { + type: "Identifier", value: "this", range: [124, 128], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/6-AST-Alignment-Tokens.shot index cf45b4578a48..e60f93635f64 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/6-AST-Alignment-Tokens.shot @@ -88,10 +88,8 @@ Snapshot Diff: end: { column: 29, line: 4 }, }, }, -- Keyword { -- type: 'Keyword', -+ Identifier { -+ type: 'Identifier', + Identifier { + type: 'Identifier', value: 'this', range: [124, 128], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/2-TSESTree-Tokens.shot index 4ed3f2a15270..7384c5b71f9c 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/2-TSESTree-Tokens.shot @@ -39,8 +39,8 @@ end: { column: 8, line: 3 }, }, }, - Keyword { - type: "Keyword", + Identifier { + type: "Identifier", value: "this", range: [81, 85], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/6-AST-Alignment-Tokens.shot index 4dd08bd918b5..f2753dc6195f 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/6-AST-Alignment-Tokens.shot @@ -48,10 +48,8 @@ Snapshot Diff: end: { column: 8, line: 3 }, }, }, -- Keyword { -- type: 'Keyword', -+ Identifier { -+ type: 'Identifier', + Identifier { + type: 'Identifier', value: 'this', range: [81, 85], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/2-TSESTree-Tokens.shot index 1deb60e039ac..f41521a4d6ef 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/2-TSESTree-Tokens.shot @@ -109,8 +109,8 @@ end: { column: 16, line: 6 }, }, }, - Keyword { - type: "Keyword", + Identifier { + type: "Identifier", value: "this", range: [120, 124], @@ -269,8 +269,8 @@ end: { column: 17, line: 10 }, }, }, - Keyword { - type: "Keyword", + Identifier { + type: "Identifier", value: "this", range: [183, 187], @@ -429,8 +429,8 @@ end: { column: 17, line: 14 }, }, }, - Keyword { - type: "Keyword", + Identifier { + type: "Identifier", value: "this", range: [241, 245], @@ -689,8 +689,8 @@ end: { column: 17, line: 19 }, }, }, - Keyword { - type: "Keyword", + Identifier { + type: "Identifier", value: "this", range: [329, 333], @@ -949,8 +949,8 @@ end: { column: 22, line: 24 }, }, }, - Keyword { - type: "Keyword", + Identifier { + type: "Identifier", value: "this", range: [419, 423], @@ -1089,8 +1089,8 @@ end: { column: 8, line: 28 }, }, }, - Keyword { - type: "Keyword", + Identifier { + type: "Identifier", value: "typeof", range: [471, 477], @@ -1109,8 +1109,8 @@ end: { column: 16, line: 28 }, }, }, - Keyword { - type: "Keyword", + Identifier { + type: "Identifier", value: "this", range: [478, 482], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/6-AST-Alignment-Tokens.shot index a00c84b46b57..3abc427e91f4 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/6-AST-Alignment-Tokens.shot @@ -120,10 +120,8 @@ Snapshot Diff: end: { column: 16, line: 6 }, }, }, -- Keyword { -- type: 'Keyword', -+ Identifier { -+ type: 'Identifier', + Identifier { + type: 'Identifier', value: 'this', range: [120, 124], @@ -284,10 +282,8 @@ Snapshot Diff: end: { column: 17, line: 10 }, }, }, -- Keyword { -- type: 'Keyword', -+ Identifier { -+ type: 'Identifier', + Identifier { + type: 'Identifier', value: 'this', range: [183, 187], @@ -448,10 +444,8 @@ Snapshot Diff: end: { column: 17, line: 14 }, }, }, -- Keyword { -- type: 'Keyword', -+ Identifier { -+ type: 'Identifier', + Identifier { + type: 'Identifier', value: 'this', range: [241, 245], @@ -712,10 +706,8 @@ Snapshot Diff: end: { column: 17, line: 19 }, }, }, -- Keyword { -- type: 'Keyword', -+ Identifier { -+ type: 'Identifier', + Identifier { + type: 'Identifier', value: 'this', range: [329, 333], @@ -974,10 +966,8 @@ Snapshot Diff: end: { column: 22, line: 24 }, }, }, -- Keyword { -- type: 'Keyword', -+ Identifier { -+ type: 'Identifier', + Identifier { + type: 'Identifier', value: 'this', range: [419, 423], @@ -1116,10 +1106,8 @@ Snapshot Diff: end: { column: 8, line: 28 }, }, }, -- Keyword { -- type: 'Keyword', -+ Identifier { -+ type: 'Identifier', + Identifier { + type: 'Identifier', value: 'typeof', range: [471, 477], @@ -1138,10 +1126,8 @@ Snapshot Diff: end: { column: 16, line: 28 }, }, }, -- Keyword { -- type: 'Keyword', -+ Identifier { -+ type: 'Identifier', + Identifier { + type: 'Identifier', value: 'this', range: [478, 482], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/2-TSESTree-Tokens.shot index accecbdf3e6c..9257d8476df2 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/2-TSESTree-Tokens.shot @@ -39,8 +39,8 @@ end: { column: 16, line: 3 }, }, }, - Keyword { - type: "Keyword", + Identifier { + type: "Identifier", value: "this", range: [90, 94], @@ -99,8 +99,8 @@ end: { column: 15, line: 4 }, }, }, - Keyword { - type: "Keyword", + Identifier { + type: "Identifier", value: "this", range: [112, 116], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/6-AST-Alignment-Tokens.shot index c76669826b20..fdcc7a211dbb 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/6-AST-Alignment-Tokens.shot @@ -48,10 +48,8 @@ Snapshot Diff: end: { column: 16, line: 3 }, }, }, -- Keyword { -- type: 'Keyword', -+ Identifier { -+ type: 'Identifier', + Identifier { + type: 'Identifier', value: 'this', range: [90, 94], @@ -112,10 +110,8 @@ Snapshot Diff: end: { column: 15, line: 4 }, }, }, -- Keyword { -- type: 'Keyword', -+ Identifier { -+ type: 'Identifier', + Identifier { + type: 'Identifier', value: 'this', range: [112, 116], From 5b2486400b5c3a5c2e3d809d9c15a5bca8e5397a Mon Sep 17 00:00:00 2001 From: Sasha Kondrashov Date: Fri, 1 Aug 2025 18:36:14 -0400 Subject: [PATCH 102/283] chore: fix dangling reference to generate:configs in comments (#11431) change generate:configs to generate-configs Co-authored-by: Sasha Kondrashov --- packages/eslint-plugin/src/configs/eslintrc/all.ts | 2 +- .../eslint-plugin/src/configs/eslintrc/disable-type-checked.ts | 2 +- .../src/configs/eslintrc/recommended-type-checked-only.ts | 2 +- .../src/configs/eslintrc/recommended-type-checked.ts | 2 +- packages/eslint-plugin/src/configs/eslintrc/recommended.ts | 2 +- .../src/configs/eslintrc/strict-type-checked-only.ts | 2 +- .../eslint-plugin/src/configs/eslintrc/strict-type-checked.ts | 2 +- packages/eslint-plugin/src/configs/eslintrc/strict.ts | 2 +- .../src/configs/eslintrc/stylistic-type-checked-only.ts | 2 +- .../src/configs/eslintrc/stylistic-type-checked.ts | 2 +- packages/eslint-plugin/src/configs/eslintrc/stylistic.ts | 2 +- packages/eslint-plugin/src/configs/flat/all.ts | 2 +- packages/eslint-plugin/src/configs/flat/disable-type-checked.ts | 2 +- .../src/configs/flat/recommended-type-checked-only.ts | 2 +- .../eslint-plugin/src/configs/flat/recommended-type-checked.ts | 2 +- packages/eslint-plugin/src/configs/flat/recommended.ts | 2 +- .../eslint-plugin/src/configs/flat/strict-type-checked-only.ts | 2 +- packages/eslint-plugin/src/configs/flat/strict-type-checked.ts | 2 +- packages/eslint-plugin/src/configs/flat/strict.ts | 2 +- .../src/configs/flat/stylistic-type-checked-only.ts | 2 +- .../eslint-plugin/src/configs/flat/stylistic-type-checked.ts | 2 +- packages/eslint-plugin/src/configs/flat/stylistic.ts | 2 +- tools/scripts/generate-configs.mts | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/packages/eslint-plugin/src/configs/eslintrc/all.ts b/packages/eslint-plugin/src/configs/eslintrc/all.ts index 2764e4f92a74..34f7fd540450 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/all.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/all.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts b/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts index 9dd6c95c929e..6853a151722d 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked-only.ts b/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked-only.ts index 0936657b5d23..ba352ceb281b 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked-only.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts b/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts index 73eda5db7b43..bae9c46a5c3f 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/eslintrc/recommended.ts b/packages/eslint-plugin/src/configs/eslintrc/recommended.ts index c5476c5ec6e0..8b3f99dbfd59 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/recommended.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/recommended.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts b/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts index 00e4ca12f8a4..db4df10d5ce2 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts b/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts index 43d1df44b53b..7421a17fdce4 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/eslintrc/strict.ts b/packages/eslint-plugin/src/configs/eslintrc/strict.ts index 1677fdabffb6..9e081af8a85e 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/strict.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/strict.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts index d3cbbfc3ea9a..eb4765a87b3a 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts index b77f94794f2f..7a6759d8032d 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/eslintrc/stylistic.ts b/packages/eslint-plugin/src/configs/eslintrc/stylistic.ts index fe4a00ffe7c1..e81313ee0185 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/stylistic.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/stylistic.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/flat/all.ts b/packages/eslint-plugin/src/configs/flat/all.ts index 37f6b8647ddc..777028d8580c 100644 --- a/packages/eslint-plugin/src/configs/flat/all.ts +++ b/packages/eslint-plugin/src/configs/flat/all.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts b/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts index 15c5bb0e3dcf..5a48e1722775 100644 --- a/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts +++ b/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/flat/recommended-type-checked-only.ts b/packages/eslint-plugin/src/configs/flat/recommended-type-checked-only.ts index 0e417f24e0a5..fc985169efc6 100644 --- a/packages/eslint-plugin/src/configs/flat/recommended-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/flat/recommended-type-checked-only.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/flat/recommended-type-checked.ts b/packages/eslint-plugin/src/configs/flat/recommended-type-checked.ts index bb46e4cb4238..c92de2abf739 100644 --- a/packages/eslint-plugin/src/configs/flat/recommended-type-checked.ts +++ b/packages/eslint-plugin/src/configs/flat/recommended-type-checked.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/flat/recommended.ts b/packages/eslint-plugin/src/configs/flat/recommended.ts index f94d6606637d..51f845362835 100644 --- a/packages/eslint-plugin/src/configs/flat/recommended.ts +++ b/packages/eslint-plugin/src/configs/flat/recommended.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/flat/strict-type-checked-only.ts b/packages/eslint-plugin/src/configs/flat/strict-type-checked-only.ts index 4d424ec0968f..f9c31cbb40ec 100644 --- a/packages/eslint-plugin/src/configs/flat/strict-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/flat/strict-type-checked-only.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/flat/strict-type-checked.ts b/packages/eslint-plugin/src/configs/flat/strict-type-checked.ts index 8753687ce006..aeb43fd25cac 100644 --- a/packages/eslint-plugin/src/configs/flat/strict-type-checked.ts +++ b/packages/eslint-plugin/src/configs/flat/strict-type-checked.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/flat/strict.ts b/packages/eslint-plugin/src/configs/flat/strict.ts index 0afa85b9f088..0d942ad5b86b 100644 --- a/packages/eslint-plugin/src/configs/flat/strict.ts +++ b/packages/eslint-plugin/src/configs/flat/strict.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts index 2c132123f0ba..cc8a23f738ea 100644 --- a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts index 22113f880802..c3b76192bb57 100644 --- a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts +++ b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/packages/eslint-plugin/src/configs/flat/stylistic.ts b/packages/eslint-plugin/src/configs/flat/stylistic.ts index 26771ce80895..b336aeebcfe8 100644 --- a/packages/eslint-plugin/src/configs/flat/stylistic.ts +++ b/packages/eslint-plugin/src/configs/flat/stylistic.ts @@ -3,7 +3,7 @@ // SEE https://typescript-eslint.io/users/configs // // For developers working in the typescript-eslint monorepo: -// You can regenerate it using `yarn generate:configs` +// You can regenerate it using `yarn generate-configs` import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; diff --git a/tools/scripts/generate-configs.mts b/tools/scripts/generate-configs.mts index 99a428fdea85..e6892c71b647 100644 --- a/tools/scripts/generate-configs.mts +++ b/tools/scripts/generate-configs.mts @@ -28,7 +28,7 @@ const AUTO_GENERATED_COMMENT_LINES = [ '// SEE https://typescript-eslint.io/users/configs', '//', '// For developers working in the typescript-eslint monorepo:', - '// You can regenerate it using `yarn generate:configs`', + '// You can regenerate it using `yarn generate-configs`', '', ] as const; From 757f9ee6737291f73d5a077f3103f198440bc771 Mon Sep 17 00:00:00 2001 From: Younsang Na <77400131+nayounsang@users.noreply.github.com> Date: Sat, 2 Aug 2025 07:55:15 +0900 Subject: [PATCH 103/283] fix(eslint-plugin): [prefer-optional-chain] ignore `check` option for most RHS of a chain (#11272) * feat: add check void option * test: add test case for check void * feat: check void type * chore: add snapshot * docs: add checkvoid section * chore: update snapshot * refactor: inject option based on flagsToExcludeFromCheck * test: add test for checkVoid = false * test: add tc for all checks are excluded but invaild * test: add test cases * fix: ignore isValidFalseBooleanCheckType if there is no more op * feat: remove checkVoid option * docs: remove checkVoid on docs * fix: reupdate snapshot * chore: revert gatherLogicalOperands.ts * chore: revert perfer-optional-chain.test.ts * fix: ignore isValidFalseBooleanCheckType if there is no more op * test: add test case * Update packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts * Update prefer-optional-chain.test.ts --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .../gatherLogicalOperands.ts | 16 ++++--- .../prefer-optional-chain.test.ts | 44 +++++++++++++++++++ 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/gatherLogicalOperands.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/gatherLogicalOperands.ts index 174f8982cad8..fdb6996c612d 100644 --- a/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/gatherLogicalOperands.ts +++ b/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/gatherLogicalOperands.ts @@ -248,12 +248,13 @@ export function gatherLogicalOperands( case AST_NODE_TYPES.UnaryExpression: if ( operand.operator === '!' && - isValidFalseBooleanCheckType( - operand.argument, - areMoreOperands && node.operator === '||', - parserServices, - options, - ) + (!areMoreOperands || + isValidFalseBooleanCheckType( + operand.argument, + node.operator === '||', + parserServices, + options, + )) ) { result.push({ comparedName: operand.argument, @@ -274,9 +275,10 @@ export function gatherLogicalOperands( default: if ( + !areMoreOperands || isValidFalseBooleanCheckType( operand, - areMoreOperands && node.operator === '&&', + node.operator === '&&', parserServices, options, ) diff --git a/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts b/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts index c05f6218b24c..12c73b04eea7 100644 --- a/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts @@ -1680,6 +1680,46 @@ describe('hand-crafted cases', () => { ], output: 'a?.prop;', }, + { + code: ` +declare const foo: { + bar: undefined | (() => void); +}; + +foo.bar && foo.bar(); + `, + errors: [{ messageId: 'preferOptionalChain' }], + output: ` +declare const foo: { + bar: undefined | (() => void); +}; + +foo.bar?.(); + `, + }, + { + code: ` +declare const foo: { bar: string }; + +const baz = foo && foo.bar; + `, + errors: [ + { + messageId: 'preferOptionalChain', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: ` +declare const foo: { bar: string }; + +const baz = foo?.bar; + `, + }, + ], + }, + ], + options: [{ checkString: false }], + }, ], valid: [ '!a || !b;', @@ -1917,6 +1957,10 @@ describe('hand-crafted cases', () => { !x || x.a; `, "typeof globalThis !== 'undefined' && globalThis.Array();", + ` + declare const x: void | (() => void); + x && x(); + `, ], }); }); From b872e2b2f5b07762e2ab5615e57a11fcf6603f16 Mon Sep 17 00:00:00 2001 From: Kim Sang Du Date: Sat, 2 Aug 2025 08:18:31 +0900 Subject: [PATCH 104/283] feat(eslint-plugin): [naming-convention] add enumMember PascalCase default option (#11127) * feat: naming-convention add enumMember PascalCase default option * test: add valid and invaild enum Member case --- .../src/rules/naming-convention.ts | 5 +++ .../naming-convention.test.ts | 34 +++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index 03500d825163..20d80048f545 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -60,6 +60,11 @@ const defaultCamelCaseAllTheThingsConfig: Options = [ format: ['PascalCase'], selector: 'typeLike', }, + + { + format: ['PascalCase'], + selector: 'enumMember', + }, ]; export default createRule({ diff --git a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts index c43b293c686e..8ca4dc6014ad 100644 --- a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts +++ b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts @@ -1301,6 +1301,32 @@ ruleTester.run('naming-convention', rule, { }, ], }, + { + code: ` + const enum SearchIndexType { + title = 1, + heading = 2, + } + `, + errors: [ + { + data: { + formats: 'PascalCase', + name: 'title', + type: 'Enum Member', + }, + messageId: 'doesNotMatchFormat', + }, + { + data: { + formats: 'PascalCase', + name: 'heading', + type: 'Enum Member', + }, + messageId: 'doesNotMatchFormat', + }, + ], + }, ], valid: [ { @@ -2291,5 +2317,13 @@ ruleTester.run('naming-convention', rule, { }, ], }, + { + code: ` + const enum SearchIndexType { + Title = 1, + Heading = 2, + } + `, + }, ], }); From 2112d58fd2ba2c929f965621a1b0af7e7a9d09f7 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sun, 3 Aug 2025 10:00:06 +0930 Subject: [PATCH 105/283] feat: update to TypeScript 5.9.2 (#11445) --- package.json | 4 +- .../snapshots/2-TSESTree-Tokens.shot | 14 +- .../snapshots/6-AST-Alignment-Tokens.shot | 158 +++++++++++++++++- .../snapshots/2-TSESTree-Tokens.shot | 14 +- .../snapshots/6-AST-Alignment-Tokens.shot | 26 +-- .../fixtures-with-differences-tokens.shot | 1 + packages/eslint-plugin/package.json | 2 +- packages/parser/package.json | 2 +- packages/project-service/package.json | 2 +- .../scope-manager/src/lib/dom.iterable.ts | 1 + packages/scope-manager/src/lib/dom.ts | 36 +++- .../scope-manager/src/lib/esnext.error.ts | 13 ++ .../src/lib/esnext.sharedmemory.ts | 13 ++ packages/scope-manager/src/lib/esnext.ts | 4 + packages/scope-manager/src/lib/index.ts | 4 + .../src/lib/webworker.iterable.ts | 1 + packages/scope-manager/src/lib/webworker.ts | 20 ++- packages/tsconfig-utils/package.json | 2 +- packages/type-utils/package.json | 2 +- packages/types/src/lib.ts | 2 + packages/typescript-eslint/package.json | 2 +- packages/typescript-estree/package.json | 2 +- packages/typescript-estree/src/convert.ts | 3 + .../src/parseSettings/warnAboutTSVersion.ts | 2 +- .../lib/__snapshots__/convert.test.ts.snap | 2 +- packages/utils/package.json | 2 +- tools/scripts/generate-lib.mts | 8 +- tools/scripts/typings/typescript.d.ts | 13 -- yarn.lock | 34 ++-- 29 files changed, 305 insertions(+), 84 deletions(-) create mode 100644 packages/scope-manager/src/lib/esnext.error.ts create mode 100644 packages/scope-manager/src/lib/esnext.sharedmemory.ts delete mode 100644 tools/scripts/typings/typescript.d.ts diff --git a/package.json b/package.json index 33567c469efa..7181cc9af196 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "rimraf": "^5.0.5", "semver": "7.7.0", "tsx": "*", - "typescript": ">=4.8.4 <5.9.0", + "typescript": ">=4.8.4 <6.0.0", "typescript-eslint": "workspace:^", "vite": "^6.3.5", "vitest": "^3.1.3", @@ -114,7 +114,7 @@ "prettier": "3.5.0", "react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch", "tsx": "^4.7.2", - "typescript": "5.8.2" + "typescript": "5.9.2" }, "packageManager": "yarn@3.8.2", "nx": { diff --git a/packages/ast-spec/src/jsx/JSXAttribute/fixtures/element-non-self-closing/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/jsx/JSXAttribute/fixtures/element-non-self-closing/snapshots/2-TSESTree-Tokens.shot index 52c93eab8644..1d0b129b61d1 100644 --- a/packages/ast-spec/src/jsx/JSXAttribute/fixtures/element-non-self-closing/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/jsx/JSXAttribute/fixtures/element-non-self-closing/snapshots/2-TSESTree-Tokens.shot @@ -81,21 +81,11 @@ }, Punctuator { type: "Punctuator", - value: "<", + value: " jsx > JSXAttribute > element-non-self-closing > AST Alignment - Token`] Snapshot Diff: -Compared values have no visual difference. +- TSESTree ++ Babel + + Array [ + Punctuator { + type: 'Punctuator', + value: '<', + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + JSXIdentifier { + type: 'JSXIdentifier', + value: 'App', + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + JSXIdentifier { + type: 'JSXIdentifier', + value: 'foo', + + range: [5, 8], + loc: { + start: { column: 5, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + JSXIdentifier { + type: 'JSXIdentifier', + value: 'div', + + range: [10, 13], + loc: { + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [13, 14], + loc: { + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + JSXText { + type: 'JSXText', + value: 'bar', + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', +- value: '', + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '/', + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ] diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot index 4b048a6998fe..559bb0197281 100644 --- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot @@ -521,21 +521,11 @@ }, Punctuator { type: "Punctuator", - value: "<", + value: " List fixtures with Token differences`] "element/AccessorProperty/fixtures/modifier-private/fixture.ts", "element/AccessorProperty/fixtures/modifier-protected/fixture.ts", "element/AccessorProperty/fixtures/modifier-public/fixture.ts", + "jsx/JSXAttribute/fixtures/element-non-self-closing/fixture.tsx", "jsx/JSXNamespacedName/fixtures/component-dashed/fixture.tsx", "jsx/JSXNamespacedName/fixtures/component/fixture.tsx", "legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/fixture.ts", diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 414b1934c311..5fe8658bcb1c 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -94,7 +94,7 @@ "peerDependencies": { "@typescript-eslint/parser": "^8.38.0", "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" }, "funding": { "type": "opencollective", diff --git a/packages/parser/package.json b/packages/parser/package.json index 83d0fe1499f8..907ac8d98418 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -48,7 +48,7 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { "@typescript-eslint/scope-manager": "8.38.0", diff --git a/packages/project-service/package.json b/packages/project-service/package.json index c74ab6d96c3e..817ec14ea73f 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -46,7 +46,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "peerDependencies": { - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.38.0", diff --git a/packages/scope-manager/src/lib/dom.iterable.ts b/packages/scope-manager/src/lib/dom.iterable.ts index 2ccd538bc593..e5109bdf2d4b 100644 --- a/packages/scope-manager/src/lib/dom.iterable.ts +++ b/packages/scope-manager/src/lib/dom.iterable.ts @@ -22,6 +22,7 @@ export const dom_iterable: LibDefinition = { ['Cache', TYPE], ['CanvasPath', TYPE], ['CanvasPathDrawingStyles', TYPE], + ['CookieStoreManager', TYPE], ['CustomStateSet', TYPE], ['DOMRectList', TYPE], ['DOMStringList', TYPE], diff --git a/packages/scope-manager/src/lib/dom.ts b/packages/scope-manager/src/lib/dom.ts index 469c43a48f7c..c6d054c1b6bc 100644 --- a/packages/scope-manager/src/lib/dom.ts +++ b/packages/scope-manager/src/lib/dom.ts @@ -42,9 +42,14 @@ export const dom: LibDefinition = { ['AuthenticationExtensionsClientInputs', TYPE], ['AuthenticationExtensionsClientInputsJSON', TYPE], ['AuthenticationExtensionsClientOutputs', TYPE], + ['AuthenticationExtensionsLargeBlobInputs', TYPE], + ['AuthenticationExtensionsLargeBlobInputsJSON', TYPE], + ['AuthenticationExtensionsLargeBlobOutputs', TYPE], ['AuthenticationExtensionsPRFInputs', TYPE], + ['AuthenticationExtensionsPRFInputsJSON', TYPE], ['AuthenticationExtensionsPRFOutputs', TYPE], ['AuthenticationExtensionsPRFValues', TYPE], + ['AuthenticationExtensionsPRFValuesJSON', TYPE], ['AuthenticatorSelectionCriteria', TYPE], ['AvcEncoderConfig', TYPE], ['BiquadFilterOptions', TYPE], @@ -73,6 +78,11 @@ export const dom: LibDefinition = { ['ConstrainULongRange', TYPE], ['ContentVisibilityAutoStateChangeEventInit', TYPE], ['ConvolverOptions', TYPE], + ['CookieChangeEventInit', TYPE], + ['CookieInit', TYPE], + ['CookieListItem', TYPE], + ['CookieStoreDeleteOptions', TYPE], + ['CookieStoreGetOptions', TYPE], ['CredentialCreationOptions', TYPE], ['CredentialPropertiesOutput', TYPE], ['CredentialRequestOptions', TYPE], @@ -126,6 +136,7 @@ export const dom: LibDefinition = { ['GamepadEffectParameters', TYPE], ['GamepadEventInit', TYPE], ['GetAnimationsOptions', TYPE], + ['GetComposedRangesOptions', TYPE], ['GetHTMLOptions', TYPE], ['GetNotificationOptions', TYPE], ['GetRootNodeOptions', TYPE], @@ -148,10 +159,12 @@ export const dom: LibDefinition = { ['ImageDecodeResult', TYPE], ['ImageDecoderInit', TYPE], ['ImageEncodeOptions', TYPE], + ['ImportNodeOptions', TYPE], ['InputEventInit', TYPE], ['IntersectionObserverInit', TYPE], ['JsonWebKey', TYPE], ['KeyAlgorithm', TYPE], + ['KeySystemTrackConfiguration', TYPE], ['KeyboardEventInit', TYPE], ['Keyframe', TYPE], ['KeyframeAnimationOptions', TYPE], @@ -165,6 +178,7 @@ export const dom: LibDefinition = { ['MediaCapabilitiesDecodingInfo', TYPE], ['MediaCapabilitiesEncodingInfo', TYPE], ['MediaCapabilitiesInfo', TYPE], + ['MediaCapabilitiesKeySystemConfiguration', TYPE], ['MediaConfiguration', TYPE], ['MediaDecodingConfiguration', TYPE], ['MediaElementAudioSourceOptions', TYPE], @@ -180,6 +194,7 @@ export const dom: LibDefinition = { ['MediaQueryListEventInit', TYPE], ['MediaRecorderOptions', TYPE], ['MediaSessionActionDetails', TYPE], + ['MediaSettingsRange', TYPE], ['MediaStreamAudioSourceOptions', TYPE], ['MediaStreamConstraints', TYPE], ['MediaStreamTrackEventInit', TYPE], @@ -223,6 +238,8 @@ export const dom: LibDefinition = { ['PeriodicWaveConstraints', TYPE], ['PeriodicWaveOptions', TYPE], ['PermissionDescriptor', TYPE], + ['PhotoCapabilities', TYPE], + ['PhotoSettings', TYPE], ['PictureInPictureEventInit', TYPE], ['PlaneLayout', TYPE], ['PointerEventInit', TYPE], @@ -256,6 +273,7 @@ export const dom: LibDefinition = { ['RTCDataChannelInit', TYPE], ['RTCDtlsFingerprint', TYPE], ['RTCEncodedAudioFrameMetadata', TYPE], + ['RTCEncodedFrameMetadata', TYPE], ['RTCEncodedVideoFrameMetadata', TYPE], ['RTCErrorEventInit', TYPE], ['RTCErrorInit', TYPE], @@ -263,6 +281,7 @@ export const dom: LibDefinition = { ['RTCIceCandidatePairStats', TYPE], ['RTCIceServer', TYPE], ['RTCInboundRtpStreamStats', TYPE], + ['RTCLocalIceCandidateInit', TYPE], ['RTCLocalSessionDescriptionInit', TYPE], ['RTCOfferAnswerOptions', TYPE], ['RTCOfferOptions', TYPE], @@ -318,6 +337,7 @@ export const dom: LibDefinition = { ['ShareData', TYPE], ['SpeechSynthesisErrorEventInit', TYPE], ['SpeechSynthesisEventInit', TYPE], + ['StartViewTransitionOptions', TYPE], ['StaticRangeInit', TYPE], ['StereoPannerOptions', TYPE], ['StorageEstimate', TYPE], @@ -362,6 +382,7 @@ export const dom: LibDefinition = { ['WebTransportErrorOptions', TYPE], ['WebTransportHash', TYPE], ['WebTransportOptions', TYPE], + ['WebTransportSendOptions', TYPE], ['WebTransportSendStreamOptions', TYPE], ['WheelEventInit', TYPE], ['WindowPostMessageOptions', TYPE], @@ -422,6 +443,7 @@ export const dom: LibDefinition = { ['BroadcastChannel', TYPE_VALUE], ['ByteLengthQueuingStrategy', TYPE_VALUE], ['CDATASection', TYPE_VALUE], + ['CSPViolationReportBody', TYPE_VALUE], ['CSSAnimation', TYPE_VALUE], ['CSSConditionRule', TYPE_VALUE], ['CSSContainerRule', TYPE_VALUE], @@ -515,6 +537,10 @@ export const dom: LibDefinition = { ['ConstantSourceNode', TYPE_VALUE], ['ContentVisibilityAutoStateChangeEvent', TYPE_VALUE], ['ConvolverNode', TYPE_VALUE], + ['CookieChangeEvent', TYPE_VALUE], + ['CookieStoreEventMap', TYPE], + ['CookieStore', TYPE_VALUE], + ['CookieStoreManager', TYPE_VALUE], ['CountQueuingStrategy', TYPE_VALUE], ['Credential', TYPE_VALUE], ['CredentialsContainer', TYPE_VALUE], @@ -731,6 +757,7 @@ export const dom: LibDefinition = { ['IdleDeadline', TYPE_VALUE], ['ImageBitmap', TYPE_VALUE], ['ImageBitmapRenderingContext', TYPE_VALUE], + ['ImageCapture', TYPE_VALUE], ['ImageData', TYPE_VALUE], ['ImageDecoder', TYPE_VALUE], ['ImageTrack', TYPE_VALUE], @@ -817,6 +844,7 @@ export const dom: LibDefinition = { ['NavigatorID', TYPE], ['NavigatorLanguage', TYPE], ['NavigatorLocks', TYPE], + ['NavigatorLogin', TYPE_VALUE], ['NavigatorOnLine', TYPE], ['NavigatorPlugins', TYPE], ['NavigatorStorage', TYPE], @@ -1201,9 +1229,9 @@ export const dom: LibDefinition = { ['XPathExpression', TYPE_VALUE], ['XPathResult', TYPE_VALUE], ['XSLTProcessor', TYPE_VALUE], - ['Console', TYPE], ['CSS', TYPE_VALUE], ['WebAssembly', TYPE_VALUE], + ['Console', TYPE], ['AudioDataOutputCallback', TYPE], ['BlobCallback', TYPE], ['CustomElementConstructor', TYPE], @@ -1276,6 +1304,7 @@ export const dom: LibDefinition = { ['ConstrainDOMString', TYPE], ['ConstrainDouble', TYPE], ['ConstrainULong', TYPE], + ['CookieList', TYPE], ['DOMHighResTimeStamp', TYPE], ['EpochTimeStamp', TYPE], ['EventListenerOrEventListenerObject', TYPE], @@ -1301,6 +1330,7 @@ export const dom: LibDefinition = { ['IDBValidKey', TYPE], ['ImageBitmapSource', TYPE], ['ImageBufferSource', TYPE], + ['ImageDataArray', TYPE], ['Int32List', TYPE], ['LineAndPositionSetting', TYPE], ['MediaProvider', TYPE], @@ -1374,6 +1404,7 @@ export const dom: LibDefinition = { ['CompositeOperation', TYPE], ['CompositeOperationOrAuto', TYPE], ['CompressionFormat', TYPE], + ['CookieSameSite', TYPE], ['CredentialMediationRequirement', TYPE], ['DOMParserSupportedType', TYPE], ['DirectionSetting', TYPE], @@ -1386,6 +1417,7 @@ export const dom: LibDefinition = { ['EndOfStreamError', TYPE], ['EndingType', TYPE], ['FileSystemHandleKind', TYPE], + ['FillLightMode', TYPE], ['FillMode', TYPE], ['FontDisplay', TYPE], ['FontFaceLoadStatus', TYPE], @@ -1412,6 +1444,7 @@ export const dom: LibDefinition = { ['LatencyMode', TYPE], ['LineAlignSetting', TYPE], ['LockMode', TYPE], + ['LoginStatus', TYPE], ['MIDIPortConnectionState', TYPE], ['MIDIPortDeviceState', TYPE], ['MIDIPortType', TYPE], @@ -1478,6 +1511,7 @@ export const dom: LibDefinition = { ['ReadableStreamType', TYPE], ['ReadyState', TYPE], ['RecordingState', TYPE], + ['RedEyeReduction', TYPE], ['ReferrerPolicy', TYPE], ['RemotePlaybackState', TYPE], ['RequestCache', TYPE], diff --git a/packages/scope-manager/src/lib/esnext.error.ts b/packages/scope-manager/src/lib/esnext.error.ts new file mode 100644 index 000000000000..fdf38f4d7120 --- /dev/null +++ b/packages/scope-manager/src/lib/esnext.error.ts @@ -0,0 +1,13 @@ +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo + +import type { LibDefinition } from '../variable'; + +import { TYPE } from './base-config'; + +export const esnext_error: LibDefinition = { + libs: [], + variables: [['ErrorConstructor', TYPE]], +}; diff --git a/packages/scope-manager/src/lib/esnext.sharedmemory.ts b/packages/scope-manager/src/lib/esnext.sharedmemory.ts new file mode 100644 index 000000000000..05c530843e70 --- /dev/null +++ b/packages/scope-manager/src/lib/esnext.sharedmemory.ts @@ -0,0 +1,13 @@ +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo + +import type { LibDefinition } from '../variable'; + +import { TYPE } from './base-config'; + +export const esnext_sharedmemory: LibDefinition = { + libs: [], + variables: [['Atomics', TYPE]], +}; diff --git a/packages/scope-manager/src/lib/esnext.ts b/packages/scope-manager/src/lib/esnext.ts index 8288f8c9308c..4caeb5d5de7f 100644 --- a/packages/scope-manager/src/lib/esnext.ts +++ b/packages/scope-manager/src/lib/esnext.ts @@ -10,10 +10,12 @@ import { esnext_array } from './esnext.array'; import { esnext_collection } from './esnext.collection'; import { esnext_decorators } from './esnext.decorators'; import { esnext_disposable } from './esnext.disposable'; +import { esnext_error } from './esnext.error'; import { esnext_float16 } from './esnext.float16'; import { esnext_intl } from './esnext.intl'; import { esnext_iterator } from './esnext.iterator'; import { esnext_promise } from './esnext.promise'; +import { esnext_sharedmemory } from './esnext.sharedmemory'; export const esnext: LibDefinition = { libs: [ @@ -26,6 +28,8 @@ export const esnext: LibDefinition = { esnext_iterator, esnext_promise, esnext_float16, + esnext_error, + esnext_sharedmemory, ], variables: [], }; diff --git a/packages/scope-manager/src/lib/index.ts b/packages/scope-manager/src/lib/index.ts index 2b51fe7b2335..b3baf6d6fede 100644 --- a/packages/scope-manager/src/lib/index.ts +++ b/packages/scope-manager/src/lib/index.ts @@ -95,6 +95,7 @@ import { esnext_bigint } from './esnext.bigint'; import { esnext_collection } from './esnext.collection'; import { esnext_decorators } from './esnext.decorators'; import { esnext_disposable } from './esnext.disposable'; +import { esnext_error } from './esnext.error'; import { esnext_float16 } from './esnext.float16'; import { esnext_full } from './esnext.full'; import { esnext_intl } from './esnext.intl'; @@ -102,6 +103,7 @@ import { esnext_iterator } from './esnext.iterator'; import { esnext_object } from './esnext.object'; import { esnext_promise } from './esnext.promise'; import { esnext_regexp } from './esnext.regexp'; +import { esnext_sharedmemory } from './esnext.sharedmemory'; import { esnext_string } from './esnext.string'; import { esnext_symbol } from './esnext.symbol'; import { esnext_weakref } from './esnext.weakref'; @@ -209,6 +211,8 @@ export const lib: ReadonlyMap = new Map< ['esnext.regexp', esnext_regexp], ['esnext.iterator', esnext_iterator], ['esnext.float16', esnext_float16], + ['esnext.error', esnext_error], + ['esnext.sharedmemory', esnext_sharedmemory], ['decorators', decorators], ['decorators.legacy', decorators_legacy], ['es2016.full', es2016_full], diff --git a/packages/scope-manager/src/lib/webworker.iterable.ts b/packages/scope-manager/src/lib/webworker.iterable.ts index 1e02a18e42bf..e42417f0d48e 100644 --- a/packages/scope-manager/src/lib/webworker.iterable.ts +++ b/packages/scope-manager/src/lib/webworker.iterable.ts @@ -16,6 +16,7 @@ export const webworker_iterable: LibDefinition = { ['Cache', TYPE], ['CanvasPath', TYPE], ['CanvasPathDrawingStyles', TYPE], + ['CookieStoreManager', TYPE], ['DOMStringList', TYPE], ['FileList', TYPE], ['FontFaceSet', TYPE], diff --git a/packages/scope-manager/src/lib/webworker.ts b/packages/scope-manager/src/lib/webworker.ts index 17df7198988e..d0c8891975de 100644 --- a/packages/scope-manager/src/lib/webworker.ts +++ b/packages/scope-manager/src/lib/webworker.ts @@ -34,6 +34,10 @@ export const webworker: LibDefinition = { ['CacheQueryOptions', TYPE], ['ClientQueryOptions', TYPE], ['CloseEventInit', TYPE], + ['CookieInit', TYPE], + ['CookieListItem', TYPE], + ['CookieStoreDeleteOptions', TYPE], + ['CookieStoreGetOptions', TYPE], ['CryptoKeyPair', TYPE], ['CustomEventInit', TYPE], ['DOMMatrix2DInit', TYPE], @@ -53,6 +57,7 @@ export const webworker: LibDefinition = { ['EventInit', TYPE], ['EventListenerOptions', TYPE], ['EventSourceInit', TYPE], + ['ExtendableCookieChangeEventInit', TYPE], ['ExtendableEventInit', TYPE], ['ExtendableMessageEventInit', TYPE], ['FetchEventInit', TYPE], @@ -82,12 +87,14 @@ export const webworker: LibDefinition = { ['ImageEncodeOptions', TYPE], ['JsonWebKey', TYPE], ['KeyAlgorithm', TYPE], + ['KeySystemTrackConfiguration', TYPE], ['LockInfo', TYPE], ['LockManagerSnapshot', TYPE], ['LockOptions', TYPE], ['MediaCapabilitiesDecodingInfo', TYPE], ['MediaCapabilitiesEncodingInfo', TYPE], ['MediaCapabilitiesInfo', TYPE], + ['MediaCapabilitiesKeySystemConfiguration', TYPE], ['MediaConfiguration', TYPE], ['MediaDecodingConfiguration', TYPE], ['MediaEncodingConfiguration', TYPE], @@ -107,11 +114,13 @@ export const webworker: LibDefinition = { ['ProgressEventInit', TYPE], ['PromiseRejectionEventInit', TYPE], ['PushEventInit', TYPE], + ['PushSubscriptionChangeEventInit', TYPE], ['PushSubscriptionJSON', TYPE], ['PushSubscriptionOptionsInit', TYPE], ['QueuingStrategy', TYPE], ['QueuingStrategyInit', TYPE], ['RTCEncodedAudioFrameMetadata', TYPE], + ['RTCEncodedFrameMetadata', TYPE], ['RTCEncodedVideoFrameMetadata', TYPE], ['ReadableStreamGetReaderOptions', TYPE], ['ReadableStreamIteratorOptions', TYPE], @@ -159,6 +168,7 @@ export const webworker: LibDefinition = { ['WebTransportErrorOptions', TYPE], ['WebTransportHash', TYPE], ['WebTransportOptions', TYPE], + ['WebTransportSendOptions', TYPE], ['WebTransportSendStreamOptions', TYPE], ['WorkerOptions', TYPE], ['WriteParams', TYPE], @@ -228,6 +238,8 @@ export const webworker: LibDefinition = { ['Clients', TYPE_VALUE], ['CloseEvent', TYPE_VALUE], ['CompressionStream', TYPE_VALUE], + ['CookieStore', TYPE_VALUE], + ['CookieStoreManager', TYPE_VALUE], ['CountQueuingStrategy', TYPE_VALUE], ['Crypto', TYPE_VALUE], ['CryptoKey', TYPE_VALUE], @@ -264,6 +276,7 @@ export const webworker: LibDefinition = { ['EventSourceEventMap', TYPE], ['EventSource', TYPE_VALUE], ['EventTarget', TYPE_VALUE], + ['ExtendableCookieChangeEvent', TYPE_VALUE], ['ExtendableEvent', TYPE_VALUE], ['ExtendableMessageEvent', TYPE_VALUE], ['FetchEvent', TYPE_VALUE], @@ -363,6 +376,7 @@ export const webworker: LibDefinition = { ['PushManager', TYPE_VALUE], ['PushMessageData', TYPE_VALUE], ['PushSubscription', TYPE_VALUE], + ['PushSubscriptionChangeEvent', TYPE_VALUE], ['PushSubscriptionOptions', TYPE_VALUE], ['RTCDataChannelEventMap', TYPE], ['RTCDataChannel', TYPE_VALUE], @@ -470,8 +484,8 @@ export const webworker: LibDefinition = { ['XMLHttpRequestEventTargetEventMap', TYPE], ['XMLHttpRequestEventTarget', TYPE_VALUE], ['XMLHttpRequestUpload', TYPE_VALUE], - ['Console', TYPE], ['WebAssembly', TYPE_VALUE], + ['Console', TYPE], ['AudioDataOutputCallback', TYPE], ['EncodedAudioChunkOutputCallback', TYPE], ['EncodedVideoChunkOutputCallback', TYPE], @@ -505,6 +519,7 @@ export const webworker: LibDefinition = { ['CSSPerspectiveValue', TYPE], ['CSSUnparsedSegment', TYPE], ['CanvasImageSource', TYPE], + ['CookieList', TYPE], ['DOMHighResTimeStamp', TYPE], ['EpochTimeStamp', TYPE], ['EventListenerOrEventListenerObject', TYPE], @@ -528,6 +543,7 @@ export const webworker: LibDefinition = { ['IDBValidKey', TYPE], ['ImageBitmapSource', TYPE], ['ImageBufferSource', TYPE], + ['ImageDataArray', TYPE], ['Int32List', TYPE], ['MessageEventSource', TYPE], ['NamedCurve', TYPE], @@ -567,6 +583,7 @@ export const webworker: LibDefinition = { ['ColorGamut', TYPE], ['ColorSpaceConversion', TYPE], ['CompressionFormat', TYPE], + ['CookieSameSite', TYPE], ['DocumentVisibilityState', TYPE], ['EncodedAudioChunkType', TYPE], ['EncodedVideoChunkType', TYPE], @@ -592,6 +609,7 @@ export const webworker: LibDefinition = { ['LockMode', TYPE], ['MediaDecodingType', TYPE], ['MediaEncodingType', TYPE], + ['MediaKeysRequirement', TYPE], ['NotificationDirection', TYPE], ['NotificationPermission', TYPE], ['OffscreenRenderingContextId', TYPE], diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 4ffee83ef6bc..6d83c9c81356 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "peerDependencies": { - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 519a9c639b8b..c50de2984845 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -52,7 +52,7 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { "@typescript-eslint/parser": "8.38.0", diff --git a/packages/types/src/lib.ts b/packages/types/src/lib.ts index 73ca1fe943fc..d68fd407c1d4 100644 --- a/packages/types/src/lib.ts +++ b/packages/types/src/lib.ts @@ -94,6 +94,7 @@ export type Lib = | 'esnext.collection' | 'esnext.decorators' | 'esnext.disposable' + | 'esnext.error' | 'esnext.float16' | 'esnext.full' | 'esnext.intl' @@ -101,6 +102,7 @@ export type Lib = | 'esnext.object' | 'esnext.promise' | 'esnext.regexp' + | 'esnext.sharedmemory' | 'esnext.string' | 'esnext.symbol' | 'esnext.weakref' diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 7396e05a7644..cff903394e31 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -57,7 +57,7 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index ce6d4b54e5b3..d7917b5903ee 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -73,7 +73,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" }, "funding": { "type": "opencollective", diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 7ebc034afdec..e4564c92aa72 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2181,6 +2181,9 @@ export class Converter { ); if (node.importClause) { + // TODO(bradzacher) swap to `phaseModifier` once we add support for `import defer` + // https://github.com/estree/estree/issues/328 + // eslint-disable-next-line @typescript-eslint/no-deprecated if (node.importClause.isTypeOnly) { result.importKind = 'type'; } diff --git a/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts b/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts index 8ac2801476bd..2d8f42d52540 100644 --- a/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts +++ b/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts @@ -8,7 +8,7 @@ import { version as TYPESCRIPT_ESTREE_VERSION } from '../version'; /** * This needs to be kept in sync with package.json in the typescript-eslint monorepo */ -export const SUPPORTED_TYPESCRIPT_VERSIONS = '>=4.8.4 <5.9.0'; +export const SUPPORTED_TYPESCRIPT_VERSIONS = '>=4.8.4 <6.0.0'; /* * The semver package will ignore prerelease ranges, and we don't want to explicitly document every one diff --git a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap index 88b6ecabdead..e1699f2c49ec 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap @@ -274,7 +274,7 @@ exports[`convert > deeplyCopy > should convert node correctly 1`] = ` "imports": undefined, "isDeclarationFile": false, "jsDocParsingMode": 0, - "kind": 307, + "kind": 308, "languageVariant": 1, "languageVersion": 99, "libReferenceDirectives": [], diff --git a/packages/utils/package.json b/packages/utils/package.json index 06f8448a8cdb..4b6743382deb 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -68,7 +68,7 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", diff --git a/tools/scripts/generate-lib.mts b/tools/scripts/generate-lib.mts index 817d25c2a2f8..7efbb6e536e3 100644 --- a/tools/scripts/generate-lib.mts +++ b/tools/scripts/generate-lib.mts @@ -14,7 +14,7 @@ import fs from 'node:fs'; import path from 'node:path'; import prettier from 'prettier'; import { rimraf } from 'rimraf'; -import ts from 'typescript'; +import * as ts from 'typescript'; import { PACKAGES_SCOPE_MANAGER, @@ -37,9 +37,11 @@ function parseAndAnalyze( return { ast, scopeManager }; } -const libMap = new Map(ts.libMap); +// @ts-expect-error - libMap is private and not typed +const tsLibMap = ts.libMap as Map; +const libMap = new Map(tsLibMap); // add the "full" libs as well - these are used by the default config resolution system -for (const [lib] of ts.libMap) { +for (const [lib] of tsLibMap) { if ( (/^es2\d{3}$/.test(lib) || lib === 'esnext') && // there's no "full" lib for es2015 diff --git a/tools/scripts/typings/typescript.d.ts b/tools/scripts/typings/typescript.d.ts deleted file mode 100644 index 354cbeefda46..000000000000 --- a/tools/scripts/typings/typescript.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import 'typescript'; - -// aliasing because the TS namespace annoyingly declares its own Map type -type StringMap = Map; -declare module 'typescript' { - /** - * Map of available libraries - * - * The key is the key used in compilerOptions.lib - * The value is the file name - */ - const libMap: StringMap; -} diff --git a/yarn.lock b/yarn.lock index 5557a5f5f1f4..72fb30f201d4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5992,7 +5992,7 @@ __metadata: peerDependencies: "@typescript-eslint/parser": ^8.38.0 eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <5.9.0" + typescript: ">=4.8.4 <6.0.0" languageName: unknown linkType: soft @@ -6023,7 +6023,7 @@ __metadata: vitest: ^3.1.3 peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <5.9.0" + typescript: ">=4.8.4 <6.0.0" languageName: unknown linkType: soft @@ -6039,7 +6039,7 @@ __metadata: typescript: "*" vitest: ^3.1.3 peerDependencies: - typescript: ">=4.8.4 <5.9.0" + typescript: ">=4.8.4 <6.0.0" languageName: unknown linkType: soft @@ -6108,7 +6108,7 @@ __metadata: typescript: "*" vitest: ^3.1.3 peerDependencies: - typescript: ">=4.8.4 <5.9.0" + typescript: ">=4.8.4 <6.0.0" languageName: unknown linkType: soft @@ -6130,7 +6130,7 @@ __metadata: vitest: ^3.1.3 peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <5.9.0" + typescript: ">=4.8.4 <6.0.0" languageName: unknown linkType: soft @@ -6199,7 +6199,7 @@ __metadata: rimraf: ^5.0.5 semver: 7.7.0 tsx: "*" - typescript: ">=4.8.4 <5.9.0" + typescript: ">=4.8.4 <6.0.0" typescript-eslint: "workspace:^" vite: ^6.3.5 vitest: ^3.1.3 @@ -6229,7 +6229,7 @@ __metadata: typescript: "*" vitest: ^3.1.3 peerDependencies: - typescript: ">=4.8.4 <5.9.0" + typescript: ">=4.8.4 <6.0.0" languageName: unknown linkType: soft @@ -6248,7 +6248,7 @@ __metadata: vitest: ^3.1.3 peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <5.9.0" + typescript: ">=4.8.4 <6.0.0" languageName: unknown linkType: soft @@ -19812,27 +19812,27 @@ __metadata: vitest: ^3.1.3 peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <5.9.0" + typescript: ">=4.8.4 <6.0.0" languageName: unknown linkType: soft -"typescript@npm:5.8.2": - version: 5.8.2 - resolution: "typescript@npm:5.8.2" +"typescript@npm:5.9.2": + version: 5.9.2 + resolution: "typescript@npm:5.9.2" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 7f9e3d7ac15da6df713e439e785e51facd65d6450d5f51fab3e8d2f2e3f4eb317080d895480b8e305450cdbcb37e17383e8bf521e7395f8b556e2f2a4730ed86 + checksum: f619cf6773cfe31409279711afd68cdf0859780006c50bc2a7a0c3227f85dea89a3b97248846326f3a17dad72ea90ec27cf61a8387772c680b2252fd02d8497b languageName: node linkType: hard -"typescript@patch:typescript@npm%3A5.8.2#~builtin": - version: 5.8.2 - resolution: "typescript@patch:typescript@npm%3A5.8.2#~builtin::version=5.8.2&hash=b45daf" +"typescript@patch:typescript@npm%3A5.9.2#~builtin": + version: 5.9.2 + resolution: "typescript@patch:typescript@npm%3A5.9.2#~builtin::version=5.9.2&hash=b45daf" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: a58d19ff9811c1764a299dd83ca20ed8020f0ab642906dafc880121b710751227201531fdc99878158205c356ac79679b0b61ac5b42eda0e28bfb180947a258d + checksum: e42a701947325500008334622321a6ad073f842f5e7d5e7b588a6346b31fdf51d56082b9ce5cef24312ecd3e48d6c0d4d44da7555f65e2feec18cf62ec540385 languageName: node linkType: hard From 956c1c7c951b5f19606cf9c17f68a8acc7ff7a7a Mon Sep 17 00:00:00 2001 From: Abhijeet Singh Date: Sun, 3 Aug 2025 23:02:40 +0530 Subject: [PATCH 106/283] chore: remove vestiges of Jest internally (#11385) * chore: remove vestiges of Jest internally * feat: remove jest references from mdx files --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .gitattributes | 2 -- .github/workflows/nx-migrate.yml | 2 +- .vscode/extensions.json | 1 - .vscode/settings.json | 14 -------------- docs/contributing/Pull_Requests.mdx | 10 ---------- docs/maintenance/Pull_Requests.mdx | 1 - .../scope-manager/tests/eslint-scope/README.md | 1 - 7 files changed, 1 insertion(+), 30 deletions(-) diff --git a/.gitattributes b/.gitattributes index b94bd55a2808..8090a19ef303 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,4 @@ * text=auto eol=lf -# force github to treat out custom jest snapshot extension as normal jest snapshots -*.shot linguist-language=Jest-Snapshot *.shot linguist-generated packages/scope-manager/src/lib/**/* linguist-generated diff --git a/.github/workflows/nx-migrate.yml b/.github/workflows/nx-migrate.yml index ee1b4da6e4bc..6eb61b7714cb 100644 --- a/.github/workflows/nx-migrate.yml +++ b/.github/workflows/nx-migrate.yml @@ -2,7 +2,7 @@ # `nx migrate` when renovate opens a PR to change the version of @nx/workspace. # # You will therefore also notice that in the renovate configuration, we ignore any packages which -# Nx will manage for us as part of `nx migrate` such as the remaining @nx/* packages and jest. +# Nx will manage for us as part of `nx migrate` such as the remaining @nx/* packages. name: Nx Migrate diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 44d398701588..6b60d5d55159 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,7 +5,6 @@ "editorconfig.editorconfig", "esbenp.prettier-vscode", "streetsidesoftware.code-spell-checker", - "tlent.jest-snapshot-language-support", "mrmlnc.vscode-json5", "vitest.explorer" ], diff --git a/.vscode/settings.json b/.vscode/settings.json index 23eb7b35f04c..b2472604617c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -20,19 +20,5 @@ "javascript.preferences.quoteStyle": "single", "typescript.preferences.quoteStyle": "single", "editor.defaultFormatter": "esbenp.prettier-vscode", - - // make the .shot files from jest-specific-snapshot act like normal snapshots - "files.associations": { - "*.shot": "jest-snapshot" - }, - "vsicons.associations.files": [ - { - "icon": "jest_snapshot", - "extensions": [ - ".shot", - ], - "extends": "jest_snapshot" - }, - ], "nxConsole.generateAiAgentRules": true, } diff --git a/docs/contributing/Pull_Requests.mdx b/docs/contributing/Pull_Requests.mdx index ae2626cfcdfd..e1aa475654b7 100644 --- a/docs/contributing/Pull_Requests.mdx +++ b/docs/contributing/Pull_Requests.mdx @@ -48,16 +48,6 @@ For rule tests we recommend, when reasonable: AST tests belong in the `ast-spec` package, within `fixtures/` subfolders alongside the AST declarations. Each test has its own `/` folder, containing a `fixture.ts` file defining the test, and a `snapshots/` subfolder. Happy-path test folders are stored directly under `fixtures/`; error-path test folders go under `fixtures/_errors/`. You can check out the [`ClassDeclaration` fixtures folder](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/ast-spec/src/declaration/ClassDeclaration/fixtures) for an example of both happy-path and unhappy-path test folders. -### Updating Snapshots - -[Jest snapshots](https://jestjs.io/docs/snapshot-testing) are generated for use in some tests, e.g. for [rule schemas](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/tests/schema-snapshots) and [code examples in rule docs](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/tests/docs-eslint-output-snapshots). You may need to re-generate these snapshots after adjusting a rule and/or its documentation, by running the relevant test suite(s) with the `-u` flag: - -```bash -cd packages/eslint-plugin -yarn test docs -u -yarn test schemas -u -``` - ## Raising the PR Once your changes are ready, you can raise a PR! 🙌 diff --git a/docs/maintenance/Pull_Requests.mdx b/docs/maintenance/Pull_Requests.mdx index 04c1547f0cb7..ec1cfa24d2c4 100644 --- a/docs/maintenance/Pull_Requests.mdx +++ b/docs/maintenance/Pull_Requests.mdx @@ -80,7 +80,6 @@ If there's no backing issue: - Parenthesis and whitespace (see: `getWrappingFixer`). - Unions and intersections (see: `unionConstituents` and `intersectionConstituents`). - Unit tests: - - All lines are covered per the Codecov / `yarn jest path/to/impacted/file --coverage` report. - Both "positive" and "negative" ("valid" and "invalid") cases exist, if reasonably possible to test for. - Fixes and suggestions, if present, don't remove `//` or `/*` comments - `invalid` lint rule errors include line and column information diff --git a/packages/scope-manager/tests/eslint-scope/README.md b/packages/scope-manager/tests/eslint-scope/README.md index 1397ce3cd76a..cbd9986a840d 100644 --- a/packages/scope-manager/tests/eslint-scope/README.md +++ b/packages/scope-manager/tests/eslint-scope/README.md @@ -6,7 +6,6 @@ The intention is to help us ensure we do not regress functionality compared to t They have been modified to: - be written in TypeScript -- work with jest - work with our folder structure - adhere to our formatting and linting style From 8dc8340ebac4d0695686c7f336b4c9c87c06f185 Mon Sep 17 00:00:00 2001 From: Sasha Kondrashov Date: Sun, 3 Aug 2025 14:54:40 -0400 Subject: [PATCH 107/283] feat(eslint-plugin): add no-unnecessary-type-conversion to strict-type-checked ruleset (#11427) add no-unnecessary-type-conversion to strict-type-checked ruleset Co-authored-by: Sasha Kondrashov Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .../src/configs/eslintrc/strict-type-checked-only.ts | 1 + .../eslint-plugin/src/configs/eslintrc/strict-type-checked.ts | 1 + .../eslint-plugin/src/configs/flat/strict-type-checked-only.ts | 1 + packages/eslint-plugin/src/configs/flat/strict-type-checked.ts | 1 + .../eslint-plugin/src/rules/no-unnecessary-type-conversion.ts | 1 + 5 files changed, 5 insertions(+) diff --git a/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts b/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts index db4df10d5ce2..a2b5b457d01e 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts @@ -30,6 +30,7 @@ export = { '@typescript-eslint/no-unnecessary-template-expression': 'error', '@typescript-eslint/no-unnecessary-type-arguments': 'error', '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unnecessary-type-conversion': 'error', '@typescript-eslint/no-unnecessary-type-parameters': 'error', '@typescript-eslint/no-unsafe-argument': 'error', '@typescript-eslint/no-unsafe-assignment': 'error', diff --git a/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts b/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts index 7421a17fdce4..ec1523d8b48e 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts @@ -51,6 +51,7 @@ export = { '@typescript-eslint/no-unnecessary-type-arguments': 'error', '@typescript-eslint/no-unnecessary-type-assertion': 'error', '@typescript-eslint/no-unnecessary-type-constraint': 'error', + '@typescript-eslint/no-unnecessary-type-conversion': 'error', '@typescript-eslint/no-unnecessary-type-parameters': 'error', '@typescript-eslint/no-unsafe-argument': 'error', '@typescript-eslint/no-unsafe-assignment': 'error', diff --git a/packages/eslint-plugin/src/configs/flat/strict-type-checked-only.ts b/packages/eslint-plugin/src/configs/flat/strict-type-checked-only.ts index f9c31cbb40ec..043f1aad0cd5 100644 --- a/packages/eslint-plugin/src/configs/flat/strict-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/flat/strict-type-checked-only.ts @@ -43,6 +43,7 @@ export default ( '@typescript-eslint/no-unnecessary-template-expression': 'error', '@typescript-eslint/no-unnecessary-type-arguments': 'error', '@typescript-eslint/no-unnecessary-type-assertion': 'error', + '@typescript-eslint/no-unnecessary-type-conversion': 'error', '@typescript-eslint/no-unnecessary-type-parameters': 'error', '@typescript-eslint/no-unsafe-argument': 'error', '@typescript-eslint/no-unsafe-assignment': 'error', diff --git a/packages/eslint-plugin/src/configs/flat/strict-type-checked.ts b/packages/eslint-plugin/src/configs/flat/strict-type-checked.ts index aeb43fd25cac..b3c0a2391178 100644 --- a/packages/eslint-plugin/src/configs/flat/strict-type-checked.ts +++ b/packages/eslint-plugin/src/configs/flat/strict-type-checked.ts @@ -64,6 +64,7 @@ export default ( '@typescript-eslint/no-unnecessary-type-arguments': 'error', '@typescript-eslint/no-unnecessary-type-assertion': 'error', '@typescript-eslint/no-unnecessary-type-constraint': 'error', + '@typescript-eslint/no-unnecessary-type-conversion': 'error', '@typescript-eslint/no-unnecessary-type-parameters': 'error', '@typescript-eslint/no-unsafe-argument': 'error', '@typescript-eslint/no-unsafe-assignment': 'error', diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts index b9471c87d2bd..09af31518b11 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts @@ -26,6 +26,7 @@ export default createRule({ docs: { description: 'Disallow conversion idioms when they do not change the type or value of the expression', + recommended: 'strict', requiresTypeChecking: true, }, hasSuggestions: true, From e901ad8f762e7588758d970880d128c4c62dbabd Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Sun, 3 Aug 2025 20:40:52 -0600 Subject: [PATCH 108/283] fix(eslint-plugin): revert #11127 (#11447) Revert "feat(eslint-plugin): [naming-convention] add enumMember PascalCase default option (#11127)" This reverts commit b872e2b2f5b07762e2ab5615e57a11fcf6603f16. --- .../src/rules/naming-convention.ts | 5 --- .../naming-convention.test.ts | 34 ------------------- 2 files changed, 39 deletions(-) diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index 20d80048f545..03500d825163 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -60,11 +60,6 @@ const defaultCamelCaseAllTheThingsConfig: Options = [ format: ['PascalCase'], selector: 'typeLike', }, - - { - format: ['PascalCase'], - selector: 'enumMember', - }, ]; export default createRule({ diff --git a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts index 8ca4dc6014ad..c43b293c686e 100644 --- a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts +++ b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts @@ -1301,32 +1301,6 @@ ruleTester.run('naming-convention', rule, { }, ], }, - { - code: ` - const enum SearchIndexType { - title = 1, - heading = 2, - } - `, - errors: [ - { - data: { - formats: 'PascalCase', - name: 'title', - type: 'Enum Member', - }, - messageId: 'doesNotMatchFormat', - }, - { - data: { - formats: 'PascalCase', - name: 'heading', - type: 'Enum Member', - }, - messageId: 'doesNotMatchFormat', - }, - ], - }, ], valid: [ { @@ -2317,13 +2291,5 @@ ruleTester.run('naming-convention', rule, { }, ], }, - { - code: ` - const enum SearchIndexType { - Title = 1, - Heading = 2, - } - `, - }, ], }); From 422e3e29e0cf4bc3106551f32a49bc94cff92b1b Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Mon, 4 Aug 2025 15:45:22 +0100 Subject: [PATCH 109/283] feat(eslint-plugin): [only-throw-error] support yield/await expressions (#11417) * feat(eslint-plugin): support yield/await expressions It seems we can actually support yield and await as the type checker will already resolve the yielded/awaited type. When yielding, it is possible a generator can be typed such that the `yield` resolves to an `Error`. * lintfix --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .../src/rules/only-throw-error.ts | 7 --- .../tests/rules/only-throw-error.test.ts | 58 +++++++++++++++++++ 2 files changed, 58 insertions(+), 7 deletions(-) diff --git a/packages/eslint-plugin/src/rules/only-throw-error.ts b/packages/eslint-plugin/src/rules/only-throw-error.ts index 187e6ac5e5b1..ec5de09d13f0 100644 --- a/packages/eslint-plugin/src/rules/only-throw-error.ts +++ b/packages/eslint-plugin/src/rules/only-throw-error.ts @@ -143,13 +143,6 @@ export default createRule({ } function checkThrowArgument(node: TSESTree.Node): void { - if ( - node.type === AST_NODE_TYPES.AwaitExpression || - node.type === AST_NODE_TYPES.YieldExpression - ) { - return; - } - if (options.allowRethrowing && isRethrownError(node)) { return; } diff --git a/packages/eslint-plugin/tests/rules/only-throw-error.test.ts b/packages/eslint-plugin/tests/rules/only-throw-error.test.ts index a85d65cd85e5..6f60f01b8405 100644 --- a/packages/eslint-plugin/tests/rules/only-throw-error.test.ts +++ b/packages/eslint-plugin/tests/rules/only-throw-error.test.ts @@ -243,6 +243,30 @@ Promise.reject('foo').catch(e => { }, ], }, + { + code: ` +async function foo() { + throw await Promise.resolve(new Error('error')); +} + `, + options: [ + { + allowThrowingAny: false, + }, + ], + }, + { + code: ` +function* foo(): Generator { + throw yield 303; +} + `, + options: [ + { + allowThrowingAny: false, + }, + ], + }, ], invalid: [ { @@ -745,5 +769,39 @@ Promise.reject('foo').then(e => { }, ], }, + { + code: ` +async function foo() { + throw await bar; +} + `, + errors: [ + { + messageId: 'object', + }, + ], + options: [ + { + allowThrowingAny: false, + }, + ], + }, + { + code: ` +async function foo() { + throw await Promise.resolve(303); +} + `, + errors: [ + { + messageId: 'object', + }, + ], + options: [ + { + allowThrowingAny: false, + }, + ], + }, ], }); From a8def4b3cb4dfb2e40b9db11e66110ffb33046d8 Mon Sep 17 00:00:00 2001 From: tao <2471314@gmail.com> Date: Mon, 4 Aug 2025 22:47:55 +0800 Subject: [PATCH 110/283] fix(eslint-plugin): [no-unsafe-assignment] add an `unsafeObjectPattern` message (#11403) add an unsafeObjectPattern message Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .../src/rules/no-unsafe-assignment.ts | 4 +- .../tests/rules/no-unsafe-assignment.test.ts | 38 +++++++++---------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts b/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts index 2dd9ca6b5d2e..6b3e47e3a3b4 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts @@ -50,6 +50,8 @@ export default createRule({ unsafeArraySpread: 'Unsafe spread of an {{sender}} value in an array.', unsafeAssignment: 'Unsafe assignment of type {{sender}} to a variable of type {{receiver}}.', + unsafeObjectPattern: + 'Unsafe object destructuring of a property with an {{sender}} value.', }, schema: [], }, @@ -215,7 +217,7 @@ export default createRule({ if (isTypeAnyType(senderType)) { context.report({ node: receiverProperty.value, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', data: createData(senderType), }); didReport = true; diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts index c72b71e70b49..e744d560218d 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts @@ -188,7 +188,7 @@ const { errors: [ { data: { receiver: 'error typed', sender: 'error typed' }, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, { data: { receiver: 'error typed', sender: 'error typed' }, @@ -368,7 +368,7 @@ const [x] = [] as any[]; column: 10, endColumn: 11, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -379,7 +379,7 @@ const [x] = [] as any[]; column: 17, endColumn: 18, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -390,7 +390,7 @@ const [x] = [] as any[]; column: 4, endColumn: 5, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -401,7 +401,7 @@ const [x] = [] as any[]; column: 17, endColumn: 18, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -412,7 +412,7 @@ const [x] = [] as any[]; column: 24, endColumn: 25, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -423,7 +423,7 @@ const [x] = [] as any[]; column: 11, endColumn: 12, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -434,7 +434,7 @@ const [x] = [] as any[]; column: 17, endColumn: 18, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -445,7 +445,7 @@ const [x] = [] as any[]; column: 24, endColumn: 25, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -456,7 +456,7 @@ const [x] = [] as any[]; column: 11, endColumn: 12, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -493,7 +493,7 @@ const x = [...([] as any[])]; column: 9, endColumn: 10, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -504,7 +504,7 @@ const x = [...([] as any[])]; column: 16, endColumn: 17, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -515,7 +515,7 @@ const x = [...([] as any[])]; column: 4, endColumn: 5, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -526,7 +526,7 @@ const x = [...([] as any[])]; column: 12, endColumn: 13, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -537,7 +537,7 @@ const x = [...([] as any[])]; column: 19, endColumn: 20, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -548,7 +548,7 @@ const x = [...([] as any[])]; column: 7, endColumn: 8, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -563,7 +563,7 @@ const { column: 8, endColumn: 9, line: 3, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -574,7 +574,7 @@ const { column: 21, endColumn: 22, line: 1, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, @@ -589,7 +589,7 @@ const { column: 8, endColumn: 9, line: 3, - messageId: 'unsafeArrayPatternFromTuple', + messageId: 'unsafeObjectPattern', }, ], }, From c98d51320bae29639c66d679057ad78785845da8 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 4 Aug 2025 17:25:59 +0000 Subject: [PATCH 111/283] chore(release): publish 8.39.0 --- CHANGELOG.md | 25 +++++ packages/ast-spec/CHANGELOG.md | 12 +++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 25 +++++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 12 +++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 12 +++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 12 +++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 12 +++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 12 +++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 12 +++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 12 +++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 12 +++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 12 +++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 288 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fc35a618ac2..17a92736476a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,28 @@ +## 8.39.0 (2025-08-04) + +### 🚀 Features + +- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445)) +- **eslint-plugin:** [naming-convention] add enumMember PascalCase default option ([#11127](https://github.com/typescript-eslint/typescript-eslint/pull/11127)) +- **eslint-plugin:** add no-unnecessary-type-conversion to strict-type-checked ruleset ([#11427](https://github.com/typescript-eslint/typescript-eslint/pull/11427)) +- **eslint-plugin:** [only-throw-error] support yield/await expressions ([#11417](https://github.com/typescript-eslint/typescript-eslint/pull/11417)) + +### 🩹 Fixes + +- **eslint-plugin:** [prefer-optional-chain] ignore `check` option for most RHS of a chain ([#11272](https://github.com/typescript-eslint/typescript-eslint/pull/11272)) +- **eslint-plugin:** [no-unsafe-assignment] add an `unsafeObjectPattern` message ([#11403](https://github.com/typescript-eslint/typescript-eslint/pull/11403)) + +### ❤️ Thank You + +- Brad Zacher @bradzacher +- James Garbutt @43081j +- Kim Sang Du @developer-bandi +- Sasha Kondrashov +- tao +- Younsang Na @nayounsang + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index e8521d2d1873..b030f9c70944 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.39.0 (2025-08-04) + +### 🚀 Features + +- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445)) + +### ❤️ Thank You + +- Brad Zacher @bradzacher + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) ### 🚀 Features diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 4a998776122a..7886f3ba2298 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.38.0", + "version": "8.39.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 3d95f6d98077..f600bb2a064b 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,28 @@ +## 8.39.0 (2025-08-04) + +### 🚀 Features + +- **eslint-plugin:** [only-throw-error] support yield/await expressions ([#11417](https://github.com/typescript-eslint/typescript-eslint/pull/11417)) +- **eslint-plugin:** add no-unnecessary-type-conversion to strict-type-checked ruleset ([#11427](https://github.com/typescript-eslint/typescript-eslint/pull/11427)) +- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445)) +- **eslint-plugin:** [naming-convention] add enumMember PascalCase default option ([#11127](https://github.com/typescript-eslint/typescript-eslint/pull/11127)) + +### 🩹 Fixes + +- **eslint-plugin:** [no-unsafe-assignment] add an `unsafeObjectPattern` message ([#11403](https://github.com/typescript-eslint/typescript-eslint/pull/11403)) +- **eslint-plugin:** [prefer-optional-chain] ignore `check` option for most RHS of a chain ([#11272](https://github.com/typescript-eslint/typescript-eslint/pull/11272)) + +### ❤️ Thank You + +- Brad Zacher @bradzacher +- James Garbutt @43081j +- Kim Sang Du @developer-bandi +- Sasha Kondrashov +- tao +- Younsang Na @nayounsang + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) ### 🩹 Fixes diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 5fe8658bcb1c..6528a89df355 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.38.0", + "version": "8.39.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.38.0", - "@typescript-eslint/type-utils": "8.38.0", - "@typescript-eslint/utils": "8.38.0", - "@typescript-eslint/visitor-keys": "8.38.0", + "@typescript-eslint/scope-manager": "8.39.0", + "@typescript-eslint/type-utils": "8.39.0", + "@typescript-eslint/utils": "8.39.0", + "@typescript-eslint/visitor-keys": "8.39.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.38.0", - "@typescript-eslint/rule-tester": "8.38.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.39.0", + "@typescript-eslint/rule-tester": "8.39.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.38.0", + "@typescript-eslint/parser": "^8.39.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index f60e62dae6d1..9dbf184543a1 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.39.0 (2025-08-04) + +### 🚀 Features + +- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445)) + +### ❤️ Thank You + +- Brad Zacher @bradzacher + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 907ac8d98418..b7b5bfb575a1 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.38.0", + "version": "8.39.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.38.0", - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/typescript-estree": "8.38.0", - "@typescript-eslint/visitor-keys": "8.38.0", + "@typescript-eslint/scope-manager": "8.39.0", + "@typescript-eslint/types": "8.39.0", + "@typescript-eslint/typescript-estree": "8.39.0", + "@typescript-eslint/visitor-keys": "8.39.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 5390dc0080b1..298235ccdaa8 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.39.0 (2025-08-04) + +### 🚀 Features + +- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445)) + +### ❤️ Thank You + +- Brad Zacher @bradzacher + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 817ec14ea73f..7a1e24059c9d 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.38.0", + "version": "8.39.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.38.0", - "@typescript-eslint/types": "^8.38.0", + "@typescript-eslint/tsconfig-utils": "^8.39.0", + "@typescript-eslint/types": "^8.39.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index b4fa33f66420..89273cd77a9a 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.0 (2025-08-04) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index f9b50559c3bd..07e1b352d192 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.38.0", + "version": "8.39.0", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.38.0", - "@typescript-eslint/utils": "8.38.0", + "@typescript-eslint/type-utils": "8.39.0", + "@typescript-eslint/utils": "8.39.0", "natural-compare": "^1.4.0", "prettier": "3.5.0" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 8f74f2fe9b17..5c19ba510dda 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.0 (2025-08-04) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index e6f9af825a51..4cd19221a392 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.38.0", + "version": "8.39.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.38.0", - "@typescript-eslint/typescript-estree": "8.38.0", - "@typescript-eslint/utils": "8.38.0", + "@typescript-eslint/parser": "8.39.0", + "@typescript-eslint/typescript-estree": "8.39.0", + "@typescript-eslint/utils": "8.39.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 2e2cbc0b546d..cdb6f834d40f 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.39.0 (2025-08-04) + +### 🚀 Features + +- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445)) + +### ❤️ Thank You + +- Brad Zacher @bradzacher + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index b23260130d87..a9cc3b8389b4 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.38.0", + "version": "8.39.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/visitor-keys": "8.38.0" + "@typescript-eslint/types": "8.39.0", + "@typescript-eslint/visitor-keys": "8.39.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.38.0", + "@typescript-eslint/typescript-estree": "8.39.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index d6b86ffae289..3446b0a083fd 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.39.0 (2025-08-04) + +### 🚀 Features + +- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445)) + +### ❤️ Thank You + +- Brad Zacher @bradzacher + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 6d83c9c81356..7216e813473d 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.38.0", + "version": "8.39.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 6933f3251555..0d645bb17e34 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.39.0 (2025-08-04) + +### 🚀 Features + +- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445)) + +### ❤️ Thank You + +- Brad Zacher @bradzacher + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index c50de2984845..363358279f99 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.38.0", + "version": "8.39.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/typescript-estree": "8.38.0", - "@typescript-eslint/utils": "8.38.0", + "@typescript-eslint/types": "8.39.0", + "@typescript-eslint/typescript-estree": "8.39.0", + "@typescript-eslint/utils": "8.39.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.38.0", + "@typescript-eslint/parser": "8.39.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index d7d95719f448..b69585d84d61 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.39.0 (2025-08-04) + +### 🚀 Features + +- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445)) + +### ❤️ Thank You + +- Brad Zacher @bradzacher + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index ee0dc3efc5cb..179d2e67ba08 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.38.0", + "version": "8.39.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 5643448c16a2..6b005fee0959 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.39.0 (2025-08-04) + +### 🚀 Features + +- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445)) + +### ❤️ Thank You + +- Brad Zacher @bradzacher + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) ### 🩹 Fixes diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index cff903394e31..802aaad93dfc 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.38.0", + "version": "8.39.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.38.0", - "@typescript-eslint/parser": "8.38.0", - "@typescript-eslint/typescript-estree": "8.38.0", - "@typescript-eslint/utils": "8.38.0" + "@typescript-eslint/eslint-plugin": "8.39.0", + "@typescript-eslint/parser": "8.39.0", + "@typescript-eslint/typescript-estree": "8.39.0", + "@typescript-eslint/utils": "8.39.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 019910777dd8..2ff01167c450 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.39.0 (2025-08-04) + +### 🚀 Features + +- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445)) + +### ❤️ Thank You + +- Brad Zacher @bradzacher + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) ### 🚀 Features diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index d7917b5903ee..c90e63338b1f 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.38.0", + "version": "8.39.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.38.0", - "@typescript-eslint/tsconfig-utils": "8.38.0", - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/visitor-keys": "8.38.0", + "@typescript-eslint/project-service": "8.39.0", + "@typescript-eslint/tsconfig-utils": "8.39.0", + "@typescript-eslint/types": "8.39.0", + "@typescript-eslint/visitor-keys": "8.39.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index a3d48e647c5f..99a7f44a6ddd 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.39.0 (2025-08-04) + +### 🚀 Features + +- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445)) + +### ❤️ Thank You + +- Brad Zacher @bradzacher + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index 4b6743382deb..b803d8ddd2d0 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.38.0", + "version": "8.39.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.38.0", - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/typescript-estree": "8.38.0" + "@typescript-eslint/scope-manager": "8.39.0", + "@typescript-eslint/types": "8.39.0", + "@typescript-eslint/typescript-estree": "8.39.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 79679da51f0d..62db35eac489 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.0 (2025-08-04) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.38.0 (2025-07-21) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index f3a18a014ec0..6a305afb7f8c 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.38.0", + "version": "8.39.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.38.0", + "@typescript-eslint/types": "8.39.0", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 72fb30f201d4..89f3fc8ce4ab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5955,19 +5955,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.38.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.39.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.38.0 - "@typescript-eslint/rule-tester": 8.38.0 - "@typescript-eslint/scope-manager": 8.38.0 - "@typescript-eslint/type-utils": 8.38.0 - "@typescript-eslint/utils": 8.38.0 - "@typescript-eslint/visitor-keys": 8.38.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.39.0 + "@typescript-eslint/rule-tester": 8.39.0 + "@typescript-eslint/scope-manager": 8.39.0 + "@typescript-eslint/type-utils": 8.39.0 + "@typescript-eslint/utils": 8.39.0 + "@typescript-eslint/visitor-keys": 8.39.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5990,7 +5990,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.38.0 + "@typescript-eslint/parser": ^8.39.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -6006,14 +6006,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.38.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.39.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.38.0 - "@typescript-eslint/types": 8.38.0 - "@typescript-eslint/typescript-estree": 8.38.0 - "@typescript-eslint/visitor-keys": 8.38.0 + "@typescript-eslint/scope-manager": 8.39.0 + "@typescript-eslint/types": 8.39.0 + "@typescript-eslint/typescript-estree": 8.39.0 + "@typescript-eslint/visitor-keys": 8.39.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6027,12 +6027,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.38.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.39.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.38.0 - "@typescript-eslint/types": ^8.38.0 + "@typescript-eslint/tsconfig-utils": ^8.39.0 + "@typescript-eslint/types": ^8.39.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -6043,12 +6043,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.38.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.39.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.38.0 - "@typescript-eslint/utils": 8.38.0 + "@typescript-eslint/type-utils": 8.39.0 + "@typescript-eslint/utils": 8.39.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -6059,15 +6059,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.38.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.39.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.38.0 - "@typescript-eslint/typescript-estree": 8.38.0 - "@typescript-eslint/utils": 8.38.0 + "@typescript-eslint/parser": 8.39.0 + "@typescript-eslint/typescript-estree": 8.39.0 + "@typescript-eslint/utils": 8.39.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -6082,13 +6082,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.38.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.39.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.38.0 - "@typescript-eslint/typescript-estree": 8.38.0 - "@typescript-eslint/visitor-keys": 8.38.0 + "@typescript-eslint/types": 8.39.0 + "@typescript-eslint/typescript-estree": 8.39.0 + "@typescript-eslint/visitor-keys": 8.39.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -6099,7 +6099,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.38.0, @typescript-eslint/tsconfig-utils@^8.38.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.39.0, @typescript-eslint/tsconfig-utils@^8.39.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -6112,14 +6112,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.38.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.39.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.38.0 - "@typescript-eslint/types": 8.38.0 - "@typescript-eslint/typescript-estree": 8.38.0 - "@typescript-eslint/utils": 8.38.0 + "@typescript-eslint/parser": 8.39.0 + "@typescript-eslint/types": 8.39.0 + "@typescript-eslint/typescript-estree": 8.39.0 + "@typescript-eslint/utils": 8.39.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6134,7 +6134,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.38.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.38.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.39.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.39.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6207,15 +6207,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.38.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.39.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.38.0 - "@typescript-eslint/tsconfig-utils": 8.38.0 - "@typescript-eslint/types": 8.38.0 - "@typescript-eslint/visitor-keys": 8.38.0 + "@typescript-eslint/project-service": 8.39.0 + "@typescript-eslint/tsconfig-utils": 8.39.0 + "@typescript-eslint/types": 8.39.0 + "@typescript-eslint/visitor-keys": 8.39.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6233,14 +6233,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.38.0, @typescript-eslint/utils@^8.24.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.39.0, @typescript-eslint/utils@^8.24.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.38.0 - "@typescript-eslint/types": 8.38.0 - "@typescript-eslint/typescript-estree": 8.38.0 + "@typescript-eslint/scope-manager": 8.39.0 + "@typescript-eslint/types": 8.39.0 + "@typescript-eslint/typescript-estree": 8.39.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6252,11 +6252,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.38.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.39.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.38.0 + "@typescript-eslint/types": 8.39.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19801,10 +19801,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.38.0 - "@typescript-eslint/parser": 8.38.0 - "@typescript-eslint/typescript-estree": 8.38.0 - "@typescript-eslint/utils": 8.38.0 + "@typescript-eslint/eslint-plugin": 8.39.0 + "@typescript-eslint/parser": 8.39.0 + "@typescript-eslint/typescript-estree": 8.39.0 + "@typescript-eslint/utils": 8.39.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From aa58effb61ad0297ee49321d1107cecaece03fd9 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Mon, 4 Aug 2025 17:04:55 -0700 Subject: [PATCH 112/283] chore: fix renovate failures --- .github/renovate.json5 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 77a883433202..0ed71214d769 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -2,6 +2,11 @@ $schema: 'https://docs.renovatebot.com/renovate-schema.json', extends: ['config:recommended', ':approveMajorUpdates'], + env: { + // the build takes a while + SKIP_POSTINSTALL: 'true', + }, + dependencyDashboardLabels: ['dependencies', 'repo maintenance'], enabledManagers: ['github-actions', 'npm'], From 88b063e0de30f24d619dc748dbec51362b3fdb9a Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Mon, 4 Aug 2025 17:17:37 -0700 Subject: [PATCH 113/283] chore: revert fix renovate failures --- .github/renovate.json5 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 0ed71214d769..77a883433202 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -2,11 +2,6 @@ $schema: 'https://docs.renovatebot.com/renovate-schema.json', extends: ['config:recommended', ':approveMajorUpdates'], - env: { - // the build takes a while - SKIP_POSTINSTALL: 'true', - }, - dependencyDashboardLabels: ['dependencies', 'repo maintenance'], enabledManagers: ['github-actions', 'npm'], From 7319bad3a5022be2adfbcb331451cfd85d1d786a Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Thu, 7 Aug 2025 18:00:59 -0600 Subject: [PATCH 114/283] fix(typescript-eslint): handle `file://` urls in stack trace when inferring `tsconfigRootDir` (#11464) --- .cspell.json | 1 + .../src/getTSConfigRootDirFromStack.ts | 12 ++++++++-- .../tests/getTsconfigRootDirFromStack.test.ts | 23 +++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.cspell.json b/.cspell.json index 265533fa0454..ffe51471848e 100644 --- a/.cspell.json +++ b/.cspell.json @@ -46,6 +46,7 @@ "\\(#.+?\\)" ], "words": [ + "AFAICT", "Airbnb", "Airbnb's", "allowdefaultproject", diff --git a/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts b/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts index b4ac708ea3ba..1d4c558eabe4 100644 --- a/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts +++ b/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts @@ -1,4 +1,5 @@ import path from 'node:path'; +import { fileURLToPath } from 'node:url'; /** * Infers the `tsconfigRootDir` from the current call stack, using the V8 API. @@ -26,11 +27,18 @@ export function getTSConfigRootDirFromStack(): string | undefined { } for (const callSite of getStack()) { - const stackFrameFilePath = callSite.getFileName(); - if (!stackFrameFilePath) { + const stackFrameFilePathOrUrl = callSite.getFileName(); + if (!stackFrameFilePathOrUrl) { continue; } + // ESM seem to return a file URL, so we'll convert it to a file path. + // AFAICT this isn't documented in the v8 API docs, but it seems to be the case. + // See https://github.com/typescript-eslint/typescript-eslint/issues/11429 + const stackFrameFilePath = stackFrameFilePathOrUrl.startsWith('file://') + ? fileURLToPath(stackFrameFilePathOrUrl) + : stackFrameFilePathOrUrl; + const parsedPath = path.parse(stackFrameFilePath); if (/^eslint\.config\.(c|m)?(j|t)s$/.test(parsedPath.base)) { return parsedPath.dir; diff --git a/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts b/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts index a9c169785c65..8f37d5833df5 100644 --- a/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts +++ b/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts @@ -3,11 +3,34 @@ import * as normalFolder from './path-test-fixtures/tsconfigRootDirInference-nor import * as notEslintConfig from './path-test-fixtures/tsconfigRootDirInference-not-eslint-config/not-an-eslint.config.cjs'; import * as folderThatHasASpace from './path-test-fixtures/tsconfigRootDirInference-space/folder that has a space/eslint.config.cjs'; +const isWindows = process.platform === 'win32'; + describe(getTSConfigRootDirFromStack, () => { it('does stack analysis right for normal folder', () => { expect(normalFolder.get()).toBe(normalFolder.dirname()); }); + it('does stack analysis right for a file that gives a file:// URL as its name', () => { + vi.spyOn(Error, 'captureStackTrace').mockImplementationOnce( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (target: any, _constructorOpt) => { + target.stack = [ + { + getFileName() { + return !isWindows + ? 'file:///a/b/eslint.config.mts' + : 'file:///F:/a/b/eslint.config.mts'; + }, + }, + ]; + }, + ); + + const inferredTsconfigRootDir = getTSConfigRootDirFromStack(); + + expect(inferredTsconfigRootDir).toBe(!isWindows ? '/a/b' : 'F:\\a\\b'); + }); + it('does stack analysis right for folder that has a space', () => { expect(folderThatHasASpace.get()).toBe(folderThatHasASpace.dirname()); }); From fee2bc6a0b0ce1c09a276fd910b639ed553f73d2 Mon Sep 17 00:00:00 2001 From: James Garbutt <43081j@users.noreply.github.com> Date: Sat, 9 Aug 2025 03:42:44 +0100 Subject: [PATCH 115/283] chore: update eslint-plugin-eslint-plugin (#11449) Updates the the new major which is ESM only, flat-configs only, and has its own types! Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- eslint.config.mjs | 6 +++++- package.json | 2 +- .../eslint-plugin/src/rules/ban-ts-comment.ts | 1 - .../src/rules/class-methods-use-this.ts | 1 - .../eslint-plugin/src/rules/dot-notation.ts | 5 ----- .../src/rules/no-meaningless-void-operator.ts | 1 - .../tests/schema-snapshots/ban-ts-comment.shot | 1 - .../class-methods-use-this.shot | 1 - .../tests/schema-snapshots/dot-notation.shot | 5 ----- .../no-meaningless-void-operator.shot | 1 - typings/eslint-plugin-eslint-plugin.d.ts | 17 ----------------- yarn.lock | 12 ++++++------ 12 files changed, 12 insertions(+), 41 deletions(-) delete mode 100644 typings/eslint-plugin-eslint-plugin.d.ts diff --git a/eslint.config.mjs b/eslint.config.mjs index 114cea61a45a..ee482497342e 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -455,7 +455,7 @@ export default tseslint.config( // { - extends: [eslintPluginPlugin.configs['flat/recommended']], + extends: [eslintPluginPlugin.configs.recommended], files: [ 'packages/eslint-plugin-internal/**/*.?(m|c)ts?(x)', 'packages/eslint-plugin/**/*.?(m|c)ts?(x)', @@ -464,6 +464,10 @@ export default tseslint.config( rules: { '@typescript-eslint/internal/no-typescript-estree-import': 'error', + // TODO (43081j): maybe enable these one day? + 'eslint-plugin/no-meta-replaced-by': 'off', + 'eslint-plugin/require-meta-default-options': 'off', + 'eslint-plugin/require-meta-schema-description': 'off', }, }, { diff --git a/package.json b/package.json index 7181cc9af196..dcacd743d00c 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "cross-fetch": "^4.0.0", "cspell": "^9.0.0", "eslint": "^9.26.0", - "eslint-plugin-eslint-plugin": "^6.3.1", + "eslint-plugin-eslint-plugin": "^7.0.0", "eslint-plugin-import": "^2.31.0", "eslint-plugin-jsdoc": "^50.5.0", "eslint-plugin-jsx-a11y": "^6.10.2", diff --git a/packages/eslint-plugin/src/rules/ban-ts-comment.ts b/packages/eslint-plugin/src/rules/ban-ts-comment.ts index d041e34266af..e5ce60193628 100644 --- a/packages/eslint-plugin/src/rules/ban-ts-comment.ts +++ b/packages/eslint-plugin/src/rules/ban-ts-comment.ts @@ -86,7 +86,6 @@ export default createRule({ properties: { minimumDescriptionLength: { type: 'number', - default: defaultMinimumDescriptionLength, description: 'A minimum character length for descriptions when `allow-with-description` is enabled.', }, diff --git a/packages/eslint-plugin/src/rules/class-methods-use-this.ts b/packages/eslint-plugin/src/rules/class-methods-use-this.ts index 773a658ef133..f0757f628af1 100644 --- a/packages/eslint-plugin/src/rules/class-methods-use-this.ts +++ b/packages/eslint-plugin/src/rules/class-methods-use-this.ts @@ -38,7 +38,6 @@ export default createRule({ properties: { enforceForClassFields: { type: 'boolean', - default: true, description: 'Enforces that functions used as instance field initializers utilize `this`.', }, diff --git a/packages/eslint-plugin/src/rules/dot-notation.ts b/packages/eslint-plugin/src/rules/dot-notation.ts index 69d53170c70e..82e164df1cf5 100644 --- a/packages/eslint-plugin/src/rules/dot-notation.ts +++ b/packages/eslint-plugin/src/rules/dot-notation.ts @@ -48,29 +48,24 @@ export default createRule({ properties: { allowIndexSignaturePropertyAccess: { type: 'boolean', - default: false, description: 'Whether to allow accessing properties matching an index signature with array notation.', }, allowKeywords: { type: 'boolean', - default: true, description: 'Whether to allow keywords such as ["class"]`.', }, allowPattern: { type: 'string', - default: '', description: 'Regular expression of names to allow.', }, allowPrivateClassPropertyAccess: { type: 'boolean', - default: false, description: 'Whether to allow accessing class members marked as `private` with array notation.', }, allowProtectedClassPropertyAccess: { type: 'boolean', - default: false, description: 'Whether to allow accessing class members marked as `protected` with array notation.', }, diff --git a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts index 68cc840fa84b..6ad9d40c58b1 100644 --- a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts +++ b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts @@ -36,7 +36,6 @@ export default createRule({ properties: { checkNever: { type: 'boolean', - default: false, description: 'Whether to suggest removing `void` when the argument has type `never`.', }, diff --git a/packages/eslint-plugin/tests/schema-snapshots/ban-ts-comment.shot b/packages/eslint-plugin/tests/schema-snapshots/ban-ts-comment.shot index c7127300a580..ad8dac75ad73 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/ban-ts-comment.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/ban-ts-comment.shot @@ -29,7 +29,6 @@ "additionalProperties": false, "properties": { "minimumDescriptionLength": { - "default": 3, "description": "A minimum character length for descriptions when `allow-with-description` is enabled.", "type": "number" }, diff --git a/packages/eslint-plugin/tests/schema-snapshots/class-methods-use-this.shot b/packages/eslint-plugin/tests/schema-snapshots/class-methods-use-this.shot index 26c76ab0cffb..75bfbbbb7c79 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/class-methods-use-this.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/class-methods-use-this.shot @@ -6,7 +6,6 @@ "additionalProperties": false, "properties": { "enforceForClassFields": { - "default": true, "description": "Enforces that functions used as instance field initializers utilize `this`.", "type": "boolean" }, diff --git a/packages/eslint-plugin/tests/schema-snapshots/dot-notation.shot b/packages/eslint-plugin/tests/schema-snapshots/dot-notation.shot index e5839641aa64..90b1c7beead3 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/dot-notation.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/dot-notation.shot @@ -6,27 +6,22 @@ "additionalProperties": false, "properties": { "allowIndexSignaturePropertyAccess": { - "default": false, "description": "Whether to allow accessing properties matching an index signature with array notation.", "type": "boolean" }, "allowKeywords": { - "default": true, "description": "Whether to allow keywords such as [\"class\"]`.", "type": "boolean" }, "allowPattern": { - "default": "", "description": "Regular expression of names to allow.", "type": "string" }, "allowPrivateClassPropertyAccess": { - "default": false, "description": "Whether to allow accessing class members marked as `private` with array notation.", "type": "boolean" }, "allowProtectedClassPropertyAccess": { - "default": false, "description": "Whether to allow accessing class members marked as `protected` with array notation.", "type": "boolean" } diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-meaningless-void-operator.shot b/packages/eslint-plugin/tests/schema-snapshots/no-meaningless-void-operator.shot index 350098bd0a9a..650eb8dc1aad 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-meaningless-void-operator.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-meaningless-void-operator.shot @@ -6,7 +6,6 @@ "additionalProperties": false, "properties": { "checkNever": { - "default": false, "description": "Whether to suggest removing `void` when the argument has type `never`.", "type": "boolean" } diff --git a/typings/eslint-plugin-eslint-plugin.d.ts b/typings/eslint-plugin-eslint-plugin.d.ts deleted file mode 100644 index 8496db0e5667..000000000000 --- a/typings/eslint-plugin-eslint-plugin.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -// TODO: Move this to DefinitelyTyped -declare module 'eslint-plugin-eslint-plugin' { - import type { FlatConfig, Linter } from '@typescript-eslint/utils/ts-eslint'; - - declare const exprt: { - configs: { - 'flat/all': FlatConfig.Config; - 'flat/recommended': FlatConfig.Config; - 'flat/rules': FlatConfig.Config; - 'flat/rules-recommended': FlatConfig.Config; - 'flat/tests': FlatConfig.Config; - 'flat/tests-recommended': FlatConfig.Config; - }; - rules: NonNullable; - }; - export = exprt; -} diff --git a/yarn.lock b/yarn.lock index 89f3fc8ce4ab..ac1d2a25fcf4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6179,7 +6179,7 @@ __metadata: cross-fetch: ^4.0.0 cspell: ^9.0.0 eslint: ^9.26.0 - eslint-plugin-eslint-plugin: ^6.3.1 + eslint-plugin-eslint-plugin: ^7.0.0 eslint-plugin-import: ^2.31.0 eslint-plugin-jsdoc: ^50.5.0 eslint-plugin-jsx-a11y: ^6.10.2 @@ -10049,15 +10049,15 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-eslint-plugin@npm:^6.3.1": - version: 6.4.0 - resolution: "eslint-plugin-eslint-plugin@npm:6.4.0" +"eslint-plugin-eslint-plugin@npm:^7.0.0": + version: 7.0.0 + resolution: "eslint-plugin-eslint-plugin@npm:7.0.0" dependencies: "@eslint-community/eslint-utils": ^4.4.0 estraverse: ^5.3.0 peerDependencies: - eslint: ">=8.23.0" - checksum: 8cf4e4928c207fec5fd5ae025a0ec3c11e8d7d147aee1732a0eff4c3d258a279981ca26d3d4b35df22dcc61db0da8973d51466f1c783d5e03785c78e167ba03c + eslint: ">=9.0.0" + checksum: b67099bbb56a2abc28e09f296ae9b04e23401c72cf2f611c50010644f8a5ab732801c7367f1784c6522ca4e727e1144d4590878065c84b384bb634b70c4d0f5e languageName: node linkType: hard From b2ee794265c4c727009e65a4eb5f06fad9686cf8 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 11 Aug 2025 17:21:48 +0000 Subject: [PATCH 116/283] chore(release): publish 8.39.1 --- CHANGELOG.md | 12 +++ packages/ast-spec/CHANGELOG.md | 6 ++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 6 ++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 12 +++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 6 ++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 202 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17a92736476a..57e55a765b43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.39.1 (2025-08-11) + +### 🩹 Fixes + +- **typescript-eslint:** handle `file://` urls in stack trace when inferring `tsconfigRootDir` ([#11464](https://github.com/typescript-eslint/typescript-eslint/pull/11464)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index b030f9c70944..fd00cc97cc72 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.1 (2025-08-11) + +This was a version bump only for ast-spec to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) ### 🚀 Features diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 7886f3ba2298..48147e62e3d0 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.39.0", + "version": "8.39.1", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index f600bb2a064b..24ac0116feb4 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.1 (2025-08-11) + +This was a version bump only for eslint-plugin to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) ### 🚀 Features diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 6528a89df355..6debdd1e1a5e 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.39.0", + "version": "8.39.1", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.39.0", - "@typescript-eslint/type-utils": "8.39.0", - "@typescript-eslint/utils": "8.39.0", - "@typescript-eslint/visitor-keys": "8.39.0", + "@typescript-eslint/scope-manager": "8.39.1", + "@typescript-eslint/type-utils": "8.39.1", + "@typescript-eslint/utils": "8.39.1", + "@typescript-eslint/visitor-keys": "8.39.1", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.39.0", - "@typescript-eslint/rule-tester": "8.39.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.39.1", + "@typescript-eslint/rule-tester": "8.39.1", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.39.0", + "@typescript-eslint/parser": "^8.39.1", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 9dbf184543a1..f19df12f2a18 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.1 (2025-08-11) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) ### 🚀 Features diff --git a/packages/parser/package.json b/packages/parser/package.json index b7b5bfb575a1..0bb48c178d8c 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.39.0", + "version": "8.39.1", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.39.0", - "@typescript-eslint/types": "8.39.0", - "@typescript-eslint/typescript-estree": "8.39.0", - "@typescript-eslint/visitor-keys": "8.39.0", + "@typescript-eslint/scope-manager": "8.39.1", + "@typescript-eslint/types": "8.39.1", + "@typescript-eslint/typescript-estree": "8.39.1", + "@typescript-eslint/visitor-keys": "8.39.1", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 298235ccdaa8..6fbea812651d 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.1 (2025-08-11) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) ### 🚀 Features diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 7a1e24059c9d..56464567bd10 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.39.0", + "version": "8.39.1", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.39.0", - "@typescript-eslint/types": "^8.39.0", + "@typescript-eslint/tsconfig-utils": "^8.39.1", + "@typescript-eslint/types": "^8.39.1", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 89273cd77a9a..ecea6871fe2a 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.1 (2025-08-11) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 07e1b352d192..b1ba2cd63c84 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.39.0", + "version": "8.39.1", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.39.0", - "@typescript-eslint/utils": "8.39.0", + "@typescript-eslint/type-utils": "8.39.1", + "@typescript-eslint/utils": "8.39.1", "natural-compare": "^1.4.0", "prettier": "3.5.0" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 5c19ba510dda..1fdacfbe49ae 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.1 (2025-08-11) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 4cd19221a392..1ff1435f1b93 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.39.0", + "version": "8.39.1", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.39.0", - "@typescript-eslint/typescript-estree": "8.39.0", - "@typescript-eslint/utils": "8.39.0", + "@typescript-eslint/parser": "8.39.1", + "@typescript-eslint/typescript-estree": "8.39.1", + "@typescript-eslint/utils": "8.39.1", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index cdb6f834d40f..9ccb2753903d 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.1 (2025-08-11) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) ### 🚀 Features diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index a9cc3b8389b4..49219d37ac2f 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.39.0", + "version": "8.39.1", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.39.0", - "@typescript-eslint/visitor-keys": "8.39.0" + "@typescript-eslint/types": "8.39.1", + "@typescript-eslint/visitor-keys": "8.39.1" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.39.0", + "@typescript-eslint/typescript-estree": "8.39.1", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 3446b0a083fd..783df6985837 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.1 (2025-08-11) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) ### 🚀 Features diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 7216e813473d..1c6e4c444027 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.39.0", + "version": "8.39.1", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 0d645bb17e34..c9292049ad18 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.1 (2025-08-11) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) ### 🚀 Features diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 363358279f99..bfd97dce816a 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.39.0", + "version": "8.39.1", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.39.0", - "@typescript-eslint/typescript-estree": "8.39.0", - "@typescript-eslint/utils": "8.39.0", + "@typescript-eslint/types": "8.39.1", + "@typescript-eslint/typescript-estree": "8.39.1", + "@typescript-eslint/utils": "8.39.1", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.39.0", + "@typescript-eslint/parser": "8.39.1", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index b69585d84d61..17a80e1bed35 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.1 (2025-08-11) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) ### 🚀 Features diff --git a/packages/types/package.json b/packages/types/package.json index 179d2e67ba08..a6489918ae2d 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.39.0", + "version": "8.39.1", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 6b005fee0959..979cbed223be 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.39.1 (2025-08-11) + +### 🩹 Fixes + +- **typescript-eslint:** handle `file://` urls in stack trace when inferring `tsconfigRootDir` ([#11464](https://github.com/typescript-eslint/typescript-eslint/pull/11464)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) ### 🚀 Features diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 802aaad93dfc..3b828ed2dd7c 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.39.0", + "version": "8.39.1", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.39.0", - "@typescript-eslint/parser": "8.39.0", - "@typescript-eslint/typescript-estree": "8.39.0", - "@typescript-eslint/utils": "8.39.0" + "@typescript-eslint/eslint-plugin": "8.39.1", + "@typescript-eslint/parser": "8.39.1", + "@typescript-eslint/typescript-estree": "8.39.1", + "@typescript-eslint/utils": "8.39.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 2ff01167c450..2259c1b5c99b 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.1 (2025-08-11) + +This was a version bump only for typescript-estree to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) ### 🚀 Features diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index c90e63338b1f..a929aa530543 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.39.0", + "version": "8.39.1", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.39.0", - "@typescript-eslint/tsconfig-utils": "8.39.0", - "@typescript-eslint/types": "8.39.0", - "@typescript-eslint/visitor-keys": "8.39.0", + "@typescript-eslint/project-service": "8.39.1", + "@typescript-eslint/tsconfig-utils": "8.39.1", + "@typescript-eslint/types": "8.39.1", + "@typescript-eslint/visitor-keys": "8.39.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 99a7f44a6ddd..ec6a8e9a2a20 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.1 (2025-08-11) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) ### 🚀 Features diff --git a/packages/utils/package.json b/packages/utils/package.json index b803d8ddd2d0..15879bb746d4 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.39.0", + "version": "8.39.1", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.39.0", - "@typescript-eslint/types": "8.39.0", - "@typescript-eslint/typescript-estree": "8.39.0" + "@typescript-eslint/scope-manager": "8.39.1", + "@typescript-eslint/types": "8.39.1", + "@typescript-eslint/typescript-estree": "8.39.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 62db35eac489..3625a7072bfa 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.39.1 (2025-08-11) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.0 (2025-08-04) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 6a305afb7f8c..5adf5c665663 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.39.0", + "version": "8.39.1", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.39.0", + "@typescript-eslint/types": "8.39.1", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index ac1d2a25fcf4..29bee77daa40 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5955,19 +5955,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.39.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.39.1, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.39.0 - "@typescript-eslint/rule-tester": 8.39.0 - "@typescript-eslint/scope-manager": 8.39.0 - "@typescript-eslint/type-utils": 8.39.0 - "@typescript-eslint/utils": 8.39.0 - "@typescript-eslint/visitor-keys": 8.39.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.39.1 + "@typescript-eslint/rule-tester": 8.39.1 + "@typescript-eslint/scope-manager": 8.39.1 + "@typescript-eslint/type-utils": 8.39.1 + "@typescript-eslint/utils": 8.39.1 + "@typescript-eslint/visitor-keys": 8.39.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5990,7 +5990,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.39.0 + "@typescript-eslint/parser": ^8.39.1 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -6006,14 +6006,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.39.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.39.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.39.0 - "@typescript-eslint/types": 8.39.0 - "@typescript-eslint/typescript-estree": 8.39.0 - "@typescript-eslint/visitor-keys": 8.39.0 + "@typescript-eslint/scope-manager": 8.39.1 + "@typescript-eslint/types": 8.39.1 + "@typescript-eslint/typescript-estree": 8.39.1 + "@typescript-eslint/visitor-keys": 8.39.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6027,12 +6027,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.39.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.39.1, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.39.0 - "@typescript-eslint/types": ^8.39.0 + "@typescript-eslint/tsconfig-utils": ^8.39.1 + "@typescript-eslint/types": ^8.39.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -6043,12 +6043,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.39.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.39.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.39.0 - "@typescript-eslint/utils": 8.39.0 + "@typescript-eslint/type-utils": 8.39.1 + "@typescript-eslint/utils": 8.39.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -6059,15 +6059,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.39.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.39.1, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.39.0 - "@typescript-eslint/typescript-estree": 8.39.0 - "@typescript-eslint/utils": 8.39.0 + "@typescript-eslint/parser": 8.39.1 + "@typescript-eslint/typescript-estree": 8.39.1 + "@typescript-eslint/utils": 8.39.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -6082,13 +6082,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.39.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.39.1, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.39.0 - "@typescript-eslint/typescript-estree": 8.39.0 - "@typescript-eslint/visitor-keys": 8.39.0 + "@typescript-eslint/types": 8.39.1 + "@typescript-eslint/typescript-estree": 8.39.1 + "@typescript-eslint/visitor-keys": 8.39.1 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -6099,7 +6099,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.39.0, @typescript-eslint/tsconfig-utils@^8.39.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.39.1, @typescript-eslint/tsconfig-utils@^8.39.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -6112,14 +6112,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.39.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.39.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.39.0 - "@typescript-eslint/types": 8.39.0 - "@typescript-eslint/typescript-estree": 8.39.0 - "@typescript-eslint/utils": 8.39.0 + "@typescript-eslint/parser": 8.39.1 + "@typescript-eslint/types": 8.39.1 + "@typescript-eslint/typescript-estree": 8.39.1 + "@typescript-eslint/utils": 8.39.1 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6134,7 +6134,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.39.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.39.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.39.1, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.39.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6207,15 +6207,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.39.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.39.1, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.39.0 - "@typescript-eslint/tsconfig-utils": 8.39.0 - "@typescript-eslint/types": 8.39.0 - "@typescript-eslint/visitor-keys": 8.39.0 + "@typescript-eslint/project-service": 8.39.1 + "@typescript-eslint/tsconfig-utils": 8.39.1 + "@typescript-eslint/types": 8.39.1 + "@typescript-eslint/visitor-keys": 8.39.1 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6233,14 +6233,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.39.0, @typescript-eslint/utils@^8.24.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.39.1, @typescript-eslint/utils@^8.24.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.39.0 - "@typescript-eslint/types": 8.39.0 - "@typescript-eslint/typescript-estree": 8.39.0 + "@typescript-eslint/scope-manager": 8.39.1 + "@typescript-eslint/types": 8.39.1 + "@typescript-eslint/typescript-estree": 8.39.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6252,11 +6252,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.39.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.39.1, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.39.0 + "@typescript-eslint/types": 8.39.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19801,10 +19801,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.39.0 - "@typescript-eslint/parser": 8.39.0 - "@typescript-eslint/typescript-estree": 8.39.0 - "@typescript-eslint/utils": 8.39.0 + "@typescript-eslint/eslint-plugin": 8.39.1 + "@typescript-eslint/parser": 8.39.1 + "@typescript-eslint/typescript-estree": 8.39.1 + "@typescript-eslint/utils": 8.39.1 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From c1b6296e4221887469474a12c3d4be05548b01c4 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Fri, 15 Aug 2025 20:32:54 -0700 Subject: [PATCH 117/283] chore: disable postinstall for renovate --- tools/scripts/postinstall.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/postinstall.mts b/tools/scripts/postinstall.mts index c6bfcd2f3a97..9343d73a084e 100644 --- a/tools/scripts/postinstall.mts +++ b/tools/scripts/postinstall.mts @@ -20,7 +20,7 @@ const $ = $_config({ * We therefore use an env var for this. */ -if (process.env.SKIP_POSTINSTALL) { +if (process.env.SKIP_POSTINSTALL || process.env.MEND_HOSTED === "true") { console.log( '\nSkipping postinstall script because $SKIP_POSTINSTALL is set...\n', ); From 37d9ccc03037d789e136284633c33cabdd014a85 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Fri, 15 Aug 2025 21:39:02 -0600 Subject: [PATCH 118/283] fix(typescript-estree): correct range of import assertion with trailing comma (#11478) Co-authored-by: fisker Cheung --- .prettierignore | 3 +- .../config.ts | 4 + .../fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 149 +++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 202 ++++++++++++++++++ .../snapshots/3-Babel-Error.shot | 4 + .../fixtures-with-differences-errors.shot | 3 +- .../tests/fixtures-without-babel-support.shot | 7 +- packages/ast-spec/tests/fixtures.test.ts | 2 +- .../tests/util/parsers/parser-types.ts | 21 -- packages/ast-spec/tsconfig.spec.json | 8 + packages/ast-spec/typings/global.d.ts | 20 ++ packages/typescript-estree/src/convert.ts | 7 +- 13 files changed, 405 insertions(+), 26 deletions(-) create mode 100644 packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/config.ts create mode 100644 packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts create mode 100644 packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-Error.shot create mode 100644 packages/ast-spec/typings/global.d.ts diff --git a/.prettierignore b/.prettierignore index 77ec15cde8cf..c5f057dfff86 100644 --- a/.prettierignore +++ b/.prettierignore @@ -25,8 +25,9 @@ packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/fi # TODO - remove this once prettier supports it # https://github.com/prettier/prettier/issues/16072 -packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-assert/fixture.ts packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts +# https://github.com/prettier/prettier/issues/17405 +packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts # Ignore CHANGELOG.md files to avoid issues with automated release job CHANGELOG.md diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/config.ts b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/config.ts new file mode 100644 index 000000000000..0b761eb56eb3 --- /dev/null +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/config.ts @@ -0,0 +1,4 @@ +export default { + expectBabelToNotSupport: + 'waiting for https://github.com/babel/babel/pull/17465 to be released', +} satisfies ASTFixtureConfig; diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts new file mode 100644 index 000000000000..f5ad318ad5f4 --- /dev/null +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts @@ -0,0 +1 @@ +type TrailingComma = import("A", { with: { "resolution-mode": "import", }, } ); diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f1f332ffa5de --- /dev/null +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,149 @@ +Program { + type: "Program", + body: [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + declare: false, + id: Identifier { + type: "Identifier", + decorators: [], + name: "TrailingComma", + optional: false, + + range: [5, 18], + loc: { + start: { column: 5, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + typeAnnotation: TSImportType { + type: "TSImportType", + argument: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: ""A"", + value: "A", + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + options: ObjectExpression { + type: "ObjectExpression", + properties: [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "with", + optional: false, + + range: [35, 39], + loc: { + start: { column: 35, line: 1 }, + end: { column: 39, line: 1 }, + }, + }, + kind: "init", + method: false, + optional: false, + shorthand: false, + value: ObjectExpression { + type: "ObjectExpression", + properties: [ + Property { + type: "Property", + computed: false, + key: Literal { + type: "Literal", + raw: ""resolution-mode"", + value: "resolution-mode", + + range: [43, 60], + loc: { + start: { column: 43, line: 1 }, + end: { column: 60, line: 1 }, + }, + }, + kind: "init", + method: false, + optional: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: ""import"", + value: "import", + + range: [62, 70], + loc: { + start: { column: 62, line: 1 }, + end: { column: 70, line: 1 }, + }, + }, + + range: [43, 70], + loc: { + start: { column: 43, line: 1 }, + end: { column: 70, line: 1 }, + }, + }, + ], + + range: [41, 73], + loc: { + start: { column: 41, line: 1 }, + end: { column: 73, line: 1 }, + }, + }, + + range: [35, 73], + loc: { + start: { column: 35, line: 1 }, + end: { column: 73, line: 1 }, + }, + }, + ], + + range: [33, 76], + loc: { + start: { column: 33, line: 1 }, + end: { column: 76, line: 1 }, + }, + }, + qualifier: null, + typeArguments: null, + + range: [21, 78], + loc: { + start: { column: 21, line: 1 }, + end: { column: 78, line: 1 }, + }, + }, + + range: [0, 79], + loc: { + start: { column: 0, line: 1 }, + end: { column: 79, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 80], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..cae5e0bcfd9e --- /dev/null +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,202 @@ +[ + Identifier { + type: "Identifier", + value: "type", + + range: [0, 4], + loc: { + start: { column: 0, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "TrailingComma", + + range: [5, 18], + loc: { + start: { column: 5, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + String { + type: "String", + value: ""A"", + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [33, 34], + loc: { + start: { column: 33, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "with", + + range: [35, 39], + loc: { + start: { column: 35, line: 1 }, + end: { column: 39, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [39, 40], + loc: { + start: { column: 39, line: 1 }, + end: { column: 40, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [41, 42], + loc: { + start: { column: 41, line: 1 }, + end: { column: 42, line: 1 }, + }, + }, + String { + type: "String", + value: ""resolution-mode"", + + range: [43, 60], + loc: { + start: { column: 43, line: 1 }, + end: { column: 60, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [60, 61], + loc: { + start: { column: 60, line: 1 }, + end: { column: 61, line: 1 }, + }, + }, + String { + type: "String", + value: ""import"", + + range: [62, 70], + loc: { + start: { column: 62, line: 1 }, + end: { column: 70, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [70, 71], + loc: { + start: { column: 70, line: 1 }, + end: { column: 71, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [72, 73], + loc: { + start: { column: 72, line: 1 }, + end: { column: 73, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [73, 74], + loc: { + start: { column: 73, line: 1 }, + end: { column: 74, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [75, 76], + loc: { + start: { column: 75, line: 1 }, + end: { column: 76, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [77, 78], + loc: { + start: { column: 77, line: 1 }, + end: { column: 78, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [78, 79], + loc: { + start: { column: 78, line: 1 }, + end: { column: 79, line: 1 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-Error.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-Error.shot new file mode 100644 index 000000000000..8f216bc26e47 --- /dev/null +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > type > TSImportType > type-import-type-with-trailing-comma-in-import-attributes > Babel - Error`] +SyntaxError: Unexpected token, expected "}" (1:73) diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index 7051aa777fbb..006a68578577 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -47,7 +47,8 @@ exports[`AST Fixtures > List fixtures with Error differences`] "legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts", - "type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/fixture.ts" + "type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/fixture.ts", + "type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts" ], "TSESTree errored but Babel didn't": [ "declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/fixture.ts", diff --git a/packages/ast-spec/tests/fixtures-without-babel-support.shot b/packages/ast-spec/tests/fixtures-without-babel-support.shot index 0a63977a3f5e..a13f680d01a0 100644 --- a/packages/ast-spec/tests/fixtures-without-babel-support.shot +++ b/packages/ast-spec/tests/fixtures-without-babel-support.shot @@ -1,4 +1,9 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > List fixtures we expect babel to not support`] -[] +[ + [ + "type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts", + "waiting for https://github.com/babel/babel/pull/17465 to be released" + ] +] diff --git a/packages/ast-spec/tests/fixtures.test.ts b/packages/ast-spec/tests/fixtures.test.ts index 16534e6f0c1e..b6400540425c 100644 --- a/packages/ast-spec/tests/fixtures.test.ts +++ b/packages/ast-spec/tests/fixtures.test.ts @@ -4,7 +4,7 @@ import * as path from 'node:path'; import { pathToFileURL } from 'node:url'; import { VitestSnapshotEnvironment } from 'vitest/snapshot'; -import type { ASTFixtureConfig, Fixture } from './util/parsers/parser-types.js'; +import type { Fixture } from './util/parsers/parser-types.js'; import { getErrorLabel } from './util/getErrorLabel.js'; import { parseBabel } from './util/parsers/babel.js'; diff --git a/packages/ast-spec/tests/util/parsers/parser-types.ts b/packages/ast-spec/tests/util/parsers/parser-types.ts index e1d382876654..e95a648c6f24 100644 --- a/packages/ast-spec/tests/util/parsers/parser-types.ts +++ b/packages/ast-spec/tests/util/parsers/parser-types.ts @@ -5,27 +5,6 @@ interface SuccessSnapshotPaths { readonly tokens: SnapshotPathFn; } -/** - * We define this as a global type to make it easier to consume from fixtures. - * It saves us having to import the type into `src` files from a test utils folder. - * This is a convenient property because it saves us from a lot of `../`! - */ -export interface ASTFixtureConfig { - /** - * Prevents the parser from throwing an error if it receives an invalid AST from TypeScript. - * This case only usually occurs when attempting to lint invalid code. - */ - readonly allowInvalidAST?: boolean; - - /** - * Specifies that we expect that babel doesn't yet support the code in this fixture, so we expect that it will error. - * This should not be used if we expect babel to throw for this feature due to a valid parser error! - * - * The value should be a description of why there isn't support - for example a github issue URL. - */ - readonly expectBabelToNotSupport?: string; -} - export interface Fixture { readonly absolute: string; readonly babelParsed: ParserResponse; diff --git a/packages/ast-spec/tsconfig.spec.json b/packages/ast-spec/tsconfig.spec.json index fa52d4c4e988..0f776aea58e3 100644 --- a/packages/ast-spec/tsconfig.spec.json +++ b/packages/ast-spec/tsconfig.spec.json @@ -3,6 +3,14 @@ "compilerOptions": { "outDir": "../../dist/packages/ast-spec" }, + "include": [ + "tests", + "typings", + "**/fixtures/**/config.ts", + "vitest.config.mts", + "package.json" + ], + "exclude": ["**/fixtures/**/fixture.ts"], "references": [ { "path": "../typescript-estree/tsconfig.build.json" diff --git a/packages/ast-spec/typings/global.d.ts b/packages/ast-spec/typings/global.d.ts new file mode 100644 index 000000000000..7dd0713ea5d4 --- /dev/null +++ b/packages/ast-spec/typings/global.d.ts @@ -0,0 +1,20 @@ +/** + * We define this as a global type to make it easier to consume from fixtures. + * It saves us having to import the type into `src` files from a test utils folder. + * This is a convenient property because it saves us from a lot of `../`! + */ +interface ASTFixtureConfig { + /** + * Prevents the parser from throwing an error if it receives an invalid AST from TypeScript. + * This case only usually occurs when attempting to lint invalid code. + */ + readonly allowInvalidAST?: boolean; + + /** + * Specifies that we expect that babel doesn't yet support the code in this fixture, so we expect that it will error. + * This should not be used if we expect babel to throw for this feature due to a valid parser error! + * + * The value should be a description of why there isn't support - for example a github issue URL. + */ + readonly expectBabelToNotSupport?: string; +} diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index e4564c92aa72..dccb674537c6 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -3166,11 +3166,16 @@ export class Converter { const commaToken = findNextToken(node.argument, node, this.ast)!; const openBraceToken = findNextToken(commaToken, node, this.ast)!; - const closeBraceToken = findNextToken( + const tokenAfterAttributes = findNextToken( node.attributes, node, this.ast, )!; + // Since TS 5.9, there could be a trailing comma, i.e. `{ with: { ... }, }` + const closeBraceToken = + tokenAfterAttributes.kind === ts.SyntaxKind.CommaToken + ? findNextToken(tokenAfterAttributes, node, this.ast)! + : tokenAfterAttributes; const withOrAssertToken = findNextToken( openBraceToken, node, From 3426f0dd6f1f89d923720ff1af53b672809e5587 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Fri, 15 Aug 2025 21:44:42 -0600 Subject: [PATCH 119/283] fix(typescript-eslint): export `plugin`, `parser`, and `configs` that are compatible with both `defineConfig()` and `tseslint.config()` (#11475) --- packages/typescript-eslint/package.json | 12 ++++ .../src/compatibility-types.ts | 25 +++++++ packages/typescript-eslint/src/index.ts | 66 ++++++++++++------- .../tests/type-compatibility.test-d.ts | 49 ++++++++++++++ packages/typescript-eslint/vitest.config.mts | 4 ++ 5 files changed, 134 insertions(+), 22 deletions(-) create mode 100644 packages/typescript-eslint/src/compatibility-types.ts create mode 100644 packages/typescript-eslint/tests/type-compatibility.test-d.ts diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 3b828ed2dd7c..ed9e55806bd5 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -78,6 +78,18 @@ "targets": { "lint": { "command": "eslint" + }, + "typecheck": { + "outputs": [ + "{workspaceRoot}/dist", + "{projectRoot}/dist" + ] + }, + "test": { + "dependsOn": [ + "^build", + "typecheck" + ] } } } diff --git a/packages/typescript-eslint/src/compatibility-types.ts b/packages/typescript-eslint/src/compatibility-types.ts new file mode 100644 index 000000000000..10357e93accf --- /dev/null +++ b/packages/typescript-eslint/src/compatibility-types.ts @@ -0,0 +1,25 @@ +/* + * This file contains types that are intentionally wide/inaccurate, that exist + * for the purpose of satisfying both `defineConfig()` and `tseslint.config()`. + * See https://github.com/typescript-eslint/typescript-eslint/issues/10899 + */ + +export interface CompatibleParser { + parseForESLint(text: string): { + ast: unknown; + scopeManager: unknown; + }; +} + +export interface CompatibleConfig { + name?: string; + rules?: object; +} + +export type CompatibleConfigArray = CompatibleConfig[]; + +export interface CompatiblePlugin { + meta: { + name: string; + }; +} diff --git a/packages/typescript-eslint/src/index.ts b/packages/typescript-eslint/src/index.ts index b123d80b4db2..02197940789a 100644 --- a/packages/typescript-eslint/src/index.ts +++ b/packages/typescript-eslint/src/index.ts @@ -1,14 +1,23 @@ // see the comment in config-helper.ts for why this doesn't use /ts-eslint import type { TSESLint } from '@typescript-eslint/utils'; +import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; import pluginBase from '@typescript-eslint/eslint-plugin'; import rawPlugin from '@typescript-eslint/eslint-plugin/use-at-your-own-risk/raw-plugin'; import { addCandidateTSConfigRootDir } from '@typescript-eslint/typescript-estree'; +import type { + CompatibleConfig, + CompatibleConfigArray, + CompatibleParser, + CompatiblePlugin, +} from './compatibility-types'; + import { config } from './config-helper'; import { getTSConfigRootDirFromStack } from './getTSConfigRootDirFromStack'; -export const parser: TSESLint.FlatConfig.Parser = rawPlugin.parser; +export const parser: CompatibleParser = + rawPlugin.parser as CompatibleParser satisfies FlatConfig.Parser; /* we could build a plugin object here without the `configs` key - but if we do @@ -33,30 +42,30 @@ use our new package); however legacy configs consumed via `@eslint/eslintrc` would never be able to satisfy this constraint and thus users would be blocked from using them. */ -export const plugin: TSESLint.FlatConfig.Plugin = pluginBase as Omit< - typeof pluginBase, - 'configs' ->; +export const plugin: CompatiblePlugin = + pluginBase satisfies FlatConfig.Plugins['string']; export const configs = createConfigsGetters({ /** * Enables each the rules provided as a part of typescript-eslint. Note that many rules are not applicable in all codebases, or are meant to be configured. * @see {@link https://typescript-eslint.io/users/configs#all} */ - all: rawPlugin.flatConfigs['flat/all'], + all: rawPlugin.flatConfigs['flat/all'] as CompatibleConfigArray, /** * A minimal ruleset that sets only the required parser and plugin options needed to run typescript-eslint. * We don't recommend using this directly; instead, extend from an earlier recommended rule. * @see {@link https://typescript-eslint.io/users/configs#base} */ - base: rawPlugin.flatConfigs['flat/base'], + base: rawPlugin.flatConfigs['flat/base'] as CompatibleConfig, /** * A utility ruleset that will disable type-aware linting and all type-aware rules available in our project. * @see {@link https://typescript-eslint.io/users/configs#disable-type-checked} */ - disableTypeChecked: rawPlugin.flatConfigs['flat/disable-type-checked'], + disableTypeChecked: rawPlugin.flatConfigs[ + 'flat/disable-type-checked' + ] as CompatibleConfig, /** * This is a compatibility ruleset that: @@ -64,65 +73,78 @@ export const configs = createConfigsGetters({ * - enables rules that make sense due to TS's typechecking / transpilation. * @see {@link https://typescript-eslint.io/users/configs/#eslint-recommended} */ - eslintRecommended: rawPlugin.flatConfigs['flat/eslint-recommended'], + eslintRecommended: rawPlugin.flatConfigs[ + 'flat/eslint-recommended' + ] as CompatibleConfig, /** * Recommended rules for code correctness that you can drop in without additional configuration. * @see {@link https://typescript-eslint.io/users/configs#recommended} */ - recommended: rawPlugin.flatConfigs['flat/recommended'], + recommended: rawPlugin.flatConfigs[ + 'flat/recommended' + ] as CompatibleConfigArray, /** * Contains all of `recommended` along with additional recommended rules that require type information. * @see {@link https://typescript-eslint.io/users/configs#recommended-type-checked} */ - recommendedTypeChecked: - rawPlugin.flatConfigs['flat/recommended-type-checked'], + recommendedTypeChecked: rawPlugin.flatConfigs[ + 'flat/recommended-type-checked' + ] as CompatibleConfigArray, /** * A version of `recommended` that only contains type-checked rules and disables of any corresponding core ESLint rules. * @see {@link https://typescript-eslint.io/users/configs#recommended-type-checked-only} */ - recommendedTypeCheckedOnly: - rawPlugin.flatConfigs['flat/recommended-type-checked-only'], + recommendedTypeCheckedOnly: rawPlugin.flatConfigs[ + 'flat/recommended-type-checked-only' + ] as CompatibleConfigArray, /** * Contains all of `recommended`, as well as additional strict rules that can also catch bugs. * @see {@link https://typescript-eslint.io/users/configs#strict} */ - strict: rawPlugin.flatConfigs['flat/strict'], + strict: rawPlugin.flatConfigs['flat/strict'] as CompatibleConfigArray, /** * Contains all of `recommended`, `recommended-type-checked`, and `strict`, along with additional strict rules that require type information. * @see {@link https://typescript-eslint.io/users/configs#strict-type-checked} */ - strictTypeChecked: rawPlugin.flatConfigs['flat/strict-type-checked'], + strictTypeChecked: rawPlugin.flatConfigs[ + 'flat/strict-type-checked' + ] as CompatibleConfigArray, /** * A version of `strict` that only contains type-checked rules and disables of any corresponding core ESLint rules. * @see {@link https://typescript-eslint.io/users/configs#strict-type-checked-only} */ - strictTypeCheckedOnly: rawPlugin.flatConfigs['flat/strict-type-checked-only'], + strictTypeCheckedOnly: rawPlugin.flatConfigs[ + 'flat/strict-type-checked-only' + ] as CompatibleConfigArray, /** * Rules considered to be best practice for modern TypeScript codebases, but that do not impact program logic. * @see {@link https://typescript-eslint.io/users/configs#stylistic} */ - stylistic: rawPlugin.flatConfigs['flat/stylistic'], + stylistic: rawPlugin.flatConfigs['flat/stylistic'] as CompatibleConfigArray, /** * Contains all of `stylistic`, along with additional stylistic rules that require type information. * @see {@link https://typescript-eslint.io/users/configs#stylistic-type-checked} */ - stylisticTypeChecked: rawPlugin.flatConfigs['flat/stylistic-type-checked'], + stylisticTypeChecked: rawPlugin.flatConfigs[ + 'flat/stylistic-type-checked' + ] as CompatibleConfigArray, /** * A version of `stylistic` that only contains type-checked rules and disables of any corresponding core ESLint rules. * @see {@link https://typescript-eslint.io/users/configs#stylistic-type-checked-only} */ - stylisticTypeCheckedOnly: - rawPlugin.flatConfigs['flat/stylistic-type-checked-only'], -}); + stylisticTypeCheckedOnly: rawPlugin.flatConfigs[ + 'flat/stylistic-type-checked-only' + ] as CompatibleConfigArray, +}) satisfies Record; function createConfigsGetters(values: T): T { const configs = {}; diff --git a/packages/typescript-eslint/tests/type-compatibility.test-d.ts b/packages/typescript-eslint/tests/type-compatibility.test-d.ts new file mode 100644 index 000000000000..b0e2f71b81d2 --- /dev/null +++ b/packages/typescript-eslint/tests/type-compatibility.test-d.ts @@ -0,0 +1,49 @@ +import { defineConfig } from 'eslint/config'; + +import tseslint from '../src/index'; + +describe('test for compatibility with config helpers', () => { + test('exported plugin is compatible with tseslint.config()', () => { + tseslint.config({ + plugins: { + '@typescript-eslint': tseslint.plugin, + }, + }); + }); + + test('exported plugin is compatible with defineConfig()', () => { + defineConfig({ + plugins: { + '@typescript-eslint': tseslint.plugin, + }, + }); + }); + + test('exported parser is compatible with tseslint.config()', () => { + tseslint.config({ + languageOptions: { + parser: tseslint.parser, + }, + }); + }); + + test('exported parser is compatible with defineConfig()', () => { + defineConfig({ + languageOptions: { + parser: tseslint.parser, + }, + }); + }); + + test('exported configs are compatible with tseslint.config()', () => { + tseslint.config(tseslint.configs.recommendedTypeChecked); + tseslint.config(tseslint.configs.strict); + tseslint.config(tseslint.configs.eslintRecommended); + }); + + test('exported configs are compatible with defineConfig()', () => { + defineConfig(tseslint.configs.recommendedTypeChecked); + defineConfig(tseslint.configs.strict); + defineConfig(tseslint.configs.eslintRecommended); + }); +}); diff --git a/packages/typescript-eslint/vitest.config.mts b/packages/typescript-eslint/vitest.config.mts index 7d1cc31b83d7..a527ce206583 100644 --- a/packages/typescript-eslint/vitest.config.mts +++ b/packages/typescript-eslint/vitest.config.mts @@ -14,6 +14,10 @@ const vitestConfig = mergeConfig( dir: path.join(import.meta.dirname, 'tests'), name: packageJson.name, root: import.meta.dirname, + typecheck: { + enabled: true, + tsconfig: path.join(import.meta.dirname, 'tsconfig.spec.json'), + }, }, }), ); From 19aa4d6da88b1c3b61f492c1ecdc09d701b31b04 Mon Sep 17 00:00:00 2001 From: Nolan Gajdascz Date: Fri, 15 Aug 2025 23:47:14 -0400 Subject: [PATCH 120/283] fix(utils): correct `calculateConfigForFile` return type (#11451) --- packages/utils/src/ts-eslint/eslint/FlatESLint.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/utils/src/ts-eslint/eslint/FlatESLint.ts b/packages/utils/src/ts-eslint/eslint/FlatESLint.ts index 085a9e0fdfa9..1861200f51b4 100644 --- a/packages/utils/src/ts-eslint/eslint/FlatESLint.ts +++ b/packages/utils/src/ts-eslint/eslint/FlatESLint.ts @@ -6,7 +6,7 @@ import type * as Shared from './ESLintShared'; // eslint-disable-next-line @typescript-eslint/no-unused-vars declare class FlatESLintBase extends Shared.ESLintBase< - FlatConfig.ConfigArray, + FlatConfig.Config | FlatConfig.ConfigArray, FlatESLint.ESLintOptions > { static readonly configType: 'flat'; @@ -18,7 +18,7 @@ declare class FlatESLintBase extends Shared.ESLintBase< * @param filePath The path of the file to retrieve a config object for. * @returns A configuration object for the file or `undefined` if there is no configuration data for the object. */ - calculateConfigForFile(filePath: string): Promise; + calculateConfigForFile(filePath: string): Promise; /** * Finds the config file being used by this instance based on the options From d50a6b11c502c4840f9649789672f49b262ff83c Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Sat, 16 Aug 2025 11:57:44 +0800 Subject: [PATCH 121/283] feat(typescript-estree): forbid invalid keys in `EnumMember` (#11232) --- .../snapshots/1-TSESTree-AST.shot | 1 - .../snapshots/5-AST-Alignment-AST.shot | 1 - .../fixtures/_error_/bigint-name/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 +++ .../bigint-name/snapshots/2-Babel-Error.shot | 10 +++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/computed-string-name/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 +++ .../snapshots/2-Babel-Error.shot | 10 +++ .../snapshots/3-Alignment-Error.shot | 4 + .../fixtures/_error_/number-name/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 +++ .../number-name/snapshots/2-Babel-Error.shot | 10 +++ .../snapshots/3-Alignment-Error.shot | 4 + .../ast-spec/src/element/TSEnumMember/spec.ts | 45 ++--------- .../snapshots/1-TSESTree-Error.shot | 8 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 8 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 8 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../const-enum/snapshots/1-TSESTree-AST.shot | 2 - .../snapshots/5-AST-Alignment-AST.shot | 16 ++-- .../snapshots/1-TSESTree-AST.shot | 2 - .../snapshots/5-AST-Alignment-AST.shot | 2 - .../snapshots/1-TSESTree-AST.shot | 2 - .../snapshots/5-AST-Alignment-AST.shot | 2 - .../snapshots/1-TSESTree-AST.shot | 2 - .../snapshots/5-AST-Alignment-AST.shot | 2 - .../enum/snapshots/1-TSESTree-AST.shot | 2 - .../enum/snapshots/5-AST-Alignment-AST.shot | 2 - .../fixtures-with-differences-errors.shot | 3 - .../src/rules/naming-convention.ts | 10 +-- .../rules/no-unsafe-enum-comparison.test.ts | 81 ------------------- .../rules/prefer-literal-enum-member.test.ts | 14 ---- .../rules/switch-exhaustiveness-check.test.ts | 40 --------- .../src/referencer/Referencer.ts | 5 +- packages/typescript-estree/src/convert.ts | 51 +++++++++--- 38 files changed, 162 insertions(+), 231 deletions(-) create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot index ddd23006e5d0..9a5146151d36 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot @@ -8,7 +8,6 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot index 90fb8dedf846..eeec47153937 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot @@ -15,7 +15,6 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts new file mode 100644 index 000000000000..3fcd08d2bc99 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts @@ -0,0 +1,3 @@ +enum Foo { + 1n = 2 +} diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..87ba241f5d40 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > bigint-name > TSESTree - Error`] +TSError + 1 | enum Foo { +> 2 | 1n = 2 + | ^^ An enum member cannot have a numeric name. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..b3afe3afc96e --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > bigint-name > Babel - Error`] +BabelError + 1 | enum Foo { +> 2 | 1n = 2 + | ^ Unexpected token (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..083d80544d72 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > bigint-name > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts new file mode 100644 index 000000000000..2e99a8d3766b --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts @@ -0,0 +1,3 @@ +enum Foo { + ["A"] = 2 +} diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..2079fad90f2e --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > computed-string-name > TSESTree - Error`] +TSError + 1 | enum Foo { +> 2 | ["A"] = 2 + | ^^^^^ Computed property names are not allowed in enums. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..c68571c79318 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > computed-string-name > Babel - Error`] +BabelError + 1 | enum Foo { +> 2 | ["A"] = 2 + | ^ Unexpected token (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..1331cf0d18b9 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > computed-string-name > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts new file mode 100644 index 000000000000..174773e65995 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts @@ -0,0 +1,3 @@ +enum Foo { + 1 = 2 +} diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..8dfacb32e5b9 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > number-name > TSESTree - Error`] +TSError + 1 | enum Foo { +> 2 | 1 = 2 + | ^ An enum member cannot have a numeric name. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..76b2f2b9c62e --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > number-name > Babel - Error`] +BabelError + 1 | enum Foo { +> 2 | 1 = 2 + | ^ Unexpected token (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..34e6cebc91e1 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > number-name > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSEnumMember/spec.ts b/packages/ast-spec/src/element/TSEnumMember/spec.ts index a80e963ad278..a4d1b836f951 100644 --- a/packages/ast-spec/src/element/TSEnumMember/spec.ts +++ b/packages/ast-spec/src/element/TSEnumMember/spec.ts @@ -1,44 +1,15 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; +import type { Identifier } from '../../expression/Identifier/spec'; +import type { StringLiteral } from '../../expression/literal/StringLiteral/spec'; import type { Expression } from '../../unions/Expression'; -import type { - PropertyNameComputed, - PropertyNameNonComputed, -} from '../../unions/PropertyName'; -interface TSEnumMemberBase extends BaseNode { +export interface TSEnumMember extends BaseNode { type: AST_NODE_TYPES.TSEnumMember; - computed: boolean; - id: - | PropertyNameComputed // this should only happen in semantically invalid code (ts error 1164) - | PropertyNameNonComputed; + id: Identifier | StringLiteral; initializer: Expression | undefined; + /** + * @deprecated the enum member is always non-computed. + */ + computed: boolean; } - -/** - * this should only really happen in semantically invalid code (errors 1164 and 2452) - * - * @example - * ```ts - * // VALID: - * enum Foo { ['a'] } - * - * // INVALID: - * const x = 'a'; - * enum Foo { [x] } - * enum Bar { ['a' + 'b'] } - * ``` - */ -export interface TSEnumMemberComputedName extends TSEnumMemberBase { - computed: true; - id: PropertyNameComputed; -} - -export interface TSEnumMemberNonComputedName extends TSEnumMemberBase { - computed: false; - id: PropertyNameNonComputed; -} - -export type TSEnumMember = - | TSEnumMemberComputedName - | TSEnumMemberNonComputedName; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot index c64aaae4a4d8..dc8d857908c8 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-number > TSESTree - Error`] -NO ERROR +TSError + 2 | + 3 | export enum Foo { +> 4 | [1], + | ^^^ Computed property names are not allowed in enums. + 5 | } + 6 | diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot index f5e14d5d4b27..f9ae118971e1 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-number > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot index 866743a38587..90ef25fd26d8 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-string > TSESTree - Error`] -NO ERROR +TSError + 2 | + 3 | export enum Foo { +> 4 | ['baz'], + | ^^^^^^^ Computed property names are not allowed in enums. + 5 | } + 6 | diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot index f58190aa21f3..2dc13fd3d5d2 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-string > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot index 85b95f8e17d3..7e31fde5e0c7 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-var-ref > TSESTree - Error`] -NO ERROR +TSError + 2 | + 3 | export enum Foo { +> 4 | [x], + | ^^^ Computed property names are not allowed in enums. + 5 | } + 6 | diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot index 006e3518ee1f..3909357acf22 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-var-ref > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot index 9187f52aade3..238113e5cc58 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot @@ -8,7 +8,6 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -41,7 +40,6 @@ Program { }, TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot index 1c5c321a9cf2..20c84325ce31 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot @@ -15,7 +15,6 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -81,7 +80,6 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -121,12 +119,7 @@ Snapshot Diff: - loc: { - start: { column: 15, line: 3 }, - end: { column: 1, line: 6 }, -+ range: [103, 106], -+ loc: { -+ start: { column: 2, line: 5 }, -+ end: { column: 5, line: 5 }, -+ }, - }, +- }, - }, - const: true, - declare: false, @@ -140,7 +133,12 @@ Snapshot Diff: - loc: { - start: { column: 11, line: 3 }, - end: { column: 14, line: 3 }, -- }, ++ range: [103, 106], ++ loc: { ++ start: { column: 2, line: 5 }, ++ end: { column: 5, line: 5 }, ++ }, + }, - }, + ], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot index 0a35e9756f00..01c4d100b383 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot @@ -11,7 +11,6 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -44,7 +43,6 @@ Program { }, TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot index bc225b94ed0d..603938fb4270 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -19,7 +19,6 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -85,7 +84,6 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot index 15279e8049d7..f946f794f043 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot @@ -11,7 +11,6 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -44,7 +43,6 @@ Program { }, TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot index 695e866e0f98..eff7ba3226bd 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -19,7 +19,6 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -85,7 +84,6 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot index b1554a6d0194..8f42d8de69bf 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot @@ -11,7 +11,6 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -44,7 +43,6 @@ Program { }, TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot index b52051becdfb..10c5f8d572d1 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -19,7 +19,6 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -85,7 +84,6 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot index 513eb9bcd84c..e483a20f2a29 100644 --- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot @@ -8,7 +8,6 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -30,7 +29,6 @@ Program { }, TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot index 3c1cbd1bc2a0..544b72e407c8 100644 --- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot @@ -15,7 +15,6 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -59,7 +58,6 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index 006a68578577..9bbb4c97243b 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -27,9 +27,6 @@ exports[`AST Fixtures > List fixtures with Error differences`] "legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/const-assertions/fixture.ts", - "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/fixture.ts", - "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/fixture.ts", - "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/import-type-error/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/fixture.ts", diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index 03500d825163..02b95a5948fc 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -631,12 +631,10 @@ export default createRule({ // #region interface - 'TSEnumMember[computed != true]': { - handler: ( - node: TSESTree.TSEnumMemberNonComputedName, - validator, - ): void => { - const id = node.id; + TSEnumMember: { + handler: (node: TSESTree.TSEnumMember, validator): void => { + // Unknown reason, can't get the correct type + const id = node.id as TSESTree.Identifier | TSESTree.StringLiteral; const modifiers = new Set(); if (requiresQuoting(id, compilerOptions.target)) { diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts index b592b7fe513d..89e28f163314 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts @@ -1121,87 +1121,6 @@ ruleTester.run('no-unsafe-enum-comparison', rule, { }, ], }, - { - code: ` - enum ComputedKey { - ['test-key' /* with comment */] = 1, - } - declare const computedKey: ComputedKey; - computedKey === 1; - `, - errors: [ - { - messageId: 'mismatchedCondition', - suggestions: [ - { - messageId: 'replaceValueWithEnum', - output: ` - enum ComputedKey { - ['test-key' /* with comment */] = 1, - } - declare const computedKey: ComputedKey; - computedKey === ComputedKey['test-key']; - `, - }, - ], - }, - ], - }, - { - code: ` - enum ComputedKey { - [\`test-key\` /* with comment */] = 1, - } - declare const computedKey: ComputedKey; - computedKey === 1; - `, - errors: [ - { - messageId: 'mismatchedCondition', - suggestions: [ - { - messageId: 'replaceValueWithEnum', - output: ` - enum ComputedKey { - [\`test-key\` /* with comment */] = 1, - } - declare const computedKey: ComputedKey; - computedKey === ComputedKey[\`test-key\`]; - `, - }, - ], - }, - ], - }, - { - code: ` - enum ComputedKey { - [\`test- - key\` /* with comment */] = 1, - } - declare const computedKey: ComputedKey; - computedKey === 1; - `, - errors: [ - { - messageId: 'mismatchedCondition', - suggestions: [ - { - messageId: 'replaceValueWithEnum', - output: ` - enum ComputedKey { - [\`test- - key\` /* with comment */] = 1, - } - declare const computedKey: ComputedKey; - computedKey === ComputedKey[\`test- - key\`]; - `, - }, - ], - }, - ], - }, { code: ` enum Fruit { diff --git a/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts b/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts index ea670139ccb3..f655c87e9ce2 100644 --- a/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts @@ -54,11 +54,6 @@ enum ValidQuotedKey { ` enum ValidQuotedKeyWithAssignment { 'a' = 1, -} - `, - ` -enum ValidKeyWithComputedSyntaxButNoComputedKey { - ['a'], } `, { @@ -107,15 +102,6 @@ enum Foo { }, { code: ` -enum Foo { - ['A-1'] = 1 << 0, - C = ~Foo['A-1'], -} - `, - options: [{ allowBitwiseExpressions: true }], - }, - { - code: ` enum Foo { A = 1 << 0, B = 1 << 1, diff --git a/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts b/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts index da5b65c8177f..b18e91e4872a 100644 --- a/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts +++ b/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts @@ -2281,46 +2281,6 @@ switch (value) { }, ], }, - { - code: ` - enum Enum { - 'a' = 1, - [\`key-with - - new-line\`] = 2, - } - - declare const a: Enum; - - switch (a) { - } - `, - errors: [ - { - messageId: 'switchIsNotExhaustive', - suggestions: [ - { - messageId: 'addMissingCases', - output: ` - enum Enum { - 'a' = 1, - [\`key-with - - new-line\`] = 2, - } - - declare const a: Enum; - - switch (a) { - case Enum.a: { throw new Error('Not implemented yet: Enum.a case') } - case Enum['key-with\\n\\n new-line']: { throw new Error('Not implemented yet: Enum[\\'key-with\\\\n\\\\n new-line\\'] case') } - } - `, - }, - ], - }, - ], - }, { code: noFormat` enum Enum { diff --git a/packages/scope-manager/src/referencer/Referencer.ts b/packages/scope-manager/src/referencer/Referencer.ts index 1f621d8f7823..562921170751 100644 --- a/packages/scope-manager/src/referencer/Referencer.ts +++ b/packages/scope-manager/src/referencer/Referencer.ts @@ -668,10 +668,7 @@ export class Referencer extends Visitor { name, new TSEnumMemberDefinition(name, member), ); - } else if ( - !member.computed && - member.id.type === AST_NODE_TYPES.Identifier - ) { + } else if (member.id.type === AST_NODE_TYPES.Identifier) { this.currentScope().defineIdentifier( member.id, new TSEnumMemberDefinition(member.id, member), diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index dccb674537c6..150c0ee950ea 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -476,7 +476,7 @@ export class Converter { >( node: Properties, deprecatedKey: Key, - preferredKey: string, + preferredKey: string | undefined, value: Value, ): Properties & Record { let warned = false; @@ -487,10 +487,13 @@ export class Converter { ? (): Value => value : (): Value => { if (!warned) { - process.emitWarning( - `The '${deprecatedKey}' property is deprecated on ${node.type} nodes. Use ${preferredKey} instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`, - 'DeprecationWarning', - ); + let message = `The '${deprecatedKey}' property is deprecated on ${node.type} nodes.`; + if (preferredKey) { + message += ` Use ${preferredKey} instead.`; + } + message += + ' See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.'; + process.emitWarning(message, 'DeprecationWarning'); warned = true; } @@ -3263,12 +3266,38 @@ export class Converter { } case SyntaxKind.EnumMember: { - return this.createNode(node, { - type: AST_NODE_TYPES.TSEnumMember, - computed: node.name.kind === ts.SyntaxKind.ComputedPropertyName, - id: this.convertChild(node.name), - initializer: node.initializer && this.convertChild(node.initializer), - }); + const computed = node.name.kind === ts.SyntaxKind.ComputedPropertyName; + if (computed) { + this.#throwUnlessAllowInvalidAST( + node.name, + 'Computed property names are not allowed in enums.', + ); + } + + if ( + node.name.kind === SyntaxKind.NumericLiteral || + node.name.kind === SyntaxKind.BigIntLiteral + ) { + this.#throwUnlessAllowInvalidAST( + node.name, + 'An enum member cannot have a numeric name.', + ); + } + + return this.createNode( + node, + this.#withDeprecatedGetter( + { + type: AST_NODE_TYPES.TSEnumMember, + id: this.convertChild(node.name), + initializer: + node.initializer && this.convertChild(node.initializer), + }, + 'computed', + undefined, + computed, + ), + ); } case SyntaxKind.ModuleDeclaration: { From 07b8c8ec965315bcdf57ccd9ff44f17f500b1930 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 18 Aug 2025 10:39:32 -0600 Subject: [PATCH 122/283] chore: fix prettier typo blocking CI (#11488) prettier --- tools/scripts/postinstall.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/postinstall.mts b/tools/scripts/postinstall.mts index 9343d73a084e..e64af26d08fa 100644 --- a/tools/scripts/postinstall.mts +++ b/tools/scripts/postinstall.mts @@ -20,7 +20,7 @@ const $ = $_config({ * We therefore use an env var for this. */ -if (process.env.SKIP_POSTINSTALL || process.env.MEND_HOSTED === "true") { +if (process.env.SKIP_POSTINSTALL || process.env.MEND_HOSTED === 'true') { console.log( '\nSkipping postinstall script because $SKIP_POSTINSTALL is set...\n', ); From 76486227715a02a93a7b537f05c22825b764dbc3 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 18 Aug 2025 10:40:53 -0600 Subject: [PATCH 123/283] fix(typescript-estree): revert #11232 (feat(typescript-estree): forbid invalid keys in EnumMember) (#11493) Revert "feat(typescript-estree): forbid invalid keys in `EnumMember` (#11232)" This reverts commit d50a6b11c502c4840f9649789672f49b262ff83c. --- .../snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 1 + .../fixtures/_error_/bigint-name/fixture.ts | 3 - .../snapshots/1-TSESTree-Error.shot | 9 --- .../bigint-name/snapshots/2-Babel-Error.shot | 10 --- .../snapshots/3-Alignment-Error.shot | 4 - .../_error_/computed-string-name/fixture.ts | 3 - .../snapshots/1-TSESTree-Error.shot | 9 --- .../snapshots/2-Babel-Error.shot | 10 --- .../snapshots/3-Alignment-Error.shot | 4 - .../fixtures/_error_/number-name/fixture.ts | 3 - .../snapshots/1-TSESTree-Error.shot | 9 --- .../number-name/snapshots/2-Babel-Error.shot | 10 --- .../snapshots/3-Alignment-Error.shot | 4 - .../ast-spec/src/element/TSEnumMember/spec.ts | 45 +++++++++-- .../snapshots/1-TSESTree-Error.shot | 8 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 8 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 8 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../const-enum/snapshots/1-TSESTree-AST.shot | 2 + .../snapshots/5-AST-Alignment-AST.shot | 16 ++-- .../snapshots/1-TSESTree-AST.shot | 2 + .../snapshots/5-AST-Alignment-AST.shot | 2 + .../snapshots/1-TSESTree-AST.shot | 2 + .../snapshots/5-AST-Alignment-AST.shot | 2 + .../snapshots/1-TSESTree-AST.shot | 2 + .../snapshots/5-AST-Alignment-AST.shot | 2 + .../enum/snapshots/1-TSESTree-AST.shot | 2 + .../enum/snapshots/5-AST-Alignment-AST.shot | 2 + .../fixtures-with-differences-errors.shot | 3 + .../src/rules/naming-convention.ts | 10 ++- .../rules/no-unsafe-enum-comparison.test.ts | 81 +++++++++++++++++++ .../rules/prefer-literal-enum-member.test.ts | 14 ++++ .../rules/switch-exhaustiveness-check.test.ts | 40 +++++++++ .../src/referencer/Referencer.ts | 5 +- packages/typescript-estree/src/convert.ts | 51 +++--------- 38 files changed, 231 insertions(+), 162 deletions(-) delete mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts delete mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot delete mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot delete mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot delete mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts delete mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot delete mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot delete mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot delete mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts delete mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot delete mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot delete mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot index 9a5146151d36..ddd23006e5d0 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot @@ -8,6 +8,7 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", + computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot index eeec47153937..90fb8dedf846 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot @@ -15,6 +15,7 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', +- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts deleted file mode 100644 index 3fcd08d2bc99..000000000000 --- a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts +++ /dev/null @@ -1,3 +0,0 @@ -enum Foo { - 1n = 2 -} diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot deleted file mode 100644 index 87ba241f5d40..000000000000 --- a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot +++ /dev/null @@ -1,9 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`AST Fixtures > element > TSEnumMember > _error_ > bigint-name > TSESTree - Error`] -TSError - 1 | enum Foo { -> 2 | 1n = 2 - | ^^ An enum member cannot have a numeric name. - 3 | } - 4 | diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot deleted file mode 100644 index b3afe3afc96e..000000000000 --- a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot +++ /dev/null @@ -1,10 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`AST Fixtures > element > TSEnumMember > _error_ > bigint-name > Babel - Error`] -BabelError - 1 | enum Foo { -> 2 | 1n = 2 - | ^ Unexpected token (2:2) - 3 | } - 4 | - diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot deleted file mode 100644 index 083d80544d72..000000000000 --- a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot +++ /dev/null @@ -1,4 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`AST Fixtures > element > TSEnumMember > _error_ > bigint-name > Error Alignment`] -Both errored diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts deleted file mode 100644 index 2e99a8d3766b..000000000000 --- a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts +++ /dev/null @@ -1,3 +0,0 @@ -enum Foo { - ["A"] = 2 -} diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot deleted file mode 100644 index 2079fad90f2e..000000000000 --- a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot +++ /dev/null @@ -1,9 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`AST Fixtures > element > TSEnumMember > _error_ > computed-string-name > TSESTree - Error`] -TSError - 1 | enum Foo { -> 2 | ["A"] = 2 - | ^^^^^ Computed property names are not allowed in enums. - 3 | } - 4 | diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot deleted file mode 100644 index c68571c79318..000000000000 --- a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot +++ /dev/null @@ -1,10 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`AST Fixtures > element > TSEnumMember > _error_ > computed-string-name > Babel - Error`] -BabelError - 1 | enum Foo { -> 2 | ["A"] = 2 - | ^ Unexpected token (2:2) - 3 | } - 4 | - diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot deleted file mode 100644 index 1331cf0d18b9..000000000000 --- a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot +++ /dev/null @@ -1,4 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`AST Fixtures > element > TSEnumMember > _error_ > computed-string-name > Error Alignment`] -Both errored diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts deleted file mode 100644 index 174773e65995..000000000000 --- a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts +++ /dev/null @@ -1,3 +0,0 @@ -enum Foo { - 1 = 2 -} diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot deleted file mode 100644 index 8dfacb32e5b9..000000000000 --- a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot +++ /dev/null @@ -1,9 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`AST Fixtures > element > TSEnumMember > _error_ > number-name > TSESTree - Error`] -TSError - 1 | enum Foo { -> 2 | 1 = 2 - | ^ An enum member cannot have a numeric name. - 3 | } - 4 | diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot deleted file mode 100644 index 76b2f2b9c62e..000000000000 --- a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot +++ /dev/null @@ -1,10 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`AST Fixtures > element > TSEnumMember > _error_ > number-name > Babel - Error`] -BabelError - 1 | enum Foo { -> 2 | 1 = 2 - | ^ Unexpected token (2:2) - 3 | } - 4 | - diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot deleted file mode 100644 index 34e6cebc91e1..000000000000 --- a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot +++ /dev/null @@ -1,4 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`AST Fixtures > element > TSEnumMember > _error_ > number-name > Error Alignment`] -Both errored diff --git a/packages/ast-spec/src/element/TSEnumMember/spec.ts b/packages/ast-spec/src/element/TSEnumMember/spec.ts index a4d1b836f951..a80e963ad278 100644 --- a/packages/ast-spec/src/element/TSEnumMember/spec.ts +++ b/packages/ast-spec/src/element/TSEnumMember/spec.ts @@ -1,15 +1,44 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; -import type { Identifier } from '../../expression/Identifier/spec'; -import type { StringLiteral } from '../../expression/literal/StringLiteral/spec'; import type { Expression } from '../../unions/Expression'; +import type { + PropertyNameComputed, + PropertyNameNonComputed, +} from '../../unions/PropertyName'; -export interface TSEnumMember extends BaseNode { +interface TSEnumMemberBase extends BaseNode { type: AST_NODE_TYPES.TSEnumMember; - id: Identifier | StringLiteral; - initializer: Expression | undefined; - /** - * @deprecated the enum member is always non-computed. - */ computed: boolean; + id: + | PropertyNameComputed // this should only happen in semantically invalid code (ts error 1164) + | PropertyNameNonComputed; + initializer: Expression | undefined; +} + +/** + * this should only really happen in semantically invalid code (errors 1164 and 2452) + * + * @example + * ```ts + * // VALID: + * enum Foo { ['a'] } + * + * // INVALID: + * const x = 'a'; + * enum Foo { [x] } + * enum Bar { ['a' + 'b'] } + * ``` + */ +export interface TSEnumMemberComputedName extends TSEnumMemberBase { + computed: true; + id: PropertyNameComputed; } + +export interface TSEnumMemberNonComputedName extends TSEnumMemberBase { + computed: false; + id: PropertyNameNonComputed; +} + +export type TSEnumMember = + | TSEnumMemberComputedName + | TSEnumMemberNonComputedName; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot index dc8d857908c8..c64aaae4a4d8 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot @@ -1,10 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-number > TSESTree - Error`] -TSError - 2 | - 3 | export enum Foo { -> 4 | [1], - | ^^^ Computed property names are not allowed in enums. - 5 | } - 6 | +NO ERROR diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot index f9ae118971e1..f5e14d5d4b27 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-number > Error Alignment`] -Both errored +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot index 90ef25fd26d8..866743a38587 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot @@ -1,10 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-string > TSESTree - Error`] -TSError - 2 | - 3 | export enum Foo { -> 4 | ['baz'], - | ^^^^^^^ Computed property names are not allowed in enums. - 5 | } - 6 | +NO ERROR diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot index 2dc13fd3d5d2..f58190aa21f3 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-string > Error Alignment`] -Both errored +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot index 7e31fde5e0c7..85b95f8e17d3 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot @@ -1,10 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-var-ref > TSESTree - Error`] -TSError - 2 | - 3 | export enum Foo { -> 4 | [x], - | ^^^ Computed property names are not allowed in enums. - 5 | } - 6 | +NO ERROR diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot index 3909357acf22..006e3518ee1f 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-var-ref > Error Alignment`] -Both errored +Babel errored but TSESTree didn't diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot index 238113e5cc58..9187f52aade3 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot @@ -8,6 +8,7 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", + computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -40,6 +41,7 @@ Program { }, TSEnumMember { type: "TSEnumMember", + computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot index 20c84325ce31..1c5c321a9cf2 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot @@ -15,6 +15,7 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', +- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -80,6 +81,7 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', +- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -119,7 +121,12 @@ Snapshot Diff: - loc: { - start: { column: 15, line: 3 }, - end: { column: 1, line: 6 }, -- }, ++ range: [103, 106], ++ loc: { ++ start: { column: 2, line: 5 }, ++ end: { column: 5, line: 5 }, ++ }, + }, - }, - const: true, - declare: false, @@ -133,12 +140,7 @@ Snapshot Diff: - loc: { - start: { column: 11, line: 3 }, - end: { column: 14, line: 3 }, -+ range: [103, 106], -+ loc: { -+ start: { column: 2, line: 5 }, -+ end: { column: 5, line: 5 }, -+ }, - }, +- }, - }, + ], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot index 01c4d100b383..0a35e9756f00 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot @@ -11,6 +11,7 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", + computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -43,6 +44,7 @@ Program { }, TSEnumMember { type: "TSEnumMember", + computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot index 603938fb4270..bc225b94ed0d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -19,6 +19,7 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', +- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -84,6 +85,7 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', +- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot index f946f794f043..15279e8049d7 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot @@ -11,6 +11,7 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", + computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -43,6 +44,7 @@ Program { }, TSEnumMember { type: "TSEnumMember", + computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot index eff7ba3226bd..695e866e0f98 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -19,6 +19,7 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', +- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -84,6 +85,7 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', +- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot index 8f42d8de69bf..b1554a6d0194 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot @@ -11,6 +11,7 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", + computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -43,6 +44,7 @@ Program { }, TSEnumMember { type: "TSEnumMember", + computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot index 10c5f8d572d1..b52051becdfb 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -19,6 +19,7 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', +- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -84,6 +85,7 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', +- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot index e483a20f2a29..513eb9bcd84c 100644 --- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot @@ -8,6 +8,7 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", + computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -29,6 +30,7 @@ Program { }, TSEnumMember { type: "TSEnumMember", + computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot index 544b72e407c8..3c1cbd1bc2a0 100644 --- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot @@ -15,6 +15,7 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', +- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -58,6 +59,7 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', +- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index 9bbb4c97243b..006a68578577 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -27,6 +27,9 @@ exports[`AST Fixtures > List fixtures with Error differences`] "legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/const-assertions/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/import-type-error/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/fixture.ts", diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index 02b95a5948fc..03500d825163 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -631,10 +631,12 @@ export default createRule({ // #region interface - TSEnumMember: { - handler: (node: TSESTree.TSEnumMember, validator): void => { - // Unknown reason, can't get the correct type - const id = node.id as TSESTree.Identifier | TSESTree.StringLiteral; + 'TSEnumMember[computed != true]': { + handler: ( + node: TSESTree.TSEnumMemberNonComputedName, + validator, + ): void => { + const id = node.id; const modifiers = new Set(); if (requiresQuoting(id, compilerOptions.target)) { diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts index 89e28f163314..b592b7fe513d 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts @@ -1121,6 +1121,87 @@ ruleTester.run('no-unsafe-enum-comparison', rule, { }, ], }, + { + code: ` + enum ComputedKey { + ['test-key' /* with comment */] = 1, + } + declare const computedKey: ComputedKey; + computedKey === 1; + `, + errors: [ + { + messageId: 'mismatchedCondition', + suggestions: [ + { + messageId: 'replaceValueWithEnum', + output: ` + enum ComputedKey { + ['test-key' /* with comment */] = 1, + } + declare const computedKey: ComputedKey; + computedKey === ComputedKey['test-key']; + `, + }, + ], + }, + ], + }, + { + code: ` + enum ComputedKey { + [\`test-key\` /* with comment */] = 1, + } + declare const computedKey: ComputedKey; + computedKey === 1; + `, + errors: [ + { + messageId: 'mismatchedCondition', + suggestions: [ + { + messageId: 'replaceValueWithEnum', + output: ` + enum ComputedKey { + [\`test-key\` /* with comment */] = 1, + } + declare const computedKey: ComputedKey; + computedKey === ComputedKey[\`test-key\`]; + `, + }, + ], + }, + ], + }, + { + code: ` + enum ComputedKey { + [\`test- + key\` /* with comment */] = 1, + } + declare const computedKey: ComputedKey; + computedKey === 1; + `, + errors: [ + { + messageId: 'mismatchedCondition', + suggestions: [ + { + messageId: 'replaceValueWithEnum', + output: ` + enum ComputedKey { + [\`test- + key\` /* with comment */] = 1, + } + declare const computedKey: ComputedKey; + computedKey === ComputedKey[\`test- + key\`]; + `, + }, + ], + }, + ], + }, { code: ` enum Fruit { diff --git a/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts b/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts index f655c87e9ce2..ea670139ccb3 100644 --- a/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts @@ -54,6 +54,11 @@ enum ValidQuotedKey { ` enum ValidQuotedKeyWithAssignment { 'a' = 1, +} + `, + ` +enum ValidKeyWithComputedSyntaxButNoComputedKey { + ['a'], } `, { @@ -102,6 +107,15 @@ enum Foo { }, { code: ` +enum Foo { + ['A-1'] = 1 << 0, + C = ~Foo['A-1'], +} + `, + options: [{ allowBitwiseExpressions: true }], + }, + { + code: ` enum Foo { A = 1 << 0, B = 1 << 1, diff --git a/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts b/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts index b18e91e4872a..da5b65c8177f 100644 --- a/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts +++ b/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts @@ -2281,6 +2281,46 @@ switch (value) { }, ], }, + { + code: ` + enum Enum { + 'a' = 1, + [\`key-with + + new-line\`] = 2, + } + + declare const a: Enum; + + switch (a) { + } + `, + errors: [ + { + messageId: 'switchIsNotExhaustive', + suggestions: [ + { + messageId: 'addMissingCases', + output: ` + enum Enum { + 'a' = 1, + [\`key-with + + new-line\`] = 2, + } + + declare const a: Enum; + + switch (a) { + case Enum.a: { throw new Error('Not implemented yet: Enum.a case') } + case Enum['key-with\\n\\n new-line']: { throw new Error('Not implemented yet: Enum[\\'key-with\\\\n\\\\n new-line\\'] case') } + } + `, + }, + ], + }, + ], + }, { code: noFormat` enum Enum { diff --git a/packages/scope-manager/src/referencer/Referencer.ts b/packages/scope-manager/src/referencer/Referencer.ts index 562921170751..1f621d8f7823 100644 --- a/packages/scope-manager/src/referencer/Referencer.ts +++ b/packages/scope-manager/src/referencer/Referencer.ts @@ -668,7 +668,10 @@ export class Referencer extends Visitor { name, new TSEnumMemberDefinition(name, member), ); - } else if (member.id.type === AST_NODE_TYPES.Identifier) { + } else if ( + !member.computed && + member.id.type === AST_NODE_TYPES.Identifier + ) { this.currentScope().defineIdentifier( member.id, new TSEnumMemberDefinition(member.id, member), diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 150c0ee950ea..dccb674537c6 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -476,7 +476,7 @@ export class Converter { >( node: Properties, deprecatedKey: Key, - preferredKey: string | undefined, + preferredKey: string, value: Value, ): Properties & Record { let warned = false; @@ -487,13 +487,10 @@ export class Converter { ? (): Value => value : (): Value => { if (!warned) { - let message = `The '${deprecatedKey}' property is deprecated on ${node.type} nodes.`; - if (preferredKey) { - message += ` Use ${preferredKey} instead.`; - } - message += - ' See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.'; - process.emitWarning(message, 'DeprecationWarning'); + process.emitWarning( + `The '${deprecatedKey}' property is deprecated on ${node.type} nodes. Use ${preferredKey} instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`, + 'DeprecationWarning', + ); warned = true; } @@ -3266,38 +3263,12 @@ export class Converter { } case SyntaxKind.EnumMember: { - const computed = node.name.kind === ts.SyntaxKind.ComputedPropertyName; - if (computed) { - this.#throwUnlessAllowInvalidAST( - node.name, - 'Computed property names are not allowed in enums.', - ); - } - - if ( - node.name.kind === SyntaxKind.NumericLiteral || - node.name.kind === SyntaxKind.BigIntLiteral - ) { - this.#throwUnlessAllowInvalidAST( - node.name, - 'An enum member cannot have a numeric name.', - ); - } - - return this.createNode( - node, - this.#withDeprecatedGetter( - { - type: AST_NODE_TYPES.TSEnumMember, - id: this.convertChild(node.name), - initializer: - node.initializer && this.convertChild(node.initializer), - }, - 'computed', - undefined, - computed, - ), - ); + return this.createNode(node, { + type: AST_NODE_TYPES.TSEnumMember, + computed: node.name.kind === ts.SyntaxKind.ComputedPropertyName, + id: this.convertChild(node.name), + initializer: node.initializer && this.convertChild(node.initializer), + }); } case SyntaxKind.ModuleDeclaration: { From 60c3b26317578b03bf64d8194488ba948c1b05bb Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 18 Aug 2025 17:20:55 +0000 Subject: [PATCH 124/283] chore(release): publish 8.40.0 --- CHANGELOG.md | 20 ++++ packages/ast-spec/CHANGELOG.md | 17 ++++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 12 +++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 12 +++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 12 +++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 17 ++++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 12 +++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 250 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57e55a765b43..e3f19a841802 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +## 8.40.0 (2025-08-18) + +### 🚀 Features + +- **typescript-estree:** forbid invalid keys in `EnumMember` ([#11232](https://github.com/typescript-eslint/typescript-eslint/pull/11232)) + +### 🩹 Fixes + +- **typescript-eslint:** export `plugin`, `parser`, and `configs` that are compatible with both `defineConfig()` and `tseslint.config()` ([#11475](https://github.com/typescript-eslint/typescript-eslint/pull/11475)) +- **typescript-estree:** correct range of import assertion with trailing comma ([#11478](https://github.com/typescript-eslint/typescript-eslint/pull/11478)) +- **utils:** correct `calculateConfigForFile` return type ([#11451](https://github.com/typescript-eslint/typescript-eslint/pull/11451)) + +### ❤️ Thank You + +- fisker Cheung @fisker +- Kirk Waiblinger @kirkwaiblinger +- Nolan Gajdascz @Gajdascz + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) ### 🩹 Fixes diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index fd00cc97cc72..5041687ce5a6 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,20 @@ +## 8.40.0 (2025-08-18) + +### 🚀 Features + +- **typescript-estree:** forbid invalid keys in `EnumMember` ([#11232](https://github.com/typescript-eslint/typescript-eslint/pull/11232)) + +### 🩹 Fixes + +- **typescript-estree:** correct range of import assertion with trailing comma ([#11478](https://github.com/typescript-eslint/typescript-eslint/pull/11478)) + +### ❤️ Thank You + +- fisker Cheung @fisker +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) This was a version bump only for ast-spec to align it with other projects, there were no code changes. diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 48147e62e3d0..ba03ff05d456 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.39.1", + "version": "8.40.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 24ac0116feb4..89976c5c01fc 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.40.0 (2025-08-18) + +### 🚀 Features + +- **typescript-estree:** forbid invalid keys in `EnumMember` ([#11232](https://github.com/typescript-eslint/typescript-eslint/pull/11232)) + +### ❤️ Thank You + +- fisker Cheung @fisker + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) This was a version bump only for eslint-plugin to align it with other projects, there were no code changes. diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 6debdd1e1a5e..e38ecf7a466e 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.39.1", + "version": "8.40.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.39.1", - "@typescript-eslint/type-utils": "8.39.1", - "@typescript-eslint/utils": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1", + "@typescript-eslint/scope-manager": "8.40.0", + "@typescript-eslint/type-utils": "8.40.0", + "@typescript-eslint/utils": "8.40.0", + "@typescript-eslint/visitor-keys": "8.40.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.39.1", - "@typescript-eslint/rule-tester": "8.39.1", + "@typescript-eslint/rule-schema-to-typescript-types": "8.40.0", + "@typescript-eslint/rule-tester": "8.40.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.39.1", + "@typescript-eslint/parser": "^8.40.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index f19df12f2a18..76a784632769 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.40.0 (2025-08-18) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 0bb48c178d8c..707c22d668e5 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.39.1", + "version": "8.40.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.39.1", - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1", + "@typescript-eslint/scope-manager": "8.40.0", + "@typescript-eslint/types": "8.40.0", + "@typescript-eslint/typescript-estree": "8.40.0", + "@typescript-eslint/visitor-keys": "8.40.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 6fbea812651d..811569e0c179 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.40.0 (2025-08-18) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 56464567bd10..6baf59992728 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.39.1", + "version": "8.40.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.39.1", - "@typescript-eslint/types": "^8.39.1", + "@typescript-eslint/tsconfig-utils": "^8.40.0", + "@typescript-eslint/types": "^8.40.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index ecea6871fe2a..7fe444510994 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.40.0 (2025-08-18) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index b1ba2cd63c84..74d9ffd401e3 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.39.1", + "version": "8.40.0", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.39.1", - "@typescript-eslint/utils": "8.39.1", + "@typescript-eslint/type-utils": "8.40.0", + "@typescript-eslint/utils": "8.40.0", "natural-compare": "^1.4.0", "prettier": "3.5.0" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 1fdacfbe49ae..029a948a3158 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.40.0 (2025-08-18) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 1ff1435f1b93..775673b300bf 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.39.1", + "version": "8.40.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1", - "@typescript-eslint/utils": "8.39.1", + "@typescript-eslint/parser": "8.40.0", + "@typescript-eslint/typescript-estree": "8.40.0", + "@typescript-eslint/utils": "8.40.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 9ccb2753903d..d8c7ed5095b8 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.40.0 (2025-08-18) + +### 🚀 Features + +- **typescript-estree:** forbid invalid keys in `EnumMember` ([#11232](https://github.com/typescript-eslint/typescript-eslint/pull/11232)) + +### ❤️ Thank You + +- fisker Cheung @fisker + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 49219d37ac2f..2daecf078fd1 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.39.1", + "version": "8.40.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1" + "@typescript-eslint/types": "8.40.0", + "@typescript-eslint/visitor-keys": "8.40.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.39.1", + "@typescript-eslint/typescript-estree": "8.40.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 783df6985837..0550c29f4279 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.40.0 (2025-08-18) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 1c6e4c444027..e0a2b8a748ab 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.39.1", + "version": "8.40.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index c9292049ad18..d1d563254aa8 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.40.0 (2025-08-18) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index bfd97dce816a..759fb48e783b 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.39.1", + "version": "8.40.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1", - "@typescript-eslint/utils": "8.39.1", + "@typescript-eslint/types": "8.40.0", + "@typescript-eslint/typescript-estree": "8.40.0", + "@typescript-eslint/utils": "8.40.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.39.1", + "@typescript-eslint/parser": "8.40.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 17a80e1bed35..362312d7b36c 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.40.0 (2025-08-18) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index a6489918ae2d..e00fed13b14b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.39.1", + "version": "8.40.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 979cbed223be..581ca1d10193 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.40.0 (2025-08-18) + +### 🩹 Fixes + +- **typescript-eslint:** export `plugin`, `parser`, and `configs` that are compatible with both `defineConfig()` and `tseslint.config()` ([#11475](https://github.com/typescript-eslint/typescript-eslint/pull/11475)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) ### 🩹 Fixes diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index ed9e55806bd5..f3249437d2ba 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.39.1", + "version": "8.40.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.39.1", - "@typescript-eslint/parser": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1", - "@typescript-eslint/utils": "8.39.1" + "@typescript-eslint/eslint-plugin": "8.40.0", + "@typescript-eslint/parser": "8.40.0", + "@typescript-eslint/typescript-estree": "8.40.0", + "@typescript-eslint/utils": "8.40.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 2259c1b5c99b..89ae1dd46852 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,20 @@ +## 8.40.0 (2025-08-18) + +### 🚀 Features + +- **typescript-estree:** forbid invalid keys in `EnumMember` ([#11232](https://github.com/typescript-eslint/typescript-eslint/pull/11232)) + +### 🩹 Fixes + +- **typescript-estree:** correct range of import assertion with trailing comma ([#11478](https://github.com/typescript-eslint/typescript-eslint/pull/11478)) + +### ❤️ Thank You + +- fisker Cheung @fisker +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) This was a version bump only for typescript-estree to align it with other projects, there were no code changes. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index a929aa530543..01df8590e4c4 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.39.1", + "version": "8.40.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.39.1", - "@typescript-eslint/tsconfig-utils": "8.39.1", - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1", + "@typescript-eslint/project-service": "8.40.0", + "@typescript-eslint/tsconfig-utils": "8.40.0", + "@typescript-eslint/types": "8.40.0", + "@typescript-eslint/visitor-keys": "8.40.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index ec6a8e9a2a20..4eb5650e43aa 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.40.0 (2025-08-18) + +### 🩹 Fixes + +- **utils:** correct `calculateConfigForFile` return type ([#11451](https://github.com/typescript-eslint/typescript-eslint/pull/11451)) + +### ❤️ Thank You + +- Nolan Gajdascz @Gajdascz + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index 15879bb746d4..d3549db2065c 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.39.1", + "version": "8.40.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.39.1", - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1" + "@typescript-eslint/scope-manager": "8.40.0", + "@typescript-eslint/types": "8.40.0", + "@typescript-eslint/typescript-estree": "8.40.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 3625a7072bfa..cb5c5f0f33d3 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.40.0 (2025-08-18) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.39.1 (2025-08-11) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 5adf5c665663..6c4e73577c20 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.39.1", + "version": "8.40.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.39.1", + "@typescript-eslint/types": "8.40.0", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 29bee77daa40..485535c6e770 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5955,19 +5955,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.39.1, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.40.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.39.1 - "@typescript-eslint/rule-tester": 8.39.1 - "@typescript-eslint/scope-manager": 8.39.1 - "@typescript-eslint/type-utils": 8.39.1 - "@typescript-eslint/utils": 8.39.1 - "@typescript-eslint/visitor-keys": 8.39.1 + "@typescript-eslint/rule-schema-to-typescript-types": 8.40.0 + "@typescript-eslint/rule-tester": 8.40.0 + "@typescript-eslint/scope-manager": 8.40.0 + "@typescript-eslint/type-utils": 8.40.0 + "@typescript-eslint/utils": 8.40.0 + "@typescript-eslint/visitor-keys": 8.40.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5990,7 +5990,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.39.1 + "@typescript-eslint/parser": ^8.40.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -6006,14 +6006,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.39.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.40.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.39.1 - "@typescript-eslint/types": 8.39.1 - "@typescript-eslint/typescript-estree": 8.39.1 - "@typescript-eslint/visitor-keys": 8.39.1 + "@typescript-eslint/scope-manager": 8.40.0 + "@typescript-eslint/types": 8.40.0 + "@typescript-eslint/typescript-estree": 8.40.0 + "@typescript-eslint/visitor-keys": 8.40.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6027,12 +6027,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.39.1, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.40.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.39.1 - "@typescript-eslint/types": ^8.39.1 + "@typescript-eslint/tsconfig-utils": ^8.40.0 + "@typescript-eslint/types": ^8.40.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -6043,12 +6043,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.39.1, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.40.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.39.1 - "@typescript-eslint/utils": 8.39.1 + "@typescript-eslint/type-utils": 8.40.0 + "@typescript-eslint/utils": 8.40.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -6059,15 +6059,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.39.1, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.40.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.39.1 - "@typescript-eslint/typescript-estree": 8.39.1 - "@typescript-eslint/utils": 8.39.1 + "@typescript-eslint/parser": 8.40.0 + "@typescript-eslint/typescript-estree": 8.40.0 + "@typescript-eslint/utils": 8.40.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -6082,13 +6082,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.39.1, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.40.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.39.1 - "@typescript-eslint/typescript-estree": 8.39.1 - "@typescript-eslint/visitor-keys": 8.39.1 + "@typescript-eslint/types": 8.40.0 + "@typescript-eslint/typescript-estree": 8.40.0 + "@typescript-eslint/visitor-keys": 8.40.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -6099,7 +6099,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.39.1, @typescript-eslint/tsconfig-utils@^8.39.1, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.40.0, @typescript-eslint/tsconfig-utils@^8.40.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -6112,14 +6112,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.39.1, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.40.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.39.1 - "@typescript-eslint/types": 8.39.1 - "@typescript-eslint/typescript-estree": 8.39.1 - "@typescript-eslint/utils": 8.39.1 + "@typescript-eslint/parser": 8.40.0 + "@typescript-eslint/types": 8.40.0 + "@typescript-eslint/typescript-estree": 8.40.0 + "@typescript-eslint/utils": 8.40.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6134,7 +6134,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.39.1, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.39.1, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.40.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.40.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6207,15 +6207,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.39.1, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.40.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.39.1 - "@typescript-eslint/tsconfig-utils": 8.39.1 - "@typescript-eslint/types": 8.39.1 - "@typescript-eslint/visitor-keys": 8.39.1 + "@typescript-eslint/project-service": 8.40.0 + "@typescript-eslint/tsconfig-utils": 8.40.0 + "@typescript-eslint/types": 8.40.0 + "@typescript-eslint/visitor-keys": 8.40.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6233,14 +6233,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.39.1, @typescript-eslint/utils@^8.24.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.40.0, @typescript-eslint/utils@^8.24.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.39.1 - "@typescript-eslint/types": 8.39.1 - "@typescript-eslint/typescript-estree": 8.39.1 + "@typescript-eslint/scope-manager": 8.40.0 + "@typescript-eslint/types": 8.40.0 + "@typescript-eslint/typescript-estree": 8.40.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6252,11 +6252,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.39.1, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.40.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.39.1 + "@typescript-eslint/types": 8.40.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19801,10 +19801,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.39.1 - "@typescript-eslint/parser": 8.39.1 - "@typescript-eslint/typescript-estree": 8.39.1 - "@typescript-eslint/utils": 8.39.1 + "@typescript-eslint/eslint-plugin": 8.40.0 + "@typescript-eslint/parser": 8.40.0 + "@typescript-eslint/typescript-estree": 8.40.0 + "@typescript-eslint/utils": 8.40.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From 270fa594102856ca9cc06ca897819c3c196c1314 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 18 Aug 2025 12:20:02 -0600 Subject: [PATCH 125/283] feat: tighten `tsconfigRootDir` validation (#11463) * input validation * tweaks and such * fixup * evolving any * windows * tweaks * windows test * absolutify * fixup posix snapshots * maybe * test * maybe now? * structured clone yay * fixup * test * less * again * wtf * ohhhhh - maybe this? * hoisting * back in biz * yeah yeah yeah * fun fun * typo * revert print debugging * cov * istanbul syntax * cov * lint, ugh * cov ignore comments dont really work with vitest --- packages/rule-tester/tests/RuleTester.test.ts | 35 ++++- packages/rule-tester/tests/filename.test.ts | 5 +- .../src/create-program/shared.ts | 4 +- .../src/parseSettings/createParseSettings.ts | 42 +++++- .../tests/lib/createParseSettings.test.ts | 58 ++++++- .../tests/lib/getProjectConfigFiles.test.ts | 141 +++++++++++++----- 6 files changed, 233 insertions(+), 52 deletions(-) diff --git a/packages/rule-tester/tests/RuleTester.test.ts b/packages/rule-tester/tests/RuleTester.test.ts index a2d4b83c44e6..73a5a05d45cf 100644 --- a/packages/rule-tester/tests/RuleTester.test.ts +++ b/packages/rule-tester/tests/RuleTester.test.ts @@ -4,6 +4,7 @@ import type { MockInstance } from 'vitest'; import * as parser from '@typescript-eslint/parser'; import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree'; +import path from 'node:path'; import type { InvalidTestCase, RuleTesterConfig, ValidTestCase } from '../src'; import type { RuleTesterTestFrameworkFunctionBase } from '../src/TestFramework'; @@ -95,6 +96,19 @@ const NOOP_RULE: RuleModule<'error'> = { }, }; +function windowsToPosixPath(p: string): string { + if (process.platform !== 'win32') { + return p; + } + const parsed = path.parse(p); + const hasDriveLetter = /^[a-zA-Z]:/.test(parsed.root); + let rv = p; + if (hasDriveLetter) { + rv = rv.substring(2); + } + return rv.replaceAll('\\', '/'); +} + describe(RuleTester, () => { const runRuleForItemSpy: MockInstance< ( @@ -143,7 +157,20 @@ describe(RuleTester, () => { function getTestConfigFromCall(): unknown[] { return runRuleForItemSpy.mock.calls.map(c => { - return { ...c[2], filename: c[2].filename?.replaceAll('\\', '/') }; + const copy = structuredClone(c[2]); + if (copy.filename) { + // @ts-expect-error -- readonly-ness + copy.filename = windowsToPosixPath(copy.filename); + } + + if (copy.languageOptions?.parserOptions?.tsconfigRootDir) { + // @ts-expect-error -- readonly-ness + copy.languageOptions.parserOptions.tsconfigRootDir = windowsToPosixPath( + copy.languageOptions.parserOptions.tsconfigRootDir, + ); + } + + return copy; }); } @@ -277,7 +304,7 @@ describe(RuleTester, () => { parser, parserOptions: { project: 'tsconfig.json', - tsconfigRootDir: '/some/path/that/totally/exists/', + tsconfigRootDir: path.resolve('/some/path/that/totally/exists/'), }, }, }); @@ -337,7 +364,7 @@ describe(RuleTester, () => { parser, parserOptions: { project: 'tsconfig.json', - tsconfigRootDir: '/some/path/that/totally/exists/', + tsconfigRootDir: path.resolve('/some/path/that/totally/exists/'), }, }, }); @@ -375,7 +402,7 @@ describe(RuleTester, () => { parser, parserOptions: { project: 'tsconfig.json', - tsconfigRootDir: '/some/path/that/totally/exists/', + tsconfigRootDir: path.resolve('/some/path/that/totally/exists/'), }, }, }); diff --git a/packages/rule-tester/tests/filename.test.ts b/packages/rule-tester/tests/filename.test.ts index 7068aa7fd3b5..0e9656702e95 100644 --- a/packages/rule-tester/tests/filename.test.ts +++ b/packages/rule-tester/tests/filename.test.ts @@ -2,6 +2,7 @@ import type { TSESLint } from '@typescript-eslint/utils'; import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils'; +import path from 'node:path'; import { RuleTester } from '../src/RuleTester'; @@ -62,7 +63,9 @@ describe('rule tester filename', () => { new RuleTester({ languageOptions: { - parserOptions: { tsconfigRootDir: '/some/path/that/totally/exists/' }, + parserOptions: { + tsconfigRootDir: path.resolve('/some/path/that/totally/exists/'), + }, }, }).run('with tsconfigRootDir', rule, { invalid: [ diff --git a/packages/typescript-estree/src/create-program/shared.ts b/packages/typescript-estree/src/create-program/shared.ts index 088e5ce1c7dd..68d8a4e0e0d8 100644 --- a/packages/typescript-estree/src/create-program/shared.ts +++ b/packages/typescript-estree/src/create-program/shared.ts @@ -70,9 +70,7 @@ export function getCanonicalFileName(filePath: string): CanonicalPath { } export function ensureAbsolutePath(p: string, tsconfigRootDir: string): string { - return path.isAbsolute(p) - ? p - : path.join(tsconfigRootDir || process.cwd(), p); + return path.resolve(tsconfigRootDir, p); } export function canonicalDirname(p: CanonicalPath): CanonicalPath { diff --git a/packages/typescript-estree/src/parseSettings/createParseSettings.ts b/packages/typescript-estree/src/parseSettings/createParseSettings.ts index 6710e36b870f..e393686e0afc 100644 --- a/packages/typescript-estree/src/parseSettings/createParseSettings.ts +++ b/packages/typescript-estree/src/parseSettings/createParseSettings.ts @@ -50,10 +50,44 @@ export function createParseSettings( ): MutableParseSettings { const codeFullText = enforceCodeString(code); const singleRun = inferSingleRun(tsestreeOptions); - const tsconfigRootDir = - typeof tsestreeOptions.tsconfigRootDir === 'string' - ? tsestreeOptions.tsconfigRootDir - : getInferredTSConfigRootDir(); + + const tsconfigRootDir = (() => { + if (tsestreeOptions.tsconfigRootDir == null) { + const inferredTsconfigRootDir = getInferredTSConfigRootDir(); + if (path.resolve(inferredTsconfigRootDir) !== inferredTsconfigRootDir) { + throw new Error( + `inferred tsconfigRootDir should be a resolved absolute path, but received: ${JSON.stringify( + inferredTsconfigRootDir, + )}. This is a bug in typescript-eslint! Please report it to us at https://github.com/typescript-eslint/typescript-eslint/issues/new/choose.`, + ); + } + return inferredTsconfigRootDir; + } + + if (typeof tsestreeOptions.tsconfigRootDir === 'string') { + const userProvidedTsconfigRootDir = tsestreeOptions.tsconfigRootDir; + if ( + !path.isAbsolute(userProvidedTsconfigRootDir) || + // Ensure it's fully absolute with a drive letter if windows + (process.platform === 'win32' && + !/^[a-zA-Z]:/.test(userProvidedTsconfigRootDir)) + ) { + throw new Error( + `parserOptions.tsconfigRootDir must be an absolute path, but received: ${JSON.stringify( + userProvidedTsconfigRootDir, + )}. This is a bug in your configuration; please supply an absolute path.`, + ); + } + // Deal with any funny business around trailing path separators (a/b/) or relative path segments (/a/b/../c) + // Since we already know it's absolute, we can safely use path.resolve here. + return path.resolve(userProvidedTsconfigRootDir); + } + + throw new Error( + `If provided, parserOptions.tsconfigRootDir must be a string, but received a value of type "${typeof tsestreeOptions.tsconfigRootDir}"`, + ); + })(); + const passedLoggerFn = typeof tsestreeOptions.loggerFn === 'function'; const filePath = ensureAbsolutePath( typeof tsestreeOptions.filePath === 'string' && diff --git a/packages/typescript-estree/tests/lib/createParseSettings.test.ts b/packages/typescript-estree/tests/lib/createParseSettings.test.ts index d3f5fea99819..b1f33f9304d2 100644 --- a/packages/typescript-estree/tests/lib/createParseSettings.test.ts +++ b/packages/typescript-estree/tests/lib/createParseSettings.test.ts @@ -6,6 +6,8 @@ import { createParseSettings } from '../../src/parseSettings/createParseSettings const projectService = { service: true }; +const isWindows = process.platform === 'win32'; + vi.mock('@typescript-eslint/project-service', () => ({ createProjectService: () => projectService, })); @@ -71,8 +73,50 @@ describe(createParseSettings, () => { clearCandidateTSConfigRootDirs(); }); + it('errors on non-absolute path', () => { + expect(() => + createParseSettings('', { tsconfigRootDir: 'a/b/c' }), + ).toThrowErrorMatchingInlineSnapshot( + `[Error: parserOptions.tsconfigRootDir must be an absolute path, but received: "a/b/c". This is a bug in your configuration; please supply an absolute path.]`, + ); + }); + + it.runIf(isWindows)( + 'complains about missing drive letter on windows', + () => { + expect(() => + createParseSettings('', { tsconfigRootDir: '\\a\\b\\c' }), + ).toThrowErrorMatchingInlineSnapshot( + `[Error: parserOptions.tsconfigRootDir must be an absolute path, but received: "\\\\a\\\\b\\\\c". This is a bug in your configuration; please supply an absolute path.]`, + ); + }, + ); + + it('normalizes crazy tsconfigRootDir', () => { + const parseSettings = createParseSettings('', { + tsconfigRootDir: !isWindows + ? '/a/b////..//c///' + : 'E:\\a\\b\\\\\\\\..\\\\c\\\\\\', + }); + + expect(parseSettings.tsconfigRootDir).toBe( + !isWindows ? '/a/c' : 'E:\\a\\c', + ); + }); + + it('errors on invalid tsconfigRootDir', () => { + expect(() => + createParseSettings('', { + // @ts-expect-error -- testing invalid input + tsconfigRootDir: 42, + }), + ).toThrowErrorMatchingInlineSnapshot( + `[Error: If provided, parserOptions.tsconfigRootDir must be a string, but received a value of type "number"]`, + ); + }); + it('uses the provided tsconfigRootDir when it exists and no candidates exist', () => { - const tsconfigRootDir = 'a/b/c'; + const tsconfigRootDir = !isWindows ? '/a/b/c' : 'F:\\b\\c'; const parseSettings = createParseSettings('', { tsconfigRootDir }); @@ -81,7 +125,7 @@ describe(createParseSettings, () => { it('uses the provided tsconfigRootDir when it exists and a candidate exists', () => { addCandidateTSConfigRootDir('candidate'); - const tsconfigRootDir = 'a/b/c'; + const tsconfigRootDir = !isWindows ? '/a/b/c' : 'F:\\a\\b\\c'; const parseSettings = createParseSettings('', { tsconfigRootDir }); @@ -89,12 +133,20 @@ describe(createParseSettings, () => { }); it('uses the inferred candidate when no tsconfigRootDir is provided and a candidate exists', () => { - const tsconfigRootDir = 'a/b/c'; + const tsconfigRootDir = !isWindows ? '/a/b/c' : 'G:\\a\\b\\c'; addCandidateTSConfigRootDir(tsconfigRootDir); const parseSettings = createParseSettings(''); expect(parseSettings.tsconfigRootDir).toBe(tsconfigRootDir); }); + + it('should error if inferred tsconfig is not clean', () => { + addCandidateTSConfigRootDir('a/b/c'); + + expect(() => createParseSettings('')).toThrowErrorMatchingInlineSnapshot( + `[Error: inferred tsconfigRootDir should be a resolved absolute path, but received: "a/b/c". This is a bug in typescript-eslint! Please report it to us at https://github.com/typescript-eslint/typescript-eslint/issues/new/choose.]`, + ); + }); }); }); diff --git a/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts b/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts index 8e464eb746fc..525cd8e2acdf 100644 --- a/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts +++ b/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts @@ -1,9 +1,12 @@ import { existsSync } from 'node:fs'; -import path from 'node:path'; + +import type { ParseSettings } from '../../src/parseSettings'; import { ExpiringCache } from '../../src/parseSettings/ExpiringCache'; import { getProjectConfigFiles } from '../../src/parseSettings/getProjectConfigFiles'; +const isWindows = process.platform === 'win32'; + const mockExistsSync = vi.mocked(existsSync); vi.mock(import('node:fs'), async importOriginal => { @@ -11,21 +14,36 @@ vi.mock(import('node:fs'), async importOriginal => { return { ...actual, - default: actual.default, existsSync: vi.fn(actual.existsSync), }; }); -const parseSettings = { - filePath: './repos/repo/packages/package/file.ts', +type TestParseSettings = Pick< + ParseSettings, + 'filePath' | 'tsconfigMatchCache' | 'tsconfigRootDir' +> & { tsconfigMatchCache: ExpiringCache }; + +const parseSettingsWindows: TestParseSettings = { + filePath: 'H:\\repos\\repo\\packages\\package\\file.ts', + tsconfigMatchCache: new ExpiringCache(1), + tsconfigRootDir: 'H:\\repos\\repo', +}; + +const parseSettingsPosix: TestParseSettings = { + filePath: '/repos/repo/packages/package/file.ts', tsconfigMatchCache: new ExpiringCache(1), - tsconfigRootDir: './repos/repo', + tsconfigRootDir: '/repos/repo', }; +const parseSettings: TestParseSettings = !isWindows + ? parseSettingsPosix + : parseSettingsWindows; + describe(getProjectConfigFiles, () => { beforeEach(() => { parseSettings.tsconfigMatchCache.clear(); vi.clearAllMocks(); + vi.resetModules(); }); afterAll(() => { @@ -66,14 +84,17 @@ describe(getProjectConfigFiles, () => { const actual = getProjectConfigFiles(parseSettings, true); expect(actual).toStrictEqual([ - path.normalize('repos/repo/packages/package/tsconfig.json'), + !isWindows + ? '/repos/repo/packages/package/tsconfig.json' + : 'H:\\repos\\repo\\packages\\package\\tsconfig.json', ]); expect(mockExistsSync).toHaveBeenCalledOnce(); }); it('returns a nearby parent tsconfig.json when it was previously cached by a different directory search', () => { mockExistsSync.mockImplementation( - input => input === path.normalize('a/tsconfig.json'), + input => + input === (!isWindows ? '/a/tsconfig.json' : 'H:\\a\\tsconfig.json'), ); const tsconfigMatchCache = new ExpiringCache(1); @@ -81,9 +102,9 @@ describe(getProjectConfigFiles, () => { // This should call to fs.existsSync three times: c, b, a getProjectConfigFiles( { - filePath: './a/b/c/d.ts', + filePath: !isWindows ? '/a/b/c/d.ts' : 'H:\\a\\b\\c\\d.ts', tsconfigMatchCache, - tsconfigRootDir: './a', + tsconfigRootDir: !isWindows ? '/a' : 'H:\\a', }, true, ); @@ -92,20 +113,23 @@ describe(getProjectConfigFiles, () => { // Then it should retrieve c from cache, pointing to a const actual = getProjectConfigFiles( { - filePath: './a/b/c/e/f.ts', + filePath: !isWindows ? '/a/b/c/e/f.ts' : 'H:\\a\\b\\c\\e\\f.ts', tsconfigMatchCache, - tsconfigRootDir: './a', + tsconfigRootDir: !isWindows ? '/a' : 'H:\\a', }, true, ); - expect(actual).toStrictEqual([path.normalize('a/tsconfig.json')]); + expect(actual).toStrictEqual([ + !isWindows ? '/a/tsconfig.json' : 'H:\\a\\tsconfig.json', + ]); expect(mockExistsSync).toHaveBeenCalledTimes(4); }); it('returns a distant parent tsconfig.json when it was previously cached by a different directory search', () => { mockExistsSync.mockImplementation( - input => input === path.normalize('a/tsconfig.json'), + input => + input === (!isWindows ? '/a/tsconfig.json' : 'H:\\a\\tsconfig.json'), ); const tsconfigMatchCache = new ExpiringCache(1); @@ -113,9 +137,9 @@ describe(getProjectConfigFiles, () => { // This should call to fs.existsSync 4 times: d, c, b, a getProjectConfigFiles( { - filePath: './a/b/c/d/e.ts', + filePath: !isWindows ? '/a/b/c/d/e.ts' : 'H:\\a\\b\\c\\d\\e.ts', tsconfigMatchCache, - tsconfigRootDir: './a', + tsconfigRootDir: !isWindows ? '/a' : 'H:\\a', }, true, ); @@ -124,14 +148,16 @@ describe(getProjectConfigFiles, () => { // Then it should retrieve b from cache, pointing to a const actual = getProjectConfigFiles( { - filePath: './a/b/f/g/h.ts', + filePath: !isWindows ? '/a/b/f/g/h.ts' : 'H:\\a\\b\\f\\g\\h.ts', tsconfigMatchCache, - tsconfigRootDir: './a', + tsconfigRootDir: !isWindows ? '/a' : 'H:\\a', }, true, ); - expect(actual).toStrictEqual([path.normalize('a/tsconfig.json')]); + expect(actual).toStrictEqual([ + !isWindows ? '/a/tsconfig.json' : 'H:\\a\\tsconfig.json', + ]); expect(mockExistsSync).toHaveBeenCalledTimes(6); }); }); @@ -143,40 +169,81 @@ describe(getProjectConfigFiles, () => { const actual = getProjectConfigFiles(parseSettings, true); expect(actual).toStrictEqual([ - path.normalize('repos/repo/packages/package/tsconfig.json'), + !isWindows + ? '/repos/repo/packages/package/tsconfig.json' + : 'H:\\repos\\repo\\packages\\package\\tsconfig.json', ]); }); it('returns a parent tsconfig.json when matched', () => { mockExistsSync.mockImplementation( - filePath => filePath === path.normalize('repos/repo/tsconfig.json'), + filePath => + filePath === + (!isWindows + ? '/repos/repo/tsconfig.json' + : 'H:\\repos\\repo\\tsconfig.json'), ); const actual = getProjectConfigFiles(parseSettings, true); expect(actual).toStrictEqual([ - path.normalize('repos/repo/tsconfig.json'), + !isWindows + ? '/repos/repo/tsconfig.json' + : 'H:\\repos\\repo\\tsconfig.json', ]); }); - it('throws when searching hits .', () => { - mockExistsSync.mockReturnValue(false); - - expect(() => - getProjectConfigFiles(parseSettings, true), - ).toThrowErrorMatchingInlineSnapshot( - `[Error: project was set to \`true\` but couldn't find any tsconfig.json relative to './repos/repo/packages/package/file.ts' within './repos/repo'.]`, - ); + it('throws when searching hits .', async () => { + // ensure posix-style paths are used for consistent snapshot. + vi.doMock(import('node:path'), async importActual => { + const actualPath = await importActual(); + return { + ...actualPath.posix, + default: actualPath.posix, + }; + }); + + try { + const { getProjectConfigFiles } = await import( + '../../src/parseSettings/getProjectConfigFiles.js' + ); + + mockExistsSync.mockReturnValue(false); + + expect(() => + getProjectConfigFiles(parseSettingsPosix, true), + ).toThrowErrorMatchingInlineSnapshot( + `[Error: project was set to \`true\` but couldn't find any tsconfig.json relative to '/repos/repo/packages/package/file.ts' within '/repos/repo'.]`, + ); + } finally { + vi.doUnmock(import('node:path')); + } }); - it('throws when searching passes the tsconfigRootDir', () => { - mockExistsSync.mockReturnValue(false); - - expect(() => - getProjectConfigFiles({ ...parseSettings, tsconfigRootDir: '/' }, true), - ).toThrowErrorMatchingInlineSnapshot( - `[Error: project was set to \`true\` but couldn't find any tsconfig.json relative to './repos/repo/packages/package/file.ts' within '/'.]`, - ); + it('throws when searching passes the tsconfigRootDir', async () => { + // ensure posix-style paths are used for consistent snapshot. + vi.doMock(import('node:path'), async importActual => { + const actualPath = await importActual(); + return { ...actualPath.posix, default: actualPath.posix }; + }); + try { + const { getProjectConfigFiles } = await import( + '../../src/parseSettings/getProjectConfigFiles.js' + ); + + mockExistsSync.mockReturnValue(false); + + expect(() => + getProjectConfigFiles( + { ...parseSettingsPosix, tsconfigRootDir: '/' }, + true, + ), + ).toThrowErrorMatchingInlineSnapshot( + `[Error: project was set to \`true\` but couldn't find any tsconfig.json relative to '/repos/repo/packages/package/file.ts' within '/'.]`, + ); + } finally { + vi.doUnmock(import('node:path')); + } }); }); }); From 848201306ff7de346cd714332c4ef13643975fcb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 20:17:51 +0000 Subject: [PATCH 126/283] fix(deps): update babel monorepo (#11174) * fix(deps): update babel monorepo * update snapshots * remove expect not to support --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .../snapshots/2-Babel-Error.shot | 2 +- .../snapshots/2-Babel-Error.shot | 2 +- .../snapshots/2-Babel-Error.shot | 2 +- .../snapshots/2-Babel-Error.shot | 2 +- .../snapshots/2-Babel-Error.shot | 2 +- .../snapshots/2-Babel-Error.shot | 2 +- .../snapshots/2-Babel-Error.shot | 2 +- .../snapshots/2-Babel-Error.shot | 2 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../let-id-init/snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/2-Babel-Error.shot | 2 +- .../snapshots/2-Babel-Error.shot | 2 +- .../snapshots/2-Babel-Error.shot | 2 +- .../snapshots/2-Babel-Error.shot | 2 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../global-this/snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 8 +- .../snapshots/6-AST-Alignment-Tokens.shot | 12 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 8 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 16 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../conditional/snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../constructor/snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../function/snapshots/4-Babel-Tokens.shot | 4 +- .../indexed/snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../mapped/snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../reference/snapshots/4-Babel-Tokens.shot | 4 +- .../tuple-empty/snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../tuple-named/snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../tuple-rest/snapshots/4-Babel-Tokens.shot | 4 +- .../tuple/snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 8 +- .../typeof-this/snapshots/4-Babel-Tokens.shot | 8 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../typeof/snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 16 +- .../config.ts | 4 - .../snapshots/3-Babel-AST.shot | 139 ++++ .../snapshots/3-Babel-Error.shot | 2 +- .../snapshots/4-Babel-Tokens.shot | 202 ++++++ .../snapshots/5-AST-Alignment-AST.shot | 160 +++++ .../snapshots/6-AST-Alignment-Tokens.shot | 211 +++++++ .../tests/fixtures-with-differences-ast.shot | 1 + .../fixtures-with-differences-errors.shot | 3 +- .../fixtures-with-differences-tokens.shot | 59 +- .../tests/fixtures-without-babel-support.shot | 7 +- yarn.lock | 596 ++++-------------- 81 files changed, 984 insertions(+), 704 deletions(-) delete mode 100644 packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/config.ts create mode 100644 packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/6-AST-Alignment-Tokens.shot diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot index 506605699490..90a0b63510ca 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot @@ -3,6 +3,6 @@ exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-init > Babel - Error`] BabelError > 1 | declare using foo! = 1; - | ^ Missing semicolon. (1:7) + | ^ 'declare' modifier cannot appear on a using declaration. (1:8) 2 | diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot index 6da6ff4f9888..969cf36c0bbf 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot @@ -3,6 +3,6 @@ exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-no-init > Babel - Error`] BabelError > 1 | declare using foo!; - | ^ Missing semicolon. (1:7) + | ^ 'declare' modifier cannot appear on a using declaration. (1:8) 2 | diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot index d347213e6ad4..8260ff32d2ca 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot @@ -3,6 +3,6 @@ exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-type-init > Babel - Error`] BabelError > 1 | declare using foo!: any = 1; - | ^ Missing semicolon. (1:7) + | ^ 'declare' modifier cannot appear on a using declaration. (1:8) 2 | diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot index 3ece5982f90f..02a7a6964314 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot @@ -3,6 +3,6 @@ exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-type-no-init > Babel - Error`] BabelError > 1 | declare using foo!: any; - | ^ Missing semicolon. (1:7) + | ^ 'declare' modifier cannot appear on a using declaration. (1:8) 2 | diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot index c3883b0d2ef1..97094e711350 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot @@ -3,6 +3,6 @@ exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-init > Babel - Error`] BabelError > 1 | declare using foo = 1; - | ^ Missing semicolon. (1:7) + | ^ 'declare' modifier cannot appear on a using declaration. (1:8) 2 | diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot index 62096b9772ac..a8442943b6d0 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot @@ -3,6 +3,6 @@ exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-no-init > Babel - Error`] BabelError > 1 | declare using foo; - | ^ Missing semicolon. (1:7) + | ^ 'declare' modifier cannot appear on a using declaration. (1:8) 2 | diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot index 553ccd15573b..35ddd9daf071 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot @@ -3,6 +3,6 @@ exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-type-init > Babel - Error`] BabelError > 1 | declare using foo: any = 1; - | ^ Missing semicolon. (1:7) + | ^ 'declare' modifier cannot appear on a using declaration. (1:8) 2 | diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot index 11158f84f69e..420a6845fbf9 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot @@ -3,6 +3,6 @@ exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-type-no-init > Babel - Error`] BabelError > 1 | declare using foo: any; - | ^ Missing semicolon. (1:7) + | ^ 'declare' modifier cannot appear on a using declaration. (1:8) 2 | diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-no-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-no-init/snapshots/4-Babel-Tokens.shot index 1e8aedb5a757..89f263da8a91 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-no-init/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-no-init/snapshots/4-Babel-Tokens.shot @@ -9,8 +9,8 @@ end: { column: 7, line: 1 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [8, 11], diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-type-no-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-type-no-init/snapshots/4-Babel-Tokens.shot index de560945193b..e237405b6f8f 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-type-no-init/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-type-no-init/snapshots/4-Babel-Tokens.shot @@ -9,8 +9,8 @@ end: { column: 7, line: 1 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [8, 11], diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-no-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-no-init/snapshots/4-Babel-Tokens.shot index b7868b340a2c..d946b523b795 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-no-init/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-no-init/snapshots/4-Babel-Tokens.shot @@ -9,8 +9,8 @@ end: { column: 7, line: 1 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [8, 11], diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-type-no-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-type-no-init/snapshots/4-Babel-Tokens.shot index f25ebacc499a..802d9e8f933e 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-type-no-init/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-type-no-init/snapshots/4-Babel-Tokens.shot @@ -9,8 +9,8 @@ end: { column: 7, line: 1 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [8, 11], diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-init/snapshots/4-Babel-Tokens.shot index f7b059c3e53e..370c22201c27 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-init/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-init/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [0, 3], diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-type-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-type-init/snapshots/4-Babel-Tokens.shot index 8eb9db558757..fb2de915e0e2 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-type-init/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-type-init/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [0, 3], diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-definite-type-no-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-definite-type-no-init/snapshots/4-Babel-Tokens.shot index 04367dd27c4f..858d88120216 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-definite-type-no-init/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-definite-type-no-init/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [0, 3], diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-init/snapshots/4-Babel-Tokens.shot index ef80cf7131ed..c43ae8ec6cec 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-init/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-init/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [0, 3], diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-no-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-no-init/snapshots/4-Babel-Tokens.shot index b6a6248914c3..b3be12441d9c 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-no-init/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-no-init/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [0, 3], diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-init/snapshots/4-Babel-Tokens.shot index 447584b158d1..a7e85c35fe66 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-init/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-init/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [0, 3], diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-no-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-no-init/snapshots/4-Babel-Tokens.shot index 5c5508c4addd..d978035e4a7c 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-no-init/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-no-init/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [0, 3], diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/4-Babel-Tokens.shot index 79072bfc8258..d08e8a6769b2 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [0, 3], diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot index 6d6ec2a3e287..3243edaa376b 100644 --- a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot @@ -4,7 +4,7 @@ exports[`AST Fixtures > element > MethodDefinition > _error_ > duplicated-access BabelError 1 | class Foo { > 2 | public public bar() {}; - | ^ Accessibility modifier already seen. (2:9) + | ^ Accessibility modifier already seen: 'public'. (2:9) 3 | } 4 | diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot index 05ef660a6ae1..013fb16531eb 100644 --- a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot @@ -4,7 +4,7 @@ exports[`AST Fixtures > element > MethodDefinition > _error_ > mixed-accessibili BabelError 1 | class Foo { > 2 | public protected bar() {}; - | ^ Accessibility modifier already seen. (2:9) + | ^ Accessibility modifier already seen: 'protected'. (2:9) 3 | } 4 | diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot index 7da522cb7532..31592e35fd82 100644 --- a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot @@ -4,7 +4,7 @@ exports[`AST Fixtures > element > PropertyDefinition > _error_ > duplicated-acce BabelError 1 | class Foo { > 2 | public public bar; - | ^ Accessibility modifier already seen. (2:9) + | ^ Accessibility modifier already seen: 'public'. (2:9) 3 | } 4 | diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot index 3498ed99592a..f62e3c0547b7 100644 --- a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot @@ -4,7 +4,7 @@ exports[`AST Fixtures > element > PropertyDefinition > _error_ > mixed-accessibi BabelError 1 | class Foo { > 2 | public protected bar; - | ^ Accessibility modifier already seen. (2:9) + | ^ Accessibility modifier already seen: 'protected'. (2:9) 3 | } 4 | diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/4-Babel-Tokens.shot index 794cf8cd318c..b2ba9113ed0e 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/4-Babel-Tokens.shot @@ -109,8 +109,8 @@ end: { column: 18, line: 4 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [118, 121], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/4-Babel-Tokens.shot index 2b4bd47565ba..fb0b35f8e5f1 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/4-Babel-Tokens.shot @@ -109,8 +109,8 @@ end: { column: 21, line: 8 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [165, 168], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/4-Babel-Tokens.shot index 65e2dfe0dc77..781a841d719c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/4-Babel-Tokens.shot @@ -2579,8 +2579,8 @@ end: { column: 18, line: 76 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [1130, 1133], @@ -2609,8 +2609,8 @@ end: { column: 11, line: 77 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "yield", range: [1138, 1143], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/6-AST-Alignment-Tokens.shot index 358988f5d91b..89c5aca71c1a 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/6-AST-Alignment-Tokens.shot @@ -2596,10 +2596,8 @@ Snapshot Diff: end: { column: 18, line: 76 }, }, }, -- Keyword { -- type: 'Keyword', -+ Identifier { -+ type: 'Identifier', + Keyword { + type: 'Keyword', value: 'let', range: [1130, 1133], @@ -2628,10 +2626,8 @@ Snapshot Diff: end: { column: 11, line: 77 }, }, }, -- Keyword { -- type: 'Keyword', -+ Identifier { -+ type: 'Identifier', + Keyword { + type: 'Keyword', value: 'yield', range: [1138, 1143], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/4-Babel-Tokens.shot index 0ebcd27bf8f3..d5d1ec3f7e5c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/4-Babel-Tokens.shot @@ -139,8 +139,8 @@ end: { column: 20, line: 4 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [133, 136], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/4-Babel-Tokens.shot index cfe34f596563..d7da87a7a9d7 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], @@ -49,8 +49,8 @@ end: { column: 12, line: 3 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [86, 89], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/4-Babel-Tokens.shot index 7efe3d3c1a01..bc7b5325ce7b 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/4-Babel-Tokens.shot @@ -89,8 +89,8 @@ end: { column: 45, line: 3 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [121, 124], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot index e8b74eb74e4b..c5d1e3db16f5 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], @@ -89,8 +89,8 @@ end: { column: 37, line: 3 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [111, 114], @@ -159,8 +159,8 @@ end: { column: 34, line: 4 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [146, 149], @@ -269,8 +269,8 @@ end: { column: 45, line: 5 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [192, 195], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/4-Babel-Tokens.shot index 81c2b521b7d5..693b4c9de7a5 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/4-Babel-Tokens.shot index 35f693b45343..efe446c91415 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/4-Babel-Tokens.shot index 9c14b6f29d0d..8e7e2549262f 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/4-Babel-Tokens.shot index 220fe9555e9b..f95f0ec5e899 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/4-Babel-Tokens.shot index c96f24501f5e..1526af3e6f08 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/4-Babel-Tokens.shot index d8b85c337844..308ede1f966f 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/4-Babel-Tokens.shot index 1177bc6d5393..749b397d0672 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/4-Babel-Tokens.shot index e74a4370243b..e2cb259df540 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/4-Babel-Tokens.shot index 9e9481a35684..8333ead4d538 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/4-Babel-Tokens.shot index fc203602a9ed..7f92e37fb63e 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/4-Babel-Tokens.shot index a5b6a00a1418..d82ffedb7ebe 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/4-Babel-Tokens.shot index 111a3921015f..7384c5b71f9c 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/4-Babel-Tokens.shot index ba1f21afcd61..cb4f94fecb64 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/4-Babel-Tokens.shot index 5b981eedef46..b988bba0f56f 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/4-Babel-Tokens.shot index 508a7be90987..52f735fd8160 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/4-Babel-Tokens.shot index b3fa4f40d2cf..9289da650dcb 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/4-Babel-Tokens.shot index b56d0a990e99..0aee0dcb8696 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/4-Babel-Tokens.shot index bd73b0295988..b0602909de5d 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/4-Babel-Tokens.shot index 68b91afce98a..142b15bfa8cb 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/4-Babel-Tokens.shot index c3ffd41f1daa..b28d19369e69 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/4-Babel-Tokens.shot index 79a0ab7f3906..294fd82c0101 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/4-Babel-Tokens.shot index 340b5d51db47..4487279ef14f 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/4-Babel-Tokens.shot index a3de1c4a3b65..29e683c4011f 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/4-Babel-Tokens.shot index 4beddd730692..c2b1215eabc2 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/4-Babel-Tokens.shot index 474ccbd9551e..c83935cd8d50 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/4-Babel-Tokens.shot index 41031c9068b0..5fb2042b7470 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/4-Babel-Tokens.shot index 7b3c79ba1164..0e6c24dc58d9 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/4-Babel-Tokens.shot index 1936dc9a2c28..c2b21dcd7402 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/4-Babel-Tokens.shot index b696dfd5b340..55c76af54c68 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/4-Babel-Tokens.shot index f27109984826..3dfe6687ff52 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/4-Babel-Tokens.shot index 788399b58467..9ed540fb2ebe 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/4-Babel-Tokens.shot index 0728f53a8a9a..c00e485c9228 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/4-Babel-Tokens.shot index e3baed46299d..5ea169be4a42 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/4-Babel-Tokens.shot index 3a5d505e2e8a..82cfb8838ccd 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], @@ -59,8 +59,8 @@ end: { column: 15, line: 3 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [89, 92], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/4-Babel-Tokens.shot index db8464f05758..9257d8476df2 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], @@ -59,8 +59,8 @@ end: { column: 22, line: 3 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [96, 99], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/4-Babel-Tokens.shot index 6afaf9bc864a..5a00a924380e 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/4-Babel-Tokens.shot index baf361175501..1dd2f34f58fe 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot index a5c2e0f37f4e..547dd756f9d3 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ [ - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [73, 76], @@ -89,8 +89,8 @@ end: { column: 37, line: 3 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [111, 114], @@ -159,8 +159,8 @@ end: { column: 34, line: 4 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [146, 149], @@ -269,8 +269,8 @@ end: { column: 45, line: 5 }, }, }, - Identifier { - type: "Identifier", + Keyword { + type: "Keyword", value: "let", range: [192, 195], diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/config.ts b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/config.ts deleted file mode 100644 index 0b761eb56eb3..000000000000 --- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/config.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default { - expectBabelToNotSupport: - 'waiting for https://github.com/babel/babel/pull/17465 to be released', -} satisfies ASTFixtureConfig; diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..b667343abacf --- /dev/null +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-AST.shot @@ -0,0 +1,139 @@ +Program { + type: "Program", + body: [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + declare: false, + id: Identifier { + type: "Identifier", + decorators: [], + name: "TrailingComma", + optional: false, + + range: [5, 18], + loc: { + start: { column: 5, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + typeAnnotation: TSImportType { + type: "TSImportType", + argument: Literal { + type: "Literal", + raw: ""A"", + value: "A", + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + options: ObjectExpression { + type: "ObjectExpression", + properties: [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + decorators: [], + name: "with", + optional: false, + + range: [35, 39], + loc: { + start: { column: 35, line: 1 }, + end: { column: 39, line: 1 }, + }, + }, + kind: "init", + method: false, + optional: false, + shorthand: false, + value: ObjectExpression { + type: "ObjectExpression", + properties: [ + Property { + type: "Property", + computed: false, + key: Literal { + type: "Literal", + raw: ""resolution-mode"", + value: "resolution-mode", + + range: [43, 60], + loc: { + start: { column: 43, line: 1 }, + end: { column: 60, line: 1 }, + }, + }, + kind: "init", + method: false, + optional: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: ""import"", + value: "import", + + range: [62, 70], + loc: { + start: { column: 62, line: 1 }, + end: { column: 70, line: 1 }, + }, + }, + + range: [43, 70], + loc: { + start: { column: 43, line: 1 }, + end: { column: 70, line: 1 }, + }, + }, + ], + + range: [41, 73], + loc: { + start: { column: 41, line: 1 }, + end: { column: 73, line: 1 }, + }, + }, + + range: [35, 73], + loc: { + start: { column: 35, line: 1 }, + end: { column: 73, line: 1 }, + }, + }, + ], + + range: [33, 76], + loc: { + start: { column: 33, line: 1 }, + end: { column: 76, line: 1 }, + }, + }, + qualifier: null, + + range: [21, 78], + loc: { + start: { column: 21, line: 1 }, + end: { column: 78, line: 1 }, + }, + }, + + range: [0, 79], + loc: { + start: { column: 0, line: 1 }, + end: { column: 79, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 80], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} \ No newline at end of file diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-Error.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-Error.shot index 8f216bc26e47..0c1ff0965afa 100644 --- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-Error.shot +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > type > TSImportType > type-import-type-with-trailing-comma-in-import-attributes > Babel - Error`] -SyntaxError: Unexpected token, expected "}" (1:73) +NO ERROR diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..1c38f78693d0 --- /dev/null +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,202 @@ +[ + Identifier { + type: "Identifier", + value: "type", + + range: [0, 4], + loc: { + start: { column: 0, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "TrailingComma", + + range: [5, 18], + loc: { + start: { column: 5, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + String { + type: "String", + value: ""A"", + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [33, 34], + loc: { + start: { column: 33, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "with", + + range: [35, 39], + loc: { + start: { column: 35, line: 1 }, + end: { column: 39, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [39, 40], + loc: { + start: { column: 39, line: 1 }, + end: { column: 40, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [41, 42], + loc: { + start: { column: 41, line: 1 }, + end: { column: 42, line: 1 }, + }, + }, + String { + type: "String", + value: ""resolution-mode"", + + range: [43, 60], + loc: { + start: { column: 43, line: 1 }, + end: { column: 60, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [60, 61], + loc: { + start: { column: 60, line: 1 }, + end: { column: 61, line: 1 }, + }, + }, + String { + type: "String", + value: ""import"", + + range: [62, 70], + loc: { + start: { column: 62, line: 1 }, + end: { column: 70, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [70, 71], + loc: { + start: { column: 70, line: 1 }, + end: { column: 71, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [72, 73], + loc: { + start: { column: 72, line: 1 }, + end: { column: 73, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [73, 74], + loc: { + start: { column: 73, line: 1 }, + end: { column: 74, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [75, 76], + loc: { + start: { column: 75, line: 1 }, + end: { column: 76, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [77, 78], + loc: { + start: { column: 77, line: 1 }, + end: { column: 78, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [78, 79], + loc: { + start: { column: 78, line: 1 }, + end: { column: 79, line: 1 }, + }, + }, +] \ No newline at end of file diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..4cf4abde9c9f --- /dev/null +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,160 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > type > TSImportType > type-import-type-with-trailing-comma-in-import-attributes > AST Alignment - AST`] +Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + declare: false, + id: Identifier { + type: 'Identifier', + decorators: Array [], + name: 'TrailingComma', + optional: false, + + range: [5, 18], + loc: { + start: { column: 5, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + typeAnnotation: TSImportType { + type: 'TSImportType', +- argument: TSLiteralType { +- type: 'TSLiteralType', +- literal: Literal { +- type: 'Literal', +- raw: '"A"', +- value: 'A', ++ argument: Literal { ++ type: 'Literal', ++ raw: '"A"', ++ value: 'A', + +- range: [28, 31], +- loc: { +- start: { column: 28, line: 1 }, +- end: { column: 31, line: 1 }, +- }, +- }, +- + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + options: ObjectExpression { + type: 'ObjectExpression', + properties: Array [ + Property { + type: 'Property', + computed: false, + key: Identifier { + type: 'Identifier', + decorators: Array [], + name: 'with', + optional: false, + + range: [35, 39], + loc: { + start: { column: 35, line: 1 }, + end: { column: 39, line: 1 }, + }, + }, + kind: 'init', + method: false, + optional: false, + shorthand: false, + value: ObjectExpression { + type: 'ObjectExpression', + properties: Array [ + Property { + type: 'Property', + computed: false, + key: Literal { + type: 'Literal', + raw: '"resolution-mode"', + value: 'resolution-mode', + + range: [43, 60], + loc: { + start: { column: 43, line: 1 }, + end: { column: 60, line: 1 }, + }, + }, + kind: 'init', + method: false, + optional: false, + shorthand: false, + value: Literal { + type: 'Literal', + raw: '"import"', + value: 'import', + + range: [62, 70], + loc: { + start: { column: 62, line: 1 }, + end: { column: 70, line: 1 }, + }, + }, + + range: [43, 70], + loc: { + start: { column: 43, line: 1 }, + end: { column: 70, line: 1 }, + }, + }, + ], + + range: [41, 73], + loc: { + start: { column: 41, line: 1 }, + end: { column: 73, line: 1 }, + }, + }, + + range: [35, 73], + loc: { + start: { column: 35, line: 1 }, + end: { column: 73, line: 1 }, + }, + }, + ], + + range: [33, 76], + loc: { + start: { column: 33, line: 1 }, + end: { column: 76, line: 1 }, + }, + }, + qualifier: null, +- typeArguments: null, + + range: [21, 78], + loc: { + start: { column: 21, line: 1 }, + end: { column: 78, line: 1 }, + }, + }, + + range: [0, 79], + loc: { + start: { column: 0, line: 1 }, + end: { column: 79, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 80], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + } diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..548e27a14f2b --- /dev/null +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,211 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > type > TSImportType > type-import-type-with-trailing-comma-in-import-attributes > AST Alignment - Token`] +Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Identifier { + type: 'Identifier', + value: 'type', + + range: [0, 4], + loc: { + start: { column: 0, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'TrailingComma', + + range: [5, 18], + loc: { + start: { column: 5, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'import', + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + String { + type: 'String', + value: '"A"', + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [33, 34], + loc: { + start: { column: 33, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'with', + + range: [35, 39], + loc: { + start: { column: 35, line: 1 }, + end: { column: 39, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [39, 40], + loc: { + start: { column: 39, line: 1 }, + end: { column: 40, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [41, 42], + loc: { + start: { column: 41, line: 1 }, + end: { column: 42, line: 1 }, + }, + }, + String { + type: 'String', + value: '"resolution-mode"', + + range: [43, 60], + loc: { + start: { column: 43, line: 1 }, + end: { column: 60, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [60, 61], + loc: { + start: { column: 60, line: 1 }, + end: { column: 61, line: 1 }, + }, + }, + String { + type: 'String', + value: '"import"', + + range: [62, 70], + loc: { + start: { column: 62, line: 1 }, + end: { column: 70, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [70, 71], + loc: { + start: { column: 70, line: 1 }, + end: { column: 71, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [72, 73], + loc: { + start: { column: 72, line: 1 }, + end: { column: 73, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [73, 74], + loc: { + start: { column: 73, line: 1 }, + end: { column: 74, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [75, 76], + loc: { + start: { column: 75, line: 1 }, + end: { column: 76, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [77, 78], + loc: { + start: { column: 77, line: 1 }, + end: { column: 78, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [78, 79], + loc: { + start: { column: 78, line: 1 }, + end: { column: 79, line: 1 }, + }, + }, + ] diff --git a/packages/ast-spec/tests/fixtures-with-differences-ast.shot b/packages/ast-spec/tests/fixtures-with-differences-ast.shot index a64da89a8106..b1e1785390dd 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-ast.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-ast.shot @@ -253,6 +253,7 @@ exports[`AST Fixtures > List fixtures with AST differences`] "special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts", "special/TSTypeParameter/fixtures/method-const-modifiers/fixture.ts", "type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts", + "type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts", "type/TSMappedType/fixtures/no-modifiers/fixture.ts", "type/TSMappedType/fixtures/optional-minus/fixture.ts", "type/TSMappedType/fixtures/optional-plus/fixture.ts", diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index 006a68578577..7051aa777fbb 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -47,8 +47,7 @@ exports[`AST Fixtures > List fixtures with Error differences`] "legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts", - "type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/fixture.ts", - "type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts" + "type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/fixture.ts" ], "TSESTree errored but Babel didn't": [ "declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/fixture.ts", diff --git a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot index b4fcd8caad7c..3b8639027419 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot @@ -18,18 +18,6 @@ exports[`AST Fixtures > List fixtures with Token differences`] "declaration/TSInterfaceDeclaration/fixtures/type-param-many/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/type-param-one/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/with-member-one/fixture.ts", - "declaration/VariableDeclaration/fixtures/declare-let-destructure-no-init/fixture.ts", - "declaration/VariableDeclaration/fixtures/declare-let-destructure-type-no-init/fixture.ts", - "declaration/VariableDeclaration/fixtures/declare-let-id-no-init/fixture.ts", - "declaration/VariableDeclaration/fixtures/declare-let-id-type-no-init/fixture.ts", - "declaration/VariableDeclaration/fixtures/let-destructure-init/fixture.ts", - "declaration/VariableDeclaration/fixtures/let-destructure-type-init/fixture.ts", - "declaration/VariableDeclaration/fixtures/let-id-definite-type-no-init/fixture.ts", - "declaration/VariableDeclaration/fixtures/let-id-init/fixture.ts", - "declaration/VariableDeclaration/fixtures/let-id-no-init/fixture.ts", - "declaration/VariableDeclaration/fixtures/let-id-type-init/fixture.ts", - "declaration/VariableDeclaration/fixtures/let-id-type-no-init/fixture.ts", - "declaration/VariableDeclaration/fixtures/multiple-declarations/fixture.ts", "element/AccessorProperty/fixtures/modifier-private/fixture.ts", "element/AccessorProperty/fixtures/modifier-protected/fixture.ts", "element/AccessorProperty/fixtures/modifier-public/fixture.ts", @@ -38,7 +26,6 @@ exports[`AST Fixtures > List fixtures with Token differences`] "jsx/JSXNamespacedName/fixtures/component/fixture.tsx", "legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/fixture.ts", "legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/fixture.ts", - "legacy-fixtures/basics/fixtures/async-function-with-var-declaration/fixture.ts", "legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/fixture.ts", "legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/fixture.ts", "legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/fixture.ts", @@ -61,7 +48,6 @@ exports[`AST Fixtures > List fixtures with Token differences`] "legacy-fixtures/basics/fixtures/export-declare-named-enum/fixture.ts", "legacy-fixtures/basics/fixtures/export-default-interface/fixture.ts", "legacy-fixtures/basics/fixtures/export-named-enum/fixture.ts", - "legacy-fixtures/basics/fixtures/global-this/fixture.ts", "legacy-fixtures/basics/fixtures/interface-extends-multiple/fixture.ts", "legacy-fixtures/basics/fixtures/interface-extends/fixture.ts", "legacy-fixtures/basics/fixtures/interface-type-parameters/fixture.ts", @@ -74,63 +60,22 @@ exports[`AST Fixtures > List fixtures with Token differences`] "legacy-fixtures/basics/fixtures/interface-with-optional-properties/fixture.ts", "legacy-fixtures/basics/fixtures/interface-without-type-annotation/fixture.ts", "legacy-fixtures/basics/fixtures/keyword-variables/fixture.ts", - "legacy-fixtures/basics/fixtures/non-null-assertion-operator/fixture.ts", - "legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/fixture.ts", - "legacy-fixtures/basics/fixtures/nullish-coalescing/fixture.ts", "legacy-fixtures/basics/fixtures/type-assertion-in-interface/fixture.ts", "legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/fixture.ts", "legacy-fixtures/basics/fixtures/type-guard-in-interface/fixture.ts", "legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/fixture.ts", "legacy-fixtures/basics/fixtures/typed-this/fixture.ts", - "legacy-fixtures/basics/fixtures/union-intersection/fixture.ts", - "legacy-fixtures/basics/fixtures/unknown-type-annotation/fixture.ts", - "legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/fixture.ts", "legacy-fixtures/class-decorators/fixtures/class-parameter-property/fixture.ts", "legacy-fixtures/declare/fixtures/enum/fixture.ts", "legacy-fixtures/declare/fixtures/interface/fixture.ts", "legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture.ts", - "legacy-fixtures/types/fixtures/conditional-with-null/fixture.ts", - "legacy-fixtures/types/fixtures/conditional/fixture.ts", - "legacy-fixtures/types/fixtures/constructor-generic/fixture.ts", - "legacy-fixtures/types/fixtures/constructor-in-generic/fixture.ts", - "legacy-fixtures/types/fixtures/constructor-with-rest/fixture.ts", - "legacy-fixtures/types/fixtures/constructor/fixture.ts", - "legacy-fixtures/types/fixtures/function-generic/fixture.ts", - "legacy-fixtures/types/fixtures/function-in-generic/fixture.ts", - "legacy-fixtures/types/fixtures/function-with-rest/fixture.ts", - "legacy-fixtures/types/fixtures/function-with-this/fixture.ts", - "legacy-fixtures/types/fixtures/function/fixture.ts", - "legacy-fixtures/types/fixtures/indexed/fixture.ts", "legacy-fixtures/types/fixtures/interface-with-accessors/fixture.ts", - "legacy-fixtures/types/fixtures/literal-number-negative/fixture.ts", - "legacy-fixtures/types/fixtures/literal-number/fixture.ts", - "legacy-fixtures/types/fixtures/literal-string/fixture.ts", - "legacy-fixtures/types/fixtures/mapped-readonly-minus/fixture.ts", - "legacy-fixtures/types/fixtures/mapped-readonly-plus/fixture.ts", - "legacy-fixtures/types/fixtures/mapped-readonly/fixture.ts", - "legacy-fixtures/types/fixtures/mapped-untypped/fixture.ts", - "legacy-fixtures/types/fixtures/mapped/fixture.ts", - "legacy-fixtures/types/fixtures/reference-generic-nested/fixture.ts", - "legacy-fixtures/types/fixtures/reference-generic/fixture.ts", - "legacy-fixtures/types/fixtures/reference/fixture.ts", "legacy-fixtures/types/fixtures/this-type-expanded/fixture.ts", - "legacy-fixtures/types/fixtures/tuple-empty/fixture.ts", - "legacy-fixtures/types/fixtures/tuple-named-optional/fixture.ts", - "legacy-fixtures/types/fixtures/tuple-named-rest/fixture.ts", - "legacy-fixtures/types/fixtures/tuple-named/fixture.ts", - "legacy-fixtures/types/fixtures/tuple-optional/fixture.ts", - "legacy-fixtures/types/fixtures/tuple-rest/fixture.ts", - "legacy-fixtures/types/fixtures/tuple/fixture.ts", - "legacy-fixtures/types/fixtures/type-literal/fixture.ts", - "legacy-fixtures/types/fixtures/type-operator/fixture.ts", - "legacy-fixtures/types/fixtures/typeof-this/fixture.ts", - "legacy-fixtures/types/fixtures/typeof-with-type-parameters/fixture.ts", - "legacy-fixtures/types/fixtures/typeof/fixture.ts", - "legacy-fixtures/types/fixtures/union-intersection/fixture.ts", "special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/fixture.ts", "special/TSTypeParameter/fixtures/interface-const-modifier-extends/fixture.ts", "special/TSTypeParameter/fixtures/interface-const-modifier-multiple/fixture.ts", "special/TSTypeParameter/fixtures/interface-const-modifier/fixture.ts", "special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts", - "type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts" + "type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts", + "type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts" ] diff --git a/packages/ast-spec/tests/fixtures-without-babel-support.shot b/packages/ast-spec/tests/fixtures-without-babel-support.shot index a13f680d01a0..0a63977a3f5e 100644 --- a/packages/ast-spec/tests/fixtures-without-babel-support.shot +++ b/packages/ast-spec/tests/fixtures-without-babel-support.shot @@ -1,9 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > List fixtures we expect babel to not support`] -[ - [ - "type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts", - "waiting for https://github.com/babel/babel/pull/17465 to be released" - ] -] +[] diff --git a/yarn.lock b/yarn.lock index 485535c6e770..da06edc171f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -227,50 +227,50 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.16.0, @babel/code-frame@npm:^7.24.2, @babel/code-frame@npm:^7.25.9, @babel/code-frame@npm:^7.26.0, @babel/code-frame@npm:^7.8.3": - version: 7.26.2 - resolution: "@babel/code-frame@npm:7.26.2" +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.16.0, @babel/code-frame@npm:^7.24.2, @babel/code-frame@npm:^7.27.1, @babel/code-frame@npm:^7.8.3": + version: 7.27.1 + resolution: "@babel/code-frame@npm:7.27.1" dependencies: - "@babel/helper-validator-identifier": ^7.25.9 + "@babel/helper-validator-identifier": ^7.27.1 js-tokens: ^4.0.0 - picocolors: ^1.0.0 - checksum: db13f5c42d54b76c1480916485e6900748bbcb0014a8aca87f50a091f70ff4e0d0a6db63cade75eb41fcc3d2b6ba0a7f89e343def4f96f00269b41b8ab8dd7b8 + picocolors: ^1.1.1 + checksum: 5874edc5d37406c4a0bb14cf79c8e51ad412fb0423d176775ac14fc0259831be1bf95bdda9c2aa651126990505e09a9f0ed85deaa99893bc316d2682c5115bdc languageName: node linkType: hard -"@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.25.9, @babel/compat-data@npm:^7.26.0": - version: 7.26.2 - resolution: "@babel/compat-data@npm:7.26.2" - checksum: d52fae9b0dc59b409d6005ae6b172e89329f46d68136130065ebe923a156fc633e0f1c8600b3e319b9e0f99fd948f64991a5419e2e9431d00d9d235d5f7a7618 +"@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.26.0, @babel/compat-data@npm:^7.27.2": + version: 7.28.0 + resolution: "@babel/compat-data@npm:7.28.0" + checksum: 37a40d4ea10a32783bc24c4ad374200f5db864c8dfa42f82e76f02b8e84e4c65e6a017fc014d165b08833f89333dff4cb635fce30f03c333ea3525ea7e20f0a2 languageName: node linkType: hard "@babel/core@npm:^7.11.1, @babel/core@npm:^7.21.3, @babel/core@npm:^7.23.2, @babel/core@npm:^7.24.4, @babel/core@npm:^7.25.9": - version: 7.26.0 - resolution: "@babel/core@npm:7.26.0" + version: 7.28.3 + resolution: "@babel/core@npm:7.28.3" dependencies: "@ampproject/remapping": ^2.2.0 - "@babel/code-frame": ^7.26.0 - "@babel/generator": ^7.26.0 - "@babel/helper-compilation-targets": ^7.25.9 - "@babel/helper-module-transforms": ^7.26.0 - "@babel/helpers": ^7.26.0 - "@babel/parser": ^7.26.0 - "@babel/template": ^7.25.9 - "@babel/traverse": ^7.25.9 - "@babel/types": ^7.26.0 + "@babel/code-frame": ^7.27.1 + "@babel/generator": ^7.28.3 + "@babel/helper-compilation-targets": ^7.27.2 + "@babel/helper-module-transforms": ^7.28.3 + "@babel/helpers": ^7.28.3 + "@babel/parser": ^7.28.3 + "@babel/template": ^7.27.2 + "@babel/traverse": ^7.28.3 + "@babel/types": ^7.28.2 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: b296084cfd818bed8079526af93b5dfa0ba70282532d2132caf71d4060ab190ba26d3184832a45accd82c3c54016985a4109ab9118674347a7e5e9bc464894e6 + checksum: d09132cd752730d219bdd29dbd65cb647151105bef6e615cfb6d57249f71a3d1aaf8a5beaa1c7ec54ad927962e4913ebc660f7f0c3e65c39bc171bc386285e50 languageName: node linkType: hard "@babel/eslint-parser@npm:^7.24.1": - version: 7.26.8 - resolution: "@babel/eslint-parser@npm:7.26.8" + version: 7.28.0 + resolution: "@babel/eslint-parser@npm:7.28.0" dependencies: "@nicolo-ribaudo/eslint-scope-5-internals": 5.1.1-v1 eslint-visitor-keys: ^2.1.0 @@ -278,20 +278,20 @@ __metadata: peerDependencies: "@babel/core": ^7.11.0 eslint: ^7.5.0 || ^8.0.0 || ^9.0.0 - checksum: a434da9e3099e5f77911baa4eaa21f2ec64768703be1fde2858e8ffdb8be6cb78ff67c611c8c17fe1ece54d925b65487a7455cca93103b017443a51b76320751 + checksum: ccfc4b9b9fdca2b8df95da3827b70231e9588a71447ff7b2de76c4f36710e4e0a7dc5e2e98623f398a737c2429c46500cb11d4ccdfeb98271e067d0bf0eec9b5 languageName: node linkType: hard -"@babel/generator@npm:^7.25.9, @babel/generator@npm:^7.26.0": - version: 7.26.2 - resolution: "@babel/generator@npm:7.26.2" +"@babel/generator@npm:^7.25.9, @babel/generator@npm:^7.28.3": + version: 7.28.3 + resolution: "@babel/generator@npm:7.28.3" dependencies: - "@babel/parser": ^7.26.2 - "@babel/types": ^7.26.0 - "@jridgewell/gen-mapping": ^0.3.5 - "@jridgewell/trace-mapping": ^0.3.25 + "@babel/parser": ^7.28.3 + "@babel/types": ^7.28.2 + "@jridgewell/gen-mapping": ^0.3.12 + "@jridgewell/trace-mapping": ^0.3.28 jsesc: ^3.0.2 - checksum: 6ff850b7d6082619f8c2f518d993cf7254cfbaa20b026282cbef5c9b2197686d076a432b18e36c4d1a42721c016df4f77a8f62c67600775d9683621d534b91b4 + checksum: e2202bf2b9c8a94f7e7a0a049fda0ee037d055c46922e85afa3bbc53309113f859b8193894f991045d7865226028b8f4f06152ed315ab414451932016dba5e42 languageName: node linkType: hard @@ -314,16 +314,16 @@ __metadata: languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.22.6, @babel/helper-compilation-targets@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-compilation-targets@npm:7.25.9" +"@babel/helper-compilation-targets@npm:^7.22.6, @babel/helper-compilation-targets@npm:^7.25.9, @babel/helper-compilation-targets@npm:^7.27.2": + version: 7.27.2 + resolution: "@babel/helper-compilation-targets@npm:7.27.2" dependencies: - "@babel/compat-data": ^7.25.9 - "@babel/helper-validator-option": ^7.25.9 + "@babel/compat-data": ^7.27.2 + "@babel/helper-validator-option": ^7.27.1 browserslist: ^4.24.0 lru-cache: ^5.1.1 semver: ^6.3.1 - checksum: 3af536e2db358b38f968abdf7d512d425d1018fef2f485d6f131a57a7bcaed32c606b4e148bb230e1508fa42b5b2ac281855a68eb78270f54698c48a83201b9b + checksum: 7b95328237de85d7af1dea010a4daa28e79f961dda48b652860d5893ce9b136fc8b9ea1f126d8e0a24963b09ba5c6631dcb907b4ce109b04452d34a6ae979807 languageName: node linkType: hard @@ -372,6 +372,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-globals@npm:^7.28.0": + version: 7.28.0 + resolution: "@babel/helper-globals@npm:7.28.0" + checksum: d8d7b91c12dad1ee747968af0cb73baf91053b2bcf78634da2c2c4991fb45ede9bd0c8f9b5f3254881242bc0921218fcb7c28ae885477c25177147e978ce4397 + languageName: node + linkType: hard + "@babel/helper-member-expression-to-functions@npm:^7.25.9": version: 7.25.9 resolution: "@babel/helper-member-expression-to-functions@npm:7.25.9" @@ -382,26 +389,26 @@ __metadata: languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.10.4, @babel/helper-module-imports@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-module-imports@npm:7.25.9" +"@babel/helper-module-imports@npm:^7.10.4, @babel/helper-module-imports@npm:^7.25.9, @babel/helper-module-imports@npm:^7.27.1": + version: 7.27.1 + resolution: "@babel/helper-module-imports@npm:7.27.1" dependencies: - "@babel/traverse": ^7.25.9 - "@babel/types": ^7.25.9 - checksum: 1b411ce4ca825422ef7065dffae7d8acef52023e51ad096351e3e2c05837e9bf9fca2af9ca7f28dc26d596a588863d0fedd40711a88e350b736c619a80e704e6 + "@babel/traverse": ^7.27.1 + "@babel/types": ^7.27.1 + checksum: 92d01c71c0e4aacdc2babce418a9a1a27a8f7d770a210ffa0f3933f321befab18b655bc1241bebc40767516731de0b85639140c42e45a8210abe1e792f115b28 languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.25.9, @babel/helper-module-transforms@npm:^7.26.0": - version: 7.26.0 - resolution: "@babel/helper-module-transforms@npm:7.26.0" +"@babel/helper-module-transforms@npm:^7.25.9, @babel/helper-module-transforms@npm:^7.28.3": + version: 7.28.3 + resolution: "@babel/helper-module-transforms@npm:7.28.3" dependencies: - "@babel/helper-module-imports": ^7.25.9 - "@babel/helper-validator-identifier": ^7.25.9 - "@babel/traverse": ^7.25.9 + "@babel/helper-module-imports": ^7.27.1 + "@babel/helper-validator-identifier": ^7.27.1 + "@babel/traverse": ^7.28.3 peerDependencies: "@babel/core": ^7.0.0 - checksum: 942eee3adf2b387443c247a2c190c17c4fd45ba92a23087abab4c804f40541790d51ad5277e4b5b1ed8d5ba5b62de73857446b7742f835c18ebd350384e63917 + checksum: 7cf7b79da0fa626d6c84bfc7b35c079a2559caecaa2ff645b0f1db0d741507aa4df6b5b98a3283e8ac4e89094af271d805bf5701e5c4f916e622797b7c8cbb18 languageName: node linkType: hard @@ -481,10 +488,10 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-option@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-validator-option@npm:7.25.9" - checksum: 9491b2755948ebbdd68f87da907283698e663b5af2d2b1b02a2765761974b1120d5d8d49e9175b167f16f72748ffceec8c9cf62acfbee73f4904507b246e2b3d +"@babel/helper-validator-option@npm:^7.25.9, @babel/helper-validator-option@npm:^7.27.1": + version: 7.27.1 + resolution: "@babel/helper-validator-option@npm:7.27.1" + checksum: db73e6a308092531c629ee5de7f0d04390835b21a263be2644276cb27da2384b64676cab9f22cd8d8dbd854c92b1d7d56fc8517cf0070c35d1c14a8c828b0903 languageName: node linkType: hard @@ -499,35 +506,24 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.26.0": - version: 7.26.0 - resolution: "@babel/helpers@npm:7.26.0" +"@babel/helpers@npm:^7.28.3": + version: 7.28.3 + resolution: "@babel/helpers@npm:7.28.3" dependencies: - "@babel/template": ^7.25.9 - "@babel/types": ^7.26.0 - checksum: d77fe8d45033d6007eadfa440355c1355eed57902d5a302f450827ad3d530343430a21210584d32eef2f216ae463d4591184c6fc60cf205bbf3a884561469200 + "@babel/template": ^7.27.2 + "@babel/types": ^7.28.2 + checksum: 16c7f259dbd23834740ebc1c7e5a32d9424615eacd324ee067b585ab40eaafab37e2e50f50c84183a7e7a31251dc5a65a2ec4f8395f049001bbe6e14d0d3e9d4 languageName: node linkType: hard -"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.0, @babel/parser@npm:^7.26.2": - version: 7.27.2 - resolution: "@babel/parser@npm:7.27.2" +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.25.4, @babel/parser@npm:^7.27.2, @babel/parser@npm:^7.28.3": + version: 7.28.3 + resolution: "@babel/parser@npm:7.28.3" dependencies: - "@babel/types": ^7.27.1 + "@babel/types": ^7.28.2 bin: parser: ./bin/babel-parser.js - checksum: 1ac70a75028f1cc10eefb10ed2d83cf700ca3e1ddb4cf556a003fc5c4ca53ae83350bbb8065020fcc70d476fcf7bf1c17191b72384f719614ae18397142289cf - languageName: node - linkType: hard - -"@babel/parser@npm:^7.25.4": - version: 7.27.3 - resolution: "@babel/parser@npm:7.27.3" - dependencies: - "@babel/types": ^7.27.3 - bin: - parser: ./bin/babel-parser.js - checksum: aef2cfd154e47a639615d173d3f05a8ce8007fcc5a0ade013c953adee71a8bc19465a147e060cc67388fd748b62a3b42bf3b5cc3e83d4f8add526b3b722e2231 + checksum: 5aa5ea0683a4056f98cd9cd61650870d5d44ec1654da14f72a8a06fabe7b2a35bf6cef9605f3740b5ded1e68f64ec45ce1aabf7691047a13a1ff2babe126acf9 languageName: node linkType: hard @@ -1504,57 +1500,45 @@ __metadata: 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.24.4, @babel/runtime@npm:^7.25.9, @babel/runtime@npm:^7.8.4": - version: 7.26.0 - resolution: "@babel/runtime@npm:7.26.0" - dependencies: - regenerator-runtime: ^0.14.0 - checksum: c8e2c0504ab271b3467a261a8f119bf2603eb857a0d71e37791f4e3fae00f681365073cc79f141ddaa90c6077c60ba56448004ad5429d07ac73532be9f7cf28a + version: 7.28.3 + resolution: "@babel/runtime@npm:7.28.3" + checksum: dd22662b9e02b6e66cfb061d6f9730eb0aa3b3a390a7bd70fe9a64116d86a3704df6d54ab978cb4acc13b58dbf63a3d7dd4616b0b87030eb14a22835e0aa602d languageName: node linkType: hard -"@babel/template@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/template@npm:7.25.9" +"@babel/template@npm:^7.25.9, @babel/template@npm:^7.27.2": + version: 7.27.2 + resolution: "@babel/template@npm:7.27.2" dependencies: - "@babel/code-frame": ^7.25.9 - "@babel/parser": ^7.25.9 - "@babel/types": ^7.25.9 - checksum: 103641fea19c7f4e82dc913aa6b6ac157112a96d7c724d513288f538b84bae04fb87b1f1e495ac1736367b1bc30e10f058b30208fb25f66038e1f1eb4e426472 + "@babel/code-frame": ^7.27.1 + "@babel/parser": ^7.27.2 + "@babel/types": ^7.27.1 + checksum: ff5628bc066060624afd970616090e5bba91c6240c2e4b458d13267a523572cbfcbf549391eec8217b94b064cf96571c6273f0c04b28a8567b96edc675c28e27 languageName: node linkType: hard -"@babel/traverse@npm:^7.16.0, @babel/traverse@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/traverse@npm:7.25.9" +"@babel/traverse@npm:^7.16.0, @babel/traverse@npm:^7.25.9, @babel/traverse@npm:^7.27.1, @babel/traverse@npm:^7.28.3": + version: 7.28.3 + resolution: "@babel/traverse@npm:7.28.3" dependencies: - "@babel/code-frame": ^7.25.9 - "@babel/generator": ^7.25.9 - "@babel/parser": ^7.25.9 - "@babel/template": ^7.25.9 - "@babel/types": ^7.25.9 + "@babel/code-frame": ^7.27.1 + "@babel/generator": ^7.28.3 + "@babel/helper-globals": ^7.28.0 + "@babel/parser": ^7.28.3 + "@babel/template": ^7.27.2 + "@babel/types": ^7.28.2 debug: ^4.3.1 - globals: ^11.1.0 - checksum: 901d325662ff1dd9bc51de00862e01055fa6bc374f5297d7e3731f2f0e268bbb1d2141f53fa82860aa308ee44afdcf186a948f16c83153927925804b95a9594d + checksum: 5f5ce477adc99ebdd6e8c9b7ba2e0a162bef39a1d3c5860c730c1674e57f9cb057c7e3dfdd652ce890bd79331a70f6cd310902414697787578e68167d52d96e7 languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.3, @babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0, @babel/types@npm:^7.27.1, @babel/types@npm:^7.4.4": - version: 7.27.1 - resolution: "@babel/types@npm:7.27.1" - dependencies: - "@babel/helper-string-parser": ^7.27.1 - "@babel/helper-validator-identifier": ^7.27.1 - checksum: 357c13f37aaa2f2e2cfcdb63f986d5f7abc9f38df20182b620ace34387d2460620415770fe5856eb54d70c9f0ba2f71230d29465e789188635a948476b830ae4 - languageName: node - linkType: hard - -"@babel/types@npm:^7.25.4, @babel/types@npm:^7.27.3": - version: 7.27.3 - resolution: "@babel/types@npm:7.27.3" +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.21.3, @babel/types@npm:^7.25.4, @babel/types@npm:^7.25.9, @babel/types@npm:^7.27.1, @babel/types@npm:^7.28.2, @babel/types@npm:^7.4.4": + version: 7.28.2 + resolution: "@babel/types@npm:7.28.2" dependencies: "@babel/helper-string-parser": ^7.27.1 "@babel/helper-validator-identifier": ^7.27.1 - checksum: f0d43c0231f3ebc118480e149292dcd92ea128e2650285ced99ff2e5610db2171305f59aa07406ba0cb36af8e4331a53a69576d6b0c3f3176144dd3ad514b9ae + checksum: 2218f0996d5fbadc4e3428c4c38f4ed403f0e2634e3089beba2c89783268c0c1d796a23e65f9f1ff8547b9061ae1a67691c76dc27d0b457e5fa9f2dd4e022e49 languageName: node linkType: hard @@ -2163,16 +2147,7 @@ __metadata: languageName: node linkType: hard -"@csstools/css-parser-algorithms@npm:^3.0.4": - version: 3.0.4 - resolution: "@csstools/css-parser-algorithms@npm:3.0.4" - peerDependencies: - "@csstools/css-tokenizer": ^3.0.3 - checksum: 5b6b2b97fbe0a0c5652e44613bcf62ec89a93f64069a48f6cd63b5757c7dc227970c54c50a8212b9feb90aff399490636a58366df3ca733d490d911768eaddaf - languageName: node - linkType: hard - -"@csstools/css-parser-algorithms@npm:^3.0.5": +"@csstools/css-parser-algorithms@npm:^3.0.4, @csstools/css-parser-algorithms@npm:^3.0.5": version: 3.0.5 resolution: "@csstools/css-parser-algorithms@npm:3.0.5" peerDependencies: @@ -2181,31 +2156,14 @@ __metadata: languageName: node linkType: hard -"@csstools/css-tokenizer@npm:^3.0.3": - version: 3.0.3 - resolution: "@csstools/css-tokenizer@npm:3.0.3" - checksum: 6b300beba1b29c546b720887be18a40bafded5dc96550fb87d61fbc2c550e9632e7baafa2bf34a66e0f25fb6b70558ee67ef3b45856aa5e621febc2124cf5039 - languageName: node - linkType: hard - -"@csstools/css-tokenizer@npm:^3.0.4": +"@csstools/css-tokenizer@npm:^3.0.3, @csstools/css-tokenizer@npm:^3.0.4": version: 3.0.4 resolution: "@csstools/css-tokenizer@npm:3.0.4" checksum: adc6681d3a0d7a75dc8e5ee0488c99ad4509e4810ae45dd6549a2e64a996e8d75512e70bb244778dc0c6ee85723e20eaeea8c083bf65b51eb19034e182554243 languageName: node linkType: hard -"@csstools/media-query-list-parser@npm:^4.0.2": - version: 4.0.2 - resolution: "@csstools/media-query-list-parser@npm:4.0.2" - peerDependencies: - "@csstools/css-parser-algorithms": ^3.0.4 - "@csstools/css-tokenizer": ^3.0.3 - checksum: 5265675655ffe2242c272c344bdb77932d44fa7bf45d4de26793406cc287047b64a007d26f32c40db242bc9866dc4020da308a3b590a9a3dc7561089ca18cdea - languageName: node - linkType: hard - -"@csstools/media-query-list-parser@npm:^4.0.3": +"@csstools/media-query-list-parser@npm:^4.0.2, @csstools/media-query-list-parser@npm:^4.0.3": version: 4.0.3 resolution: "@csstools/media-query-list-parser@npm:4.0.3" peerDependencies: @@ -3378,13 +3336,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/aix-ppc64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/aix-ppc64@npm:0.25.4" - conditions: os=aix & cpu=ppc64 - languageName: node - linkType: hard - "@esbuild/aix-ppc64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/aix-ppc64@npm:0.25.5" @@ -3399,13 +3350,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/android-arm64@npm:0.25.4" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/android-arm64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/android-arm64@npm:0.25.5" @@ -3420,13 +3364,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/android-arm@npm:0.25.4" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - "@esbuild/android-arm@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/android-arm@npm:0.25.5" @@ -3441,13 +3378,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-x64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/android-x64@npm:0.25.4" - conditions: os=android & cpu=x64 - languageName: node - linkType: hard - "@esbuild/android-x64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/android-x64@npm:0.25.5" @@ -3462,13 +3392,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/darwin-arm64@npm:0.25.4" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/darwin-arm64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/darwin-arm64@npm:0.25.5" @@ -3483,13 +3406,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/darwin-x64@npm:0.25.4" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - "@esbuild/darwin-x64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/darwin-x64@npm:0.25.5" @@ -3504,13 +3420,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/freebsd-arm64@npm:0.25.4" - conditions: os=freebsd & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/freebsd-arm64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/freebsd-arm64@npm:0.25.5" @@ -3525,13 +3434,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/freebsd-x64@npm:0.25.4" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/freebsd-x64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/freebsd-x64@npm:0.25.5" @@ -3546,13 +3448,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/linux-arm64@npm:0.25.4" - conditions: os=linux & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/linux-arm64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/linux-arm64@npm:0.25.5" @@ -3567,13 +3462,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/linux-arm@npm:0.25.4" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - "@esbuild/linux-arm@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/linux-arm@npm:0.25.5" @@ -3588,13 +3476,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/linux-ia32@npm:0.25.4" - conditions: os=linux & cpu=ia32 - languageName: node - linkType: hard - "@esbuild/linux-ia32@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/linux-ia32@npm:0.25.5" @@ -3609,13 +3490,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/linux-loong64@npm:0.25.4" - conditions: os=linux & cpu=loong64 - languageName: node - linkType: hard - "@esbuild/linux-loong64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/linux-loong64@npm:0.25.5" @@ -3630,13 +3504,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/linux-mips64el@npm:0.25.4" - conditions: os=linux & cpu=mips64el - languageName: node - linkType: hard - "@esbuild/linux-mips64el@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/linux-mips64el@npm:0.25.5" @@ -3651,13 +3518,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/linux-ppc64@npm:0.25.4" - conditions: os=linux & cpu=ppc64 - languageName: node - linkType: hard - "@esbuild/linux-ppc64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/linux-ppc64@npm:0.25.5" @@ -3672,13 +3532,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/linux-riscv64@npm:0.25.4" - conditions: os=linux & cpu=riscv64 - languageName: node - linkType: hard - "@esbuild/linux-riscv64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/linux-riscv64@npm:0.25.5" @@ -3693,13 +3546,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/linux-s390x@npm:0.25.4" - conditions: os=linux & cpu=s390x - languageName: node - linkType: hard - "@esbuild/linux-s390x@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/linux-s390x@npm:0.25.5" @@ -3714,13 +3560,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/linux-x64@npm:0.25.4" - conditions: os=linux & cpu=x64 - languageName: node - linkType: hard - "@esbuild/linux-x64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/linux-x64@npm:0.25.5" @@ -3728,13 +3567,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/netbsd-arm64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/netbsd-arm64@npm:0.25.4" - conditions: os=netbsd & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/netbsd-arm64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/netbsd-arm64@npm:0.25.5" @@ -3749,13 +3581,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/netbsd-x64@npm:0.25.4" - conditions: os=netbsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/netbsd-x64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/netbsd-x64@npm:0.25.5" @@ -3763,13 +3588,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/openbsd-arm64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/openbsd-arm64@npm:0.25.4" - conditions: os=openbsd & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/openbsd-arm64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/openbsd-arm64@npm:0.25.5" @@ -3784,13 +3602,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/openbsd-x64@npm:0.25.4" - conditions: os=openbsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/openbsd-x64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/openbsd-x64@npm:0.25.5" @@ -3805,13 +3616,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/sunos-x64@npm:0.25.4" - conditions: os=sunos & cpu=x64 - languageName: node - linkType: hard - "@esbuild/sunos-x64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/sunos-x64@npm:0.25.5" @@ -3826,13 +3630,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/win32-arm64@npm:0.25.4" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/win32-arm64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/win32-arm64@npm:0.25.5" @@ -3847,13 +3644,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/win32-ia32@npm:0.25.4" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - "@esbuild/win32-ia32@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/win32-ia32@npm:0.25.5" @@ -3868,13 +3658,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.25.4": - version: 0.25.4 - resolution: "@esbuild/win32-x64@npm:0.25.4" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@esbuild/win32-x64@npm:0.25.5": version: 0.25.5 resolution: "@esbuild/win32-x64@npm:0.25.5" @@ -4103,14 +3886,13 @@ __metadata: languageName: node linkType: hard -"@jridgewell/gen-mapping@npm:^0.3.0, @jridgewell/gen-mapping@npm:^0.3.5": - version: 0.3.5 - resolution: "@jridgewell/gen-mapping@npm:0.3.5" +"@jridgewell/gen-mapping@npm:^0.3.0, @jridgewell/gen-mapping@npm:^0.3.12, @jridgewell/gen-mapping@npm:^0.3.5": + version: 0.3.13 + resolution: "@jridgewell/gen-mapping@npm:0.3.13" dependencies: - "@jridgewell/set-array": ^1.2.1 - "@jridgewell/sourcemap-codec": ^1.4.10 + "@jridgewell/sourcemap-codec": ^1.5.0 "@jridgewell/trace-mapping": ^0.3.24 - checksum: ff7a1764ebd76a5e129c8890aa3e2f46045109dabde62b0b6c6a250152227647178ff2069ea234753a690d8f3c4ac8b5e7b267bbee272bffb7f3b0a370ab6e52 + checksum: f2105acefc433337145caa3c84bba286de954f61c0bc46279bbd85a9e6a02871089717fa060413cfb6a9d44189fe8313b2d1cabf3a2eb3284d208fd5f75c54ff languageName: node linkType: hard @@ -4121,13 +3903,6 @@ __metadata: languageName: node linkType: hard -"@jridgewell/set-array@npm:^1.2.1": - version: 1.2.1 - resolution: "@jridgewell/set-array@npm:1.2.1" - checksum: 832e513a85a588f8ed4f27d1279420d8547743cc37fcad5a5a76fc74bb895b013dfe614d0eed9cb860048e6546b798f8f2652020b4b2ba0561b05caa8c654b10 - languageName: node - linkType: hard - "@jridgewell/source-map@npm:^0.3.3": version: 0.3.3 resolution: "@jridgewell/source-map@npm:0.3.3" @@ -4138,20 +3913,20 @@ __metadata: languageName: node linkType: hard -"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.5.0": +"@jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.5.0": version: 1.5.0 resolution: "@jridgewell/sourcemap-codec@npm:1.5.0" checksum: 05df4f2538b3b0f998ea4c1cd34574d0feba216fa5d4ccaef0187d12abf82eafe6021cec8b49f9bb4d90f2ba4582ccc581e72986a5fcf4176ae0cfeb04cf52ec languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.23, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.9": - version: 0.3.25 - resolution: "@jridgewell/trace-mapping@npm:0.3.25" +"@jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.23, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.28, @jridgewell/trace-mapping@npm:^0.3.9": + version: 0.3.30 + resolution: "@jridgewell/trace-mapping@npm:0.3.30" dependencies: "@jridgewell/resolve-uri": ^3.1.0 "@jridgewell/sourcemap-codec": ^1.4.14 - checksum: 9d3c40d225e139987b50c48988f8717a54a8c994d8a948ee42e1412e08988761d0754d7d10b803061cc3aebf35f92a5dbbab493bd0e1a9ef9e89a2130e83ba34 + checksum: 26edb94faf6f02df346e3657deff9df3f2f083195cbda62a6cf60204d548a0a6134454cbc3af8437392206a89dfb3e72782eaf78f49cbd8924400e55a6575e72 languageName: node linkType: hard @@ -7166,25 +6941,7 @@ __metadata: languageName: node linkType: hard -"autoprefixer@npm:^10.4.19": - version: 10.4.19 - resolution: "autoprefixer@npm:10.4.19" - dependencies: - browserslist: ^4.23.0 - caniuse-lite: ^1.0.30001599 - fraction.js: ^4.3.7 - normalize-range: ^0.1.2 - picocolors: ^1.0.0 - postcss-value-parser: ^4.2.0 - peerDependencies: - postcss: ^8.1.0 - bin: - autoprefixer: bin/autoprefixer - checksum: 3a4bc5bace05e057396dca2b306503efc175e90e8f2abf5472d3130b72da1d54d97c0ee05df21bf04fe66a7df93fd8c8ec0f1aca72a165f4701a02531abcbf11 - languageName: node - linkType: hard - -"autoprefixer@npm:^10.4.21": +"autoprefixer@npm:^10.4.19, autoprefixer@npm:^10.4.21": version: 10.4.21 resolution: "autoprefixer@npm:10.4.21" dependencies: @@ -7503,21 +7260,7 @@ __metadata: languageName: node linkType: hard -"browserslist@npm:^4.0.0, browserslist@npm:^4.18.1, browserslist@npm:^4.23.0, browserslist@npm:^4.24.0, browserslist@npm:^4.24.4": - version: 4.24.5 - resolution: "browserslist@npm:4.24.5" - dependencies: - caniuse-lite: ^1.0.30001716 - electron-to-chromium: ^1.5.149 - node-releases: ^2.0.19 - update-browserslist-db: ^1.1.3 - bin: - browserslist: cli.js - checksum: 69310ade58b0cb2b2871022fdaba8388902f9a2d17a6fa05f383d046d6da87fd9f83018a66fe1c6296648ca7d52e3208c3fc68c82f17a0fd4bf12a452c036247 - languageName: node - linkType: hard - -"browserslist@npm:^4.24.5": +"browserslist@npm:^4.0.0, browserslist@npm:^4.18.1, browserslist@npm:^4.23.0, browserslist@npm:^4.24.0, browserslist@npm:^4.24.4, browserslist@npm:^4.24.5": version: 4.25.0 resolution: "browserslist@npm:4.25.0" dependencies: @@ -7730,14 +7473,7 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001599, caniuse-lite@npm:^1.0.30001716": - version: 1.0.30001717 - resolution: "caniuse-lite@npm:1.0.30001717" - checksum: 357fbb230d86d28c0f7005d0c19a2274059ad4f1ed419ebe8754737ec908b567c9745abf0d16eda93417f40913221adc6290eb2f0432bc5bb5364f95bd7eabfa - languageName: node - linkType: hard - -"caniuse-lite@npm:^1.0.30001702, caniuse-lite@npm:^1.0.30001718": +"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001702, caniuse-lite@npm:^1.0.30001718": version: 1.0.30001720 resolution: "caniuse-lite@npm:1.0.30001720" checksum: 97b9f9de842595ff9674001abb9c5bc093c03bb985d481ed97617ea48fc248bfb2cc1f1afe19da2bf20016f28793e495fa2f339e22080d8da3c9714fb7950926 @@ -9425,13 +9161,6 @@ __metadata: languageName: node linkType: hard -"electron-to-chromium@npm:^1.5.149": - version: 1.5.149 - resolution: "electron-to-chromium@npm:1.5.149" - checksum: 7f91d8293a48fab7dabb15c4569f8704e56320ccf7039f71134f03d601bada089393852e257cf7639233fc3fd2a558664ccca9e530287d40f94d64d107f3acab - languageName: node - linkType: hard - "electron-to-chromium@npm:^1.5.160": version: 1.5.161 resolution: "electron-to-chromium@npm:1.5.161" @@ -9732,7 +9461,7 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.25.0": +"esbuild@npm:^0.25.0, esbuild@npm:~0.25.0": version: 0.25.5 resolution: "esbuild@npm:0.25.5" dependencies: @@ -9898,92 +9627,6 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:~0.25.0": - version: 0.25.4 - resolution: "esbuild@npm:0.25.4" - dependencies: - "@esbuild/aix-ppc64": 0.25.4 - "@esbuild/android-arm": 0.25.4 - "@esbuild/android-arm64": 0.25.4 - "@esbuild/android-x64": 0.25.4 - "@esbuild/darwin-arm64": 0.25.4 - "@esbuild/darwin-x64": 0.25.4 - "@esbuild/freebsd-arm64": 0.25.4 - "@esbuild/freebsd-x64": 0.25.4 - "@esbuild/linux-arm": 0.25.4 - "@esbuild/linux-arm64": 0.25.4 - "@esbuild/linux-ia32": 0.25.4 - "@esbuild/linux-loong64": 0.25.4 - "@esbuild/linux-mips64el": 0.25.4 - "@esbuild/linux-ppc64": 0.25.4 - "@esbuild/linux-riscv64": 0.25.4 - "@esbuild/linux-s390x": 0.25.4 - "@esbuild/linux-x64": 0.25.4 - "@esbuild/netbsd-arm64": 0.25.4 - "@esbuild/netbsd-x64": 0.25.4 - "@esbuild/openbsd-arm64": 0.25.4 - "@esbuild/openbsd-x64": 0.25.4 - "@esbuild/sunos-x64": 0.25.4 - "@esbuild/win32-arm64": 0.25.4 - "@esbuild/win32-ia32": 0.25.4 - "@esbuild/win32-x64": 0.25.4 - dependenciesMeta: - "@esbuild/aix-ppc64": - optional: true - "@esbuild/android-arm": - optional: true - "@esbuild/android-arm64": - optional: true - "@esbuild/android-x64": - optional: true - "@esbuild/darwin-arm64": - optional: true - "@esbuild/darwin-x64": - optional: true - "@esbuild/freebsd-arm64": - optional: true - "@esbuild/freebsd-x64": - optional: true - "@esbuild/linux-arm": - optional: true - "@esbuild/linux-arm64": - optional: true - "@esbuild/linux-ia32": - optional: true - "@esbuild/linux-loong64": - optional: true - "@esbuild/linux-mips64el": - optional: true - "@esbuild/linux-ppc64": - optional: true - "@esbuild/linux-riscv64": - optional: true - "@esbuild/linux-s390x": - optional: true - "@esbuild/linux-x64": - optional: true - "@esbuild/netbsd-arm64": - optional: true - "@esbuild/netbsd-x64": - optional: true - "@esbuild/openbsd-arm64": - optional: true - "@esbuild/openbsd-x64": - optional: true - "@esbuild/sunos-x64": - optional: true - "@esbuild/win32-arm64": - optional: true - "@esbuild/win32-ia32": - optional: true - "@esbuild/win32-x64": - optional: true - bin: - esbuild: bin/esbuild - checksum: cd39e0236ba9ab39d28e5ba0aab9b63b3f7f3fdcd449422bfcaff087aedcf4fa0e754cb89fba37d96c67874e995e3c02634ef392f09928cdf4a5daf4dddd0171 - languageName: node - linkType: hard - "escalade@npm:^3.1.1, escalade@npm:^3.2.0": version: 3.2.0 resolution: "escalade@npm:3.2.0" @@ -10264,14 +9907,7 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^4.2.0": - version: 4.2.0 - resolution: "eslint-visitor-keys@npm:4.2.0" - checksum: 779c604672b570bb4da84cef32f6abb085ac78379779c1122d7879eade8bb38ae715645324597cf23232d03cef06032c9844d25c73625bc282a5bfd30247e5b5 - languageName: node - linkType: hard - -"eslint-visitor-keys@npm:^4.2.1": +"eslint-visitor-keys@npm:^4.2.0, eslint-visitor-keys@npm:^4.2.1": version: 4.2.1 resolution: "eslint-visitor-keys@npm:4.2.1" checksum: 3a77e3f99a49109f6fb2c5b7784bc78f9743b834d238cdba4d66c602c6b52f19ed7bcd0a5c5dbbeae3a8689fd785e76c001799f53d2228b278282cf9f699fff5 From 03e21eb255cd6070f4222086601b38db1be0bcf3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 15:00:42 -0600 Subject: [PATCH 127/283] fix(deps): update dependency prettier to v3.6.2 (#11496) * fix(deps): update dependency prettier to v3.6.2 * chore: update formatting after prettier upgrade * update more formatting --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: JamesHenry Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .prettierignore | 13 --- .../Dependency_Version_Upgrades.mdx | 1 - docs/packages/Parser.mdx | 1 - package.json | 3 +- .../fixture.ts | 2 +- .../snapshots/1-TSESTree-AST.shot | 4 +- .../snapshots/2-TSESTree-Tokens.shot | 4 +- .../snapshots/3-Babel-AST.shot | 4 +- .../snapshots/4-Babel-Tokens.shot | 4 +- .../snapshots/5-AST-Alignment-AST.shot | 6 +- .../snapshots/6-AST-Alignment-Tokens.shot | 4 +- packages/eslint-plugin-internal/package.json | 2 +- packages/eslint-plugin/package.json | 2 +- .../no-confusing-void-expression.test.ts | 8 +- .../tests/rules/no-floating-promises.test.ts | 66 +++++++------- .../tests/rules/no-unused-expressions.test.ts | 8 +- .../no-unused-vars-eslint.test.ts | 90 ++++++++++++------- .../prefer-optional-chain.test.ts | 9 +- .../package.json | 2 +- packages/website/package.json | 2 +- yarn.lock | 18 ++-- 21 files changed, 130 insertions(+), 123 deletions(-) diff --git a/.prettierignore b/.prettierignore index c5f057dfff86..9a14c7180b0b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -12,20 +12,7 @@ packages/eslint-plugin/tests/fixtures/indent/ # ignore all error fixtures cos they often have intentional syntax errors packages/ast-spec/src/*/*/fixtures/_error_/*/fixture.ts -# TS 5.6 -- string literal import/export specifiers # TODO - remove this once prettier supports it -packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/fixture.ts -packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/fixture.ts -packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/fixture.ts -packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/fixture.ts -packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/fixture.ts -packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/fixture.ts -packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/fixture.ts -packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/fixture.ts - -# TODO - remove this once prettier supports it -# https://github.com/prettier/prettier/issues/16072 -packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts # https://github.com/prettier/prettier/issues/17405 packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts diff --git a/docs/maintenance/pull-requests/Dependency_Version_Upgrades.mdx b/docs/maintenance/pull-requests/Dependency_Version_Upgrades.mdx index 596c7ea0611e..a009e10aaa4b 100644 --- a/docs/maintenance/pull-requests/Dependency_Version_Upgrades.mdx +++ b/docs/maintenance/pull-requests/Dependency_Version_Upgrades.mdx @@ -112,7 +112,6 @@ See [feat: drop support for node v12](https://github.com/typescript-eslint/types We generally start the process of supporting a new TypeScript version just after the first beta release for that version is made available. 1. Create and pin an issue with a title like _TypeScript X.Y Support_, `accepting prs`, `AST`, `dependencies`, and `New TypeScript Version` labels, and the following contents: - 1. A link to the _TypeScript X.Y Iteration Plan_ issue from the Microsoft issue tracker 2. The following text: diff --git a/docs/packages/Parser.mdx b/docs/packages/Parser.mdx index 7e9336773f03..52a294e67e41 100644 --- a/docs/packages/Parser.mdx +++ b/docs/packages/Parser.mdx @@ -251,7 +251,6 @@ project: null; ``` - If `true`, each source file's parse will find the nearest `tsconfig.json` file to that source file. - - This is done by checking that source file's directory tree for the nearest `tsconfig.json`. - If you use project references, TypeScript will **not** automatically use project references to resolve files. This means that you will have to add each referenced tsconfig to the `project` field either separately, or via a glob. diff --git a/package.json b/package.json index dcacd743d00c..36f09ef6c9b1 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "lint-staged": "^15.2.2", "markdownlint-cli": "^0.44.0", "nx": "21.2.3", - "prettier": "3.5.0", + "prettier": "3.6.2", "rimraf": "^5.0.5", "semver": "7.7.0", "tsx": "*", @@ -111,7 +111,6 @@ "@types/node": "^22.0.0", "@types/react": "^18.2.14", "eslint-plugin-eslint-plugin@^5.5.0": "patch:eslint-plugin-eslint-plugin@npm%3A5.5.1#./.yarn/patches/eslint-plugin-eslint-plugin-npm-5.5.1-4206c2506d.patch", - "prettier": "3.5.0", "react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch", "tsx": "^4.7.2", "typescript": "5.9.2" diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts index 79df9dadf881..25af9fe33ec6 100644 --- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts @@ -1 +1 @@ -type A = import("A", { with: { type: "json" } }); +type A = import('A', { with: { type: 'json' } }); diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/1-TSESTree-AST.shot index 225e77e8303a..e20487325971 100644 --- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/1-TSESTree-AST.shot @@ -22,7 +22,7 @@ Program { type: "TSLiteralType", literal: Literal { type: "Literal", - raw: ""A"", + raw: "'A'", value: "A", range: [16, 19], @@ -84,7 +84,7 @@ Program { shorthand: false, value: Literal { type: "Literal", - raw: ""json"", + raw: "'json'", value: "json", range: [37, 43], diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/2-TSESTree-Tokens.shot index d9a618899217..4aa87f31f614 100644 --- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/2-TSESTree-Tokens.shot @@ -51,7 +51,7 @@ }, String { type: "String", - value: ""A"", + value: "'A'", range: [16, 19], loc: { @@ -131,7 +131,7 @@ }, String { type: "String", - value: ""json"", + value: "'json'", range: [37, 43], loc: { diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/3-Babel-AST.shot index 76cbe3e5d77c..79fdc1382198 100644 --- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/3-Babel-AST.shot @@ -20,7 +20,7 @@ Program { type: "TSImportType", argument: Literal { type: "Literal", - raw: ""A"", + raw: "'A'", value: "A", range: [16, 19], @@ -75,7 +75,7 @@ Program { shorthand: false, value: Literal { type: "Literal", - raw: ""json"", + raw: "'json'", value: "json", range: [37, 43], diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/4-Babel-Tokens.shot index 91cd1f711197..352ef98a8d93 100644 --- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/4-Babel-Tokens.shot @@ -51,7 +51,7 @@ }, String { type: "String", - value: ""A"", + value: "'A'", range: [16, 19], loc: { @@ -131,7 +131,7 @@ }, String { type: "String", - value: ""json"", + value: "'json'", range: [37, 43], loc: { diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/5-AST-Alignment-AST.shot index 31b5f49ee553..668b4bceacd6 100644 --- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/5-AST-Alignment-AST.shot @@ -29,11 +29,11 @@ Snapshot Diff: - type: 'TSLiteralType', - literal: Literal { - type: 'Literal', -- raw: '"A"', +- raw: '\'A\'', - value: 'A', + argument: Literal { + type: 'Literal', -+ raw: '"A"', ++ raw: '\'A\'', + value: 'A', - range: [16, 19], @@ -95,7 +95,7 @@ Snapshot Diff: shorthand: false, value: Literal { type: 'Literal', - raw: '"json"', + raw: '\'json\'', value: 'json', range: [37, 43], diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/6-AST-Alignment-Tokens.shot index 87fdac962d79..bbd22a21ad7c 100644 --- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/6-AST-Alignment-Tokens.shot @@ -58,7 +58,7 @@ Snapshot Diff: }, String { type: 'String', - value: '"A"', + value: '\'A\'', range: [16, 19], loc: { @@ -140,7 +140,7 @@ Snapshot Diff: }, String { type: 'String', - value: '"json"', + value: '\'json\'', range: [37, 43], loc: { diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 20c9d4f6be11..9b105586f76a 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -27,7 +27,7 @@ "@typescript-eslint/scope-manager": "workspace:*", "@typescript-eslint/type-utils": "workspace:*", "@typescript-eslint/utils": "workspace:*", - "prettier": "3.5.0" + "prettier": "3.6.2" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index e38ecf7a466e..59a5b0a5428a 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -83,7 +83,7 @@ "mdast-util-from-markdown": "^2.0.0", "mdast-util-mdx": "^3.0.0", "micromark-extension-mdxjs": "^3.0.0", - "prettier": "3.5.0", + "prettier": "3.6.2", "rimraf": "*", "title-case": "^4.0.0", "tsx": "*", diff --git a/packages/eslint-plugin/tests/rules/no-confusing-void-expression.test.ts b/packages/eslint-plugin/tests/rules/no-confusing-void-expression.test.ts index 4fcb1b8b6865..9adc9e2403b6 100644 --- a/packages/eslint-plugin/tests/rules/no-confusing-void-expression.test.ts +++ b/packages/eslint-plugin/tests/rules/no-confusing-void-expression.test.ts @@ -110,13 +110,13 @@ ruleTester.run('no-confusing-void-expression', rule, { ` function cool(input: string) { - return console.log(input), input; + return (console.log(input), input); } `, { code: ` function cool(input: string) { - return input, console.log(input), input; + return (input, console.log(input), input); } `, }, @@ -487,10 +487,10 @@ test((() => { { code: ` function notcool(input: string) { - return input, console.log(input); + return (input, console.log(input)); } `, - errors: [{ column: 17, line: 3, messageId: 'invalidVoidExpr' }], + errors: [{ column: 18, line: 3, messageId: 'invalidVoidExpr' }], output: null, }, { diff --git a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts index 4835087e7cb6..61467bf0099b 100644 --- a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts +++ b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts @@ -112,18 +112,18 @@ async function test() { `, ` async function test() { - Promise.resolve().catch(() => {}), 123; - 123, + (Promise.resolve().catch(() => {}), 123); + (123, Promise.resolve().then( () => {}, () => {}, - ); - 123, + )); + (123, Promise.resolve().then( () => {}, () => {}, ), - 123; + 123); } `, ` @@ -512,7 +512,7 @@ interface SafeThenable { ): SafeThenable; } let promise: SafeThenable = Promise.resolve(5); -0, promise; +(0, promise); `, options: [ { @@ -594,7 +594,7 @@ interface SafeThenable { ): SafeThenable; } let promise: () => SafeThenable = () => Promise.resolve(5); -0, promise(); +(0, promise()); `, options: [ { @@ -2000,9 +2000,9 @@ async function test() { { code: ` async function test() { - Promise.resolve(), 123; - 123, Promise.resolve(); - 123, Promise.resolve(), 123; + (Promise.resolve(), 123); + (123, Promise.resolve()); + (123, Promise.resolve(), 123); } `, errors: [ @@ -2014,9 +2014,9 @@ async function test() { messageId: 'floatingFixVoid', output: ` async function test() { - void (Promise.resolve(), 123); - 123, Promise.resolve(); - 123, Promise.resolve(), 123; + void ((Promise.resolve(), 123)); + (123, Promise.resolve()); + (123, Promise.resolve(), 123); } `, }, @@ -2024,9 +2024,9 @@ async function test() { messageId: 'floatingFixAwait', output: ` async function test() { - await (Promise.resolve(), 123); - 123, Promise.resolve(); - 123, Promise.resolve(), 123; + await ((Promise.resolve(), 123)); + (123, Promise.resolve()); + (123, Promise.resolve(), 123); } `, }, @@ -2040,9 +2040,9 @@ async function test() { messageId: 'floatingFixVoid', output: ` async function test() { - Promise.resolve(), 123; - void (123, Promise.resolve()); - 123, Promise.resolve(), 123; + (Promise.resolve(), 123); + void ((123, Promise.resolve())); + (123, Promise.resolve(), 123); } `, }, @@ -2050,9 +2050,9 @@ async function test() { messageId: 'floatingFixAwait', output: ` async function test() { - Promise.resolve(), 123; - await (123, Promise.resolve()); - 123, Promise.resolve(), 123; + (Promise.resolve(), 123); + await ((123, Promise.resolve())); + (123, Promise.resolve(), 123); } `, }, @@ -2066,9 +2066,9 @@ async function test() { messageId: 'floatingFixVoid', output: ` async function test() { - Promise.resolve(), 123; - 123, Promise.resolve(); - void (123, Promise.resolve(), 123); + (Promise.resolve(), 123); + (123, Promise.resolve()); + void ((123, Promise.resolve(), 123)); } `, }, @@ -2076,9 +2076,9 @@ async function test() { messageId: 'floatingFixAwait', output: ` async function test() { - Promise.resolve(), 123; - 123, Promise.resolve(); - await (123, Promise.resolve(), 123); + (Promise.resolve(), 123); + (123, Promise.resolve()); + await ((123, Promise.resolve(), 123)); } `, }, @@ -2194,7 +2194,7 @@ await /* ... */ returnsPromise(); async function returnsPromise() { return 'value'; } -1, returnsPromise(); +(1, returnsPromise()); `, errors: [ { @@ -2207,7 +2207,7 @@ async function returnsPromise() { async function returnsPromise() { return 'value'; } -await (1, returnsPromise()); +await ((1, returnsPromise())); `, }, ], @@ -4516,7 +4516,7 @@ await promiseIntersection.finally(() => {}); }, { code: ` -Promise.resolve().finally(() => {}), 123; +(Promise.resolve().finally(() => {}), 123); `, errors: [ { @@ -4526,13 +4526,13 @@ Promise.resolve().finally(() => {}), 123; { messageId: 'floatingFixVoid', output: ` -void (Promise.resolve().finally(() => {}), 123); +void ((Promise.resolve().finally(() => {}), 123)); `, }, { messageId: 'floatingFixAwait', output: ` -await (Promise.resolve().finally(() => {}), 123); +await ((Promise.resolve().finally(() => {}), 123)); `, }, ], diff --git a/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts b/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts index fa3159a96aa2..ca860a304a9d 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts @@ -87,11 +87,11 @@ ruleTester.run('no-unused-expressions', rule, { ], }, { - code: 'f(0), {};', + code: '(f(0), {});', errors: [ { column: 1, - endColumn: 10, + endColumn: 12, endLine: 1, line: 1, messageId: 'unusedExpression', @@ -99,11 +99,11 @@ ruleTester.run('no-unused-expressions', rule, { ], }, { - code: 'a, b();', + code: '(a, b());', errors: [ { column: 1, - endColumn: 8, + endColumn: 10, endLine: 1, line: 1, messageId: 'unusedExpression', 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 c9048412d8c0..d05d538d2731 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 @@ -1566,15 +1566,15 @@ foo*/ { code: ` let x = 0; -x++, (x = 0); +(x++, (x = 0)); `, - errors: [{ ...assignedError('x'), column: 7, line: 3 }], + errors: [{ ...assignedError('x'), column: 8, line: 3 }], languageOptions: { parserOptions: { ecmaVersion: 2015 } }, }, { code: ` let x = 0; -x++, (x = 0); +(x++, (x = 0)); x = 3; `, errors: [{ ...assignedError('x'), column: 1, line: 4 }], @@ -1583,25 +1583,25 @@ x = 3; { code: ` let x = 0; -x++, 0; +(x++, 0); `, - errors: [{ ...assignedError('x'), column: 1, line: 3 }], + errors: [{ ...assignedError('x'), column: 2, line: 3 }], languageOptions: { parserOptions: { ecmaVersion: 2015 } }, }, { code: ` let x = 0; -0, x++; +(0, x++); `, - errors: [{ ...assignedError('x'), column: 4, line: 3 }], + errors: [{ ...assignedError('x'), column: 5, line: 3 }], languageOptions: { parserOptions: { ecmaVersion: 2015 } }, }, { code: ` let x = 0; -0, (1, x++); +(0, (1, x++)); `, - errors: [{ ...assignedError('x'), column: 8, line: 3 }], + errors: [{ ...assignedError('x'), column: 9, line: 3 }], languageOptions: { parserOptions: { ecmaVersion: 2015 } }, }, { @@ -1623,25 +1623,25 @@ foo = ((0, x++), 0); { code: ` let x = 0; -(x += 1), 0; +((x += 1), 0); `, - errors: [{ ...assignedError('x'), column: 2, line: 3 }], + errors: [{ ...assignedError('x'), column: 3, line: 3 }], languageOptions: { parserOptions: { ecmaVersion: 2015 } }, }, { code: ` let x = 0; -0, (x += 1); +(0, (x += 1)); `, - errors: [{ ...assignedError('x'), column: 5, line: 3 }], + errors: [{ ...assignedError('x'), column: 6, line: 3 }], languageOptions: { parserOptions: { ecmaVersion: 2015 } }, }, { code: ` let x = 0; -0, (1, (x += 1)); +(0, (1, (x += 1))); `, - errors: [{ ...assignedError('x'), column: 9, line: 3 }], + errors: [{ ...assignedError('x'), column: 10, line: 3 }], languageOptions: { parserOptions: { ecmaVersion: 2015 } }, }, { @@ -1665,15 +1665,15 @@ foo = ((0, (x += 1)), 0); { code: ` let z = 0; -(z = z + 1), (z = 2); +((z = z + 1), (z = 2)); `, - errors: [{ ...assignedError('z'), column: 15, line: 3 }], + errors: [{ ...assignedError('z'), column: 16, line: 3 }], languageOptions: { parserOptions: { ecmaVersion: 2020 } }, }, { code: ` let z = 0; -(z = z + 1), (z = 2); +((z = z + 1), (z = 2)); z = 3; `, errors: [{ ...assignedError('z'), column: 1, line: 4 }], @@ -1682,7 +1682,7 @@ z = 3; { code: ` let z = 0; -(z = z + 1), (z = 2); +((z = z + 1), (z = 2)); z = z + 3; `, errors: [{ ...assignedError('z'), column: 1, line: 4 }], @@ -1691,17 +1691,17 @@ z = z + 3; { code: ` let x = 0; -0, (x = x + 1); +(0, (x = x + 1)); `, - errors: [{ ...assignedError('x'), column: 5, line: 3 }], + errors: [{ ...assignedError('x'), column: 6, line: 3 }], languageOptions: { parserOptions: { ecmaVersion: 2020 } }, }, { code: ` let x = 0; -(x = x + 1), 0; +((x = x + 1), 0); `, - errors: [{ ...assignedError('x'), column: 2, line: 3 }], + errors: [{ ...assignedError('x'), column: 3, line: 3 }], languageOptions: { parserOptions: { ecmaVersion: 2020 } }, }, { @@ -1723,9 +1723,9 @@ foo = ((x = x + 1), 0); { code: ` let x = 0; -0, (1, (x = x + 1)); +(0, (1, (x = x + 1))); `, - errors: [{ ...assignedError('x'), column: 9, line: 3 }], + errors: [{ ...assignedError('x'), column: 10, line: 3 }], languageOptions: { parserOptions: { ecmaVersion: 2020 } }, }, { @@ -1972,7 +1972,11 @@ const _b = _a + 5; errors: [usedIgnoredError('_a', '. Used vars must not match /^_/u')], languageOptions: { parserOptions: { ecmaVersion: 6 } }, options: [ - { args: 'all', reportUsedIgnorePattern: true, varsIgnorePattern: '^_' }, + { + args: 'all', + reportUsedIgnorePattern: true, + varsIgnorePattern: '^_', + }, ], }, { @@ -1983,7 +1987,11 @@ foo(() => _a); errors: [usedIgnoredError('_a', '. Used vars must not match /^_/u')], languageOptions: { parserOptions: { ecmaVersion: 6 } }, options: [ - { args: 'all', reportUsedIgnorePattern: true, varsIgnorePattern: '^_' }, + { + args: 'all', + reportUsedIgnorePattern: true, + varsIgnorePattern: '^_', + }, ], }, { @@ -1994,7 +2002,11 @@ foo(() => _a); `, errors: [usedIgnoredError('_a', '. Used args must not match /^_/u')], options: [ - { args: 'all', argsIgnorePattern: '^_', reportUsedIgnorePattern: true }, + { + args: 'all', + argsIgnorePattern: '^_', + reportUsedIgnorePattern: true, + }, ], }, { @@ -2010,7 +2022,10 @@ console.log(a + _b); ], languageOptions: { parserOptions: { ecmaVersion: 6 } }, options: [ - { destructuredArrayIgnorePattern: '^_', reportUsedIgnorePattern: true }, + { + destructuredArrayIgnorePattern: '^_', + reportUsedIgnorePattern: true, + }, ], }, { @@ -3449,7 +3464,11 @@ const _c = a + 5; `, languageOptions: { parserOptions: { ecmaVersion: 6 } }, options: [ - { args: 'all', reportUsedIgnorePattern: true, varsIgnorePattern: '^_' }, + { + args: 'all', + reportUsedIgnorePattern: true, + varsIgnorePattern: '^_', + }, ], }, { @@ -3459,7 +3478,11 @@ const _c = a + 5; })(5); `, options: [ - { args: 'all', argsIgnorePattern: '^_', reportUsedIgnorePattern: true }, + { + args: 'all', + argsIgnorePattern: '^_', + reportUsedIgnorePattern: true, + }, ], }, { @@ -3469,7 +3492,10 @@ console.log(a + c); `, languageOptions: { parserOptions: { ecmaVersion: 6 } }, options: [ - { destructuredArrayIgnorePattern: '^_', reportUsedIgnorePattern: true }, + { + destructuredArrayIgnorePattern: '^_', + reportUsedIgnorePattern: true, + }, ], }, ], diff --git a/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts b/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts index 12c73b04eea7..b72289d020b2 100644 --- a/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts @@ -1515,8 +1515,7 @@ describe('hand-crafted cases', () => { errors: [{ messageId: 'preferOptionalChain', suggestions: null }], options: [ { - allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: - true, + allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: true, }, ], output: ` @@ -1545,8 +1544,7 @@ describe('hand-crafted cases', () => { ], options: [ { - allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: - false, + allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false, }, ], output: null, @@ -1560,8 +1558,7 @@ describe('hand-crafted cases', () => { errors: [{ messageId: 'preferOptionalChain' }], options: [ { - allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: - true, + allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: true, }, ], output: ` diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 74d9ffd401e3..8b61f154b058 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -35,7 +35,7 @@ "@typescript-eslint/type-utils": "8.40.0", "@typescript-eslint/utils": "8.40.0", "natural-compare": "^1.4.0", - "prettier": "3.5.0" + "prettier": "3.6.2" }, "devDependencies": { "@vitest/coverage-v8": "^3.1.3", diff --git a/packages/website/package.json b/packages/website/package.json index 528850f495fd..a8c3c676af7b 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -43,7 +43,7 @@ "json5": "^2.2.3", "konamimojisplosion": "^0.5.2", "lz-string": "^1.5.0", - "prettier": "3.5.0", + "prettier": "3.6.2", "prism-react-renderer": "^2.3.1", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/yarn.lock b/yarn.lock index da06edc171f7..20eb695c94e8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5724,7 +5724,7 @@ __metadata: "@typescript-eslint/utils": "workspace:*" "@vitest/coverage-v8": ^3.1.3 eslint: "*" - prettier: 3.5.0 + prettier: 3.6.2 rimraf: "*" vitest: ^3.1.3 languageName: unknown @@ -5756,7 +5756,7 @@ __metadata: mdast-util-mdx: ^3.0.0 micromark-extension-mdxjs: ^3.0.0 natural-compare: ^1.4.0 - prettier: 3.5.0 + prettier: 3.6.2 rimraf: "*" title-case: ^4.0.0 ts-api-utils: ^2.1.0 @@ -5827,7 +5827,7 @@ __metadata: "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 - prettier: 3.5.0 + prettier: 3.6.2 rimraf: "*" typescript: "*" vitest: ^3.1.3 @@ -5970,7 +5970,7 @@ __metadata: lint-staged: ^15.2.2 markdownlint-cli: ^0.44.0 nx: 21.2.3 - prettier: 3.5.0 + prettier: 3.6.2 rimraf: ^5.0.5 semver: 7.7.0 tsx: "*" @@ -16532,12 +16532,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:3.5.0": - version: 3.5.0 - resolution: "prettier@npm:3.5.0" +"prettier@npm:3.6.2": + version: 3.6.2 + resolution: "prettier@npm:3.6.2" bin: prettier: bin/prettier.cjs - checksum: 5b451b701a437f4561b7413d1e5c1da92b1af52bf5995a429ce67c84a8525145f90992c00fe2eefd471c307d261d6f160b4bac045e0ca38f1aa4aba5e9bfdf0f + checksum: 0206f5f437892e8858f298af8850bf9d0ef1c22e21107a213ba56bfb9c2387a2020bfda244a20161d8e3dad40c6b04101609a55d370dece53d0a31893b64f861 languageName: node linkType: hard @@ -20228,7 +20228,7 @@ __metadata: mdast-util-from-markdown: ^2.0.1 mdast-util-mdx: ^3.0.0 monaco-editor: ~0.52.0 - prettier: 3.5.0 + prettier: 3.6.2 prism-react-renderer: ^2.3.1 raw-loader: ^4.0.2 react: ^18.2.0 From ffbbf6dadb518b762e24d987196baa09737aeb30 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 21:16:11 +0000 Subject: [PATCH 128/283] chore(deps): update dependency @vitest/eslint-plugin to v1.3.4 (#11484) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 20eb695c94e8..eafc39faecb9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6008,7 +6008,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.40.0, @typescript-eslint/utils@^8.24.0, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.40.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: @@ -6106,10 +6106,10 @@ __metadata: linkType: hard "@vitest/eslint-plugin@npm:^1.1.44": - version: 1.2.0 - resolution: "@vitest/eslint-plugin@npm:1.2.0" + version: 1.3.4 + resolution: "@vitest/eslint-plugin@npm:1.3.4" dependencies: - "@typescript-eslint/utils": ^8.24.0 + "@typescript-eslint/utils": ^8.24.1 peerDependencies: eslint: ">= 8.57.0" typescript: ">= 5.0.0" @@ -6119,7 +6119,7 @@ __metadata: optional: true vitest: optional: true - checksum: cf5fe6ed81869b942e9f44cbc63caaec86807d11c4a9d9ad6800df76a90b054573101b8cb2feafca2489bc4a6bd9abb3e953a070963ca80e64014734d07f88e7 + checksum: 9cd8afc3a27ee247e3ebe9455f7c9df334824115459d640f38086121fd67142ee0523d9b30e55ce8dda7504d9c5cabaf80f351238fc64f33fc53ef92a59bba68 languageName: node linkType: hard From 7cc230c33b53f2a833ebdd7f051d5371523dbc90 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 21:40:44 +0000 Subject: [PATCH 129/283] chore(deps): update dependency @types/node to v22.17.1 (#11483) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index eafc39faecb9..ccb135810bef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5499,11 +5499,11 @@ __metadata: linkType: hard "@types/node@npm:^22.0.0": - version: 22.15.3 - resolution: "@types/node@npm:22.15.3" + version: 22.17.2 + resolution: "@types/node@npm:22.17.2" dependencies: undici-types: ~6.21.0 - checksum: 26618a9fdfb84de3841e898b7c5fd372e1c0bdb9adc3ec71c12c38dd07d4e73da14681924919d27ff509ebf3714b8de941a21f51c26146cc8aaae31561ca7a5c + checksum: 2a82f96abcf25104efa6e9b8231616e039e5e0854f07e9ce4fdf821d30eaac30a80ec3cafefb36d2af8bd7c9594cfda337887bd85bb5c2031ba0f7e23a3d588d languageName: node linkType: hard From 38480e0dc5e041d8768d3cd3abbe215d4a65bc72 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 18 Aug 2025 16:05:32 -0600 Subject: [PATCH 130/283] fix: resolve type error in eslint config (#11500) --- eslint.config.mjs | 58 ++++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index ee482497342e..bbb9e9a05e26 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -362,36 +362,42 @@ export default tseslint.config( // test file specific configuration { + extends: [ + // @ts-expect-error -- uses `string` instead of `off` | `readonly` | `writable` for the globals setting. + vitestPlugin.configs.env, + { + rules: { + '@typescript-eslint/no-empty-function': [ + 'error', + { allow: ['arrowFunctions'] }, + ], + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + 'vitest/no-alias-methods': 'error', + 'vitest/no-disabled-tests': 'error', + 'vitest/no-focused-tests': 'error', + 'vitest/no-identical-title': 'error', + 'vitest/no-test-prefixes': 'error', + 'vitest/no-test-return-statement': 'error', + 'vitest/prefer-describe-function-title': 'error', + 'vitest/prefer-each': 'error', + 'vitest/prefer-spy-on': 'error', + 'vitest/prefer-to-be': 'error', + 'vitest/prefer-to-contain': 'error', + 'vitest/prefer-to-have-length': 'error', + 'vitest/valid-expect': 'error', + }, + settings: { vitest: { typecheck: true } }, + }, + ], + files: [ 'packages/*/tests/**/*.?(m|c)ts?(x)', 'packages/integration-tests/tools/**/*.ts', ], - ...vitestPlugin.configs.env, - rules: { - '@typescript-eslint/no-empty-function': [ - 'error', - { allow: ['arrowFunctions'] }, - ], - '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-unsafe-assignment': 'off', - '@typescript-eslint/no-unsafe-call': 'off', - '@typescript-eslint/no-unsafe-member-access': 'off', - '@typescript-eslint/no-unsafe-return': 'off', - 'vitest/no-alias-methods': 'error', - 'vitest/no-disabled-tests': 'error', - 'vitest/no-focused-tests': 'error', - 'vitest/no-identical-title': 'error', - 'vitest/no-test-prefixes': 'error', - 'vitest/no-test-return-statement': 'error', - 'vitest/prefer-describe-function-title': 'error', - 'vitest/prefer-each': 'error', - 'vitest/prefer-spy-on': 'error', - 'vitest/prefer-to-be': 'error', - 'vitest/prefer-to-contain': 'error', - 'vitest/prefer-to-have-length': 'error', - 'vitest/valid-expect': 'error', - }, - settings: { vitest: { typecheck: true } }, }, { From 089f4f447425e4e4030cdf514f476cd36f850f54 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 15:06:16 -0700 Subject: [PATCH 131/283] chore(deps): update dependency cspell to v9.2.0 (#11498) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 932 +++++++++++++++++++++++++++--------------------------- 1 file changed, 468 insertions(+), 464 deletions(-) diff --git a/yarn.lock b/yarn.lock index ccb135810bef..7cc1a308cf0e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1556,554 +1556,554 @@ __metadata: languageName: node linkType: hard -"@cspell/cspell-bundled-dicts@npm:9.0.0": - version: 9.0.0 - resolution: "@cspell/cspell-bundled-dicts@npm:9.0.0" - dependencies: - "@cspell/dict-ada": ^4.1.0 - "@cspell/dict-al": ^1.1.0 - "@cspell/dict-aws": ^4.0.10 - "@cspell/dict-bash": ^4.2.0 - "@cspell/dict-companies": ^3.2.1 - "@cspell/dict-cpp": ^6.0.8 - "@cspell/dict-cryptocurrencies": ^5.0.4 - "@cspell/dict-csharp": ^4.0.6 - "@cspell/dict-css": ^4.0.17 - "@cspell/dict-dart": ^2.3.0 - "@cspell/dict-data-science": ^2.0.8 - "@cspell/dict-django": ^4.1.4 - "@cspell/dict-docker": ^1.1.14 - "@cspell/dict-dotnet": ^5.0.9 - "@cspell/dict-elixir": ^4.0.7 - "@cspell/dict-en-common-misspellings": ^2.0.10 - "@cspell/dict-en-gb-mit": ^3.0.3 - "@cspell/dict-en_us": ^4.4.6 - "@cspell/dict-filetypes": ^3.0.12 - "@cspell/dict-flutter": ^1.1.0 - "@cspell/dict-fonts": ^4.0.4 - "@cspell/dict-fsharp": ^1.1.0 - "@cspell/dict-fullstack": ^3.2.6 - "@cspell/dict-gaming-terms": ^1.1.1 - "@cspell/dict-git": ^3.0.4 - "@cspell/dict-golang": ^6.0.20 - "@cspell/dict-google": ^1.0.8 - "@cspell/dict-haskell": ^4.0.5 - "@cspell/dict-html": ^4.0.11 - "@cspell/dict-html-symbol-entities": ^4.0.3 - "@cspell/dict-java": ^5.0.11 - "@cspell/dict-julia": ^1.1.0 - "@cspell/dict-k8s": ^1.0.10 - "@cspell/dict-kotlin": ^1.1.0 - "@cspell/dict-latex": ^4.0.3 - "@cspell/dict-lorem-ipsum": ^4.0.4 - "@cspell/dict-lua": ^4.0.7 - "@cspell/dict-makefile": ^1.0.4 - "@cspell/dict-markdown": ^2.0.10 - "@cspell/dict-monkeyc": ^1.0.10 - "@cspell/dict-node": ^5.0.7 - "@cspell/dict-npm": ^5.2.3 - "@cspell/dict-php": ^4.0.14 - "@cspell/dict-powershell": ^5.0.14 - "@cspell/dict-public-licenses": ^2.0.13 - "@cspell/dict-python": ^4.2.18 - "@cspell/dict-r": ^2.1.0 - "@cspell/dict-ruby": ^5.0.8 - "@cspell/dict-rust": ^4.0.11 - "@cspell/dict-scala": ^5.0.7 - "@cspell/dict-shell": ^1.1.0 - "@cspell/dict-software-terms": ^5.0.7 - "@cspell/dict-sql": ^2.2.0 - "@cspell/dict-svelte": ^1.0.6 - "@cspell/dict-swift": ^2.0.5 - "@cspell/dict-terraform": ^1.1.1 - "@cspell/dict-typescript": ^3.2.1 - "@cspell/dict-vue": ^3.0.4 - checksum: 7d1b4db97d35816958ddc8581b8f106e8542fc711e73f306f91382665b141aa20e24cca529c31e5126437e464c5bb61b22c6425a18f1a6ce2e058af482dfc7af - languageName: node - linkType: hard - -"@cspell/cspell-json-reporter@npm:9.0.0": - version: 9.0.0 - resolution: "@cspell/cspell-json-reporter@npm:9.0.0" - dependencies: - "@cspell/cspell-types": 9.0.0 - checksum: 4cda5ab00e93f334de47eb0868a0fdc6509d7b173a7a7a48e182a4136591a8505bf24729c7aba1b9efa82432159450abd1fa4ac6103b727602c5372ad07140dd - languageName: node - linkType: hard - -"@cspell/cspell-pipe@npm:9.0.0": - version: 9.0.0 - resolution: "@cspell/cspell-pipe@npm:9.0.0" - checksum: 38ec91fe75dcee18e1f19b7d5696468d7813568c269c4a7bfed6bfc943b7a2b618d81ca1cc6a5007f7e93edbcba09e8fa0bab8fee55f8f3d76879d40aec89d3b - languageName: node - linkType: hard - -"@cspell/cspell-resolver@npm:9.0.0": - version: 9.0.0 - resolution: "@cspell/cspell-resolver@npm:9.0.0" +"@cspell/cspell-bundled-dicts@npm:9.2.0": + version: 9.2.0 + resolution: "@cspell/cspell-bundled-dicts@npm:9.2.0" + dependencies: + "@cspell/dict-ada": ^4.1.1 + "@cspell/dict-al": ^1.1.1 + "@cspell/dict-aws": ^4.0.12 + "@cspell/dict-bash": ^4.2.1 + "@cspell/dict-companies": ^3.2.2 + "@cspell/dict-cpp": ^6.0.9 + "@cspell/dict-cryptocurrencies": ^5.0.5 + "@cspell/dict-csharp": ^4.0.7 + "@cspell/dict-css": ^4.0.18 + "@cspell/dict-dart": ^2.3.1 + "@cspell/dict-data-science": ^2.0.9 + "@cspell/dict-django": ^4.1.5 + "@cspell/dict-docker": ^1.1.15 + "@cspell/dict-dotnet": ^5.0.10 + "@cspell/dict-elixir": ^4.0.8 + "@cspell/dict-en-common-misspellings": ^2.1.3 + "@cspell/dict-en-gb-mit": ^3.1.5 + "@cspell/dict-en_us": ^4.4.15 + "@cspell/dict-filetypes": ^3.0.13 + "@cspell/dict-flutter": ^1.1.1 + "@cspell/dict-fonts": ^4.0.5 + "@cspell/dict-fsharp": ^1.1.1 + "@cspell/dict-fullstack": ^3.2.7 + "@cspell/dict-gaming-terms": ^1.1.2 + "@cspell/dict-git": ^3.0.7 + "@cspell/dict-golang": ^6.0.23 + "@cspell/dict-google": ^1.0.9 + "@cspell/dict-haskell": ^4.0.6 + "@cspell/dict-html": ^4.0.12 + "@cspell/dict-html-symbol-entities": ^4.0.4 + "@cspell/dict-java": ^5.0.12 + "@cspell/dict-julia": ^1.1.1 + "@cspell/dict-k8s": ^1.0.12 + "@cspell/dict-kotlin": ^1.1.1 + "@cspell/dict-latex": ^4.0.4 + "@cspell/dict-lorem-ipsum": ^4.0.5 + "@cspell/dict-lua": ^4.0.8 + "@cspell/dict-makefile": ^1.0.5 + "@cspell/dict-markdown": ^2.0.12 + "@cspell/dict-monkeyc": ^1.0.11 + "@cspell/dict-node": ^5.0.8 + "@cspell/dict-npm": ^5.2.12 + "@cspell/dict-php": ^4.0.15 + "@cspell/dict-powershell": ^5.0.15 + "@cspell/dict-public-licenses": ^2.0.14 + "@cspell/dict-python": ^4.2.19 + "@cspell/dict-r": ^2.1.1 + "@cspell/dict-ruby": ^5.0.9 + "@cspell/dict-rust": ^4.0.12 + "@cspell/dict-scala": ^5.0.8 + "@cspell/dict-shell": ^1.1.1 + "@cspell/dict-software-terms": ^5.1.4 + "@cspell/dict-sql": ^2.2.1 + "@cspell/dict-svelte": ^1.0.7 + "@cspell/dict-swift": ^2.0.6 + "@cspell/dict-terraform": ^1.1.3 + "@cspell/dict-typescript": ^3.2.3 + "@cspell/dict-vue": ^3.0.5 + checksum: 82de44ecf01637f065f8a5db7fa947918f0d3758725bb8b4f26215219e9b4b5f36d9588432b4dd9bb211d23beb12048b58f02f31111e4a4bba2acca4d0c73099 + languageName: node + linkType: hard + +"@cspell/cspell-json-reporter@npm:9.2.0": + version: 9.2.0 + resolution: "@cspell/cspell-json-reporter@npm:9.2.0" + dependencies: + "@cspell/cspell-types": 9.2.0 + checksum: dd6b5e7184edd43e02e986416b6e6300b9fb987fdf6757fdada763115b1b7792181a5e976cdf16658f6dcad0ce6f2fd587ba93f96a2e6084fe0b8d96aba34d0b + languageName: node + linkType: hard + +"@cspell/cspell-pipe@npm:9.2.0": + version: 9.2.0 + resolution: "@cspell/cspell-pipe@npm:9.2.0" + checksum: fceb9b6d6df117d73bfcd08be9121ccb9828a27c1813651d6c24dcae8c89d467b24cba7df927b326c77a6b91b1bae8ec7a9558a6039335656be673132fee9469 + languageName: node + linkType: hard + +"@cspell/cspell-resolver@npm:9.2.0": + version: 9.2.0 + resolution: "@cspell/cspell-resolver@npm:9.2.0" dependencies: global-directory: ^4.0.1 - checksum: af8d73d28ada52b38be4345dfe7aefac61ce68cda382f65b966f32c7f4ec418e7e7e1f52ac2cd771d9a26fbb042289567d80175c4a3a1359b7ac66ecda927717 + checksum: 8435d5d8da9ac5e67f9365986e245083703d82f23f04256808e0283885857401d88481672061eba5192447ca0155cc2fbfd3ac324dd14102135fe327a753ea0f languageName: node linkType: hard -"@cspell/cspell-service-bus@npm:9.0.0": - version: 9.0.0 - resolution: "@cspell/cspell-service-bus@npm:9.0.0" - checksum: 1c057012cadb1db1a2a168f8aa6c1b8436075cb7947069059c497a3c7241db1ec72a85a509f970faadaa86374ccfc90070f116abf191ea132fdf97c9086efaf4 +"@cspell/cspell-service-bus@npm:9.2.0": + version: 9.2.0 + resolution: "@cspell/cspell-service-bus@npm:9.2.0" + checksum: 0e9e84319980cb02cbbb33786458dc923f2936f1a74276b6fee470361eea86c5d1c2e28a1408dbd0efa309a3d5a58350c6c9f18736cb8a1f684322841ea77950 languageName: node linkType: hard -"@cspell/cspell-types@npm:9.0.0": - version: 9.0.0 - resolution: "@cspell/cspell-types@npm:9.0.0" - checksum: b3d2ce73ac503dd0c13778743dbf3eeb95dc9857a8a4c91bfd2f57c718058a3e220d9cf34f37b0d40034bfe1cb1b81ad6d22cc48fe46b992f605271aaf6f473b +"@cspell/cspell-types@npm:9.2.0": + version: 9.2.0 + resolution: "@cspell/cspell-types@npm:9.2.0" + checksum: 7ed6fe3c2f5be94b8a2439fcfaaff4389253f5f5a300d38ca05ef5460841731baf3ed0c347af56984fa56d911e73cd484bdc3b796fe5634fb6b6f383c0b21ed4 languageName: node linkType: hard -"@cspell/dict-ada@npm:^4.1.0": - version: 4.1.0 - resolution: "@cspell/dict-ada@npm:4.1.0" - checksum: 9e961e7e38b77a8abdb5df82b96e5e4619aedb662b22d971d4808252a1da7ef041c5e4e75ecc72ac9da9f36de8f461495a1f6dbeb751e903efa3626d571a0ddb +"@cspell/dict-ada@npm:^4.1.1": + version: 4.1.1 + resolution: "@cspell/dict-ada@npm:4.1.1" + checksum: 47be2954a30463947048caece4653008ca039903761b91703950a6c9f1f4d267cc4a49aa90b94415f029f49b2a38c591ad0b4b7e7bdc916977f0cfb0c777b2cd languageName: node linkType: hard -"@cspell/dict-al@npm:^1.1.0": - version: 1.1.0 - resolution: "@cspell/dict-al@npm:1.1.0" - checksum: 219961cd60c91d43e20f6384df3d2d6b7b208fc6e9a34316e08826fe2ffd9890905d2a3b3fdbea28990989f22f1ddf094b3c635781089d9a04ee2d2b4023457d +"@cspell/dict-al@npm:^1.1.1": + version: 1.1.1 + resolution: "@cspell/dict-al@npm:1.1.1" + checksum: fff74e3cf3a69dcebb0ca3a3508c82aca81096813bfe13de8c689c17ed253ca044e84cc2bc7e8f9c9abda4c06e2c09a22b4b01d013a00353cdaa111a0c1ddb7f languageName: node linkType: hard -"@cspell/dict-aws@npm:^4.0.10": - version: 4.0.10 - resolution: "@cspell/dict-aws@npm:4.0.10" - checksum: 01bb3b9f34a16688dcdbfccef1d7162d445f3edd8fd7deba823ed4346a8302d98799367b55f7de3e6dbb80218da7d75c442012552606b44dcc49ad52e013081c +"@cspell/dict-aws@npm:^4.0.12": + version: 4.0.14 + resolution: "@cspell/dict-aws@npm:4.0.14" + checksum: 9c5cf416c8d17bebd7555bb450068582d47c803dff738f5a92d3457942da4ebf6ac6400359359aeaeacac86a270c7971979a0d03cfa9decf9262342a6a56bb97 languageName: node linkType: hard -"@cspell/dict-bash@npm:^4.2.0": - version: 4.2.0 - resolution: "@cspell/dict-bash@npm:4.2.0" +"@cspell/dict-bash@npm:^4.2.1": + version: 4.2.1 + resolution: "@cspell/dict-bash@npm:4.2.1" dependencies: - "@cspell/dict-shell": 1.1.0 - checksum: 2a87ebb5f0b1140ceeab0991411ebfe03a05cebb296d30812a3e9f78cf0a56622484fbda5212d5811e59f1b1ca4dacae77341c1f3c0c5fc2efdb19393fddd766 + "@cspell/dict-shell": 1.1.1 + checksum: 607611fcbcc0609ddfb7afec91472876301346cd7dafe13d9afed653ef714cd2ac83d6d68e5218426edc135c085217ab1e0927654aa83b170cc1685248df4b80 languageName: node linkType: hard -"@cspell/dict-companies@npm:^3.2.1": - version: 3.2.1 - resolution: "@cspell/dict-companies@npm:3.2.1" - checksum: 075b288d26058fc6048ecc3860feffff4f2b819ccca439b73e6e367bf56b166308b51180c0a519f8ca965f03caf5c3adab8becba30c3ab0ff641c2e3b14e79cc +"@cspell/dict-companies@npm:^3.2.2": + version: 3.2.4 + resolution: "@cspell/dict-companies@npm:3.2.4" + checksum: 7d7c1e0936f4000b5865d920e8d57e5d865d1d69c9acca8aac32d1d3fb118b772a6099f7c0e12b78db1aa9fc787b1a44a271757da37af8a6f569b6543f30e06d languageName: node linkType: hard -"@cspell/dict-cpp@npm:^6.0.8": - version: 6.0.8 - resolution: "@cspell/dict-cpp@npm:6.0.8" - checksum: aaba5ce7e152f676ba4cc3ac02ce3cb32545e20412abad59cbb4a41419fcd8b7cdef72da86c3a47eb5c20b6960eb6499195b51d805d830c88dbf2d4bbe68109c +"@cspell/dict-cpp@npm:^6.0.9": + version: 6.0.9 + resolution: "@cspell/dict-cpp@npm:6.0.9" + checksum: 743bf1f12d8e70aebec525f648c657abe0bbad637c515ac27f16e3eee4ac258741cafd4997fe1021b1f9a14e1983bc91e7de38fe95b889675e317581b22b0b48 languageName: node linkType: hard -"@cspell/dict-cryptocurrencies@npm:^5.0.4": - version: 5.0.4 - resolution: "@cspell/dict-cryptocurrencies@npm:5.0.4" - checksum: 54229c432f70320aa060c5c101a242e64f40f1f5b8404d1e2a5afc867e2f1cb862e1d84b3383c4bdfa3768302cca49f51bf8ea78c5509113b4a1e18ff00abfae +"@cspell/dict-cryptocurrencies@npm:^5.0.5": + version: 5.0.5 + resolution: "@cspell/dict-cryptocurrencies@npm:5.0.5" + checksum: 93dd23accb42b384fc3153e1423d39f14f88d141f7eabdc68231785b2b352125cbab3a5b6ae2532d2007bf48d70f45887cf22873b5b4654766aa22e1b6fd97a0 languageName: node linkType: hard -"@cspell/dict-csharp@npm:^4.0.6": - version: 4.0.6 - resolution: "@cspell/dict-csharp@npm:4.0.6" - checksum: b86a3c0da979bbc9e0de9d4e9a83158190ac4bd454534ace3d2e48e4162eb1915e1f2f70e017e6df25eb3c017053d745897ad46a3c8d1357fdb4a2723e545154 +"@cspell/dict-csharp@npm:^4.0.7": + version: 4.0.7 + resolution: "@cspell/dict-csharp@npm:4.0.7" + checksum: bfc429fc40585905a1b8754eaf1c70fd59911250364bc8ec5f1ce81dfb38cfb27421a8ed4052d81b40832dfb26de8d4e63656a200c5a6459ad0fa9da8e8bb6ae languageName: node linkType: hard -"@cspell/dict-css@npm:^4.0.17": - version: 4.0.17 - resolution: "@cspell/dict-css@npm:4.0.17" - checksum: 5ace777f44962b3a155a5194c17cfc81f79701d7e52fa626064902d33821f1f15e277a779355c08153aa7b8118178d96d6b004349492e630b94264070549492d +"@cspell/dict-css@npm:^4.0.18": + version: 4.0.18 + resolution: "@cspell/dict-css@npm:4.0.18" + checksum: 9c3ebe4d7c99068ea41a27b574d1d7fc5befc01dfdb82879b3dfa3457e07bef49975252ca80a1d4f0701ae038cae6fdb99306c1606d0e18ff0b93a5d8ad806ce languageName: node linkType: hard -"@cspell/dict-dart@npm:^2.3.0": - version: 2.3.0 - resolution: "@cspell/dict-dart@npm:2.3.0" - checksum: 9ae3c33585959bcdf2886bd2cbf81a05d36872d8d3a7bdfa72ab3c97549735abf9b82e1aa47c3590953a4621c0250b04fb1330b23d8030a1ae86ac3a6d68b26f +"@cspell/dict-dart@npm:^2.3.1": + version: 2.3.1 + resolution: "@cspell/dict-dart@npm:2.3.1" + checksum: 79764a0499a0267c34febc368ae8dfb47ebe58a79373e48070581a3a8095102a71e8cb88711b7dd431ca559d0d0554803ca2d53051e325903459a670f56c984f languageName: node linkType: hard -"@cspell/dict-data-science@npm:^2.0.8": - version: 2.0.8 - resolution: "@cspell/dict-data-science@npm:2.0.8" - checksum: bfafb9cf0892a207eb0aa00aac25a4c88387791530adf87e5d34ad6609c29ed250cceb0774ea126723310e16a2aacf31fa56992da0ceab6f7e40c6963905a8b0 +"@cspell/dict-data-science@npm:^2.0.9": + version: 2.0.9 + resolution: "@cspell/dict-data-science@npm:2.0.9" + checksum: f5c02e9be57093993e6764ac74c940003beaff67637bf69051f3a6c9c27fee9ed58e01b2f4134297aa75c1f4d24ca09d15f5e94b87b7f3dce05532dfbd6e030a languageName: node linkType: hard -"@cspell/dict-django@npm:^4.1.4": - version: 4.1.4 - resolution: "@cspell/dict-django@npm:4.1.4" - checksum: 70dca29f5dc7a774a4a64bc1ce70c677108cde6364520b58fab8ff0fb944632b024d5904339063a08a879a1b396b98d7e6a46ead18bf901b35651199ea0bbfe3 +"@cspell/dict-django@npm:^4.1.5": + version: 4.1.5 + resolution: "@cspell/dict-django@npm:4.1.5" + checksum: 873d287d70f65070fddd9fa46ee8a48240f50d14c2f0cb141abd941524ac3223569e610e0e6c9fba5768d0f09d60b8b467ebb91411c49caf4e2f82625913d084 languageName: node linkType: hard -"@cspell/dict-docker@npm:^1.1.14": - version: 1.1.14 - resolution: "@cspell/dict-docker@npm:1.1.14" - checksum: 4eb96da9d9912bbbc8b3522ac58e5f65b77b72aa2e5b2bdffbc604b6ece9dedfa7a4643beb71ede9e15e78735f9c13ff705b7243872eaedb11a83f4f06a3d6cd +"@cspell/dict-docker@npm:^1.1.15": + version: 1.1.16 + resolution: "@cspell/dict-docker@npm:1.1.16" + checksum: dc126d94203fa23c0a9d1466fa634b1ee4b4770d5762dbbbc868198318cf8d860de26d1632700a3e613eb81d27d0e46c72cbf74ba0cca5cca0032dbf056ae472 languageName: node linkType: hard -"@cspell/dict-dotnet@npm:^5.0.9": - version: 5.0.9 - resolution: "@cspell/dict-dotnet@npm:5.0.9" - checksum: 2fefb4593b2621cdf5bc3413aa364b788abc6a3693e629833d74c230a4fa7b7b2dd5c4245165231aedf59f75db29b081ecf15beb5a96c18242042298411ffcac +"@cspell/dict-dotnet@npm:^5.0.10": + version: 5.0.10 + resolution: "@cspell/dict-dotnet@npm:5.0.10" + checksum: 9bb78164917a9e72a1f3f44dd3b00bb30b3daff618ba5b55588653a655b5dc2ae56c77c1dd250c74e8f534a9fa8d2c56f5552115ebca05955e4f012d58f9694e languageName: node linkType: hard -"@cspell/dict-elixir@npm:^4.0.7": - version: 4.0.7 - resolution: "@cspell/dict-elixir@npm:4.0.7" - checksum: c4b717617603eb6b0b9d3d785f4917b34d187fe1f97e4a65147907da440df2b0a878f6382b621914e3a40336d613d24f011fa17c32aab31ad7183e0f065d8721 +"@cspell/dict-elixir@npm:^4.0.8": + version: 4.0.8 + resolution: "@cspell/dict-elixir@npm:4.0.8" + checksum: fad21bd31eb5826b18fbf11a4ff7d9e600cb662c1c2f70306212d8a95bf76f50af1cd74ba880fbb0c813537bfe29477b8a52bc67a6c136557fd909713f0ca664 languageName: node linkType: hard -"@cspell/dict-en-common-misspellings@npm:^2.0.10": - version: 2.0.10 - resolution: "@cspell/dict-en-common-misspellings@npm:2.0.10" - checksum: 3307bb6740b024857a000e2226809c979db88251691a9706ddb72dd55d18b4bb376dabdbd0c466e8878f236b75cbe2c62cde3223abab8e56ae766944f2e0a5ce +"@cspell/dict-en-common-misspellings@npm:^2.1.3": + version: 2.1.3 + resolution: "@cspell/dict-en-common-misspellings@npm:2.1.3" + checksum: af56e0bf00629fc1d9e1b81f3019facd85837db3de7df6ed9cd1838e81822d6545f5e74ccb27d157221ed1a08e12dfedaa404ee4f499f8faf80a90ab86860613 languageName: node linkType: hard -"@cspell/dict-en-gb-mit@npm:^3.0.3": - version: 3.0.3 - resolution: "@cspell/dict-en-gb-mit@npm:3.0.3" - checksum: 5625de2615ac2be8c048dde8169ccbe5bb1c5fde531f77b8d8ff4d9031737db605aa089be264a86dcf7bd632a8d1a3643c5224b478cb0f32801d22ea136ac13b +"@cspell/dict-en-gb-mit@npm:^3.1.5": + version: 3.1.6 + resolution: "@cspell/dict-en-gb-mit@npm:3.1.6" + checksum: cdfb51de8d344221b257b696f3d437beadd73b423129b3840f9b6ef6f7c37447bf71ce524f0716ec4052a15a7ad259f9cbd7e9c99ce11ba1bf413ea7d0694579 languageName: node linkType: hard -"@cspell/dict-en_us@npm:^4.4.6": - version: 4.4.6 - resolution: "@cspell/dict-en_us@npm:4.4.6" - checksum: defd5bd0799f7d32507083b4b411a903ad85ad154d9bbbb9006018edfcedd5da9d4ff41cda242692a39bf66109cad4374aabe29100940963e80ff241dab53724 +"@cspell/dict-en_us@npm:^4.4.15": + version: 4.4.16 + resolution: "@cspell/dict-en_us@npm:4.4.16" + checksum: 2790f892d62f43ca9abe5a3b0b23b5688eef34f4359335cd4f9b2df7a309b4be1657f632a8a5fb3a49c4e477a30db3199457bd20c1b0b15e2267a41cd4b6fe34 languageName: node linkType: hard -"@cspell/dict-filetypes@npm:^3.0.12": - version: 3.0.12 - resolution: "@cspell/dict-filetypes@npm:3.0.12" - checksum: f60959e7b72e9a4d5e2cd0cffe80cf3335184d2a303a41aaef046905097deab627ed1e30a93b92040e1ddcb53e4bb24cd7c1547c4ae906ab1af2840d8d44d2f9 +"@cspell/dict-filetypes@npm:^3.0.13": + version: 3.0.13 + resolution: "@cspell/dict-filetypes@npm:3.0.13" + checksum: d8ffa9e72b82dc0ee8fc05440175c898d363552fa769b4b6cb5c5544f47bcbc50b4761a97c9b835e182aaade0ca86df64984058342e46f41a4225dfc45502b6c languageName: node linkType: hard -"@cspell/dict-flutter@npm:^1.1.0": - version: 1.1.0 - resolution: "@cspell/dict-flutter@npm:1.1.0" - checksum: b8944d7c91b8617727dcca2191e2bdea4e97a3c2e76e6b8e015805f31dac99040da8ef74035c917c77646dfb19f1efe916d51e5171c54209850daf4be0db046c +"@cspell/dict-flutter@npm:^1.1.1": + version: 1.1.1 + resolution: "@cspell/dict-flutter@npm:1.1.1" + checksum: 1ba1539d740093da234606ae3110498669ef230fbbfdc3c97ca5560008619ce8a757442846b594900a5d85d0a4e68263bf7f2d4949cab930361fa1056a237d3f languageName: node linkType: hard -"@cspell/dict-fonts@npm:^4.0.4": - version: 4.0.4 - resolution: "@cspell/dict-fonts@npm:4.0.4" - checksum: a339339f80c40256d53a7ca4c85f58e31b8d32c9dc2b25564f45c11e258da2435933e00b52066ee8543ff3e12469d8e2ab6a3d7b1684850c2f1c4c58d9d9a239 +"@cspell/dict-fonts@npm:^4.0.5": + version: 4.0.5 + resolution: "@cspell/dict-fonts@npm:4.0.5" + checksum: e7f1ae6bd64f93812ef849a0d8efaa7716127262bb47f54c2b600f7b15dc0e02c54b63fbb066150046b15acbedafe431b7504d1851b8e3c1083ae492ac3c228e languageName: node linkType: hard -"@cspell/dict-fsharp@npm:^1.1.0": - version: 1.1.0 - resolution: "@cspell/dict-fsharp@npm:1.1.0" - checksum: 2f667bc9ef55034a603147404f9e55a29b68210acd84938695404d12ede34a060202d109a8c2deada5c863b75b8b5946c2f74e583be18c2e9727423563d914db +"@cspell/dict-fsharp@npm:^1.1.1": + version: 1.1.1 + resolution: "@cspell/dict-fsharp@npm:1.1.1" + checksum: f83b49083cfa6101ebb5bef67f3128c5c14f7d5005d6981e41c4a317bebaa5672431fcb0699b3f345c69057921b2b59bc34721ce5a63b481b4f6300ca7f77868 languageName: node linkType: hard -"@cspell/dict-fullstack@npm:^3.2.6": - version: 3.2.6 - resolution: "@cspell/dict-fullstack@npm:3.2.6" - checksum: 10d562bf2126a660542a2e82f684240791a9064e50b4de8150f9e3d478791314e41422e3fee2e38596154e71dd963ca4088f2c730575b5959d758c27186c2c67 +"@cspell/dict-fullstack@npm:^3.2.7": + version: 3.2.7 + resolution: "@cspell/dict-fullstack@npm:3.2.7" + checksum: 2743f2d07f8336e18c0a18a2f8e274d97b50122bfcaa5d536ba78cfdde41fc894eb7e42fe7474692a34a61a39afe8e7a818bb9a5586e1b721e660751f444cf39 languageName: node linkType: hard -"@cspell/dict-gaming-terms@npm:^1.1.1": - version: 1.1.1 - resolution: "@cspell/dict-gaming-terms@npm:1.1.1" - checksum: 9ca5a3b319924a4dd0eb53aeaa691cf2002c58a990c981a87ddbc64b0b95d1145b1b0aafca749f25f2bc0e2071efa95fe623ea17f587a79b2399da444abfce91 +"@cspell/dict-gaming-terms@npm:^1.1.2": + version: 1.1.2 + resolution: "@cspell/dict-gaming-terms@npm:1.1.2" + checksum: 023a2f819dfdeddf879e7fb4b68a1db9728da1aa1a87e14f2b08f624c28d0915d2722d2a46f7ad8cbc32c7be0e42966ad6192f6c75e0f2053a9a15fc95fa34af languageName: node linkType: hard -"@cspell/dict-git@npm:^3.0.4": - version: 3.0.4 - resolution: "@cspell/dict-git@npm:3.0.4" - checksum: 23519344e5873acbae47fbc60b3cbdf60ff350ea1dc09518f5b66605cd7409d854cd692127243e9d6912503cd644307e9c7ccbb0730becd9871fa52ce0f7c3b6 +"@cspell/dict-git@npm:^3.0.7": + version: 3.0.7 + resolution: "@cspell/dict-git@npm:3.0.7" + checksum: bf88770be43c1bd4c2bea6737edd20939a78b7c0e9ff28e06490394f056637a27f49a6716e0f6ed845eaf2fc1afa85d4bd7cfafb56e3d4dfeb491b49669fd376 languageName: node linkType: hard -"@cspell/dict-golang@npm:^6.0.20": - version: 6.0.20 - resolution: "@cspell/dict-golang@npm:6.0.20" - checksum: cf8e459deef3a137676103cb460cdcc5de8b5d6695b8b6f2761b8d8a7aceef262e1d6c5b5eb052740900c92e7c42059a27696ac0b42714d6360ab07a590d996f +"@cspell/dict-golang@npm:^6.0.23": + version: 6.0.23 + resolution: "@cspell/dict-golang@npm:6.0.23" + checksum: 0cdfe3ed9245b9e0d5a26c72371b38dca86d4de7e016dc37e499ea98147626184c211dd4dd9efe3a533444391ce45259783d640ef8f2daf7d75c964ba53ab697 languageName: node linkType: hard -"@cspell/dict-google@npm:^1.0.8": - version: 1.0.8 - resolution: "@cspell/dict-google@npm:1.0.8" - checksum: ca6def5dd777e9a23e0236c134abbe800e6d1df3721512147ca30516bc097d6b7ddbe0e9f351c1cf85b4ca11ab7148686cc20c3f24e9f82984dc98e698a13401 +"@cspell/dict-google@npm:^1.0.9": + version: 1.0.9 + resolution: "@cspell/dict-google@npm:1.0.9" + checksum: 61a0ed9ca85151163aaf95f866b2fd53b21edb585c082f38bc81e7db839b3c6bb7f69c82da490c53f7d06099783cc88e4591e1c17416f200d6cf5e73e6b827da languageName: node linkType: hard -"@cspell/dict-haskell@npm:^4.0.5": - version: 4.0.5 - resolution: "@cspell/dict-haskell@npm:4.0.5" - checksum: 4f663d904c17f760e10f457669665e2a4c205ef27389e82e61b4017c1bfd1e446db7401ee5fcca74a9441135ae17130e8f92601bdd6b0837850f0636ea170088 +"@cspell/dict-haskell@npm:^4.0.6": + version: 4.0.6 + resolution: "@cspell/dict-haskell@npm:4.0.6" + checksum: 510ce26a6d34dfa829278a59bedea4c4712b3a0c9430f19b7101597f0a9f26302dd6266a6ab938bfc2d67d08a04148beda68bfcd0589d1c990075a21d52816de languageName: node linkType: hard -"@cspell/dict-html-symbol-entities@npm:^4.0.3": - version: 4.0.3 - resolution: "@cspell/dict-html-symbol-entities@npm:4.0.3" - checksum: 0cef821bf2400a3f8b0d3c94eb8c5de531cbf3ed409d95faf5aaa7f272774ab1e6fa0f315c0902cc661d81bf52075f134b7687bec9c9f1184d176517b3781671 +"@cspell/dict-html-symbol-entities@npm:^4.0.4": + version: 4.0.4 + resolution: "@cspell/dict-html-symbol-entities@npm:4.0.4" + checksum: 1898fc84496526e9c54e125369f3c87412839aee3e00da8aee3fee1c1165d4f2e7944833398b08f07ee58e817999af462f254e9ce06b06323fd665cbe6d01a3e languageName: node linkType: hard -"@cspell/dict-html@npm:^4.0.11": - version: 4.0.11 - resolution: "@cspell/dict-html@npm:4.0.11" - checksum: b3e5b17c3e3d014b79c324fbe297ed24043695c6defe2d9359d3fde2430b035e916c107b63c8b76ba579a61045b0cd5fe2e856288b70d9b5f5db955a91ce55ea +"@cspell/dict-html@npm:^4.0.12": + version: 4.0.12 + resolution: "@cspell/dict-html@npm:4.0.12" + checksum: 5441fa727bf6fc49039c9051d40b8fe4c05712f5a21cfa267affb0537f02400ffd23dff12a4bff69702996d1038c331f13a2071ebcf1235b1a5679ae2c527d0b languageName: node linkType: hard -"@cspell/dict-java@npm:^5.0.11": - version: 5.0.11 - resolution: "@cspell/dict-java@npm:5.0.11" - checksum: 0fa2f3ae5c9e9d61c38d550cc55c933f6e75ef4a340c9fcc39ce99ce0844121dc2cdc8436f4e53707eb7aff6a43693766e47d6aa127800bf986c5de143e8bb30 +"@cspell/dict-java@npm:^5.0.12": + version: 5.0.12 + resolution: "@cspell/dict-java@npm:5.0.12" + checksum: bcbb2b92aa2c2703db5a2de8990733dbcf4c0febefc9e438f4c71677298806c46ed9bdaab61533b4c8665c82441cbb7a740e124128a346c13d8d9fd48d67599d languageName: node linkType: hard -"@cspell/dict-julia@npm:^1.1.0": - version: 1.1.0 - resolution: "@cspell/dict-julia@npm:1.1.0" - checksum: 2a978c8ffdd98339c45ed666818a65a367f4af3190fa7ea807a37f55bc8a9b41b19d707b6e7b438f58faaa4e29444f871a1c8df5af546f77303ba7fc2d0f4d78 +"@cspell/dict-julia@npm:^1.1.1": + version: 1.1.1 + resolution: "@cspell/dict-julia@npm:1.1.1" + checksum: 1dac60ea3a13dfaef5670812a8fd2e224225e9ca595a18a8b886eb29c86adc0645e234931af8a0110a4a5c08706e3c42c69b15f3e253c4305332268cfa414f36 languageName: node linkType: hard -"@cspell/dict-k8s@npm:^1.0.10": - version: 1.0.10 - resolution: "@cspell/dict-k8s@npm:1.0.10" - checksum: 7cc4eb5f9de33b956ab8203a020cd3322d9107b1732069afc77a54ceb3c7fcfc9ea9de4cc28ac14670f36d78278afd749292e64f2642a2d96f7cea11eea0ffa7 +"@cspell/dict-k8s@npm:^1.0.12": + version: 1.0.12 + resolution: "@cspell/dict-k8s@npm:1.0.12" + checksum: 742e068d64e83ce9948b1551e400a99d642fc8d83992736235769ee6d3ebc5af838a99d9ed435544a31d31e0a54a190aa442cc41abad80e896917ee1277e577d languageName: node linkType: hard -"@cspell/dict-kotlin@npm:^1.1.0": - version: 1.1.0 - resolution: "@cspell/dict-kotlin@npm:1.1.0" - checksum: 6127b64037e9c4f0be49fd9be3435c999361001cf52dcf6f47f0467add55df4ca95c0a0056b4bfdcdd1363132892087a30475a664e2176bc487311346a22474e +"@cspell/dict-kotlin@npm:^1.1.1": + version: 1.1.1 + resolution: "@cspell/dict-kotlin@npm:1.1.1" + checksum: 8822138c76a1f6bb54ec33e470fbd403086a20532101bd9adf4e59464772266da0e379758a490d9ab87a9e0b89ca13e968f48f71334dd0b6881b4ab05bf6cc9d languageName: node linkType: hard -"@cspell/dict-latex@npm:^4.0.3": - version: 4.0.3 - resolution: "@cspell/dict-latex@npm:4.0.3" - checksum: 948f74d411d76dea1180e66576ce6297cf520fe7eea12b6fce46f07844229750917e42c538929d8be62d04e1ff4cbeeb7c770999327f179cfeef68eb373d3586 +"@cspell/dict-latex@npm:^4.0.4": + version: 4.0.4 + resolution: "@cspell/dict-latex@npm:4.0.4" + checksum: bca63e4a3fa1137d40892f0bbc05db12be3f99ea482f2b9d46db4119be040e9a0462c3c71515319d97fe728243d85a51ab15430f2914ec9d41de4ebc23eac0a1 languageName: node linkType: hard -"@cspell/dict-lorem-ipsum@npm:^4.0.4": - version: 4.0.4 - resolution: "@cspell/dict-lorem-ipsum@npm:4.0.4" - checksum: f75cca35d89aa407a21875b2c58b5c959c0a06aed1aaea4a8b91a7e42e3d83ae1604a735e184cc7b4b3c294189013be5f46888ee46526284f99b21da391a8ef6 +"@cspell/dict-lorem-ipsum@npm:^4.0.5": + version: 4.0.5 + resolution: "@cspell/dict-lorem-ipsum@npm:4.0.5" + checksum: 7f4be03a7d2bfe9128f4f7d1f04b5cf5d525db2ffa86f1c3ca9ae7b2ccd774cd56dee9ede23d0291c502e365d7de925f5bf210ab4b5b745b0459fce13fd38820 languageName: node linkType: hard -"@cspell/dict-lua@npm:^4.0.7": - version: 4.0.7 - resolution: "@cspell/dict-lua@npm:4.0.7" - checksum: ef1ad0f059f5e2c99e6741633c75ed59640bd4c3b421c8c7af124facafc9c4ecb578e1bfe2a180d63e0063c508dec31db2615a864744c2737ed0d47fa4daaaad +"@cspell/dict-lua@npm:^4.0.8": + version: 4.0.8 + resolution: "@cspell/dict-lua@npm:4.0.8" + checksum: 3e0255147637c2df83e5eea7da70e5ccddd0be873123c79da1f12b9f590b1e516a27448be3cba31529ffdea769a5de866caa5d55f9d9a49026f0ceacebd9b3ba languageName: node linkType: hard -"@cspell/dict-makefile@npm:^1.0.4": - version: 1.0.4 - resolution: "@cspell/dict-makefile@npm:1.0.4" - checksum: 1aece9d61e21aabaad8cd8048f7647739d6a48ab532b4637b72b53d4360dc6780dc4be35a14de541a3dd05b076efd9f106af83fa0e7ca3ae149c86143a72b96b +"@cspell/dict-makefile@npm:^1.0.5": + version: 1.0.5 + resolution: "@cspell/dict-makefile@npm:1.0.5" + checksum: bde75e635750234aa4e47e6904c5c5ffd9ede4c503daa015b085830414edf40860cfdbd04b1aa81b7b433f11abaab7d244093ba667e1124e7595777cc5dccf96 languageName: node linkType: hard -"@cspell/dict-markdown@npm:^2.0.10": - version: 2.0.10 - resolution: "@cspell/dict-markdown@npm:2.0.10" +"@cspell/dict-markdown@npm:^2.0.12": + version: 2.0.12 + resolution: "@cspell/dict-markdown@npm:2.0.12" peerDependencies: - "@cspell/dict-css": ^4.0.17 - "@cspell/dict-html": ^4.0.11 - "@cspell/dict-html-symbol-entities": ^4.0.3 - "@cspell/dict-typescript": ^3.2.1 - checksum: a43a64a7c44c92572142ce5bb9efa08d4303d9e54e7141d46aa238e7b105fb022adba840ec7facbdb7d9f195a344793e98a16553c3070ef6b0f0916430814abb + "@cspell/dict-css": ^4.0.18 + "@cspell/dict-html": ^4.0.12 + "@cspell/dict-html-symbol-entities": ^4.0.4 + "@cspell/dict-typescript": ^3.2.3 + checksum: 20f9510b808a2b394ebae83257569c76ce23883f3902e32ffea5ef83d645052b7fba500e2c4ab96e669c93c250158327330a34453657bf2b6162e9d303148c44 languageName: node linkType: hard -"@cspell/dict-monkeyc@npm:^1.0.10": - version: 1.0.10 - resolution: "@cspell/dict-monkeyc@npm:1.0.10" - checksum: 670443bfc5be5d69a5b4bc22330191f586bbfd29220c00d69473eea4f2c0c94321b42d83c74e98fde6fc0fe4e933425dcffa2941b62111326b50effd101fb2d7 +"@cspell/dict-monkeyc@npm:^1.0.11": + version: 1.0.11 + resolution: "@cspell/dict-monkeyc@npm:1.0.11" + checksum: 6e896fd9596261ece639cdad4d03291f4faf92ed27d9257aae1f34f075b13a865287734d170a2e9ea228ac2b7de03eaaec795284b945c8a96ac24684ad56ba7a languageName: node linkType: hard -"@cspell/dict-node@npm:^5.0.7": - version: 5.0.7 - resolution: "@cspell/dict-node@npm:5.0.7" - checksum: 14d4dbec893a57d2c25478ea5a9b649576f9f67a7de7dac93f82b80142c10eba5bca8c6b9608ff167d54a3086f24342398a3dc952e2180adfdf0406ebd5f6c05 +"@cspell/dict-node@npm:^5.0.8": + version: 5.0.8 + resolution: "@cspell/dict-node@npm:5.0.8" + checksum: 0f6e09a50b432386a09d79ebdfa7d6281279fc8c1ce5bdb6e3f6939a38265ffa2899b57811c3673d0aa31187f57eee9c7bfbf059a2b1d1d6d98f5e4495fcdf93 languageName: node linkType: hard -"@cspell/dict-npm@npm:^5.2.3": - version: 5.2.3 - resolution: "@cspell/dict-npm@npm:5.2.3" - checksum: 86beecc3e409ed8d2f977bfc9d9341f8b6764ca9dba6c342d1c25b9948c90accc757f24b6da955eaeddd104a6493f087271fb4e4ce298074ff511d82d2401402 +"@cspell/dict-npm@npm:^5.2.12": + version: 5.2.14 + resolution: "@cspell/dict-npm@npm:5.2.14" + checksum: 59ef1f0d0f1401246d0b2824bb8ff3fa494ceecbd7cf085d56136af9de74fe0d9bc3f209b2e423ad7490db86f9be5e09a6711905c59ebdf961b413b48d22c9fb languageName: node linkType: hard -"@cspell/dict-php@npm:^4.0.14": - version: 4.0.14 - resolution: "@cspell/dict-php@npm:4.0.14" - checksum: b079e928c00e187cd1ac242ab3ff88a09d12f726ee590d01205c829c417c1c6803e3453ce3174546c25e66aef8c4512e46b3ea55a1f907e684f9a5488a454204 +"@cspell/dict-php@npm:^4.0.15": + version: 4.0.15 + resolution: "@cspell/dict-php@npm:4.0.15" + checksum: 45c25abae5262d2acf03d79914ee6bd82e80fe60c36d6e39b6a403575b5ca902e07a7737f87816d146135cabf2df56262a5fd8ec6dedb573504f116a627e3f83 languageName: node linkType: hard -"@cspell/dict-powershell@npm:^5.0.14": - version: 5.0.14 - resolution: "@cspell/dict-powershell@npm:5.0.14" - checksum: 7d527250933e8597ee2b694e70d7abf094b3ba5a2058b37934423cb2cb13384f7d79ca660ff723bea2c80390d5a30948e065369bfd2de1cc4281172b703d711f +"@cspell/dict-powershell@npm:^5.0.15": + version: 5.0.15 + resolution: "@cspell/dict-powershell@npm:5.0.15" + checksum: 3e46e0e98d92e42d34eb297d6e1626bea15e4ad6774b3f855f07e02aa1f458e9e77ae33602a0ed604f8009a2b842d4fffe5a2ee6b9884c2b63b45799003120b9 languageName: node linkType: hard -"@cspell/dict-public-licenses@npm:^2.0.13": - version: 2.0.13 - resolution: "@cspell/dict-public-licenses@npm:2.0.13" - checksum: f3aee5da76fca275c139a4a08b46cbfcb41e14cfb2c0933e413b2b3ef116f0421b34f8bd478d6fae69b199ea19ab3f46353c9aae4231492169fdf09823bcba32 +"@cspell/dict-public-licenses@npm:^2.0.14": + version: 2.0.15 + resolution: "@cspell/dict-public-licenses@npm:2.0.15" + checksum: a8580441c964a8c3ce4c4fed74189fa5752eb98e56baeb2608753e4deefb202c8f9d9f1869e17c5f2f1fc7bb1976854525ac50750109bb377b4cfa0a4eb12fe2 languageName: node linkType: hard -"@cspell/dict-python@npm:^4.2.18": - version: 4.2.18 - resolution: "@cspell/dict-python@npm:4.2.18" +"@cspell/dict-python@npm:^4.2.19": + version: 4.2.19 + resolution: "@cspell/dict-python@npm:4.2.19" dependencies: - "@cspell/dict-data-science": ^2.0.8 - checksum: aaef8f52f7d805956748cf82c07bb99f39f2bfdf87b652b76546a8f87aba9b395f3943a7630a30c4605e7220e437be70dc0023842f6d646b79a9037a047ca9fd + "@cspell/dict-data-science": ^2.0.9 + checksum: b46d9d608bc57a0e0564c052290309604ddcd9b9b764d77b70d29860c89e76e548bd9d97553fd34ac7af635c393908be2d16b2e5743f70b1b180b51b3116926b languageName: node linkType: hard -"@cspell/dict-r@npm:^2.1.0": - version: 2.1.0 - resolution: "@cspell/dict-r@npm:2.1.0" - checksum: 5ba48ac82578feade56196fa6c236a2bbea5555ce9cade2966a0c2bbd676b37aeac06556079ca7a306189ff8e9f811ca4c1b01c58ddbcdda447a9434277792c9 +"@cspell/dict-r@npm:^2.1.1": + version: 2.1.1 + resolution: "@cspell/dict-r@npm:2.1.1" + checksum: 70ac0a26fdd753633e2e1817f3ac0c475a5a0d92641ce2032fd5745d8fe32ca9f1d87b6d1318302b87e8a699229f2593db75f9618d0bdfb7809f0b331516efbf languageName: node linkType: hard -"@cspell/dict-ruby@npm:^5.0.8": - version: 5.0.8 - resolution: "@cspell/dict-ruby@npm:5.0.8" - checksum: 62734eb3a5178e6dee5feeff8e4a59b8da42e64f895191e765a2ec134c9da54480967e355766ee4440f5a912eecdfb37d97c377351c526fab7a07bc38a03659f +"@cspell/dict-ruby@npm:^5.0.9": + version: 5.0.9 + resolution: "@cspell/dict-ruby@npm:5.0.9" + checksum: 57a752ff19f9484a042e859254eb6d487b46266f374faeb17e257b3583d94fbd908c0bd308e2a7d3b0169839cdd5a6d9fc12563955b69f26e8667acc43fbfd53 languageName: node linkType: hard -"@cspell/dict-rust@npm:^4.0.11": - version: 4.0.11 - resolution: "@cspell/dict-rust@npm:4.0.11" - checksum: e336ad35129660bfde98efa9498a0b7237374ee9026baf7366a52f73f5c1a85cd0ed9dffcead7af2350155456ba8f1157d63dd17061a6187d1eabedaf33372ef +"@cspell/dict-rust@npm:^4.0.12": + version: 4.0.12 + resolution: "@cspell/dict-rust@npm:4.0.12" + checksum: ba928f5538e09887f715713a6899d09ed7b1663c85d33c766adbaf22a95e01fa71d3736d5ff17c3c0f0a387c43756702fb1529e62e714ddec0df6cde9617ad20 languageName: node linkType: hard -"@cspell/dict-scala@npm:^5.0.7": - version: 5.0.7 - resolution: "@cspell/dict-scala@npm:5.0.7" - checksum: 2eed66e8fc079995c5c7d47ce81e02b2a0312a33aa941253c727cf2ee3da8e43efc335b995f497277b919293545d8b9f71bc3181dfa694cacd9ebe79b5312cf0 +"@cspell/dict-scala@npm:^5.0.8": + version: 5.0.8 + resolution: "@cspell/dict-scala@npm:5.0.8" + checksum: f105f3fe9bca5bdeb71fcb0050ebd7a1156f321d21e0d67d428ea4d285d378d0d0b4911e407796676eb49ac39b38075fcf64eec6169caf0e242cec111c3924cd languageName: node linkType: hard -"@cspell/dict-shell@npm:1.1.0, @cspell/dict-shell@npm:^1.1.0": - version: 1.1.0 - resolution: "@cspell/dict-shell@npm:1.1.0" - checksum: bb583a25cc955d89b7f0523fa46cd10b5ac0f3395addb2592f59e7e2fdfa03df4c3eb485c4c36fd79d58578711e083ea22f8ab794a4deb9ae31a186eef959eb0 +"@cspell/dict-shell@npm:1.1.1, @cspell/dict-shell@npm:^1.1.1": + version: 1.1.1 + resolution: "@cspell/dict-shell@npm:1.1.1" + checksum: 4fdd6c2fb623b3a72f4e46bfc55113799fbe79141bbbc85384cc1b0e9ae7699d2bbedbfc2749dd8bad977da856f0dda10c5e08fedf3d0822a2eccfeee9e4116c languageName: node linkType: hard -"@cspell/dict-software-terms@npm:^5.0.7": - version: 5.0.7 - resolution: "@cspell/dict-software-terms@npm:5.0.7" - checksum: 1b64c5fe8f70b239afa604537505ff129f88f15c023f240afbb8763614117cbc7073edeeb1aa48b8e0b249b3a79afdebab9c75e68b72eab33fce88a77ee5378f +"@cspell/dict-software-terms@npm:^5.1.4": + version: 5.1.5 + resolution: "@cspell/dict-software-terms@npm:5.1.5" + checksum: 8aa3a101f7656bde09d301bcb1a4a620aeaa38eb8ff8fe65d64198e11e6857d8eb7265414f4084177941385a601f72794154fec66fbeff272ecbca891642861e languageName: node linkType: hard -"@cspell/dict-sql@npm:^2.2.0": - version: 2.2.0 - resolution: "@cspell/dict-sql@npm:2.2.0" - checksum: 46a02b2a8086802aaf5b81d7570c56a73f4bbb59ffc97823c41041521a33d85d6f0b065753bbc11776f670fc98846c28ee9496cb03c79f0b87f361f9ffd3c03d +"@cspell/dict-sql@npm:^2.2.1": + version: 2.2.1 + resolution: "@cspell/dict-sql@npm:2.2.1" + checksum: c898c8f23e613ad1708dd92a8fbe5dac10e048ae8584a42c570697046c8841aa0518e10435fff34b9bdc84bb0cfd6a5307c990ed16f36253a0f2c31f739d3dce languageName: node linkType: hard -"@cspell/dict-svelte@npm:^1.0.6": - version: 1.0.6 - resolution: "@cspell/dict-svelte@npm:1.0.6" - checksum: b6c4fb7738cc3070d3d6aa843e9a0ef9783a8e64368d0d4e0689e4680f6640760feb03db6c20e3a997d72381938cf669359e1d2730a1d14a6daa014c324ad160 +"@cspell/dict-svelte@npm:^1.0.7": + version: 1.0.7 + resolution: "@cspell/dict-svelte@npm:1.0.7" + checksum: ca739512b762731f7840243e0833bd135328cbef529d07803bc7b49a2452b1592ed318b80e55bb38caf807d51dd949029c7586a80529c6b942ce6a33842ca586 languageName: node linkType: hard -"@cspell/dict-swift@npm:^2.0.5": - version: 2.0.5 - resolution: "@cspell/dict-swift@npm:2.0.5" - checksum: 09c84f12840f1ef000c0a775ba94ee49e7726d552744be4f21000a8fd45ac7608d4142f8cd9e28a111ac9afd0c0a657183cad35ff899178c02254c27593c3704 +"@cspell/dict-swift@npm:^2.0.6": + version: 2.0.6 + resolution: "@cspell/dict-swift@npm:2.0.6" + checksum: 89ba40dcc7b54cc1af07560b69a9418a8c8c275da9cf64e0cf94e1052930bf360706575db59eb3237c8210073fa0ff87511012958d355f67ff3735138782f26d languageName: node linkType: hard -"@cspell/dict-terraform@npm:^1.1.1": - version: 1.1.1 - resolution: "@cspell/dict-terraform@npm:1.1.1" - checksum: 0843bbb0e3142caa6f878bde7850683913ffc7501a7c468ba6c0ff14e98c6938c86da04d1ed9a4be161b5b0a22d16bdc7947aa2a02b6e0268939defb9ae96529 +"@cspell/dict-terraform@npm:^1.1.3": + version: 1.1.3 + resolution: "@cspell/dict-terraform@npm:1.1.3" + checksum: d815557fde66895e14c6e9408dbcb17f46e4d56fd6c75f74fac48d5b4425f05fd9a60b8e874e2192e908e20f01ead382352842f4326355f7adf096dc23f8eaf7 languageName: node linkType: hard -"@cspell/dict-typescript@npm:^3.2.1": - version: 3.2.1 - resolution: "@cspell/dict-typescript@npm:3.2.1" - checksum: 41eee4fca447c87fe261901975e270df04d803d7188057769c4fbd0c42c00d9cee6581f51f688cd9b6972d9a1d86dc4679535f828198db6c638c9a25eb85cad4 +"@cspell/dict-typescript@npm:^3.2.3": + version: 3.2.3 + resolution: "@cspell/dict-typescript@npm:3.2.3" + checksum: bd797308fd117737ca2be8c33c81603ffd948466782fdca1eaf0bf0a665673b0addfdf207d25e3e814f995399e3b5628048d4bea25bc652e37931003f0e785cb languageName: node linkType: hard -"@cspell/dict-vue@npm:^3.0.4": - version: 3.0.4 - resolution: "@cspell/dict-vue@npm:3.0.4" - checksum: 53904dcaf74ac5e20814ebc2aa484ad6cc607091312c8eeaefb81ada060869c20625accda5e35939e53c148261c67c4129f859fbf50da28cfa5b30d70290ee15 +"@cspell/dict-vue@npm:^3.0.5": + version: 3.0.5 + resolution: "@cspell/dict-vue@npm:3.0.5" + checksum: 3288b44c0362d5a67a090ebe667fba577c32c422090ba8935cf7c994e0444495eafeb1be8cc64cc4f2e23788794f70a85b243ba924c6d73ca5a734a21f978cbc languageName: node linkType: hard -"@cspell/dynamic-import@npm:9.0.0": - version: 9.0.0 - resolution: "@cspell/dynamic-import@npm:9.0.0" +"@cspell/dynamic-import@npm:9.2.0": + version: 9.2.0 + resolution: "@cspell/dynamic-import@npm:9.2.0" dependencies: - "@cspell/url": 9.0.0 + "@cspell/url": 9.2.0 import-meta-resolve: ^4.1.0 - checksum: 62814274f366171211650dd01df8d696751dff6dd206044cd6b28d508a02570365191fa9bf0e54d77a5820f85062178951d9c0ea1c9907359292fd03cf7e5c7b + checksum: 2f0e9c4a351021be52baea297f6f4ff734a37e47bdd50b283e77028a49b4e0e0302b75fd78c1954426ceb7e4a37ed71284160c83aedc703e5ac1891d80fc36d5 languageName: node linkType: hard -"@cspell/filetypes@npm:9.0.0": - version: 9.0.0 - resolution: "@cspell/filetypes@npm:9.0.0" - checksum: 64ae36179086f1a750242dd0a0563f959f828ee6946708df5e7ba3c9808a5b57efbfaad58f67170c9df9014af19056570c6f7f54be832b91b4381dcd0e0f93c7 +"@cspell/filetypes@npm:9.2.0": + version: 9.2.0 + resolution: "@cspell/filetypes@npm:9.2.0" + checksum: 631ace9f62085ad8178499f0045d16da7314068e45d126f91ec6f28a54f8638413a45e6162f301a190dd62127090a3057c3424b2af248a247a3db47f43ef36d8 languageName: node linkType: hard -"@cspell/strong-weak-map@npm:9.0.0": - version: 9.0.0 - resolution: "@cspell/strong-weak-map@npm:9.0.0" - checksum: 939805cab278ed577af94f7a404b5cdbc2941ff6a7c047d7f8617c0acee03a15513c068786a103a17dfbf509e8a5fd368727a2cf0a94b49b716240e4db343f83 +"@cspell/strong-weak-map@npm:9.2.0": + version: 9.2.0 + resolution: "@cspell/strong-weak-map@npm:9.2.0" + checksum: 3a9faecdc164d425a65e7a0ea4e6847feab537056b6d8b1506d14b1363f35390d866412f14cdbb066b26cc2acafd8fe55d7969e3b2b6e46fffc58485b18616c8 languageName: node linkType: hard -"@cspell/url@npm:9.0.0": - version: 9.0.0 - resolution: "@cspell/url@npm:9.0.0" - checksum: 05d603585092d40b426076a03ffbbe72eb053513b44340cfabb42dade1243e4e00d1675a91e33103688605a1e13527af8ac63e0e52f06ed6ed334529272eec9f +"@cspell/url@npm:9.2.0": + version: 9.2.0 + resolution: "@cspell/url@npm:9.2.0" + checksum: 0dc83ea7e51458f4065083bc65316b822bf6db644ad91ad88bb6693738b521ccece7cb56f71358e50794a9506ac753d958add96b935777d28cda5952dbaaaec3 languageName: node linkType: hard @@ -7870,6 +7870,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^14.0.0": + version: 14.0.0 + resolution: "commander@npm:14.0.0" + checksum: 6e9bdaf2e8e4f512855ffc10579eeae2e84c4a7697a91b1a5f62aab3c9849182207855268dd7c3952ae7a2334312a7138f58e929e4b428aef5bf8af862685c9b + languageName: node + linkType: hard + "commander@npm:^2.20.0": version: 2.20.3 resolution: "commander@npm:2.20.3" @@ -8255,94 +8262,95 @@ __metadata: languageName: node linkType: hard -"cspell-config-lib@npm:9.0.0": - version: 9.0.0 - resolution: "cspell-config-lib@npm:9.0.0" +"cspell-config-lib@npm:9.2.0": + version: 9.2.0 + resolution: "cspell-config-lib@npm:9.2.0" dependencies: - "@cspell/cspell-types": 9.0.0 + "@cspell/cspell-types": 9.2.0 comment-json: ^4.2.5 - yaml: ^2.7.1 - checksum: e8b07432420af878eee710aa91fe813cb85140660210a079264a33e8293110d3a10671bd2bfea7f008e8f6b8f95db3e0832ecf48ce28709431fe7321ac940b6f + smol-toml: ^1.4.1 + yaml: ^2.8.0 + checksum: 6d355d379f374ed49fcd87f26865fa9232090f328d58072e747b0b06a71f2428afef98e9823bcc2528e06d09406d18f2958743fc28ccbc3ff71a897e5f9f66f4 languageName: node linkType: hard -"cspell-dictionary@npm:9.0.0": - version: 9.0.0 - resolution: "cspell-dictionary@npm:9.0.0" +"cspell-dictionary@npm:9.2.0": + version: 9.2.0 + resolution: "cspell-dictionary@npm:9.2.0" dependencies: - "@cspell/cspell-pipe": 9.0.0 - "@cspell/cspell-types": 9.0.0 - cspell-trie-lib: 9.0.0 + "@cspell/cspell-pipe": 9.2.0 + "@cspell/cspell-types": 9.2.0 + cspell-trie-lib: 9.2.0 fast-equals: ^5.2.2 - checksum: d1663846a15803714a485d267db25b98024c5ffae0ebecd7c0fd642351e0d5cac7b7335ae6bfa4dc87c45da3f1a90d6f7789b0538fa69da1a057382be9d356ea + checksum: 4677e036376b4fc83cf72f4e9e7d08c81883f90ea9c98608db7aa39f2e296e63de15866e9c7c97517721afacbbcc089d4d6394ccf784d85d75ab6d0aff8e7b0c languageName: node linkType: hard -"cspell-gitignore@npm:9.0.0": - version: 9.0.0 - resolution: "cspell-gitignore@npm:9.0.0" +"cspell-gitignore@npm:9.2.0": + version: 9.2.0 + resolution: "cspell-gitignore@npm:9.2.0" dependencies: - "@cspell/url": 9.0.0 - cspell-glob: 9.0.0 - cspell-io: 9.0.0 + "@cspell/url": 9.2.0 + cspell-glob: 9.2.0 + cspell-io: 9.2.0 bin: cspell-gitignore: bin.mjs - checksum: 495d81b6f9110aeb41e2cdde94ceead451a917c9047d6fefb5786e5e23d5e2ffa2c28d9b5073e747d23c506f5589dcba8f17a93913ef7472a85bb9539e7a6965 + checksum: fadd4948839276630d07a94243778192359c23a4fc86dcf800be0185ee9fe007d0bff8fa70b4c18efc04387d0438342cd345aa19bb16b3ce63d64af4ff0d51a3 languageName: node linkType: hard -"cspell-glob@npm:9.0.0": - version: 9.0.0 - resolution: "cspell-glob@npm:9.0.0" +"cspell-glob@npm:9.2.0": + version: 9.2.0 + resolution: "cspell-glob@npm:9.2.0" dependencies: - "@cspell/url": 9.0.0 - picomatch: ^4.0.2 - checksum: 44acd46989e91a8a2c8391f3ec9d1555aeed1794808cd408492b1f6b74ee38a85f5f9e82d646e375bd149263607edcd123e93371087aed022b3ce797620809e2 + "@cspell/url": 9.2.0 + picomatch: ^4.0.3 + checksum: 4e339dd10c6201d6c4e7d97f6a36848af13fc6e550e09518bae1b28434f918e1057c8cff8e9437d7b885117c40c20b506d211bf240ffe75fa346f6c7e5db97db languageName: node linkType: hard -"cspell-grammar@npm:9.0.0": - version: 9.0.0 - resolution: "cspell-grammar@npm:9.0.0" +"cspell-grammar@npm:9.2.0": + version: 9.2.0 + resolution: "cspell-grammar@npm:9.2.0" dependencies: - "@cspell/cspell-pipe": 9.0.0 - "@cspell/cspell-types": 9.0.0 + "@cspell/cspell-pipe": 9.2.0 + "@cspell/cspell-types": 9.2.0 bin: cspell-grammar: bin.mjs - checksum: 5883687ad47c3a59fe5d3c80cd97207677e7af22479823e30c7284258267238bb2b411b0d7016ce5610d18cdaef5f93de71906821c55d5aa1631f576ae5c4950 + checksum: 51bc5df067ac87ce3ce0bf9a128e6737d4f87a1d754d7bac260f95ed3d96510ac56818245aa327844edfae57a672d413430ab48b2dc026730e6e090cd20a2ac5 languageName: node linkType: hard -"cspell-io@npm:9.0.0": - version: 9.0.0 - resolution: "cspell-io@npm:9.0.0" +"cspell-io@npm:9.2.0": + version: 9.2.0 + resolution: "cspell-io@npm:9.2.0" dependencies: - "@cspell/cspell-service-bus": 9.0.0 - "@cspell/url": 9.0.0 - checksum: 2b1eaaeaf51b339ea7b5f97d4073b99d0f8530cdaa77a751bca3e276d3fba1dbc4894012dbd4cff5e5ea2cccad0a8fb42990712e35443cb5bbd305777de0f959 + "@cspell/cspell-service-bus": 9.2.0 + "@cspell/url": 9.2.0 + checksum: 1b25bace27a5308cc5e7898d9a0463f2ffbba00592442007ac36760010915add5f2bc2d1aebc858d0d5f718235137d16e3320cd4d49dd7a93d2ae102cf51b296 languageName: node linkType: hard -"cspell-lib@npm:9.0.0": - version: 9.0.0 - resolution: "cspell-lib@npm:9.0.0" - dependencies: - "@cspell/cspell-bundled-dicts": 9.0.0 - "@cspell/cspell-pipe": 9.0.0 - "@cspell/cspell-resolver": 9.0.0 - "@cspell/cspell-types": 9.0.0 - "@cspell/dynamic-import": 9.0.0 - "@cspell/filetypes": 9.0.0 - "@cspell/strong-weak-map": 9.0.0 - "@cspell/url": 9.0.0 +"cspell-lib@npm:9.2.0": + version: 9.2.0 + resolution: "cspell-lib@npm:9.2.0" + dependencies: + "@cspell/cspell-bundled-dicts": 9.2.0 + "@cspell/cspell-pipe": 9.2.0 + "@cspell/cspell-resolver": 9.2.0 + "@cspell/cspell-types": 9.2.0 + "@cspell/dynamic-import": 9.2.0 + "@cspell/filetypes": 9.2.0 + "@cspell/strong-weak-map": 9.2.0 + "@cspell/url": 9.2.0 clear-module: ^4.1.2 comment-json: ^4.2.5 - cspell-config-lib: 9.0.0 - cspell-dictionary: 9.0.0 - cspell-glob: 9.0.0 - cspell-grammar: 9.0.0 - cspell-io: 9.0.0 - cspell-trie-lib: 9.0.0 + cspell-config-lib: 9.2.0 + cspell-dictionary: 9.2.0 + cspell-glob: 9.2.0 + cspell-grammar: 9.2.0 + cspell-io: 9.2.0 + cspell-trie-lib: 9.2.0 env-paths: ^3.0.0 fast-equals: ^5.2.2 gensequence: ^7.0.0 @@ -8351,46 +8359,47 @@ __metadata: vscode-languageserver-textdocument: ^1.0.12 vscode-uri: ^3.1.0 xdg-basedir: ^5.1.0 - checksum: d81d3f95353f0c331e6c0c7c076552f7fd7830918b1cd29bb74e32f7533eae7147800abeeefab46983e2b471a44414f3bf8efb6c5c375f19e258e02c58037d65 + checksum: 48de0fa29594886613ea273d0bdbc70bdd5e8a9b9f8e7297755b1d4585f131cfc0589367e8ad275b93811a23ea7a9a055265bd7dae29b08dc05998144ac1fb1d languageName: node linkType: hard -"cspell-trie-lib@npm:9.0.0": - version: 9.0.0 - resolution: "cspell-trie-lib@npm:9.0.0" +"cspell-trie-lib@npm:9.2.0": + version: 9.2.0 + resolution: "cspell-trie-lib@npm:9.2.0" dependencies: - "@cspell/cspell-pipe": 9.0.0 - "@cspell/cspell-types": 9.0.0 + "@cspell/cspell-pipe": 9.2.0 + "@cspell/cspell-types": 9.2.0 gensequence: ^7.0.0 - checksum: 28d6d34fb5a3b217ab58116efb3d30db0f745d00a800f6f6dd6b23637ffed0e2f10dc7058264be7cafcf8ae2a7c449ab9a83fc100fa4278234c388cc8debdbc5 + checksum: 8a5907d9b787a4c16ef05f46a897eed9ed686a8e897da939ee5e4cb6d8d0423623fe5528bc76c049816f52b6c6fe6d2c8e82907ccbb67031e8dd1d9879eab844 languageName: node linkType: hard "cspell@npm:^9.0.0": - version: 9.0.0 - resolution: "cspell@npm:9.0.0" - dependencies: - "@cspell/cspell-json-reporter": 9.0.0 - "@cspell/cspell-pipe": 9.0.0 - "@cspell/cspell-types": 9.0.0 - "@cspell/dynamic-import": 9.0.0 - "@cspell/url": 9.0.0 + version: 9.2.0 + resolution: "cspell@npm:9.2.0" + dependencies: + "@cspell/cspell-json-reporter": 9.2.0 + "@cspell/cspell-pipe": 9.2.0 + "@cspell/cspell-types": 9.2.0 + "@cspell/dynamic-import": 9.2.0 + "@cspell/url": 9.2.0 chalk: ^5.4.1 chalk-template: ^1.1.0 - commander: ^13.1.0 - cspell-dictionary: 9.0.0 - cspell-gitignore: 9.0.0 - cspell-glob: 9.0.0 - cspell-io: 9.0.0 - cspell-lib: 9.0.0 + commander: ^14.0.0 + cspell-config-lib: 9.2.0 + cspell-dictionary: 9.2.0 + cspell-gitignore: 9.2.0 + cspell-glob: 9.2.0 + cspell-io: 9.2.0 + cspell-lib: 9.2.0 fast-json-stable-stringify: ^2.1.0 - file-entry-cache: ^9.1.0 - semver: ^7.7.1 - tinyglobby: ^0.2.13 + flatted: ^3.3.3 + semver: ^7.7.2 + tinyglobby: ^0.2.14 bin: cspell: bin.mjs cspell-esm: bin.mjs - checksum: 22d586992565486f8d58f693be120b3871c24a7bb4b3642fff40f2fee78c40a9924540ee4329aaf1182cea0b6de96f2868bb3f09281b9b778a48b5e29ad5ff13 + checksum: 2b30b950606adb56ccbcec151a08a440e62b50581b0a4818dfe6b55d46a1885a8340814406c18da29f5ce0343d546ce9fc1b66e7ed101087c3a96a9e7fbcc2a0 languageName: node linkType: hard @@ -10458,15 +10467,6 @@ __metadata: languageName: node linkType: hard -"file-entry-cache@npm:^9.1.0": - version: 9.1.0 - resolution: "file-entry-cache@npm:9.1.0" - dependencies: - flat-cache: ^5.0.0 - checksum: 9f2345505677fa83767c55aa3667c52b62c409bd6f2b5408999d635f1d8cc6ecab868f0a5fdfb2fadf64a0d2e92374c02ddd0c9eaea9651cfbcead56fd640099 - languageName: node - linkType: hard - "file-loader@npm:^6.2.0": version: 6.2.0 resolution: "file-loader@npm:6.2.0" @@ -10589,16 +10589,6 @@ __metadata: languageName: node linkType: hard -"flat-cache@npm:^5.0.0": - version: 5.0.0 - resolution: "flat-cache@npm:5.0.0" - dependencies: - flatted: ^3.3.1 - keyv: ^4.5.4 - checksum: a7d03de79b603f5621009f75d84d2c5cd8fb762911df93c0ed16cd1cd4f7b8d2357d4aaed8806b5943ce71ebcd4fc4998faf061f33879c56c5294b3f5c3698ef - languageName: node - linkType: hard - "flat-cache@npm:^6.1.8": version: 6.1.8 resolution: "flat-cache@npm:6.1.8" @@ -10619,7 +10609,7 @@ __metadata: languageName: node linkType: hard -"flatted@npm:^3.2.9, flatted@npm:^3.3.1, flatted@npm:^3.3.3": +"flatted@npm:^3.2.9, flatted@npm:^3.3.3": version: 3.3.3 resolution: "flatted@npm:3.3.3" checksum: 8c96c02fbeadcf4e8ffd0fa24983241e27698b0781295622591fc13585e2f226609d95e422bcf2ef044146ffacb6b68b1f20871454eddf75ab3caa6ee5f4a1fe @@ -15620,7 +15610,7 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:4.0.2, picomatch@npm:^4.0.1, picomatch@npm:^4.0.2": +"picomatch@npm:4.0.2": version: 4.0.2 resolution: "picomatch@npm:4.0.2" checksum: a7a5188c954f82c6585720e9143297ccd0e35ad8072231608086ca950bee672d51b0ef676254af0788205e59bd4e4deb4e7708769226bed725bf13370a7d1464 @@ -15634,6 +15624,13 @@ __metadata: languageName: node linkType: hard +"picomatch@npm:^4.0.1, picomatch@npm:^4.0.2, picomatch@npm:^4.0.3": + version: 4.0.3 + resolution: "picomatch@npm:4.0.3" + checksum: 6817fb74eb745a71445debe1029768de55fd59a42b75606f478ee1d0dc1aa6e78b711d041a7c9d5550e042642029b7f373dc1a43b224c4b7f12d23436735dba0 + languageName: node + linkType: hard + "pidtree@npm:^0.6.0": version: 0.6.0 resolution: "pidtree@npm:0.6.0" @@ -17904,12 +17901,12 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.0.0, semver@npm:^7.3.2, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3, semver@npm:^7.7.1": - version: 7.7.1 - resolution: "semver@npm:7.7.1" +"semver@npm:^7.0.0, semver@npm:^7.3.2, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3, semver@npm:^7.7.1, semver@npm:^7.7.2": + version: 7.7.2 + resolution: "semver@npm:7.7.2" bin: semver: bin/semver.js - checksum: 586b825d36874007c9382d9e1ad8f93888d8670040add24a28e06a910aeebd673a2eb9e3bf169c6679d9245e66efb9057e0852e70d9daa6c27372aab1dda7104 + checksum: dd94ba8f1cbc903d8eeb4dd8bf19f46b3deb14262b6717d0de3c804b594058ae785ef2e4b46c5c3b58733c99c83339068203002f9e37cfe44f7e2cc5e3d2f621 languageName: node linkType: hard @@ -18304,7 +18301,14 @@ __metadata: languageName: node linkType: hard -"smol-toml@npm:^1.3.1, smol-toml@npm:~1.3.1": +"smol-toml@npm:^1.3.1, smol-toml@npm:^1.4.1": + version: 1.4.2 + resolution: "smol-toml@npm:1.4.2" + checksum: f12d3fbc2d49396ec523170828a5c9a89bc7740eb7b205f8d8553af18629d936474c1ce55b70c7839aa239a11252e16fd1c3fc955b966b81c9dec00155df4f85 + languageName: node + linkType: hard + +"smol-toml@npm:~1.3.1": version: 1.3.1 resolution: "smol-toml@npm:1.3.1" checksum: dc3284a674065874b1d34a945709ce3da2a0c44b1ff86b3274615d322c2f6cf8e5d2f5f7d569fd92330ec08590777972725e7d3ba856bd6d841243673064994e @@ -19116,13 +19120,13 @@ __metadata: languageName: node linkType: hard -"tinyglobby@npm:^0.2.12, tinyglobby@npm:^0.2.13": - version: 0.2.13 - resolution: "tinyglobby@npm:0.2.13" +"tinyglobby@npm:^0.2.12, tinyglobby@npm:^0.2.13, tinyglobby@npm:^0.2.14": + version: 0.2.14 + resolution: "tinyglobby@npm:0.2.14" dependencies: fdir: ^6.4.4 picomatch: ^4.0.2 - checksum: 3a2e87a2518cb3616057b0aa58be4f17771ae78c6890556516ae1e631f8ce4cfee1ba1dcb62fcc54a64e2bdd6c3104f4f3d021e1a3e3f8fb0875bca380b913e5 + checksum: 261e986e3f2062dec3a582303bad2ce31b4634b9348648b46828c000d464b012cf474e38f503312367d4117c3f2f18611992738fca684040758bba44c24de522 languageName: node linkType: hard @@ -20739,12 +20743,12 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^2.6.0, yaml@npm:^2.7.0, yaml@npm:^2.7.1": - version: 2.7.1 - resolution: "yaml@npm:2.7.1" +"yaml@npm:^2.6.0, yaml@npm:^2.7.0, yaml@npm:^2.7.1, yaml@npm:^2.8.0": + version: 2.8.1 + resolution: "yaml@npm:2.8.1" bin: yaml: bin.mjs - checksum: 385f8115ddfafdf8e599813cca8b2bf4e3f6a01b919fff5ae7da277e164df684d7dfe558b4085172094792b5a04786d3c55fa8b74abb0ee029873f031150bb80 + checksum: 35b46150d48bc1da2fd5b1521a48a4fa36d68deaabe496f3c3fa9646d5796b6b974f3930a02c4b5aee6c85c860d7d7f79009416724465e835f40b87898c36de4 languageName: node linkType: hard From 2ee31bfcdc5efa989adc0c868211bbfeb85a5ad6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 15:07:07 -0700 Subject: [PATCH 132/283] chore(deps): update dependency eslint-plugin-import to v2.32.0 (#11499) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 298 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 174 insertions(+), 124 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7cc1a308cf0e..9dc611b09aeb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6782,17 +6782,19 @@ __metadata: languageName: node linkType: hard -"array-includes@npm:^3.1.6, array-includes@npm:^3.1.8": - version: 3.1.8 - resolution: "array-includes@npm:3.1.8" +"array-includes@npm:^3.1.6, array-includes@npm:^3.1.8, array-includes@npm:^3.1.9": + version: 3.1.9 + resolution: "array-includes@npm:3.1.9" dependencies: - call-bind: ^1.0.7 + call-bind: ^1.0.8 + call-bound: ^1.0.4 define-properties: ^1.2.1 - es-abstract: ^1.23.2 - es-object-atoms: ^1.0.0 - get-intrinsic: ^1.2.4 - is-string: ^1.0.7 - checksum: eb39ba5530f64e4d8acab39297c11c1c5be2a4ea188ab2b34aba5fb7224d918f77717a9d57a3e2900caaa8440e59431bdaf5c974d5212ef65d97f132e38e2d91 + es-abstract: ^1.24.0 + es-object-atoms: ^1.1.1 + get-intrinsic: ^1.3.0 + is-string: ^1.1.1 + math-intrinsics: ^1.1.0 + checksum: b58dc526fe415252e50319eaf88336e06e75aa673e3b58d252414739a4612dbe56e7b613fdcc7c90561dc9cf9202bbe5ca029ccd8c08362746459475ae5a8f3e languageName: node linkType: hard @@ -6824,29 +6826,30 @@ __metadata: languageName: node linkType: hard -"array.prototype.findlastindex@npm:^1.2.5": - version: 1.2.5 - resolution: "array.prototype.findlastindex@npm:1.2.5" +"array.prototype.findlastindex@npm:^1.2.6": + version: 1.2.6 + resolution: "array.prototype.findlastindex@npm:1.2.6" dependencies: - call-bind: ^1.0.7 + call-bind: ^1.0.8 + call-bound: ^1.0.4 define-properties: ^1.2.1 - es-abstract: ^1.23.2 + es-abstract: ^1.23.9 es-errors: ^1.3.0 - es-object-atoms: ^1.0.0 - es-shim-unscopables: ^1.0.2 - checksum: 2c81cff2a75deb95bf1ed89b6f5f2bfbfb882211e3b7cc59c3d6b87df774cd9d6b36949a8ae39ac476e092c1d4a4905f5ee11a86a456abb10f35f8211ae4e710 + es-object-atoms: ^1.1.1 + es-shim-unscopables: ^1.1.0 + checksum: bd2665bd51f674d4e1588ce5d5848a8adb255f414070e8e652585598b801480516df2c6cef2c60b6ea1a9189140411c49157a3f112d52e9eabb4e9fc80936ea6 languageName: node linkType: hard -"array.prototype.flat@npm:^1.3.1, array.prototype.flat@npm:^1.3.2": - version: 1.3.2 - resolution: "array.prototype.flat@npm:1.3.2" +"array.prototype.flat@npm:^1.3.1, array.prototype.flat@npm:^1.3.3": + version: 1.3.3 + resolution: "array.prototype.flat@npm:1.3.3" dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - es-shim-unscopables: ^1.0.0 - checksum: 5d6b4bf102065fb3f43764bfff6feb3295d372ce89591e6005df3d0ce388527a9f03c909af6f2a973969a4d178ab232ffc9236654149173e0e187ec3a1a6b87b + call-bind: ^1.0.8 + define-properties: ^1.2.1 + es-abstract: ^1.23.5 + es-shim-unscopables: ^1.0.2 + checksum: 5d5a7829ab2bb271a8d30a1c91e6271cef0ec534593c0fe6d2fb9ebf8bb62c1e5326e2fddcbbcbbe5872ca04f5e6b54a1ecf092e0af704fb538da9b2bfd95b40 languageName: node linkType: hard @@ -7398,17 +7401,17 @@ __metadata: languageName: node linkType: hard -"call-bind-apply-helpers@npm:^1.0.0, call-bind-apply-helpers@npm:^1.0.1": - version: 1.0.1 - resolution: "call-bind-apply-helpers@npm:1.0.1" +"call-bind-apply-helpers@npm:^1.0.0, call-bind-apply-helpers@npm:^1.0.1, call-bind-apply-helpers@npm:^1.0.2": + version: 1.0.2 + resolution: "call-bind-apply-helpers@npm:1.0.2" dependencies: es-errors: ^1.3.0 function-bind: ^1.1.2 - checksum: 3c55343261bb387c58a4762d15ad9d42053659a62681ec5eb50690c6b52a4a666302a01d557133ce6533e8bd04530ee3b209f23dd06c9577a1925556f8fcccdf + checksum: b2863d74fcf2a6948221f65d95b91b4b2d90cfe8927650b506141e669f7d5de65cea191bf788838bc40d13846b7886c5bc5c84ab96c3adbcf88ad69a72fcdc6b languageName: node linkType: hard -"call-bind@npm:^1.0.2, call-bind@npm:^1.0.7, call-bind@npm:^1.0.8": +"call-bind@npm:^1.0.7, call-bind@npm:^1.0.8": version: 1.0.8 resolution: "call-bind@npm:1.0.8" dependencies: @@ -7420,13 +7423,13 @@ __metadata: languageName: node linkType: hard -"call-bound@npm:^1.0.2, call-bound@npm:^1.0.3": - version: 1.0.3 - resolution: "call-bound@npm:1.0.3" +"call-bound@npm:^1.0.2, call-bound@npm:^1.0.3, call-bound@npm:^1.0.4": + version: 1.0.4 + resolution: "call-bound@npm:1.0.4" dependencies: - call-bind-apply-helpers: ^1.0.1 - get-intrinsic: ^1.2.6 - checksum: a93bbe0f2d0a2d6c144a4349ccd0593d5d0d5d9309b69101710644af8964286420062f2cc3114dca120b9bc8cc07507952d4b1b3ea7672e0d7f6f1675efedb32 + call-bind-apply-helpers: ^1.0.2 + get-intrinsic: ^1.3.0 + checksum: 2f6399488d1c272f56306ca60ff696575e2b7f31daf23bc11574798c84d9f2759dceb0cb1f471a85b77f28962a7ac6411f51d283ea2e45319009a19b6ccab3b2 languageName: node linkType: hard @@ -8851,7 +8854,7 @@ __metadata: languageName: node linkType: hard -"define-properties@npm:^1.1.3, define-properties@npm:^1.2.0, define-properties@npm:^1.2.1": +"define-properties@npm:^1.1.3, define-properties@npm:^1.2.1": version: 1.2.1 resolution: "define-properties@npm:1.2.1" dependencies: @@ -9328,25 +9331,26 @@ __metadata: languageName: node linkType: hard -"es-abstract@npm:^1.17.5, es-abstract@npm:^1.22.1, es-abstract@npm:^1.23.2, es-abstract@npm:^1.23.3, es-abstract@npm:^1.23.5, es-abstract@npm:^1.23.6": - version: 1.23.8 - resolution: "es-abstract@npm:1.23.8" +"es-abstract@npm:^1.17.5, es-abstract@npm:^1.23.2, es-abstract@npm:^1.23.3, es-abstract@npm:^1.23.5, es-abstract@npm:^1.23.6, es-abstract@npm:^1.23.9, es-abstract@npm:^1.24.0": + version: 1.24.0 + resolution: "es-abstract@npm:1.24.0" dependencies: array-buffer-byte-length: ^1.0.2 arraybuffer.prototype.slice: ^1.0.4 available-typed-arrays: ^1.0.7 call-bind: ^1.0.8 - call-bound: ^1.0.3 + call-bound: ^1.0.4 data-view-buffer: ^1.0.2 data-view-byte-length: ^1.0.2 data-view-byte-offset: ^1.0.1 es-define-property: ^1.0.1 es-errors: ^1.3.0 - es-object-atoms: ^1.0.0 - es-set-tostringtag: ^2.0.3 + es-object-atoms: ^1.1.1 + es-set-tostringtag: ^2.1.0 es-to-primitive: ^1.3.0 function.prototype.name: ^1.1.8 - get-intrinsic: ^1.2.6 + get-intrinsic: ^1.3.0 + get-proto: ^1.0.1 get-symbol-description: ^1.1.0 globalthis: ^1.0.4 gopd: ^1.2.0 @@ -9358,20 +9362,24 @@ __metadata: is-array-buffer: ^3.0.5 is-callable: ^1.2.7 is-data-view: ^1.0.2 + is-negative-zero: ^2.0.3 is-regex: ^1.2.1 + is-set: ^2.0.3 is-shared-array-buffer: ^1.0.4 is-string: ^1.1.1 is-typed-array: ^1.1.15 - is-weakref: ^1.1.0 + is-weakref: ^1.1.1 math-intrinsics: ^1.1.0 - object-inspect: ^1.13.3 + object-inspect: ^1.13.4 object-keys: ^1.1.1 object.assign: ^4.1.7 - own-keys: ^1.0.0 - regexp.prototype.flags: ^1.5.3 + own-keys: ^1.0.1 + regexp.prototype.flags: ^1.5.4 safe-array-concat: ^1.1.3 safe-push-apply: ^1.0.0 safe-regex-test: ^1.1.0 + set-proto: ^1.0.0 + stop-iteration-iterator: ^1.1.0 string.prototype.trim: ^1.2.10 string.prototype.trimend: ^1.0.9 string.prototype.trimstart: ^1.0.8 @@ -9380,8 +9388,8 @@ __metadata: typed-array-byte-offset: ^1.0.4 typed-array-length: ^1.0.7 unbox-primitive: ^1.1.0 - which-typed-array: ^1.1.18 - checksum: b91916702b8147bf3f2ed35c83a7c3f19ba09641364ebce8351d60358fa49ac66da353fe4a991de72502bb4853f52e51e3f2f93920c7c8d5dc01ab2b30d77b17 + which-typed-array: ^1.1.19 + checksum: 06b3d605e56e3da9d16d4db2629a42dac1ca31f2961a41d15c860422a266115e865b43e82d6b9da81a0fabbbb65ebc12fb68b0b755bc9dbddacb6bf7450e96df languageName: node linkType: hard @@ -9430,32 +9438,33 @@ __metadata: languageName: node linkType: hard -"es-object-atoms@npm:^1.0.0": - version: 1.0.0 - resolution: "es-object-atoms@npm:1.0.0" +"es-object-atoms@npm:^1.0.0, es-object-atoms@npm:^1.1.1": + version: 1.1.1 + resolution: "es-object-atoms@npm:1.1.1" dependencies: es-errors: ^1.3.0 - checksum: 26f0ff78ab93b63394e8403c353842b2272836968de4eafe97656adfb8a7c84b9099bf0fe96ed58f4a4cddc860f6e34c77f91649a58a5daa4a9c40b902744e3c + checksum: 214d3767287b12f36d3d7267ef342bbbe1e89f899cfd67040309fc65032372a8e60201410a99a1645f2f90c1912c8c49c8668066f6bdd954bcd614dda2e3da97 languageName: node linkType: hard -"es-set-tostringtag@npm:^2.0.3": - version: 2.0.3 - resolution: "es-set-tostringtag@npm:2.0.3" +"es-set-tostringtag@npm:^2.0.3, es-set-tostringtag@npm:^2.1.0": + version: 2.1.0 + resolution: "es-set-tostringtag@npm:2.1.0" dependencies: - get-intrinsic: ^1.2.4 + es-errors: ^1.3.0 + get-intrinsic: ^1.2.6 has-tostringtag: ^1.0.2 - hasown: ^2.0.1 - checksum: 7227fa48a41c0ce83e0377b11130d324ac797390688135b8da5c28994c0165be8b252e15cd1de41e1325e5a5412511586960213e88f9ab4a5e7d028895db5129 + hasown: ^2.0.2 + checksum: 789f35de4be3dc8d11fdcb91bc26af4ae3e6d602caa93299a8c45cf05d36cc5081454ae2a6d3afa09cceca214b76c046e4f8151e092e6fc7feeb5efb9e794fc6 languageName: node linkType: hard -"es-shim-unscopables@npm:^1.0.0, es-shim-unscopables@npm:^1.0.2": - version: 1.0.2 - resolution: "es-shim-unscopables@npm:1.0.2" +"es-shim-unscopables@npm:^1.0.2, es-shim-unscopables@npm:^1.1.0": + version: 1.1.0 + resolution: "es-shim-unscopables@npm:1.1.0" dependencies: - hasown: ^2.0.0 - checksum: 432bd527c62065da09ed1d37a3f8e623c423683285e6188108286f4a1e8e164a5bcbfbc0051557c7d14633cd2a41ce24c7048e6bbb66a985413fd32f1be72626 + hasown: ^2.0.2 + checksum: 33cfb1ebcb2f869f0bf528be1a8660b4fe8b6cec8fc641f330e508db2284b58ee2980fad6d0828882d22858c759c0806076427a3673b6daa60f753e3b558ee15 languageName: node linkType: hard @@ -9689,15 +9698,15 @@ __metadata: languageName: node linkType: hard -"eslint-module-utils@npm:^2.12.0": - version: 2.12.0 - resolution: "eslint-module-utils@npm:2.12.0" +"eslint-module-utils@npm:^2.12.1": + version: 2.12.1 + resolution: "eslint-module-utils@npm:2.12.1" dependencies: debug: ^3.2.7 peerDependenciesMeta: eslint: optional: true - checksum: be3ac52e0971c6f46daeb1a7e760e45c7c45f820c8cc211799f85f10f04ccbf7afc17039165d56cb2da7f7ca9cec2b3a777013cddf0b976784b37eb9efa24180 + checksum: 2f074670d8c934687820a83140048776b28bbaf35fc37f35623f63cc9c438d496d11f0683b4feabb9a120435435d4a69604b1c6c567f118be2c9a0aba6760fc1 languageName: node linkType: hard @@ -9714,31 +9723,31 @@ __metadata: linkType: hard "eslint-plugin-import@npm:^2.31.0": - version: 2.31.0 - resolution: "eslint-plugin-import@npm:2.31.0" + version: 2.32.0 + resolution: "eslint-plugin-import@npm:2.32.0" dependencies: "@rtsao/scc": ^1.1.0 - array-includes: ^3.1.8 - array.prototype.findlastindex: ^1.2.5 - array.prototype.flat: ^1.3.2 - array.prototype.flatmap: ^1.3.2 + array-includes: ^3.1.9 + array.prototype.findlastindex: ^1.2.6 + array.prototype.flat: ^1.3.3 + array.prototype.flatmap: ^1.3.3 debug: ^3.2.7 doctrine: ^2.1.0 eslint-import-resolver-node: ^0.3.9 - eslint-module-utils: ^2.12.0 + eslint-module-utils: ^2.12.1 hasown: ^2.0.2 - is-core-module: ^2.15.1 + is-core-module: ^2.16.1 is-glob: ^4.0.3 minimatch: ^3.1.2 object.fromentries: ^2.0.8 object.groupby: ^1.0.3 - object.values: ^1.2.0 + object.values: ^1.2.1 semver: ^6.3.1 - string.prototype.trimend: ^1.0.8 + string.prototype.trimend: ^1.0.9 tsconfig-paths: ^3.15.0 peerDependencies: eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9 - checksum: b1d2ac268b3582ff1af2a72a2c476eae4d250c100f2e335b6e102036e4a35efa530b80ec578dfc36761fabb34a635b9bf5ab071abe9d4404a4bb054fdf22d415 + checksum: 8cd40595b5e4346d3698eb577014b4b6d0ba57b7b9edf975be4f052a89330ec202d0cc5c3861d37ebeafa151b6264821410243889b0c31710911a6b625bcf76b languageName: node linkType: hard @@ -10626,12 +10635,12 @@ __metadata: languageName: node linkType: hard -"for-each@npm:^0.3.3": - version: 0.3.3 - resolution: "for-each@npm:0.3.3" +"for-each@npm:^0.3.3, for-each@npm:^0.3.5": + version: 0.3.5 + resolution: "for-each@npm:0.3.5" dependencies: - is-callable: ^1.1.3 - checksum: 6c48ff2bc63362319c65e2edca4a8e1e3483a2fabc72fbe7feaf8c73db94fc7861bd53bc02c8a66a0c1dd709da6b04eec42e0abdd6b40ce47305ae92a25e5d28 + is-callable: ^1.2.7 + checksum: 3c986d7e11f4381237cc98baa0a2f87eabe74719eee65ed7bed275163082b940ede19268c61d04c6260e0215983b12f8d885e3c8f9aa8c2113bf07c37051745c languageName: node linkType: hard @@ -10902,21 +10911,21 @@ __metadata: languageName: node linkType: hard -"get-intrinsic@npm:^1.2.4, get-intrinsic@npm:^1.2.5, get-intrinsic@npm:^1.2.6": - version: 1.2.6 - resolution: "get-intrinsic@npm:1.2.6" +"get-intrinsic@npm:^1.2.4, get-intrinsic@npm:^1.2.5, get-intrinsic@npm:^1.2.6, get-intrinsic@npm:^1.3.0": + version: 1.3.0 + resolution: "get-intrinsic@npm:1.3.0" dependencies: - call-bind-apply-helpers: ^1.0.1 - dunder-proto: ^1.0.0 + call-bind-apply-helpers: ^1.0.2 es-define-property: ^1.0.1 es-errors: ^1.3.0 - es-object-atoms: ^1.0.0 + es-object-atoms: ^1.1.1 function-bind: ^1.1.2 + get-proto: ^1.0.1 gopd: ^1.2.0 has-symbols: ^1.1.0 hasown: ^2.0.2 - math-intrinsics: ^1.0.0 - checksum: a7592a0b7f023a2e83c0121fa9449ca83780e370a5feeebe8452119474d148016e43b455049134ae7a683b9b11b93d3f65eac199a0ad452ab740d5f0c299de47 + math-intrinsics: ^1.1.0 + checksum: 301008e4482bb9a9cb49e132b88fee093bff373b4e6def8ba219b1e96b60158a6084f273ef5cafe832e42cd93462f4accb46a618d35fe59a2b507f2388c5b79d languageName: node linkType: hard @@ -10927,6 +10936,16 @@ __metadata: languageName: node linkType: hard +"get-proto@npm:^1.0.1": + version: 1.0.1 + resolution: "get-proto@npm:1.0.1" + dependencies: + dunder-proto: ^1.0.1 + es-object-atoms: ^1.0.0 + checksum: 4fc96afdb58ced9a67558698b91433e6b037aaa6f1493af77498d7c85b141382cf223c0e5946f334fb328ee85dfe6edd06d218eaf09556f4bc4ec6005d7f5f7b + languageName: node + linkType: hard + "get-stream@npm:^6.0.0, get-stream@npm:^6.0.1": version: 6.0.1 resolution: "get-stream@npm:6.0.1" @@ -11298,7 +11317,7 @@ __metadata: languageName: node linkType: hard -"hasown@npm:^2.0.0, hasown@npm:^2.0.1, hasown@npm:^2.0.2": +"hasown@npm:^2.0.2": version: 2.0.2 resolution: "hasown@npm:2.0.2" dependencies: @@ -12069,7 +12088,7 @@ __metadata: languageName: node linkType: hard -"is-callable@npm:^1.1.3, is-callable@npm:^1.2.7": +"is-callable@npm:^1.2.7": version: 1.2.7 resolution: "is-callable@npm:1.2.7" checksum: 61fd57d03b0d984e2ed3720fb1c7a897827ea174bd44402878e059542ea8c4aeedee0ea0985998aa5cc2736b2fa6e271c08587addb5b3959ac52cf665173d1ac @@ -12087,12 +12106,12 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.13.0, is-core-module@npm:^2.15.1": - version: 2.15.1 - resolution: "is-core-module@npm:2.15.1" +"is-core-module@npm:^2.13.0, is-core-module@npm:^2.16.1": + version: 2.16.1 + resolution: "is-core-module@npm:2.16.1" dependencies: hasown: ^2.0.2 - checksum: df134c168115690724b62018c37b2f5bba0d5745fa16960b329c5a00883a8bea6a5632fdb1e3efcce237c201826ba09f93197b7cd95577ea56b0df335be23633 + checksum: 6ec5b3c42d9cbf1ac23f164b16b8a140c3cec338bf8f884c076ca89950c7cc04c33e78f02b8cae7ff4751f3247e3174b2330f1fe4de194c7210deb8b1ea316a7 languageName: node linkType: hard @@ -12242,6 +12261,13 @@ __metadata: languageName: node linkType: hard +"is-negative-zero@npm:^2.0.3": + version: 2.0.3 + resolution: "is-negative-zero@npm:2.0.3" + checksum: c1e6b23d2070c0539d7b36022d5a94407132411d01aba39ec549af824231f3804b1aea90b5e4e58e807a65d23ceb538ed6e355ce76b267bdd86edb757ffcbdcd + languageName: node + linkType: hard + "is-npm@npm:^6.0.0": version: 6.0.0 resolution: "is-npm@npm:6.0.0" @@ -12396,7 +12422,7 @@ __metadata: languageName: node linkType: hard -"is-string@npm:^1.0.7, is-string@npm:^1.1.1": +"is-string@npm:^1.1.1": version: 1.1.1 resolution: "is-string@npm:1.1.1" dependencies: @@ -12447,12 +12473,12 @@ __metadata: languageName: node linkType: hard -"is-weakref@npm:^1.0.2, is-weakref@npm:^1.1.0": - version: 1.1.0 - resolution: "is-weakref@npm:1.1.0" +"is-weakref@npm:^1.0.2, is-weakref@npm:^1.1.1": + version: 1.1.1 + resolution: "is-weakref@npm:1.1.1" dependencies: - call-bound: ^1.0.2 - checksum: 2a2f3a1746ee1baecf9ac6483d903cd3f8ef3cca88e2baa42f2e85ea064bd246d218eed5f6d479fc1c76dae2231e71133b6b86160e821d176932be9fae3da4da + call-bound: ^1.0.3 + checksum: 1769b9aed5d435a3a989ffc18fc4ad1947d2acdaf530eb2bd6af844861b545047ea51102f75901f89043bed0267ed61d914ee21e6e8b9aa734ec201cdfc0726f languageName: node linkType: hard @@ -13465,7 +13491,7 @@ __metadata: languageName: node linkType: hard -"math-intrinsics@npm:^1.0.0, math-intrinsics@npm:^1.1.0": +"math-intrinsics@npm:^1.1.0": version: 1.1.0 resolution: "math-intrinsics@npm:1.1.0" checksum: 0e513b29d120f478c85a70f49da0b8b19bc638975eca466f2eeae0071f3ad00454c621bf66e16dd435896c208e719fc91ad79bbfba4e400fe0b372e7c1c9c9a2 @@ -15008,10 +15034,10 @@ __metadata: languageName: node linkType: hard -"object-inspect@npm:^1.13.3": - version: 1.13.3 - resolution: "object-inspect@npm:1.13.3" - checksum: 8c962102117241e18ea403b84d2521f78291b774b03a29ee80a9863621d88265ffd11d0d7e435c4c2cea0dc2a2fbf8bbc92255737a05536590f2df2e8756f297 +"object-inspect@npm:^1.13.3, object-inspect@npm:^1.13.4": + version: 1.13.4 + resolution: "object-inspect@npm:1.13.4" + checksum: 582810c6a8d2ef988ea0a39e69e115a138dad8f42dd445383b394877e5816eb4268489f316a6f74ee9c4e0a984b3eab1028e3e79d62b1ed67c726661d55c7a8b languageName: node linkType: hard @@ -15070,7 +15096,7 @@ __metadata: languageName: node linkType: hard -"object.values@npm:^1.1.6, object.values@npm:^1.2.0, object.values@npm:^1.2.1": +"object.values@npm:^1.1.6, object.values@npm:^1.2.1": version: 1.2.1 resolution: "object.values@npm:1.2.1" dependencies: @@ -15191,7 +15217,7 @@ __metadata: languageName: node linkType: hard -"own-keys@npm:^1.0.0": +"own-keys@npm:^1.0.1": version: 1.0.1 resolution: "own-keys@npm:1.0.1" dependencies: @@ -17157,15 +17183,17 @@ __metadata: languageName: node linkType: hard -"regexp.prototype.flags@npm:^1.5.3": - version: 1.5.3 - resolution: "regexp.prototype.flags@npm:1.5.3" +"regexp.prototype.flags@npm:^1.5.3, regexp.prototype.flags@npm:^1.5.4": + version: 1.5.4 + resolution: "regexp.prototype.flags@npm:1.5.4" dependencies: - call-bind: ^1.0.7 + call-bind: ^1.0.8 define-properties: ^1.2.1 es-errors: ^1.3.0 + get-proto: ^1.0.1 + gopd: ^1.2.0 set-function-name: ^2.0.2 - checksum: 83ff0705b837f7cb6d664010a11642250f36d3f642263dd0f3bdfe8f150261aa7b26b50ee97f21c1da30ef82a580bb5afedbef5f45639d69edaafbeac9bbb0ed + checksum: 18cb667e56cb328d2dda569d7f04e3ea78f2683135b866d606538cf7b1d4271f7f749f09608c877527799e6cf350e531368f3c7a20ccd1bb41048a48926bdeeb languageName: node linkType: hard @@ -18066,6 +18094,17 @@ __metadata: languageName: node linkType: hard +"set-proto@npm:^1.0.0": + version: 1.0.0 + resolution: "set-proto@npm:1.0.0" + dependencies: + dunder-proto: ^1.0.1 + es-errors: ^1.3.0 + es-object-atoms: ^1.0.0 + checksum: ec27cbbe334598547e99024403e96da32aca3e530583e4dba7f5db1c43cbc4affa9adfbd77c7b2c210b9b8b2e7b2e600bad2a6c44fd62e804d8233f96bbb62f4 + languageName: node + linkType: hard + "setprototypeof@npm:1.1.0": version: 1.1.0 resolution: "setprototypeof@npm:1.1.0" @@ -18530,6 +18569,16 @@ __metadata: languageName: node linkType: hard +"stop-iteration-iterator@npm:^1.1.0": + version: 1.1.0 + resolution: "stop-iteration-iterator@npm:1.1.0" + dependencies: + es-errors: ^1.3.0 + internal-slot: ^1.1.0 + checksum: be944489d8829fb3bdec1a1cc4a2142c6b6eb317305eeace1ece978d286d6997778afa1ae8cb3bd70e2b274b9aa8c69f93febb1e15b94b1359b11058f9d3c3a1 + languageName: node + linkType: hard + "string-argv@npm:^0.3.2, string-argv@npm:~0.3.1": version: 0.3.2 resolution: "string-argv@npm:0.3.2" @@ -18627,7 +18676,7 @@ __metadata: languageName: node linkType: hard -"string.prototype.trimend@npm:^1.0.8, string.prototype.trimend@npm:^1.0.9": +"string.prototype.trimend@npm:^1.0.9": version: 1.0.9 resolution: "string.prototype.trimend@npm:1.0.9" dependencies: @@ -20342,17 +20391,18 @@ __metadata: languageName: node linkType: hard -"which-typed-array@npm:^1.1.16, which-typed-array@npm:^1.1.18": - version: 1.1.18 - resolution: "which-typed-array@npm:1.1.18" +"which-typed-array@npm:^1.1.16, which-typed-array@npm:^1.1.19": + version: 1.1.19 + resolution: "which-typed-array@npm:1.1.19" dependencies: available-typed-arrays: ^1.0.7 call-bind: ^1.0.8 - call-bound: ^1.0.3 - for-each: ^0.3.3 + call-bound: ^1.0.4 + for-each: ^0.3.5 + get-proto: ^1.0.1 gopd: ^1.2.0 has-tostringtag: ^1.0.2 - checksum: d2feea7f51af66b3a240397aa41c796585033e1069f18e5b6d4cd3878538a1e7780596fd3ea9bf347c43d9e98e13be09b37d9ea3887cef29b11bc291fd47bb52 + checksum: 162d2a07f68ea323f88ed9419861487ce5d02cb876f2cf9dd1e428d04a63133f93a54f89308f337b27cabd312ee3d027cae4a79002b2f0a85b79b9ef4c190670 languageName: node linkType: hard From a4526b3f68d5625c50e83fe472babeca67c92cb7 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Tue, 19 Aug 2025 04:39:28 -0600 Subject: [PATCH 133/283] chore: skip failing tests to fix CI (#11505) * chore: skip failing tests * skip comes first * also move --- eslint.config.mjs | 4 +- .../tests/rules/no-floating-promises.test.ts | 2 + .../rules/strict-boolean-expressions.test.ts | 2 +- .../tests/TypeOrValueSpecifier.test.ts | 50 ++++++++++--------- 4 files changed, 31 insertions(+), 27 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index bbb9e9a05e26..b7b469b0dd63 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -713,8 +713,8 @@ export default tseslint.config( 'perfectionist/sort-objects': [ 'error', { - customGroups: { top: ['^valid$'] }, - groups: ['top', 'unknown'], + customGroups: { skip: ['^skip$'], top: ['^valid$'] }, + groups: ['top', 'skip', 'unknown'], }, ], }, diff --git a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts index 61467bf0099b..3c5dc458476d 100644 --- a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts +++ b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts @@ -824,6 +824,8 @@ promise().then(() => {}); ], }, { + // TODO: Skipped pending resolution of https://github.com/typescript-eslint/typescript-eslint/issues/11504 + skip: true, code: ` import { it } from 'node:test'; 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 50cedd3b489d..77d8a00e67fb 100644 --- a/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts @@ -3544,6 +3544,7 @@ assert(foo, Boolean(nullableString)); // a bug. // // See https://github.com/microsoft/TypeScript/issues/59707 + skip: true, code: ` function asserts1(x: string | number | undefined): asserts x {} function asserts2(x: string | number | undefined): asserts x {} @@ -3608,7 +3609,6 @@ someAssert(Boolean(maybeString)); }, ], output: null, - skip: true, }, { // The implementation signature doesn't count towards the call signatures diff --git a/packages/type-utils/tests/TypeOrValueSpecifier.test.ts b/packages/type-utils/tests/TypeOrValueSpecifier.test.ts index 29fbd97ac36f..a28d22f36b71 100644 --- a/packages/type-utils/tests/TypeOrValueSpecifier.test.ts +++ b/packages/type-utils/tests/TypeOrValueSpecifier.test.ts @@ -389,31 +389,33 @@ describe('TypeOrValueSpecifier', () => { package: '@babel/code-frame', }, ], + // TODO: Skipped pending resolution of https://github.com/typescript-eslint/typescript-eslint/issues/11504 + // // The following type is available from the multi-file @types/node package. - [ - 'import { it } from "node:test"; type Test = typeof it;', - { - from: 'package', - name: 'it', - package: 'node:test', - }, - ], - [ - ` - declare module "node:test" { - export function it(): void; - } - - import { it } from "node:test"; - - type Test = typeof it; - `, - { - from: 'package', - name: 'it', - package: 'node:test', - }, - ], + // [ + // 'import { it } from "node:test"; type Test = typeof it;', + // { + // from: 'package', + // name: 'it', + // package: 'node:test', + // }, + // ], + // [ + // ` + // declare module "node:test" { + // export function it(): void; + // } + // + // import { it } from "node:test"; + // + // type Test = typeof it; + // `, + // { + // from: 'package', + // name: 'it', + // package: 'node:test', + // }, + // ], [ 'import { fail } from "node:assert"; type Test = typeof fail;', { From 4935595ea8cf84f841f9c86e62357ce4492401e5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 21:04:09 +0930 Subject: [PATCH 134/283] chore(deps): update dependency eslint-plugin-jsdoc to v50.8.0 (#11501) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 85 ++++++++++++++++++++++--------------------------------- 1 file changed, 34 insertions(+), 51 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9dc611b09aeb..c15e022bd7bc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3318,14 +3318,16 @@ __metadata: languageName: node linkType: hard -"@es-joy/jsdoccomment@npm:~0.49.0": - version: 0.49.0 - resolution: "@es-joy/jsdoccomment@npm:0.49.0" +"@es-joy/jsdoccomment@npm:~0.50.2": + version: 0.50.2 + resolution: "@es-joy/jsdoccomment@npm:0.50.2" dependencies: + "@types/estree": ^1.0.6 + "@typescript-eslint/types": ^8.11.0 comment-parser: 1.4.1 esquery: ^1.6.0 jsdoc-type-pratt-parser: ~4.1.0 - checksum: 19f99097ceb5a3495843c3276d598cfb4e3287c5d1d809817fb28fc8352b16ef23eaa8d964fd7b0379c6466d0a591f579e51d25434ab709ff59f6650fa166dbf + checksum: 5bbbc4e6f85a729c3353d3cb395a4b4766a405ce6228994b662cb2c755060f07ee45e507c091b8f8d6c4fdc805d017f1ff6ec2686afa54c8bd4e91c480ab932b languageName: node linkType: hard @@ -4404,13 +4406,6 @@ __metadata: languageName: node linkType: hard -"@pkgr/core@npm:^0.1.0": - version: 0.1.1 - resolution: "@pkgr/core@npm:0.1.1" - checksum: 6f25fd2e3008f259c77207ac9915b02f1628420403b2630c92a07ff963129238c9262afc9e84344c7a23b5cc1f3965e2cd17e3798219f5fd78a63d144d3cceba - languageName: node - linkType: hard - "@pnpm/config.env-replace@npm:^1.1.0": version: 1.1.0 resolution: "@pnpm/config.env-replace@npm:1.1.0" @@ -5909,7 +5904,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.40.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.40.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.40.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.40.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -8744,15 +8739,15 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.3.6, debug@npm:^4.3.7, debug@npm:^4.4.0": - version: 4.4.0 - resolution: "debug@npm:4.4.0" +"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.3.7, debug@npm:^4.4.0, debug@npm:^4.4.1": + version: 4.4.1 + resolution: "debug@npm:4.4.1" dependencies: ms: ^2.1.3 peerDependenciesMeta: supports-color: optional: true - checksum: fb42df878dd0e22816fc56e1fdca9da73caa85212fbe40c868b1295a6878f9101ae684f4eeef516c13acfc700f5ea07f1136954f43d4cd2d477a811144136479 + checksum: a43826a01cda685ee4cec00fb2d3322eaa90ccadbef60d9287debc2a886be3e835d9199c80070ede75a409ee57828c4c6cd80e4b154f2843f0dc95a570dc0729 languageName: node linkType: hard @@ -9431,7 +9426,7 @@ __metadata: languageName: node linkType: hard -"es-module-lexer@npm:^1.2.1, es-module-lexer@npm:^1.5.3, es-module-lexer@npm:^1.7.0": +"es-module-lexer@npm:^1.2.1, es-module-lexer@npm:^1.7.0": version: 1.7.0 resolution: "es-module-lexer@npm:1.7.0" checksum: 7858bb76ae387fdbf8a6fccc951bf18919768309850587553eca34698b9193fbc65fab03d3d9f69163d860321fbf66adf89d5821e7f4148c7cb7d7b997259211 @@ -9752,23 +9747,22 @@ __metadata: linkType: hard "eslint-plugin-jsdoc@npm:^50.5.0": - version: 50.6.0 - resolution: "eslint-plugin-jsdoc@npm:50.6.0" + version: 50.8.0 + resolution: "eslint-plugin-jsdoc@npm:50.8.0" dependencies: - "@es-joy/jsdoccomment": ~0.49.0 + "@es-joy/jsdoccomment": ~0.50.2 are-docs-informative: ^0.0.2 comment-parser: 1.4.1 - debug: ^4.3.6 + debug: ^4.4.1 escape-string-regexp: ^4.0.0 - espree: ^10.1.0 + espree: ^10.3.0 esquery: ^1.6.0 - parse-imports: ^2.1.1 - semver: ^7.6.3 + parse-imports-exports: ^0.2.4 + semver: ^7.7.2 spdx-expression-parse: ^4.0.0 - synckit: ^0.9.1 peerDependencies: eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 - checksum: 012528306fa67cf76ef6d202d59d1c1834aa33f450950a30eae50805d244d90c4d8a3a2887a508be32f07992239d96fab880b7f5123e6dd1a05239759b5af00e + checksum: 79512f79f0d707c998ff24b74db3e87594bb2716f30e30c0e67941f71a0ab47114a5f792b5fa00d33d97ef349e1c276898e8bfed28e068695623db81c8114b77 languageName: node linkType: hard @@ -9984,7 +9978,7 @@ __metadata: languageName: node linkType: hard -"espree@npm:^10.0.1, espree@npm:^10.1.0, espree@npm:^10.3.0": +"espree@npm:^10.0.1, espree@npm:^10.3.0": version: 10.3.0 resolution: "espree@npm:10.3.0" dependencies: @@ -15426,13 +15420,12 @@ __metadata: languageName: node linkType: hard -"parse-imports@npm:^2.1.1": - version: 2.2.1 - resolution: "parse-imports@npm:2.2.1" +"parse-imports-exports@npm:^0.2.4": + version: 0.2.4 + resolution: "parse-imports-exports@npm:0.2.4" dependencies: - es-module-lexer: ^1.5.3 - slashes: ^3.0.12 - checksum: 0b5cedd10b6b45eea4f365bf047074a874d90e952597f83d4a8a00f1edece180b5870e42401b5531088916836f98c20eecbddc608d8717eb4a6be99a41f2b6fd + parse-statements: 1.0.11 + checksum: c0028aef0ac33c3905928973a0222be027e148ffb8950faaae1d2849526dc5c95aa44a4a619dea0e540529ae74e78414c2e2b6b037520e499e970c1059f0c12d languageName: node linkType: hard @@ -15455,6 +15448,13 @@ __metadata: languageName: node linkType: hard +"parse-statements@npm:1.0.11": + version: 1.0.11 + resolution: "parse-statements@npm:1.0.11" + checksum: b7281e5b9e949cbed4cebaf56fb2d30495e5caf0e0ef9b8227e4b4010664db693d4bc694d54d04997f65034ebd569246b6ad454d2cdc3ecbaff69b7bc7b9b068 + languageName: node + linkType: hard + "parse5-htmlparser2-tree-adapter@npm:^7.0.0": version: 7.0.0 resolution: "parse5-htmlparser2-tree-adapter@npm:7.0.0" @@ -18295,13 +18295,6 @@ __metadata: languageName: node linkType: hard -"slashes@npm:^3.0.12": - version: 3.0.12 - resolution: "slashes@npm:3.0.12" - checksum: 6b68feb5a56d53d76acd4729b0e457f47a0b687877161ca2c05486ec0bc750e0694b37094b2f5f00a339dfe490269292c4197a70da7eba2be47bc56e35f10a60 - languageName: node - linkType: hard - "slice-ansi@npm:^4.0.0": version: 4.0.0 resolution: "slice-ansi@npm:4.0.0" @@ -18997,16 +18990,6 @@ __metadata: languageName: node linkType: hard -"synckit@npm:^0.9.1": - version: 0.9.2 - resolution: "synckit@npm:0.9.2" - dependencies: - "@pkgr/core": ^0.1.0 - tslib: ^2.6.2 - checksum: 3a30e828efbdcf3b50fccab4da6e90ea7ca24d8c5c2ad3ffe98e07d7c492df121e0f75227c6e510f96f976aae76f1fa4710cb7b1d69db881caf66ef9de89360e - languageName: node - linkType: hard - "table@npm:^6.9.0": version: 6.9.0 resolution: "table@npm:6.9.0" @@ -19308,7 +19291,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.3, tslib@npm:^2.3.0, tslib@npm:^2.4.0, tslib@npm:^2.6.0, tslib@npm:^2.6.2, tslib@npm:^2.8.0": +"tslib@npm:^2.0.3, tslib@npm:^2.3.0, tslib@npm:^2.4.0, tslib@npm:^2.6.0, tslib@npm:^2.8.0": version: 2.8.1 resolution: "tslib@npm:2.8.1" checksum: e4aba30e632b8c8902b47587fd13345e2827fa639e7c3121074d5ee0880723282411a8838f830b55100cbe4517672f84a2472667d355b81e8af165a55dc6203a From 0439188fdedc5d2a114eef7a2ed1097be2cf37fb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 21:05:12 +0930 Subject: [PATCH 135/283] chore(deps): update dependency eslint-plugin-regexp to v2.10.0 (#11503) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c15e022bd7bc..ded9f53ee073 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9842,8 +9842,8 @@ __metadata: linkType: hard "eslint-plugin-regexp@npm:^2.7.0": - version: 2.7.0 - resolution: "eslint-plugin-regexp@npm:2.7.0" + version: 2.10.0 + resolution: "eslint-plugin-regexp@npm:2.10.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 "@eslint-community/regexpp": ^4.11.0 @@ -9854,7 +9854,7 @@ __metadata: scslre: ^0.3.0 peerDependencies: eslint: ">=8.44.0" - checksum: 8df259c085288e887d5b832cb4c3295cc863e7a917029069930c6ff9228fdc2c4d5252d7bc9bcfda8a87501ce9ccfb08b211547397c5888a32152afbe80718b5 + checksum: 427889ab02e2f51e6d2068309c2cd9cca4462dbedc7ed421e321bd67fee347e8fed188045b9dabb11189899289f265c44a2ed35c3f5787bd8a3421c1947bb8d1 languageName: node linkType: hard From 06d964c4723d4a5f1bb5356fc8e1e495705a9adf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 06:49:27 -0700 Subject: [PATCH 136/283] chore(deps): update dependency eslint-plugin-perfectionist to v4.15.0 (#11502) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/yarn.lock b/yarn.lock index ded9f53ee073..cc663a7332fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5904,7 +5904,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.40.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.32.1, @typescript-eslint/types@^8.40.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.40.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.40.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6003,7 +6003,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.40.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.32.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.40.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: @@ -9792,15 +9792,15 @@ __metadata: linkType: hard "eslint-plugin-perfectionist@npm:^4.12.3": - version: 4.13.0 - resolution: "eslint-plugin-perfectionist@npm:4.13.0" + version: 4.15.0 + resolution: "eslint-plugin-perfectionist@npm:4.15.0" dependencies: - "@typescript-eslint/types": ^8.32.1 - "@typescript-eslint/utils": ^8.32.1 + "@typescript-eslint/types": ^8.34.1 + "@typescript-eslint/utils": ^8.34.1 natural-orderby: ^5.0.0 peerDependencies: eslint: ">=8.45.0" - checksum: 8dacb19fcd1cb1c5362c8715f72946aaed91be4f35c3cf4465d8e82a0a1b436bd6e7c36973cfc8e25221413d3a9a0d1e73901d40cca295e91a0d61dcdb0f9aa6 + checksum: 84a7ff19a18afc08d3b992e89a9af646b83c7ae925b62e689832d311931abcb1e531793de150ac15609b9819e157f85b155070f471c40ae65821e326f287ec4f languageName: node linkType: hard From ec951aa4b35305bbd62cd9a00e2870f7fd205134 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 06:49:57 -0700 Subject: [PATCH 137/283] chore(deps): update dependency globals to v16.3.0 (#11507) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index cc663a7332fb..36ae9cc5d545 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11117,9 +11117,9 @@ __metadata: linkType: hard "globals@npm:^16.0.0": - version: 16.1.0 - resolution: "globals@npm:16.1.0" - checksum: b6ed722b61a6c37c057a71d9433c08196ad57cd1e86ed160a82f5a488310b2d85cc593f17414bad00bf88f1e6f4f8387d2014f9ac859a16ccf2a0df77a1aac45 + version: 16.3.0 + resolution: "globals@npm:16.3.0" + checksum: 2f3467f27bd84dca7778b0f7b528718b697274f3ed0d12721b9af0a14a9b6eb20240cb221817c264a27bfc5b9fac3ae28f6168b39808f27c74142942fb953c73 languageName: node linkType: hard From 7846738864d9783abb92178529cd34bdaeb0807b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 06:50:16 -0700 Subject: [PATCH 138/283] chore(deps): update dependency knip to v5.62.0 (#11508) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 289 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 184 insertions(+), 105 deletions(-) diff --git a/yarn.lock b/yarn.lock index 36ae9cc5d545..59f1b09b5465 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3290,31 +3290,31 @@ __metadata: languageName: node linkType: hard -"@emnapi/core@npm:^1.1.0, @emnapi/core@npm:^1.4.0": - version: 1.4.3 - resolution: "@emnapi/core@npm:1.4.3" +"@emnapi/core@npm:^1.1.0, @emnapi/core@npm:^1.4.5": + version: 1.4.5 + resolution: "@emnapi/core@npm:1.4.5" dependencies: - "@emnapi/wasi-threads": 1.0.2 + "@emnapi/wasi-threads": 1.0.4 tslib: ^2.4.0 - checksum: 1c757d380b3cecec637a2eccfb31b770b995060f695d1e15b29a86e2038909a24152947ef6e4b6586759e6716148ff17f40e51367d1b79c9a3e1b6812537bdf4 + checksum: ae4800fe2bcc1c790e588ce19e299fa85c6e1fe2a4ac44eda26be1ad4220b6121de18a735d5fa81307a86576fe2038ab53bde5f8f6aa3708b9276d6600a50b52 languageName: node linkType: hard -"@emnapi/runtime@npm:^1.1.0, @emnapi/runtime@npm:^1.4.0": - version: 1.4.3 - resolution: "@emnapi/runtime@npm:1.4.3" +"@emnapi/runtime@npm:^1.1.0, @emnapi/runtime@npm:^1.4.5": + version: 1.4.5 + resolution: "@emnapi/runtime@npm:1.4.5" dependencies: tslib: ^2.4.0 - checksum: ff2074809638ed878e476ece370c6eae7e6257bf029a581bb7a290488d8f2a08c420a65988c7f03bfc6bb689218f0cd995d2f935bd182150b357fc2341142f4f + checksum: 99ab25d55cf1ceeec12f83b60f48e744f8e1dfc8d52a2ed81b3b09bf15182e61ef55f25b69d51ec83044861bddaa4404e7c3285bf71dd518a7980867e41c2a10 languageName: node linkType: hard -"@emnapi/wasi-threads@npm:1.0.2": - version: 1.0.2 - resolution: "@emnapi/wasi-threads@npm:1.0.2" +"@emnapi/wasi-threads@npm:1.0.4": + version: 1.0.4 + resolution: "@emnapi/wasi-threads@npm:1.0.4" dependencies: tslib: ^2.4.0 - checksum: c289cd3d0e26f11de23429a4abc7f99927917c0871d5a22637cbb75170f2b58d3a42e80d76dea89d054e529f79e35cdc953324819a7f990305d0db2897fa5fab + checksum: 106cbb0c86e0e5a8830a3262105a6531e09ebcc21724f0da64ec49d76d87cbf894e0afcbc3a3621a104abf7465e3f758bffb5afa61a308c31abc847525c10d93 languageName: node linkType: hard @@ -4073,14 +4073,14 @@ __metadata: languageName: node linkType: hard -"@napi-rs/wasm-runtime@npm:^0.2.9": - version: 0.2.9 - resolution: "@napi-rs/wasm-runtime@npm:0.2.9" +"@napi-rs/wasm-runtime@npm:^1.0.1": + version: 1.0.3 + resolution: "@napi-rs/wasm-runtime@npm:1.0.3" dependencies: - "@emnapi/core": ^1.4.0 - "@emnapi/runtime": ^1.4.0 - "@tybys/wasm-util": ^0.9.0 - checksum: bffa375d960ebe5f0e98583f46a14bf4aaa086c2cce45582229b36eb0f5987d9dae1c184ebc218df504ffdd92a7169f73ac60697e6e2a2fc064277e3150a3764 + "@emnapi/core": ^1.4.5 + "@emnapi/runtime": ^1.4.5 + "@tybys/wasm-util": ^0.10.0 + checksum: e105c8f3bfc07ccbbccc17e6abb6d3f5a9cf685930842c4f5439c6d4a7ccab3d89da43fc8627f222a021beb7f78171f80ce3c488e3bd3a2156a049cd8224ebf0 languageName: node linkType: hard @@ -4295,95 +4295,137 @@ __metadata: languageName: node linkType: hard -"@oxc-resolver/binding-darwin-arm64@npm:9.0.2": - version: 9.0.2 - resolution: "@oxc-resolver/binding-darwin-arm64@npm:9.0.2" +"@oxc-resolver/binding-android-arm-eabi@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-android-arm-eabi@npm:11.6.1" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@oxc-resolver/binding-android-arm64@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-android-arm64@npm:11.6.1" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-darwin-arm64@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-darwin-arm64@npm:11.6.1" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@oxc-resolver/binding-darwin-x64@npm:9.0.2": - version: 9.0.2 - resolution: "@oxc-resolver/binding-darwin-x64@npm:9.0.2" +"@oxc-resolver/binding-darwin-x64@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-darwin-x64@npm:11.6.1" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@oxc-resolver/binding-freebsd-x64@npm:9.0.2": - version: 9.0.2 - resolution: "@oxc-resolver/binding-freebsd-x64@npm:9.0.2" +"@oxc-resolver/binding-freebsd-x64@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-freebsd-x64@npm:11.6.1" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm-gnueabihf@npm:9.0.2": - version: 9.0.2 - resolution: "@oxc-resolver/binding-linux-arm-gnueabihf@npm:9.0.2" +"@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.6.1" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm64-gnu@npm:9.0.2": - version: 9.0.2 - resolution: "@oxc-resolver/binding-linux-arm64-gnu@npm:9.0.2" +"@oxc-resolver/binding-linux-arm-musleabihf@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-linux-arm-musleabihf@npm:11.6.1" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-arm64-gnu@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-linux-arm64-gnu@npm:11.6.1" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm64-musl@npm:9.0.2": - version: 9.0.2 - resolution: "@oxc-resolver/binding-linux-arm64-musl@npm:9.0.2" +"@oxc-resolver/binding-linux-arm64-musl@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-linux-arm64-musl@npm:11.6.1" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@oxc-resolver/binding-linux-riscv64-gnu@npm:9.0.2": - version: 9.0.2 - resolution: "@oxc-resolver/binding-linux-riscv64-gnu@npm:9.0.2" +"@oxc-resolver/binding-linux-ppc64-gnu@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-linux-ppc64-gnu@npm:11.6.1" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-riscv64-gnu@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-linux-riscv64-gnu@npm:11.6.1" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-s390x-gnu@npm:9.0.2": - version: 9.0.2 - resolution: "@oxc-resolver/binding-linux-s390x-gnu@npm:9.0.2" +"@oxc-resolver/binding-linux-riscv64-musl@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-linux-riscv64-musl@npm:11.6.1" + conditions: os=linux & cpu=riscv64 & libc=musl + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-s390x-gnu@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-linux-s390x-gnu@npm:11.6.1" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-x64-gnu@npm:9.0.2": - version: 9.0.2 - resolution: "@oxc-resolver/binding-linux-x64-gnu@npm:9.0.2" +"@oxc-resolver/binding-linux-x64-gnu@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-linux-x64-gnu@npm:11.6.1" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-x64-musl@npm:9.0.2": - version: 9.0.2 - resolution: "@oxc-resolver/binding-linux-x64-musl@npm:9.0.2" +"@oxc-resolver/binding-linux-x64-musl@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-linux-x64-musl@npm:11.6.1" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@oxc-resolver/binding-wasm32-wasi@npm:9.0.2": - version: 9.0.2 - resolution: "@oxc-resolver/binding-wasm32-wasi@npm:9.0.2" +"@oxc-resolver/binding-wasm32-wasi@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-wasm32-wasi@npm:11.6.1" dependencies: - "@napi-rs/wasm-runtime": ^0.2.9 + "@napi-rs/wasm-runtime": ^1.0.1 conditions: cpu=wasm32 languageName: node linkType: hard -"@oxc-resolver/binding-win32-arm64-msvc@npm:9.0.2": - version: 9.0.2 - resolution: "@oxc-resolver/binding-win32-arm64-msvc@npm:9.0.2" +"@oxc-resolver/binding-win32-arm64-msvc@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-win32-arm64-msvc@npm:11.6.1" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@oxc-resolver/binding-win32-x64-msvc@npm:9.0.2": - version: 9.0.2 - resolution: "@oxc-resolver/binding-win32-x64-msvc@npm:9.0.2" +"@oxc-resolver/binding-win32-ia32-msvc@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-win32-ia32-msvc@npm:11.6.1" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@oxc-resolver/binding-win32-x64-msvc@npm:11.6.1": + version: 11.6.1 + resolution: "@oxc-resolver/binding-win32-x64-msvc@npm:11.6.1" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -5146,6 +5188,15 @@ __metadata: languageName: node linkType: hard +"@tybys/wasm-util@npm:^0.10.0": + version: 0.10.0 + resolution: "@tybys/wasm-util@npm:0.10.0" + dependencies: + tslib: ^2.4.0 + checksum: c3034e0535b91f28dc74c72fc538f353cda0fa9107bb313e8b89f101402b7dc8e400442d07560775cdd7cb63d33549867ed776372fbaa41dc68bcd108e5cff8a + languageName: node + linkType: hard + "@tybys/wasm-util@npm:^0.9.0": version: 0.9.0 resolution: "@tybys/wasm-util@npm:0.9.0" @@ -10413,12 +10464,12 @@ __metadata: languageName: node linkType: hard -"fd-package-json@npm:^1.2.0": - version: 1.2.0 - resolution: "fd-package-json@npm:1.2.0" +"fd-package-json@npm:^2.0.0": + version: 2.0.0 + resolution: "fd-package-json@npm:2.0.0" dependencies: - walk-up-path: ^3.0.1 - checksum: 043a9b5bbec41d2e452b6c81943b235f0f89358acb1f0fbcfa7ecba80df53434f8e1d663d964c919447fbd0c6f8f8e7dc477fd31a1dd1d7217bfaeeae14fcbb0 + walk-up-path: ^4.0.0 + checksum: e595a1a23f8e208815cdcf26c92218240da00acce80468324408dc4a5cb6c26b6efb5076f0458a02f044562a1e60253731187a627d5416b4961468ddfc0ae426 languageName: node linkType: hard @@ -10704,14 +10755,14 @@ __metadata: languageName: node linkType: hard -"formatly@npm:^0.2.3": - version: 0.2.3 - resolution: "formatly@npm:0.2.3" +"formatly@npm:^0.2.4": + version: 0.2.4 + resolution: "formatly@npm:0.2.4" dependencies: - fd-package-json: ^1.2.0 + fd-package-json: ^2.0.0 bin: formatly: bin/index.mjs - checksum: 8cab7108c6e46f088b737dc0a6ad4c8eafcce9b87934179d018da1ebe0746e1a28ec6b3caab34c54832f9ec08097d97ed6e907eefdaab6eb70bbeba9d3799e5e + checksum: 1d5b501a83cb5778e357594b1f3c839de2bae1ee92dc5c0fc367f2dc7f9c3cddb52934c9f261e9ef2cac08931c4a8d2beb1d0f034c9f0b212e81b7e83faca996 languageName: node linkType: hard @@ -12938,20 +12989,20 @@ __metadata: linkType: hard "knip@npm:^5.41.1": - version: 5.56.0 - resolution: "knip@npm:5.56.0" + version: 5.62.0 + resolution: "knip@npm:5.62.0" dependencies: "@nodelib/fs.walk": ^1.2.3 fast-glob: ^3.3.3 - formatly: ^0.2.3 + formatly: ^0.2.4 jiti: ^2.4.2 js-yaml: ^4.1.0 minimist: ^1.2.8 - oxc-resolver: ^9.0.2 - picocolors: ^1.1.0 + oxc-resolver: ^11.1.0 + picocolors: ^1.1.1 picomatch: ^4.0.1 - smol-toml: ^1.3.1 - strip-json-comments: 5.0.1 + smol-toml: ^1.3.4 + strip-json-comments: 5.0.2 zod: ^3.22.4 zod-validation-error: ^3.0.3 peerDependencies: @@ -12960,7 +13011,7 @@ __metadata: bin: knip: bin/knip.js knip-bun: bin/knip-bun.js - checksum: 8de4800915cd502d213ba2a8301c8f445955fed95915281b1ceb688f59c0062737171448c114d7147236f0f134c13b1a1f676e293896ace7ebf20bdeb143dc0c + checksum: a7b32e2d264b951e65ec7e0009bd27f1bacbe9be8703fa897eb520427b7414babf4c718876f3f01208d8479189061dc921edf44ad849d85b2c6689c858a79ebe languageName: node linkType: hard @@ -14714,6 +14765,15 @@ __metadata: languageName: node linkType: hard +"napi-postinstall@npm:^0.3.0": + version: 0.3.3 + resolution: "napi-postinstall@npm:0.3.3" + bin: + napi-postinstall: lib/cli.js + checksum: b18f36be61045821423f6fdfa68fcf27ef781d2f7d65ef16c611ee2d815439c7db0c2482f3982d26b0bdafbaaa0e8387cbc84172080079c506364686971d76fb + languageName: node + linkType: hard + "natural-compare@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare@npm:1.4.0" @@ -15222,24 +15282,35 @@ __metadata: languageName: node linkType: hard -"oxc-resolver@npm:^9.0.2": - version: 9.0.2 - resolution: "oxc-resolver@npm:9.0.2" - dependencies: - "@oxc-resolver/binding-darwin-arm64": 9.0.2 - "@oxc-resolver/binding-darwin-x64": 9.0.2 - "@oxc-resolver/binding-freebsd-x64": 9.0.2 - "@oxc-resolver/binding-linux-arm-gnueabihf": 9.0.2 - "@oxc-resolver/binding-linux-arm64-gnu": 9.0.2 - "@oxc-resolver/binding-linux-arm64-musl": 9.0.2 - "@oxc-resolver/binding-linux-riscv64-gnu": 9.0.2 - "@oxc-resolver/binding-linux-s390x-gnu": 9.0.2 - "@oxc-resolver/binding-linux-x64-gnu": 9.0.2 - "@oxc-resolver/binding-linux-x64-musl": 9.0.2 - "@oxc-resolver/binding-wasm32-wasi": 9.0.2 - "@oxc-resolver/binding-win32-arm64-msvc": 9.0.2 - "@oxc-resolver/binding-win32-x64-msvc": 9.0.2 +"oxc-resolver@npm:^11.1.0": + version: 11.6.1 + resolution: "oxc-resolver@npm:11.6.1" + dependencies: + "@oxc-resolver/binding-android-arm-eabi": 11.6.1 + "@oxc-resolver/binding-android-arm64": 11.6.1 + "@oxc-resolver/binding-darwin-arm64": 11.6.1 + "@oxc-resolver/binding-darwin-x64": 11.6.1 + "@oxc-resolver/binding-freebsd-x64": 11.6.1 + "@oxc-resolver/binding-linux-arm-gnueabihf": 11.6.1 + "@oxc-resolver/binding-linux-arm-musleabihf": 11.6.1 + "@oxc-resolver/binding-linux-arm64-gnu": 11.6.1 + "@oxc-resolver/binding-linux-arm64-musl": 11.6.1 + "@oxc-resolver/binding-linux-ppc64-gnu": 11.6.1 + "@oxc-resolver/binding-linux-riscv64-gnu": 11.6.1 + "@oxc-resolver/binding-linux-riscv64-musl": 11.6.1 + "@oxc-resolver/binding-linux-s390x-gnu": 11.6.1 + "@oxc-resolver/binding-linux-x64-gnu": 11.6.1 + "@oxc-resolver/binding-linux-x64-musl": 11.6.1 + "@oxc-resolver/binding-wasm32-wasi": 11.6.1 + "@oxc-resolver/binding-win32-arm64-msvc": 11.6.1 + "@oxc-resolver/binding-win32-ia32-msvc": 11.6.1 + "@oxc-resolver/binding-win32-x64-msvc": 11.6.1 + napi-postinstall: ^0.3.0 dependenciesMeta: + "@oxc-resolver/binding-android-arm-eabi": + optional: true + "@oxc-resolver/binding-android-arm64": + optional: true "@oxc-resolver/binding-darwin-arm64": optional: true "@oxc-resolver/binding-darwin-x64": @@ -15248,12 +15319,18 @@ __metadata: optional: true "@oxc-resolver/binding-linux-arm-gnueabihf": optional: true + "@oxc-resolver/binding-linux-arm-musleabihf": + optional: true "@oxc-resolver/binding-linux-arm64-gnu": optional: true "@oxc-resolver/binding-linux-arm64-musl": optional: true + "@oxc-resolver/binding-linux-ppc64-gnu": + optional: true "@oxc-resolver/binding-linux-riscv64-gnu": optional: true + "@oxc-resolver/binding-linux-riscv64-musl": + optional: true "@oxc-resolver/binding-linux-s390x-gnu": optional: true "@oxc-resolver/binding-linux-x64-gnu": @@ -15264,9 +15341,11 @@ __metadata: optional: true "@oxc-resolver/binding-win32-arm64-msvc": optional: true + "@oxc-resolver/binding-win32-ia32-msvc": + optional: true "@oxc-resolver/binding-win32-x64-msvc": optional: true - checksum: d51312a12a64f214b0139d3865cc0ac6f47ae678403595ae656fd7fac8613b4a6629c4fba86c6fa56bd0af98ad75567265ddcad7f7d2240f527c75d77dea1969 + checksum: 9cc70a0a88ed79c186b9f1bc450509bb7a0032b4ff72e5b0e674d8de167c7ea4d82751c6099b024ca2ae673f02352ce83cd0cee7119c2f5cbc4d48d18c982b38 languageName: node linkType: hard @@ -18333,7 +18412,7 @@ __metadata: languageName: node linkType: hard -"smol-toml@npm:^1.3.1, smol-toml@npm:^1.4.1": +"smol-toml@npm:^1.3.4, smol-toml@npm:^1.4.1": version: 1.4.2 resolution: "smol-toml@npm:1.4.2" checksum: f12d3fbc2d49396ec523170828a5c9a89bc7740eb7b205f8d8553af18629d936474c1ce55b70c7839aa239a11252e16fd1c3fc955b966b81c9dec00155df4f85 @@ -18793,10 +18872,10 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:5.0.1": - version: 5.0.1 - resolution: "strip-json-comments@npm:5.0.1" - checksum: b314af70c6666a71133e309a571bdb87687fc878d9fd8b38ebed393a77b89835b92f191aa6b0bc10dfd028ba99eed6b6365985001d64c5aef32a4a82456a156b +"strip-json-comments@npm:5.0.2": + version: 5.0.2 + resolution: "strip-json-comments@npm:5.0.2" + checksum: 986064b73898edc77113cd6147b32f36e299869f3675ed81c3166492a6d8f02d918a492604d1982dab40ca727a86969cb91aa44d6632626f8d7c3c6ead1216bb languageName: node linkType: hard @@ -20002,10 +20081,10 @@ __metadata: languageName: node linkType: hard -"walk-up-path@npm:^3.0.1": - version: 3.0.1 - resolution: "walk-up-path@npm:3.0.1" - checksum: 9ffca02fe30fb65f6db531260582988c5e766f4c739cf86a6109380a7f791236b5d0b92b1dce37a6f73e22dca6bc9d93bf3700413e16251b2bd6bbd1ca2be316 +"walk-up-path@npm:^4.0.0": + version: 4.0.0 + resolution: "walk-up-path@npm:4.0.0" + checksum: 6a230b20e5de296895116dc12b09dafaec1f72b8060c089533d296e241aff059dfaebe0d015c77467f857e4b40c78e08f7481add76f340233a1f34fa8af9ed63 languageName: node linkType: hard From 2a0453a7c5ba337655535d0eaf361869d73f9be9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 15:58:00 +0000 Subject: [PATCH 139/283] chore(deps): update dependency @eslint/compat to v1.3.2 (#11480) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index 59f1b09b5465..8fcc3f1e226a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3698,14 +3698,14 @@ __metadata: linkType: hard "@eslint/compat@npm:^1.2.4": - version: 1.2.4 - resolution: "@eslint/compat@npm:1.2.4" + version: 1.3.2 + resolution: "@eslint/compat@npm:1.3.2" peerDependencies: - eslint: ^9.10.0 + eslint: ^8.40 || 9 peerDependenciesMeta: eslint: optional: true - checksum: d68b0e5d4f2890c86b439cd2e4c0f9c6e7eae09230a69cf80a0b647f7242ed5c662cc286a06d6eb06d95e3def62ed26e9e1eac494538d58b4e2cfc355d37c176 + checksum: 64ef212d38c039b92d1210bbcc640bbc1d21335ff343ca3c6dcbd63d7e7fa734395ab476b7787dbc3466ff40c264db5b11322ac371b4a409f5850e053829010b languageName: node linkType: hard From f25feb4c64053b1d7d6334af010c138cce06000e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 10:41:17 -0600 Subject: [PATCH 140/283] chore(deps): update vitest monorepo to v3.2.4 (#11512) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 465 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 284 insertions(+), 181 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8fcc3f1e226a..5f8c006eda53 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3922,7 +3922,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.23, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.28, @jridgewell/trace-mapping@npm:^0.3.9": +"@jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.23, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.28, @jridgewell/trace-mapping@npm:^0.3.29, @jridgewell/trace-mapping@npm:^0.3.9": version: 0.3.30 resolution: "@jridgewell/trace-mapping@npm:0.3.30" dependencies: @@ -4551,142 +4551,142 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.41.0" +"@rollup/rollup-android-arm-eabi@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.46.3" conditions: os=android & cpu=arm languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-android-arm64@npm:4.41.0" +"@rollup/rollup-android-arm64@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-android-arm64@npm:4.46.3" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-darwin-arm64@npm:4.41.0" +"@rollup/rollup-darwin-arm64@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-darwin-arm64@npm:4.46.3" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-darwin-x64@npm:4.41.0" +"@rollup/rollup-darwin-x64@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-darwin-x64@npm:4.46.3" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-freebsd-arm64@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-freebsd-arm64@npm:4.41.0" +"@rollup/rollup-freebsd-arm64@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-freebsd-arm64@npm:4.46.3" conditions: os=freebsd & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-freebsd-x64@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-freebsd-x64@npm:4.41.0" +"@rollup/rollup-freebsd-x64@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-freebsd-x64@npm:4.46.3" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.41.0" +"@rollup/rollup-linux-arm-gnueabihf@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.46.3" conditions: os=linux & cpu=arm & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.41.0" +"@rollup/rollup-linux-arm-musleabihf@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.46.3" conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.41.0" +"@rollup/rollup-linux-arm64-gnu@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.46.3" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.41.0" +"@rollup/rollup-linux-arm64-musl@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.46.3" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-loongarch64-gnu@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.41.0" +"@rollup/rollup-linux-loongarch64-gnu@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.46.3" conditions: os=linux & cpu=loong64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.41.0" +"@rollup/rollup-linux-ppc64-gnu@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.46.3" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.41.0" +"@rollup/rollup-linux-riscv64-gnu@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.46.3" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-musl@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.41.0" +"@rollup/rollup-linux-riscv64-musl@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.46.3" conditions: os=linux & cpu=riscv64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.41.0" +"@rollup/rollup-linux-s390x-gnu@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.46.3" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.41.0" +"@rollup/rollup-linux-x64-gnu@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.46.3" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.41.0" +"@rollup/rollup-linux-x64-musl@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.46.3" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.41.0" +"@rollup/rollup-win32-arm64-msvc@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.46.3" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.41.0" +"@rollup/rollup-win32-ia32-msvc@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.46.3" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.41.0": - version: 4.41.0 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.41.0" +"@rollup/rollup-win32-x64-msvc@npm:4.46.3": + version: 4.46.3 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.46.3" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -5289,6 +5289,15 @@ __metadata: languageName: node linkType: hard +"@types/chai@npm:^5.2.2": + version: 5.2.2 + resolution: "@types/chai@npm:5.2.2" + dependencies: + "@types/deep-eql": "*" + checksum: 386887bd55ba684572cececd833ed91aba6cce2edd8cc1d8cefa78800b3a74db6dbf5c5c41af041d1d1f3ce672ea30b45c9520f948cdc75431eb7df3fbba8405 + languageName: node + linkType: hard + "@types/connect-history-api-fallback@npm:^1.3.5": version: 1.3.5 resolution: "@types/connect-history-api-fallback@npm:1.3.5" @@ -5317,6 +5326,13 @@ __metadata: languageName: node linkType: hard +"@types/deep-eql@npm:*": + version: 4.0.2 + resolution: "@types/deep-eql@npm:4.0.2" + checksum: 249a27b0bb22f6aa28461db56afa21ec044fa0e303221a62dff81831b20c8530502175f1a49060f7099e7be06181078548ac47c668de79ff9880241968d43d0c + languageName: node + linkType: hard + "@types/eslint-plugin-jsx-a11y@npm:^6.10.0": version: 6.10.0 resolution: "@types/eslint-plugin-jsx-a11y@npm:6.10.0" @@ -6126,12 +6142,13 @@ __metadata: linkType: hard "@vitest/coverage-v8@npm:^3.1.3": - version: 3.1.4 - resolution: "@vitest/coverage-v8@npm:3.1.4" + version: 3.2.4 + resolution: "@vitest/coverage-v8@npm:3.2.4" dependencies: "@ampproject/remapping": ^2.3.0 "@bcoe/v8-coverage": ^1.0.2 - debug: ^4.4.0 + ast-v8-to-istanbul: ^0.3.3 + debug: ^4.4.1 istanbul-lib-coverage: ^3.2.2 istanbul-lib-report: ^3.0.1 istanbul-lib-source-maps: ^5.0.6 @@ -6142,12 +6159,12 @@ __metadata: test-exclude: ^7.0.1 tinyrainbow: ^2.0.0 peerDependencies: - "@vitest/browser": 3.1.4 - vitest: 3.1.4 + "@vitest/browser": 3.2.4 + vitest: 3.2.4 peerDependenciesMeta: "@vitest/browser": optional: true - checksum: 745c8e7e7898ff54b97bdcc917606d488aa195701d4be3eeae0b4e5c1d4ff16af723e2837f050f7bdbd69fd3d37e131962f19f837e34dd7e0f0fa6dd8fae9c8d + checksum: b33d4abb32216c793b1da122254bf70578c4acddbf2011c377818cbfc9506383398a5a2eaeb70045120dac1f86a1a2511fd624050dd92ef7387b9469929ceb33 languageName: node linkType: hard @@ -6169,84 +6186,86 @@ __metadata: languageName: node linkType: hard -"@vitest/expect@npm:3.1.4": - version: 3.1.4 - resolution: "@vitest/expect@npm:3.1.4" +"@vitest/expect@npm:3.2.4": + version: 3.2.4 + resolution: "@vitest/expect@npm:3.2.4" dependencies: - "@vitest/spy": 3.1.4 - "@vitest/utils": 3.1.4 + "@types/chai": ^5.2.2 + "@vitest/spy": 3.2.4 + "@vitest/utils": 3.2.4 chai: ^5.2.0 tinyrainbow: ^2.0.0 - checksum: 996f67c0608fce0176283cb629b9f15d39781840a3b8ba026baa2f86762559373a963cec14e6eec42c5a6655b3152705319dccefce8014b42cbd42c968ad03e5 + checksum: 57627ee2b47555f47a15843fda05267816e9767e5a769179acac224b8682844e662fa77fbeeb04adcb0874779f3aca861f54e9fc630c1d256d5ea8211c223120 languageName: node linkType: hard -"@vitest/mocker@npm:3.1.4": - version: 3.1.4 - resolution: "@vitest/mocker@npm:3.1.4" +"@vitest/mocker@npm:3.2.4": + version: 3.2.4 + resolution: "@vitest/mocker@npm:3.2.4" dependencies: - "@vitest/spy": 3.1.4 + "@vitest/spy": 3.2.4 estree-walker: ^3.0.3 magic-string: ^0.30.17 peerDependencies: msw: ^2.4.9 - vite: ^5.0.0 || ^6.0.0 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 peerDependenciesMeta: msw: optional: true vite: optional: true - checksum: 8b96137af3575e71369e84b0b1f000a801e8ccf5649495e9d86a1c93a7e5cbec3660553cba5d7450b443212d7c93039530b210b7ede07f1f017f7ad2d8fa7857 + checksum: 2c8ba286fc714036b645a7a72bfbbd6b243baa65320dd71009f5ed1115f70f69c0209e2e213a05202c172e09a408821a33f9df5bc7979900e91cde5d302976e0 languageName: node linkType: hard -"@vitest/pretty-format@npm:3.1.4, @vitest/pretty-format@npm:^3.1.3, @vitest/pretty-format@npm:^3.1.4": - version: 3.1.4 - resolution: "@vitest/pretty-format@npm:3.1.4" +"@vitest/pretty-format@npm:3.2.4, @vitest/pretty-format@npm:^3.1.3, @vitest/pretty-format@npm:^3.2.4": + version: 3.2.4 + resolution: "@vitest/pretty-format@npm:3.2.4" dependencies: tinyrainbow: ^2.0.0 - checksum: 5468fd433e59c12d11dee36f507360da6b5032ef061c6b4bf8f97d7339f9a488e3de46aaaf3c75fb6044f5faa36fae51436b102b67e60ad74b26abfc48536119 + checksum: 68a196e4bdfce6fd03c3958b76cddb71bec65a62ab5aff05ba743a44853b03a95c2809b4e5733d21abff25c4d070dd64f60c81ac973a9fd21a840ff8f8a8d184 languageName: node linkType: hard -"@vitest/runner@npm:3.1.4": - version: 3.1.4 - resolution: "@vitest/runner@npm:3.1.4" +"@vitest/runner@npm:3.2.4": + version: 3.2.4 + resolution: "@vitest/runner@npm:3.2.4" dependencies: - "@vitest/utils": 3.1.4 + "@vitest/utils": 3.2.4 pathe: ^2.0.3 - checksum: 9e2b25d7eafd04171ee9b2609e3435998fe4d0c82122b426a576504c3c2937a20460f8f8ee8a4cfd267620fcc4d4c7bfb8bfc6610288b5ca5f252ad6c5bae6f4 + strip-literal: ^3.0.0 + checksum: c8b08365818f408eec2fe3acbffa0cc7279939a43c02074cd03b853fa37bc68aa181c8f8c2175513a4c5aa4dd3e52a0573d5897a16846d55b2ff4f3577e6c7c8 languageName: node linkType: hard -"@vitest/snapshot@npm:3.1.4": - version: 3.1.4 - resolution: "@vitest/snapshot@npm:3.1.4" +"@vitest/snapshot@npm:3.2.4": + version: 3.2.4 + resolution: "@vitest/snapshot@npm:3.2.4" dependencies: - "@vitest/pretty-format": 3.1.4 + "@vitest/pretty-format": 3.2.4 magic-string: ^0.30.17 pathe: ^2.0.3 - checksum: 4893c5c64518659db31d8b5e6e1bf0fedd320fbc26b9173004a733ad99cb2db8978e83ee7e0b8f81fed36668f6b5b22ed709ab4437a6803451dd541d07b16f3f + checksum: 2f00fb83d5c9ed1f2a79323db3993403bd34265314846cb1bcf1cb9b68f56dfde5ee5a4a8dcb6d95317835bc203662e333da6841e50800c6707e0d22e48ebe6e languageName: node linkType: hard -"@vitest/spy@npm:3.1.4": - version: 3.1.4 - resolution: "@vitest/spy@npm:3.1.4" +"@vitest/spy@npm:3.2.4": + version: 3.2.4 + resolution: "@vitest/spy@npm:3.2.4" dependencies: - tinyspy: ^3.0.2 - checksum: ea957b3b1afe9d33f445b91b446aeffa6e55f57d25801754e3d0206db045405dd6013545d2cb11ab6febd3dcbb3adc9580ec20f0d08ca458d21cfc7eebf9caa8 + tinyspy: ^4.0.3 + checksum: 0e3b591e0c67275b747c5aa67946d6496cd6759dd9b8e05c524426207ca9631fe2cae8ac85a8ba22acec4a593393cd97d825f88a42597fc65441f0b633986f49 languageName: node linkType: hard -"@vitest/utils@npm:3.1.4, @vitest/utils@npm:^3.1.3": - version: 3.1.4 - resolution: "@vitest/utils@npm:3.1.4" +"@vitest/utils@npm:3.2.4, @vitest/utils@npm:^3.1.3": + version: 3.2.4 + resolution: "@vitest/utils@npm:3.2.4" dependencies: - "@vitest/pretty-format": 3.1.4 - loupe: ^3.1.3 + "@vitest/pretty-format": 3.2.4 + loupe: ^3.1.4 tinyrainbow: ^2.0.0 - checksum: 51939f0f1a50dc277f10c81a944a104cdaf7c0cde4c3e192d5605ac34115debf0f8fca1c031483c77fb430595883324a86810070533a5623c0fd95bb4bf0259c + checksum: 6b0fd0075c23b8e3f17ecf315adc1e565e5a9e7d1b8ad78bbccf2505e399855d176254d974587c00bc4396a0e348bae1380e780a1e7f6b97ea6399a9ab665ba7 languageName: node linkType: hard @@ -6953,6 +6972,17 @@ __metadata: languageName: node linkType: hard +"ast-v8-to-istanbul@npm:^0.3.3": + version: 0.3.4 + resolution: "ast-v8-to-istanbul@npm:0.3.4" + dependencies: + "@jridgewell/trace-mapping": ^0.3.29 + estree-walker: ^3.0.3 + js-tokens: ^9.0.1 + checksum: dec6f5d9cc2b238132054a50be0da85d138902a130744bfd83067e5694d4434d379febf7e6fd81d22f5f1e2983bbfcf600684f20da411703f5faed0b6d714e5c + languageName: node + linkType: hard + "astral-regex@npm:^2.0.0": version: 2.0.0 resolution: "astral-regex@npm:2.0.0" @@ -10473,15 +10503,15 @@ __metadata: languageName: node linkType: hard -"fdir@npm:^6.4.4": - version: 6.4.4 - resolution: "fdir@npm:6.4.4" +"fdir@npm:^6.4.4, fdir@npm:^6.5.0": + version: 6.5.0 + resolution: "fdir@npm:6.5.0" peerDependencies: picomatch: ^3 || ^4 peerDependenciesMeta: picomatch: optional: true - checksum: 79043610236579ffbd0647c508b43bd030a2d034a17c43cf96813a00e8e92e51acdb115c6ddecef3b5812cc2692b976155b4f6413e51e3761f1e772fa019a321 + checksum: bd537daa9d3cd53887eed35efa0eab2dbb1ca408790e10e024120e7a36c6e9ae2b33710cb8381e35def01bc9c1d7eaba746f886338413e68ff6ebaee07b9a6e8 languageName: node linkType: hard @@ -12789,6 +12819,13 @@ __metadata: languageName: node linkType: hard +"js-tokens@npm:^9.0.1": + version: 9.0.1 + resolution: "js-tokens@npm:9.0.1" + checksum: 8b604020b1a550e575404bfdde4d12c11a7991ffe0c58a2cf3515b9a512992dc7010af788f0d8b7485e403d462d9e3d3b96c4ff03201550fdbb09e17c811e054 + languageName: node + linkType: hard + "js-yaml@npm:^3.10.0, js-yaml@npm:^3.13.1": version: 3.14.1 resolution: "js-yaml@npm:3.14.1" @@ -13298,10 +13335,10 @@ __metadata: languageName: node linkType: hard -"loupe@npm:^3.1.0, loupe@npm:^3.1.3": - version: 3.1.3 - resolution: "loupe@npm:3.1.3" - checksum: 9b2530b1d5a44d2c9fc5241f97ea00296dca257173c535b4832bc31f9516e10387991feb5b3fff23df116c8fcf907ce3980f82b215dcc5d19cde17ce9b9ec3e1 +"loupe@npm:^3.1.0, loupe@npm:^3.1.4": + version: 3.2.0 + resolution: "loupe@npm:3.2.0" + checksum: 4bfb4d9cf9e482b7f8c2f1d245cf0a14dd690b08d85356b0f0f6da94787c005ead7d2e4812a77ccddae42b86212b168beb1f65da711dc1709e9bf972beb51213 languageName: node linkType: hard @@ -14756,12 +14793,12 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.3.8": - version: 3.3.8 - resolution: "nanoid@npm:3.3.8" +"nanoid@npm:^3.3.11": + version: 3.3.11 + resolution: "nanoid@npm:3.3.11" bin: nanoid: bin/nanoid.cjs - checksum: dfe0adbc0c77e9655b550c333075f51bb28cfc7568afbf3237249904f9c86c9aaaed1f113f0fddddba75673ee31c758c30c43d4414f014a52a7a626efc5958c9 + checksum: 3be20d8866a57a6b6d218e82549711c8352ed969f9ab3c45379da28f405363ad4c9aeb0b39e9abc101a529ca65a72ff9502b00bf74a912c4b64a9d62dfd26c29 languageName: node linkType: hard @@ -16616,14 +16653,14 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.4.21, postcss@npm:^8.4.24, postcss@npm:^8.4.26, postcss@npm:^8.4.33, postcss@npm:^8.4.38, postcss@npm:^8.5.3": - version: 8.5.3 - resolution: "postcss@npm:8.5.3" +"postcss@npm:^8.4.21, postcss@npm:^8.4.24, postcss@npm:^8.4.26, postcss@npm:^8.4.33, postcss@npm:^8.4.38, postcss@npm:^8.5.3, postcss@npm:^8.5.6": + version: 8.5.6 + resolution: "postcss@npm:8.5.6" dependencies: - nanoid: ^3.3.8 + nanoid: ^3.3.11 picocolors: ^1.1.1 source-map-js: ^1.2.1 - checksum: da574620eb84ff60e65e1d8fc6bd5ad87a19101a23d0aba113c653434161543918229a0f673d89efb3b6d4906287eb04b957310dbcf4cbebacad9d1312711461 + checksum: 20f3b5d673ffeec2b28d65436756d31ee33f65b0a8bedb3d32f556fbd5973be38c3a7fb5b959a5236c60a5db7b91b0a6b14ffaac0d717dce1b903b964ee1c1bb languageName: node linkType: hard @@ -17713,31 +17750,31 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^4.34.9": - version: 4.41.0 - resolution: "rollup@npm:4.41.0" - dependencies: - "@rollup/rollup-android-arm-eabi": 4.41.0 - "@rollup/rollup-android-arm64": 4.41.0 - "@rollup/rollup-darwin-arm64": 4.41.0 - "@rollup/rollup-darwin-x64": 4.41.0 - "@rollup/rollup-freebsd-arm64": 4.41.0 - "@rollup/rollup-freebsd-x64": 4.41.0 - "@rollup/rollup-linux-arm-gnueabihf": 4.41.0 - "@rollup/rollup-linux-arm-musleabihf": 4.41.0 - "@rollup/rollup-linux-arm64-gnu": 4.41.0 - "@rollup/rollup-linux-arm64-musl": 4.41.0 - "@rollup/rollup-linux-loongarch64-gnu": 4.41.0 - "@rollup/rollup-linux-powerpc64le-gnu": 4.41.0 - "@rollup/rollup-linux-riscv64-gnu": 4.41.0 - "@rollup/rollup-linux-riscv64-musl": 4.41.0 - "@rollup/rollup-linux-s390x-gnu": 4.41.0 - "@rollup/rollup-linux-x64-gnu": 4.41.0 - "@rollup/rollup-linux-x64-musl": 4.41.0 - "@rollup/rollup-win32-arm64-msvc": 4.41.0 - "@rollup/rollup-win32-ia32-msvc": 4.41.0 - "@rollup/rollup-win32-x64-msvc": 4.41.0 - "@types/estree": 1.0.7 +"rollup@npm:^4.34.9, rollup@npm:^4.43.0": + version: 4.46.3 + resolution: "rollup@npm:4.46.3" + dependencies: + "@rollup/rollup-android-arm-eabi": 4.46.3 + "@rollup/rollup-android-arm64": 4.46.3 + "@rollup/rollup-darwin-arm64": 4.46.3 + "@rollup/rollup-darwin-x64": 4.46.3 + "@rollup/rollup-freebsd-arm64": 4.46.3 + "@rollup/rollup-freebsd-x64": 4.46.3 + "@rollup/rollup-linux-arm-gnueabihf": 4.46.3 + "@rollup/rollup-linux-arm-musleabihf": 4.46.3 + "@rollup/rollup-linux-arm64-gnu": 4.46.3 + "@rollup/rollup-linux-arm64-musl": 4.46.3 + "@rollup/rollup-linux-loongarch64-gnu": 4.46.3 + "@rollup/rollup-linux-ppc64-gnu": 4.46.3 + "@rollup/rollup-linux-riscv64-gnu": 4.46.3 + "@rollup/rollup-linux-riscv64-musl": 4.46.3 + "@rollup/rollup-linux-s390x-gnu": 4.46.3 + "@rollup/rollup-linux-x64-gnu": 4.46.3 + "@rollup/rollup-linux-x64-musl": 4.46.3 + "@rollup/rollup-win32-arm64-msvc": 4.46.3 + "@rollup/rollup-win32-ia32-msvc": 4.46.3 + "@rollup/rollup-win32-x64-msvc": 4.46.3 + "@types/estree": 1.0.8 fsevents: ~2.3.2 dependenciesMeta: "@rollup/rollup-android-arm-eabi": @@ -17762,7 +17799,7 @@ __metadata: optional: true "@rollup/rollup-linux-loongarch64-gnu": optional: true - "@rollup/rollup-linux-powerpc64le-gnu": + "@rollup/rollup-linux-ppc64-gnu": optional: true "@rollup/rollup-linux-riscv64-gnu": optional: true @@ -17784,7 +17821,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: b055892342db9e62d3b84539c2ef1e209a2d053a710c8e42432ba4f200c4d6464172f955c45574a29a500ce72f53c96e54029eb9bbacef5e0731338cf20f3857 + checksum: 8f99bdc4488c0af462c7cbebd042934d114c5232c45f427c8ef1b57d0127900b3fef6e1cf9c78f9c908adde9ebdc5b8166c026d3cf69c4f747d047126e52d245 languageName: node linkType: hard @@ -18893,6 +18930,15 @@ __metadata: languageName: node linkType: hard +"strip-literal@npm:^3.0.0": + version: 3.0.0 + resolution: "strip-literal@npm:3.0.0" + dependencies: + js-tokens: ^9.0.1 + checksum: f697a31c4ad82ad259e0c57e715cde4585084af2260e38b3c916f34f0d462cec2af294a8b8cf062cc6f40d940ece7b79b0ec8316beabb2ed13c6e13e95ca70f0 + languageName: node + linkType: hard + "style-to-object@npm:^0.4.0": version: 0.4.4 resolution: "style-to-object@npm:0.4.4" @@ -19241,10 +19287,10 @@ __metadata: languageName: node linkType: hard -"tinypool@npm:^1.0.2": - version: 1.0.2 - resolution: "tinypool@npm:1.0.2" - checksum: 752f23114d8fc95a9497fc812231d6d0a63728376aa11e6e8499c10423a91112e760e388887ea7854f1b16977c321f07c0eab061ec2f60f6761e58b184aac880 +"tinypool@npm:^1.1.1": + version: 1.1.1 + resolution: "tinypool@npm:1.1.1" + checksum: 0258abe108df8be395a2cbdc8b4390c94908850250530f7bea83a129fa33d49a8c93246f76bf81cd458534abd81322f4d4cb3a40690254f8d9044ff449f328a8 languageName: node linkType: hard @@ -19255,10 +19301,10 @@ __metadata: languageName: node linkType: hard -"tinyspy@npm:^3.0.2": - version: 3.0.2 - resolution: "tinyspy@npm:3.0.2" - checksum: 5db671b2ff5cd309de650c8c4761ca945459d7204afb1776db9a04fb4efa28a75f08517a8620c01ee32a577748802231ad92f7d5b194dc003ee7f987a2a06337 +"tinyspy@npm:^4.0.3": + version: 4.0.3 + resolution: "tinyspy@npm:4.0.3" + checksum: cd5e52d09e2a67946d3a96e6cd68377e1281eb6aaddc9d38129bcec8971a55337ab438ac672857b983f5c620a9f978e784679054322155329d483d00d9291ba9 languageName: node linkType: hard @@ -19943,22 +19989,77 @@ __metadata: languageName: node linkType: hard -"vite-node@npm:3.1.4": - version: 3.1.4 - resolution: "vite-node@npm:3.1.4" +"vite-node@npm:3.2.4": + version: 3.2.4 + resolution: "vite-node@npm:3.2.4" dependencies: cac: ^6.7.14 - debug: ^4.4.0 + debug: ^4.4.1 es-module-lexer: ^1.7.0 pathe: ^2.0.3 - vite: ^5.0.0 || ^6.0.0 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 bin: vite-node: vite-node.mjs - checksum: b3103543b1f7d9ab85a321b771954657931ceb0b4f9f7de62694d2f2c26aeed850e707314d5ffede5d62fa7cec10ba47be8855eee4597c3dce1edf9f2c3cfb26 + checksum: 2051394d48f5eefdee4afc9c5fd5dcbf7eb36d345043ba035c7782e10b33fbbd14318062c4e32e00d473a31a559fb628d67c023e82a4903016db3ac6bfdb3fe7 + languageName: node + linkType: hard + +"vite@npm:^5.0.0 || ^6.0.0 || ^7.0.0-0": + version: 7.1.3 + resolution: "vite@npm:7.1.3" + dependencies: + esbuild: ^0.25.0 + fdir: ^6.5.0 + fsevents: ~2.3.3 + picomatch: ^4.0.3 + postcss: ^8.5.6 + rollup: ^4.43.0 + tinyglobby: ^0.2.14 + peerDependencies: + "@types/node": ^20.19.0 || >=22.12.0 + jiti: ">=1.21.0" + less: ^4.0.0 + lightningcss: ^1.21.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: ">=0.54.8" + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + dependenciesMeta: + fsevents: + optional: true + peerDependenciesMeta: + "@types/node": + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + bin: + vite: bin/vite.js + checksum: 625974a3399d0e9f98e6c06d2ce83b982b5d76e030201809a6bbce03a1cbdb8ff4e0e0dc5e71cd4f402f3858afa8940e091551632a3423fddeb6afd213792d45 languageName: node linkType: hard -"vite@npm:^5.0.0 || ^6.0.0, vite@npm:^6.3.5": +"vite@npm:^6.3.5": version: 6.3.5 resolution: "vite@npm:6.3.5" dependencies: @@ -20014,36 +20115,38 @@ __metadata: linkType: hard "vitest@npm:^3.1.3": - version: 3.1.4 - resolution: "vitest@npm:3.1.4" - dependencies: - "@vitest/expect": 3.1.4 - "@vitest/mocker": 3.1.4 - "@vitest/pretty-format": ^3.1.4 - "@vitest/runner": 3.1.4 - "@vitest/snapshot": 3.1.4 - "@vitest/spy": 3.1.4 - "@vitest/utils": 3.1.4 + version: 3.2.4 + resolution: "vitest@npm:3.2.4" + dependencies: + "@types/chai": ^5.2.2 + "@vitest/expect": 3.2.4 + "@vitest/mocker": 3.2.4 + "@vitest/pretty-format": ^3.2.4 + "@vitest/runner": 3.2.4 + "@vitest/snapshot": 3.2.4 + "@vitest/spy": 3.2.4 + "@vitest/utils": 3.2.4 chai: ^5.2.0 - debug: ^4.4.0 + debug: ^4.4.1 expect-type: ^1.2.1 magic-string: ^0.30.17 pathe: ^2.0.3 + picomatch: ^4.0.2 std-env: ^3.9.0 tinybench: ^2.9.0 tinyexec: ^0.3.2 - tinyglobby: ^0.2.13 - tinypool: ^1.0.2 + tinyglobby: ^0.2.14 + tinypool: ^1.1.1 tinyrainbow: ^2.0.0 - vite: ^5.0.0 || ^6.0.0 - vite-node: 3.1.4 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 + vite-node: 3.2.4 why-is-node-running: ^2.3.0 peerDependencies: "@edge-runtime/vm": "*" "@types/debug": ^4.1.12 "@types/node": ^18.0.0 || ^20.0.0 || >=22.0.0 - "@vitest/browser": 3.1.4 - "@vitest/ui": 3.1.4 + "@vitest/browser": 3.2.4 + "@vitest/ui": 3.2.4 happy-dom: "*" jsdom: "*" peerDependenciesMeta: @@ -20063,7 +20166,7 @@ __metadata: optional: true bin: vitest: vitest.mjs - checksum: 72002a50ea9f86f37c0f96d6e61029d0fe973cc11010d3f75c73168a552d5e52149148542af07f4880bbadc177baeeb13d08422c99d6ecb26202a481be14b534 + checksum: e9aa14a2c4471c2e0364d1d7032303db8754fac9e5e9ada92fca8ebf61ee78d2c5d4386bff25913940a22ea7d78ab435c8dd85785d681b23e2c489d6c17dd382 languageName: node linkType: hard From bd1986b88de7be888ca736ec7fb86fe33473faa7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 17:20:01 +0000 Subject: [PATCH 141/283] chore(deps): update dependency webpack to v5.101.1 (#11511) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 48 +++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5f8c006eda53..80f535876609 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6489,6 +6489,15 @@ __metadata: languageName: node linkType: hard +"acorn-import-phases@npm:^1.0.3": + version: 1.0.4 + resolution: "acorn-import-phases@npm:1.0.4" + peerDependencies: + acorn: ^8.14.0 + checksum: e669cccfb6711af305150fcbfddcf4485fffdc4547a0ecabebe94103b47124cc02bfd186240061c00ac954cfb0461b4ecc3e203e138e43042b7af32063fa9510 + languageName: node + linkType: hard + "acorn-jsx@npm:^5.0.0, acorn-jsx@npm:^5.3.2": version: 5.3.2 resolution: "acorn-jsx@npm:5.3.2" @@ -6505,12 +6514,12 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.14.0, acorn@npm:^8.8.2": - version: 8.14.0 - resolution: "acorn@npm:8.14.0" +"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.14.0, acorn@npm:^8.15.0, acorn@npm:^8.8.2": + version: 8.15.0 + resolution: "acorn@npm:8.15.0" bin: acorn: bin/acorn - checksum: 8755074ba55fff94e84e81c72f1013c2d9c78e973c31231c8ae505a5f966859baf654bddd75046bffd73ce816b149298977fff5077a3033dedba0ae2aad152d4 + checksum: 309c6b49aedf1a2e34aaf266de06de04aab6eb097c02375c66fdeb0f64556a6a823540409914fb364d9a11bc30d79d485a2eba29af47992d3490e9886c4391c3 languageName: node linkType: hard @@ -9337,13 +9346,13 @@ __metadata: languageName: node linkType: hard -"enhanced-resolve@npm:^5.17.1": - version: 5.18.1 - resolution: "enhanced-resolve@npm:5.18.1" +"enhanced-resolve@npm:^5.17.3": + version: 5.18.3 + resolution: "enhanced-resolve@npm:5.18.3" dependencies: graceful-fs: ^4.2.4 tapable: ^2.2.0 - checksum: de5bea7debe3576e78173bcc409c4aee7fcb56580c602d5c47c533b92952e55d7da3d9f53b864846ba62c8bd3efb0f9ecfe5f865e57de2f3e9b6e5cda03b4e7e + checksum: e2b2188a7f9b68616984b5ce1f43b97bef3c5fde4d193c24ea4cfdb4eb784a700093f049f14155733a3cb3ae1204550590aa37dda7e742022c8f447f618a4816 languageName: node linkType: hard @@ -20346,27 +20355,28 @@ __metadata: languageName: node linkType: hard -"webpack-sources@npm:^3.2.3": - version: 3.2.3 - resolution: "webpack-sources@npm:3.2.3" - checksum: 989e401b9fe3536529e2a99dac8c1bdc50e3a0a2c8669cbafad31271eadd994bc9405f88a3039cd2e29db5e6d9d0926ceb7a1a4e7409ece021fe79c37d9c4607 +"webpack-sources@npm:^3.3.3": + version: 3.3.3 + resolution: "webpack-sources@npm:3.3.3" + checksum: 243d438ec4dfe805cca20fa66d111114b1f277b8ecfa95bb6ee0a6c7d996aee682539952028c2b203a6c170e6ef56f71ecf3e366e90bf1cb58b0ae982176b651 languageName: node linkType: hard "webpack@npm:^5.88.1, webpack@npm:^5.91.0, webpack@npm:^5.95.0": - version: 5.99.7 - resolution: "webpack@npm:5.99.7" + version: 5.101.3 + resolution: "webpack@npm:5.101.3" dependencies: "@types/eslint-scope": ^3.7.7 - "@types/estree": ^1.0.6 + "@types/estree": ^1.0.8 "@types/json-schema": ^7.0.15 "@webassemblyjs/ast": ^1.14.1 "@webassemblyjs/wasm-edit": ^1.14.1 "@webassemblyjs/wasm-parser": ^1.14.1 - acorn: ^8.14.0 + acorn: ^8.15.0 + acorn-import-phases: ^1.0.3 browserslist: ^4.24.0 chrome-trace-event: ^1.0.2 - enhanced-resolve: ^5.17.1 + enhanced-resolve: ^5.17.3 es-module-lexer: ^1.2.1 eslint-scope: 5.1.1 events: ^3.2.0 @@ -20380,13 +20390,13 @@ __metadata: tapable: ^2.1.1 terser-webpack-plugin: ^5.3.11 watchpack: ^2.4.1 - webpack-sources: ^3.2.3 + webpack-sources: ^3.3.3 peerDependenciesMeta: webpack-cli: optional: true bin: webpack: bin/webpack.js - checksum: 691b0a57c5a4e9dc1bf99188c4b68a4ff3cf10c23ea8e726e6bf36643f40ecb0fb7a4d7a92f01b187184b8c9f3bc27ee0efc6973cf46ef3913ee6ee8fe806521 + checksum: d23fd86b6bc9854f9b488830d9aa123a7f654ee22849bc8670d0a22add88951f6d9cab1d04087758b642fc31115e3b97e0ac56b80b2200c04c486067aa945663 languageName: node linkType: hard From bc0e4ca7f82bac4951f154522da105b5e378ad91 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 18:03:33 +0000 Subject: [PATCH 142/283] chore(deps): update dependency stylelint to v16.23.1 (#11510) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 120 ++++++++++++++++++++++++------------------------------ 1 file changed, 54 insertions(+), 66 deletions(-) diff --git a/yarn.lock b/yarn.lock index 80f535876609..16a5427febfc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2147,7 +2147,7 @@ __metadata: languageName: node linkType: hard -"@csstools/css-parser-algorithms@npm:^3.0.4, @csstools/css-parser-algorithms@npm:^3.0.5": +"@csstools/css-parser-algorithms@npm:^3.0.5": version: 3.0.5 resolution: "@csstools/css-parser-algorithms@npm:3.0.5" peerDependencies: @@ -2156,14 +2156,14 @@ __metadata: languageName: node linkType: hard -"@csstools/css-tokenizer@npm:^3.0.3, @csstools/css-tokenizer@npm:^3.0.4": +"@csstools/css-tokenizer@npm:^3.0.4": version: 3.0.4 resolution: "@csstools/css-tokenizer@npm:3.0.4" checksum: adc6681d3a0d7a75dc8e5ee0488c99ad4509e4810ae45dd6549a2e64a996e8d75512e70bb244778dc0c6ee85723e20eaeea8c083bf65b51eb19034e182554243 languageName: node linkType: hard -"@csstools/media-query-list-parser@npm:^4.0.2, @csstools/media-query-list-parser@npm:^4.0.3": +"@csstools/media-query-list-parser@npm:^4.0.3": version: 4.0.3 resolution: "@csstools/media-query-list-parser@npm:4.0.3" peerDependencies: @@ -3932,12 +3932,10 @@ __metadata: languageName: node linkType: hard -"@keyv/serialize@npm:^1.0.3": - version: 1.0.3 - resolution: "@keyv/serialize@npm:1.0.3" - dependencies: - buffer: ^6.0.3 - checksum: 5f7b90e8ae76d2a1850a1982cf382aea3ff7cef1f82bea793657e47d8f700609597f317607de07245b40c30b764a19fc7d4efa177d4dc42f6ed4d0a7b5f4e173 +"@keyv/serialize@npm:^1.1.0": + version: 1.1.0 + resolution: "@keyv/serialize@npm:1.1.0" + checksum: 84533dc994ff1b9585fb7593542f1d7a9746b843c13c9341a8d2feb2e1fc0136d42e0146f8ff751ad9decc64da4792538e270b95a126f6d0dbb48e349ee462ab languageName: node linkType: hard @@ -7379,16 +7377,6 @@ __metadata: languageName: node linkType: hard -"buffer@npm:^6.0.3": - version: 6.0.3 - resolution: "buffer@npm:6.0.3" - dependencies: - base64-js: ^1.3.1 - ieee754: ^1.2.1 - checksum: 5ad23293d9a731e4318e420025800b42bf0d264004c0286c8cc010af7a270c7a0f6522e84f54b9ad65cbd6db20b8badbfd8d2ebf4f80fa03dab093b89e68c3f9 - languageName: node - linkType: hard - "builtin-modules@npm:^3.1.0": version: 3.3.0 resolution: "builtin-modules@npm:3.3.0" @@ -7476,13 +7464,13 @@ __metadata: languageName: node linkType: hard -"cacheable@npm:^1.8.9": - version: 1.8.9 - resolution: "cacheable@npm:1.8.9" +"cacheable@npm:^1.10.4": + version: 1.10.4 + resolution: "cacheable@npm:1.10.4" dependencies: - hookified: ^1.7.1 - keyv: ^5.3.1 - checksum: aabfab7106df5c73948471f2b053e713edba69dfd3c01ff6df4b07ba8d53f631d8101d55edc782e3b2c7060cdcbc625af7d6f66b6bd8b4b7a14c392647e31f93 + hookified: ^1.11.0 + keyv: ^5.5.0 + checksum: b146ed94ecb8f8b7d5eabb29bde5f0d10541305e52cae01c44d1ec643969d6afa92d47c9918afea402c5e87ba1f96cb4336cc1030f33d59d2b470e7c4221efb3 languageName: node linkType: hard @@ -8829,7 +8817,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.3.7, debug@npm:^4.4.0, debug@npm:^4.4.1": +"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.4.0, debug@npm:^4.4.1": version: 4.4.1 resolution: "debug@npm:4.4.1" dependencies: @@ -10542,12 +10530,12 @@ __metadata: languageName: node linkType: hard -"file-entry-cache@npm:^10.0.8": - version: 10.0.8 - resolution: "file-entry-cache@npm:10.0.8" +"file-entry-cache@npm:^10.1.3": + version: 10.1.4 + resolution: "file-entry-cache@npm:10.1.4" dependencies: - flat-cache: ^6.1.8 - checksum: 832e9394c05b1484a38431a1061cbda6bef7597a0b3d9ddefd7ae9aa5f935cdb720e98066bd7e29cf2395b88d4ff42ce24860e808b74fb3a87dab07b8b98f04a + flat-cache: ^6.1.13 + checksum: b0fbc1522c62d060a0e17604074f32b68bc964d4dc1a40e1f75d5c731d0e104ffbb39bf61c37a836e0ce1cabb92c121f03ae2da0ee29a3885546937e1962b862 languageName: node linkType: hard @@ -10682,14 +10670,14 @@ __metadata: languageName: node linkType: hard -"flat-cache@npm:^6.1.8": - version: 6.1.8 - resolution: "flat-cache@npm:6.1.8" +"flat-cache@npm:^6.1.13": + version: 6.1.13 + resolution: "flat-cache@npm:6.1.13" dependencies: - cacheable: ^1.8.9 + cacheable: ^1.10.4 flatted: ^3.3.3 - hookified: ^1.8.1 - checksum: 7c26d536f21249e487eed8f21829b13eb114d4e07de239ce7300c995c80c3e704f78e4a63d7e75a63c28dc47b02c05e670c3fc745bbfd2b238d4aea0e4e4b3d2 + hookified: ^1.11.0 + checksum: 9a2b402a1e0a0802b5fdb94f4a3d4f2755bdeb2a81927be5fefd93fd7317b0e73b11812239bcc82d29ea36e54b376a5d4a6312edd97e515c45eb5f1d2a2f6659 languageName: node linkType: hard @@ -11572,10 +11560,10 @@ __metadata: languageName: node linkType: hard -"hookified@npm:^1.7.1, hookified@npm:^1.8.1": - version: 1.8.2 - resolution: "hookified@npm:1.8.2" - checksum: b7415e94f742e7bd0da5f3653a0f10f2021e1b39f92f20a03f27027ca308f6bf84a958b296abd1e15ee9e0d589d887687ec16745b7a0cdb488ba5f38e3ff524d +"hookified@npm:^1.11.0": + version: 1.11.0 + resolution: "hookified@npm:1.11.0" + checksum: 237189d87d3ebafacdb3b27ecdbb7060d359a16ccf6d27896920e6f8b53890c831ff5bafc2224bfcd6562a1effdca28a3edf819af46cf30cc58c142f1ce9b67d languageName: node linkType: hard @@ -11893,7 +11881,7 @@ __metadata: languageName: node linkType: hard -"ieee754@npm:^1.1.13, ieee754@npm:^1.2.1": +"ieee754@npm:^1.1.13": version: 1.2.1 resolution: "ieee754@npm:1.2.1" checksum: 5144c0c9815e54ada181d80a0b810221a253562422e7c6c3a60b1901154184f49326ec239d618c416c1c5945a2e197107aee8d986a3dd836b53dffefd99b5e7e @@ -11907,10 +11895,10 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^7.0.0, ignore@npm:^7.0.3, ignore@npm:~7.0.3": - version: 7.0.4 - resolution: "ignore@npm:7.0.4" - checksum: 09b4d69192355ac066f7d99c0fdb26f52035d2eaae423bfb5f7389091d75a93bf9c105e1fbf51f557098f6d446726f29a63cef3a7d26722dc696dd345224719b +"ignore@npm:^7.0.0, ignore@npm:^7.0.5, ignore@npm:~7.0.3": + version: 7.0.5 + resolution: "ignore@npm:7.0.5" + checksum: d0862bf64d3d58bf34d5fb0a9f725bec9ca5ce8cd1aecc8f28034269e8f69b8009ffd79ca3eda96962a6a444687781cd5efdb8c7c8ddc0a6996e36d31c217f14 languageName: node linkType: hard @@ -13011,12 +12999,12 @@ __metadata: languageName: node linkType: hard -"keyv@npm:^5.3.1": - version: 5.3.1 - resolution: "keyv@npm:5.3.1" +"keyv@npm:^5.5.0": + version: 5.5.0 + resolution: "keyv@npm:5.5.0" dependencies: - "@keyv/serialize": ^1.0.3 - checksum: 493c0e3965a3354ba6f719c7a70ed07adf7c0a299bfd9712126c547148067b7621bc008ba51abcac5fe0b7462f3e7cdaa58fb422db9022a3d34a20d30f03a0cb + "@keyv/serialize": ^1.1.0 + checksum: 7ab64dbcd6f14995f93baf33a82ca1b35c7c7b810f5c59239772904637546eb7ed9695e535420b50bcd5d2ff365cf7ba3a4f1613920249572c5a2a07e1053820 languageName: node linkType: hard @@ -13061,10 +13049,10 @@ __metadata: languageName: node linkType: hard -"known-css-properties@npm:^0.36.0": - version: 0.36.0 - resolution: "known-css-properties@npm:0.36.0" - checksum: 2b231ae0ef90a9825f3798a585077c6948c119e091df8900ae07f52e5928122835ac1ad0b50629fe1e2357a608b17428181d5c63d02a623ffe84de5204f5f4fa +"known-css-properties@npm:^0.37.0": + version: 0.37.0 + resolution: "known-css-properties@npm:0.37.0" + checksum: 8a0f8a85abd45b22c048b64b9e841dd395367715ecd9b04d8b882e147b150f2f58b09364bc24bf516a6d713871edb02d7a01db046c0c616eecc73007d2abc7ec languageName: node linkType: hard @@ -19011,12 +18999,12 @@ __metadata: linkType: hard "stylelint@npm:^16.3.1": - version: 16.19.1 - resolution: "stylelint@npm:16.19.1" + version: 16.23.1 + resolution: "stylelint@npm:16.23.1" dependencies: - "@csstools/css-parser-algorithms": ^3.0.4 - "@csstools/css-tokenizer": ^3.0.3 - "@csstools/media-query-list-parser": ^4.0.2 + "@csstools/css-parser-algorithms": ^3.0.5 + "@csstools/css-tokenizer": ^3.0.4 + "@csstools/media-query-list-parser": ^4.0.3 "@csstools/selector-specificity": ^5.0.0 "@dual-bundle/import-meta-resolve": ^4.1.0 balanced-match: ^2.0.0 @@ -19024,24 +19012,24 @@ __metadata: cosmiconfig: ^9.0.0 css-functions-list: ^3.2.3 css-tree: ^3.1.0 - debug: ^4.3.7 + debug: ^4.4.1 fast-glob: ^3.3.3 fastest-levenshtein: ^1.0.16 - file-entry-cache: ^10.0.8 + file-entry-cache: ^10.1.3 global-modules: ^2.0.0 globby: ^11.1.0 globjoin: ^0.1.4 html-tags: ^3.3.1 - ignore: ^7.0.3 + ignore: ^7.0.5 imurmurhash: ^0.1.4 is-plain-object: ^5.0.0 - known-css-properties: ^0.36.0 + known-css-properties: ^0.37.0 mathml-tag-names: ^2.1.3 meow: ^13.2.0 micromatch: ^4.0.8 normalize-path: ^3.0.0 picocolors: ^1.1.1 - postcss: ^8.5.3 + postcss: ^8.5.6 postcss-resolve-nested-selector: ^0.1.6 postcss-safe-parser: ^7.0.1 postcss-selector-parser: ^7.1.0 @@ -19054,7 +19042,7 @@ __metadata: write-file-atomic: ^5.0.1 bin: stylelint: bin/stylelint.mjs - checksum: 5bb188187053592a481c19a4420d01cb50e78a6e68edac639a0316be1cf365df28826968345e10aaf1ec1c3ed672b91c749ca10b6e71d05ff5d181db188e50c6 + checksum: e86bd662f3fa6b77c4fa6c72a8ba9fa0dcf46937dedd86a9fbc0e1193f55c4f26d4ae595990fa1e288d96f112859158094fa8566681ce6282e2bab33ec60c676 languageName: node linkType: hard From 6e6ebb3804e570b6e587ce14defc24b89b2bde2d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 13:57:07 -0600 Subject: [PATCH 143/283] chore(deps): update dependency markdownlint-cli to ^0.45.0 (#11509) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 165 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 99 insertions(+), 68 deletions(-) diff --git a/package.json b/package.json index 36f09ef6c9b1..5e81ac87d512 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "husky": "^9.1.4", "knip": "^5.41.1", "lint-staged": "^15.2.2", - "markdownlint-cli": "^0.44.0", + "markdownlint-cli": "^0.45.0", "nx": "21.2.3", "prettier": "3.6.2", "rimraf": "^5.0.5", diff --git a/yarn.lock b/yarn.lock index 16a5427febfc..a2d2c0a54cbe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3844,6 +3844,22 @@ __metadata: languageName: node linkType: hard +"@isaacs/balanced-match@npm:^4.0.1": + version: 4.0.1 + resolution: "@isaacs/balanced-match@npm:4.0.1" + checksum: 102fbc6d2c0d5edf8f6dbf2b3feb21695a21bc850f11bc47c4f06aa83bd8884fde3fe9d6d797d619901d96865fdcb4569ac2a54c937992c48885c5e3d9967fe8 + languageName: node + linkType: hard + +"@isaacs/brace-expansion@npm:^5.0.0": + version: 5.0.0 + resolution: "@isaacs/brace-expansion@npm:5.0.0" + dependencies: + "@isaacs/balanced-match": ^4.0.1 + checksum: d7a3b8b0ddbf0ccd8eeb1300e29dd0a0c02147e823d8138f248375a365682360620895c66d113e05ee02389318c654379b0e538b996345b83c914941786705b1 + languageName: node + linkType: hard + "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -6028,7 +6044,7 @@ __metadata: husky: ^9.1.4 knip: ^5.41.1 lint-staged: ^15.2.2 - markdownlint-cli: ^0.44.0 + markdownlint-cli: ^0.45.0 nx: 21.2.3 prettier: 3.6.2 rimraf: ^5.0.5 @@ -8311,7 +8327,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.6": +"cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.6": version: 7.0.6 resolution: "cross-spawn@npm:7.0.6" dependencies: @@ -10716,13 +10732,13 @@ __metadata: languageName: node linkType: hard -"foreground-child@npm:^3.1.0": - version: 3.1.1 - resolution: "foreground-child@npm:3.1.1" +"foreground-child@npm:^3.1.0, foreground-child@npm:^3.3.1": + version: 3.3.1 + resolution: "foreground-child@npm:3.3.1" dependencies: - cross-spawn: ^7.0.0 + cross-spawn: ^7.0.6 signal-exit: ^4.0.1 - checksum: 139d270bc82dc9e6f8bc045fe2aae4001dc2472157044fdfad376d0a3457f77857fa883c1c8b21b491c6caade9a926a4bed3d3d2e8d3c9202b151a4cbbd0bcd5 + checksum: b2c1a6fc0bf0233d645d9fefdfa999abf37db1b33e5dab172b3cbfb0662b88bfbd2c9e7ab853533d199050ec6b65c03fcf078fc212d26e4990220e98c6930eef languageName: node linkType: hard @@ -11084,23 +11100,23 @@ __metadata: languageName: node linkType: hard -"glob@npm:*, glob@npm:^11.0.0": - version: 11.0.2 - resolution: "glob@npm:11.0.2" +"glob@npm:*, glob@npm:^11.0.0, glob@npm:~11.0.2": + version: 11.0.3 + resolution: "glob@npm:11.0.3" dependencies: - foreground-child: ^3.1.0 - jackspeak: ^4.0.1 - minimatch: ^10.0.0 + foreground-child: ^3.3.1 + jackspeak: ^4.1.1 + minimatch: ^10.0.3 minipass: ^7.1.2 package-json-from-dist: ^1.0.0 path-scurry: ^2.0.0 bin: glob: dist/esm/bin.mjs - checksum: e936aa9b26d5c9687ec1cad53ead521122a7297528856f0c909bfff5a5af16be791d7da8289ab0cfe583470328287adff8f455c1fbf4fa2d8a040a55f9c8c50a + checksum: 65ddc1e3c969e87999880580048763cc8b5bdd375930dd43b8100a5ba481d2e2563e4553de42875790800c602522a98aa8d3ed1c5bd4d27621609e6471eb371d languageName: node linkType: hard -"glob@npm:^10.3.7, glob@npm:^10.4.1, glob@npm:~10.4.5": +"glob@npm:^10.3.7, glob@npm:^10.4.1": version: 10.4.5 resolution: "glob@npm:10.4.5" dependencies: @@ -11895,7 +11911,7 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^7.0.0, ignore@npm:^7.0.5, ignore@npm:~7.0.3": +"ignore@npm:^7.0.0, ignore@npm:^7.0.5, ignore@npm:~7.0.4": version: 7.0.5 resolution: "ignore@npm:7.0.5" checksum: d0862bf64d3d58bf34d5fb0a9f725bec9ca5ce8cd1aecc8f28034269e8f69b8009ffd79ca3eda96962a6a444687781cd5efdb8c7c8ddc0a6996e36d31c217f14 @@ -12681,12 +12697,12 @@ __metadata: languageName: node linkType: hard -"jackspeak@npm:^4.0.1": - version: 4.0.2 - resolution: "jackspeak@npm:4.0.2" +"jackspeak@npm:^4.1.1": + version: 4.1.1 + resolution: "jackspeak@npm:4.1.1" dependencies: "@isaacs/cliui": ^8.0.2 - checksum: 210030029edfa1658328799ad88c3d0fc057c4cb8a069fc4137cc8d2cc4b65c9721c6e749e890f9ca77a954bb54f200f715b8896e50d330e5f3e902e72b40974 + checksum: daca714c5adebfb80932c0b0334025307b68602765098d73d52ec546bc4defdb083292893384261c052742255d0a77d8fcf96f4c669bcb4a99b498b94a74955e languageName: node linkType: hard @@ -13492,7 +13508,7 @@ __metadata: languageName: node linkType: hard -"markdown-it@npm:14.1.0, markdown-it@npm:^14.1.0": +"markdown-it@npm:^14.1.0, markdown-it@npm:~14.1.0": version: 14.1.0 resolution: "markdown-it@npm:14.1.0" dependencies: @@ -13524,40 +13540,40 @@ __metadata: languageName: node linkType: hard -"markdownlint-cli@npm:^0.44.0": - version: 0.44.0 - resolution: "markdownlint-cli@npm:0.44.0" +"markdownlint-cli@npm:^0.45.0": + version: 0.45.0 + resolution: "markdownlint-cli@npm:0.45.0" dependencies: commander: ~13.1.0 - glob: ~10.4.5 - ignore: ~7.0.3 + glob: ~11.0.2 + ignore: ~7.0.4 js-yaml: ~4.1.0 jsonc-parser: ~3.3.1 jsonpointer: ~5.0.1 - markdownlint: ~0.37.4 - minimatch: ~9.0.5 + markdown-it: ~14.1.0 + markdownlint: ~0.38.0 + minimatch: ~10.0.1 run-con: ~1.3.2 - smol-toml: ~1.3.1 + smol-toml: ~1.3.4 bin: markdownlint: markdownlint.js - checksum: bb50c28ab11b6677c75332cf18f8513545a30f1e58dd5b4be4351c0ad3566850286276efa938451e1fb64eb2d958b3a73dd119b915999512dbbdc0b61d676c5a + checksum: 41de5e3dd3129e1dd2d136e1a5ed1258c2d5456fb4592c085e76319f3792901e7b910e825e43440df09927769c9259f6f9e79cbaa1047d281b8526cb7b5ca819 languageName: node linkType: hard -"markdownlint@npm:~0.37.4": - version: 0.37.4 - resolution: "markdownlint@npm:0.37.4" +"markdownlint@npm:~0.38.0": + version: 0.38.0 + resolution: "markdownlint@npm:0.38.0" dependencies: - markdown-it: 14.1.0 - micromark: 4.0.1 - micromark-core-commonmark: 2.0.2 - micromark-extension-directive: 3.0.2 + micromark: 4.0.2 + micromark-core-commonmark: 2.0.3 + micromark-extension-directive: 4.0.0 micromark-extension-gfm-autolink-literal: 2.1.0 micromark-extension-gfm-footnote: 2.1.0 - micromark-extension-gfm-table: 2.1.0 + micromark-extension-gfm-table: 2.1.1 micromark-extension-math: 3.1.0 - micromark-util-types: 2.0.1 - checksum: 74ae9a0821c98d56177600a0735e8a332a3a6ac378516befbea63b06fbcd17e655508b1d20476da1916f3678ad77a81caa37facaee0ee3651e84fd01f01f1104 + micromark-util-types: 2.0.2 + checksum: ea684eb78cbc71ebb2d9f79f343e763c627935a1e4ad7524ff08c110b56e4f11ba9c5d7b469441dbb732028ddd7ff6dbe77b460f922506ea78fd8bb248e353d3 languageName: node linkType: hard @@ -13930,9 +13946,9 @@ __metadata: languageName: node linkType: hard -"micromark-core-commonmark@npm:2.0.2, micromark-core-commonmark@npm:^2.0.0": - version: 2.0.2 - resolution: "micromark-core-commonmark@npm:2.0.2" +"micromark-core-commonmark@npm:2.0.3, micromark-core-commonmark@npm:^2.0.0": + version: 2.0.3 + resolution: "micromark-core-commonmark@npm:2.0.3" dependencies: decode-named-character-reference: ^1.0.0 devlop: ^1.0.0 @@ -13950,11 +13966,26 @@ __metadata: micromark-util-subtokenize: ^2.0.0 micromark-util-symbol: ^2.0.0 micromark-util-types: ^2.0.0 - checksum: e49d78429baf72533a02d06ae83e5a24d4d547bc832173547ffbae93c0960a7dbf0d8896058301498fa4297f280070a5a66891e0e6160040d6c5ef9bc5d9cd51 + checksum: cfb0fd9c895f86a4e9344f7f0344fe6bd1018945798222835248146a42430b8c7bc0b2857af574cf4e1b4ce4e5c1a35a1479942421492e37baddde8de85814dc languageName: node linkType: hard -"micromark-extension-directive@npm:3.0.2, micromark-extension-directive@npm:^3.0.0": +"micromark-extension-directive@npm:4.0.0": + version: 4.0.0 + resolution: "micromark-extension-directive@npm:4.0.0" + dependencies: + devlop: ^1.0.0 + micromark-factory-space: ^2.0.0 + micromark-factory-whitespace: ^2.0.0 + micromark-util-character: ^2.0.0 + micromark-util-symbol: ^2.0.0 + micromark-util-types: ^2.0.0 + parse-entities: ^4.0.0 + checksum: c58ee727c4b87647508977e3af186e6efbdd8453ae0a72322779f8dea768ba7e4983804843ff66f81e32efd56a971f7256fb5bda4c401542145b4f0a1ad16396 + languageName: node + linkType: hard + +"micromark-extension-directive@npm:^3.0.0": version: 3.0.2 resolution: "micromark-extension-directive@npm:3.0.2" dependencies: @@ -14023,16 +14054,16 @@ __metadata: languageName: node linkType: hard -"micromark-extension-gfm-table@npm:2.1.0, micromark-extension-gfm-table@npm:^2.0.0": - version: 2.1.0 - resolution: "micromark-extension-gfm-table@npm:2.1.0" +"micromark-extension-gfm-table@npm:2.1.1, micromark-extension-gfm-table@npm:^2.0.0": + version: 2.1.1 + resolution: "micromark-extension-gfm-table@npm:2.1.1" dependencies: devlop: ^1.0.0 micromark-factory-space: ^2.0.0 micromark-util-character: ^2.0.0 micromark-util-symbol: ^2.0.0 micromark-util-types: ^2.0.0 - checksum: 249d695f5f8bd222a0d8a774ec78ea2a2d624cb50a4d008092a54aa87dad1f9d540e151d29696cf849eb1cee380113c4df722aebb3b425a214832a2de5dea1d7 + checksum: 16a59c8c2381c8418d9cf36c605abb0b66cfebaad07e09c4c9b113298d13e0c517b652885529fcb74d149afec3f6e8ab065fd27a900073d5ec0a1d8f0c51b593 languageName: node linkType: hard @@ -14404,10 +14435,10 @@ __metadata: languageName: node linkType: hard -"micromark-util-types@npm:2.0.1, micromark-util-types@npm:^2.0.0": - version: 2.0.1 - resolution: "micromark-util-types@npm:2.0.1" - checksum: 630aac466628a360962f478f69421599c53ff8b3080765201b7be3b3a4be7f4c5b73632b9a6dd426b9e06035353c18acccee637d6c43d9b0bf1c31111bbb88a7 +"micromark-util-types@npm:2.0.2, micromark-util-types@npm:^2.0.0": + version: 2.0.2 + resolution: "micromark-util-types@npm:2.0.2" + checksum: 884f7974839e4bc6d2bd662e57c973a9164fd5c0d8fe16cddf07472b86a7e6726747c00674952c0321d17685d700cd3295e9f58a842a53acdf6c6d55ab051aab languageName: node linkType: hard @@ -14418,9 +14449,9 @@ __metadata: languageName: node linkType: hard -"micromark@npm:4.0.1, micromark@npm:^4.0.0": - version: 4.0.1 - resolution: "micromark@npm:4.0.1" +"micromark@npm:4.0.2, micromark@npm:^4.0.0": + version: 4.0.2 + resolution: "micromark@npm:4.0.2" dependencies: "@types/debug": ^4.0.0 debug: ^4.0.0 @@ -14439,7 +14470,7 @@ __metadata: micromark-util-subtokenize: ^2.0.0 micromark-util-symbol: ^2.0.0 micromark-util-types: ^2.0.0 - checksum: 83ea084e8bf84442cc70c1207e916df11f0fde0ebd9daf978c895a1466c47a1dd4ed42b21b6e65bcc0d268fcbec24b4b1b28bc59c548940fe690929b8e0e7732 + checksum: 5306c15dd12f543755bc627fc361d4255dfc430e7af6069a07ac0eacc338fbd761fe8e93f02a8bfab6097bab12ee903192fe31389222459d5029242a5aaba3b8 languageName: node linkType: hard @@ -14598,12 +14629,12 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^10.0.0": - version: 10.0.1 - resolution: "minimatch@npm:10.0.1" +"minimatch@npm:^10.0.3, minimatch@npm:~10.0.1": + version: 10.0.3 + resolution: "minimatch@npm:10.0.3" dependencies: - brace-expansion: ^2.0.1 - checksum: f5b63c2f30606091a057c5f679b067f84a2cd0ffbd2dbc9143bda850afd353c7be81949ff11ae0c86988f07390eeca64efd7143ee05a0dab37f6c6b38a2ebb6c + "@isaacs/brace-expansion": ^5.0.0 + checksum: 20bfb708095a321cb43c20b78254e484cb7d23aad992e15ca3234a3331a70fa9cd7a50bc1a7c7b2b9c9890c37ff0685f8380028fcc28ea5e6de75b1d4f9374aa languageName: node linkType: hard @@ -14625,7 +14656,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^9.0.4, minimatch@npm:^9.0.5, minimatch@npm:~9.0.5": +"minimatch@npm:^9.0.4, minimatch@npm:^9.0.5": version: 9.0.5 resolution: "minimatch@npm:9.0.5" dependencies: @@ -18453,10 +18484,10 @@ __metadata: languageName: node linkType: hard -"smol-toml@npm:~1.3.1": - version: 1.3.1 - resolution: "smol-toml@npm:1.3.1" - checksum: dc3284a674065874b1d34a945709ce3da2a0c44b1ff86b3274615d322c2f6cf8e5d2f5f7d569fd92330ec08590777972725e7d3ba856bd6d841243673064994e +"smol-toml@npm:~1.3.4": + version: 1.3.4 + resolution: "smol-toml@npm:1.3.4" + checksum: ddf333c69b6c848ce6bc89b85096ad8d89cf885cdbf8ca9c5c753df0f5b4a70e3c1984d13e033d68b89a2fff0d984a7f71eb0d3a1c087e934aeda3be71e81d3c languageName: node linkType: hard From 0bdf50a23006aaf2f2176960ad25f3a7ed9c92fd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 20:09:24 +0000 Subject: [PATCH 144/283] chore(deps): update dependency typedoc-plugin-markdown to v4.8.1 (#11513) fix(deps): update dependency typedoc-plugin-markdown to v4.8.1 Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index a2d2c0a54cbe..9a3a3e3391dc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19597,11 +19597,11 @@ __metadata: linkType: hard "typedoc-plugin-markdown@npm:^4.6.3": - version: 4.6.3 - resolution: "typedoc-plugin-markdown@npm:4.6.3" + version: 4.8.1 + resolution: "typedoc-plugin-markdown@npm:4.8.1" peerDependencies: typedoc: 0.28.x - checksum: 0305611bb36fbecebd612cb256478acda57059942e856c8e0cb671ad406fa63fb2b8bfd16956b3f41d24b7d2d0b5f57605120070879f8a6b2f45d8fd61608b8a + checksum: 5a8a78728d6c0831292591d0f0e3594818d7c616a977b2164fc2d4744828644e8bceeea2ab62d4a376671337c9b87392a4192d1022008c0a3504df6f2971d2d4 languageName: node linkType: hard From 369ccabe75258db6c99dae4421a73c015ae75657 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 20:35:06 +0000 Subject: [PATCH 145/283] chore(deps): update dependency @swc/core to v1.13.3 (#11481) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 100 +++++++++++++++++++++++++++--------------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9a3a3e3391dc..661ac2dd5280 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5038,94 +5038,94 @@ __metadata: languageName: node linkType: hard -"@swc/core-darwin-arm64@npm:1.11.7": - version: 1.11.7 - resolution: "@swc/core-darwin-arm64@npm:1.11.7" +"@swc/core-darwin-arm64@npm:1.13.3": + version: 1.13.3 + resolution: "@swc/core-darwin-arm64@npm:1.13.3" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@swc/core-darwin-x64@npm:1.11.7": - version: 1.11.7 - resolution: "@swc/core-darwin-x64@npm:1.11.7" +"@swc/core-darwin-x64@npm:1.13.3": + version: 1.13.3 + resolution: "@swc/core-darwin-x64@npm:1.13.3" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@swc/core-linux-arm-gnueabihf@npm:1.11.7": - version: 1.11.7 - resolution: "@swc/core-linux-arm-gnueabihf@npm:1.11.7" +"@swc/core-linux-arm-gnueabihf@npm:1.13.3": + version: 1.13.3 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.13.3" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@swc/core-linux-arm64-gnu@npm:1.11.7": - version: 1.11.7 - resolution: "@swc/core-linux-arm64-gnu@npm:1.11.7" +"@swc/core-linux-arm64-gnu@npm:1.13.3": + version: 1.13.3 + resolution: "@swc/core-linux-arm64-gnu@npm:1.13.3" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-arm64-musl@npm:1.11.7": - version: 1.11.7 - resolution: "@swc/core-linux-arm64-musl@npm:1.11.7" +"@swc/core-linux-arm64-musl@npm:1.13.3": + version: 1.13.3 + resolution: "@swc/core-linux-arm64-musl@npm:1.13.3" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@swc/core-linux-x64-gnu@npm:1.11.7": - version: 1.11.7 - resolution: "@swc/core-linux-x64-gnu@npm:1.11.7" +"@swc/core-linux-x64-gnu@npm:1.13.3": + version: 1.13.3 + resolution: "@swc/core-linux-x64-gnu@npm:1.13.3" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-x64-musl@npm:1.11.7": - version: 1.11.7 - resolution: "@swc/core-linux-x64-musl@npm:1.11.7" +"@swc/core-linux-x64-musl@npm:1.13.3": + version: 1.13.3 + resolution: "@swc/core-linux-x64-musl@npm:1.13.3" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@swc/core-win32-arm64-msvc@npm:1.11.7": - version: 1.11.7 - resolution: "@swc/core-win32-arm64-msvc@npm:1.11.7" +"@swc/core-win32-arm64-msvc@npm:1.13.3": + version: 1.13.3 + resolution: "@swc/core-win32-arm64-msvc@npm:1.13.3" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@swc/core-win32-ia32-msvc@npm:1.11.7": - version: 1.11.7 - resolution: "@swc/core-win32-ia32-msvc@npm:1.11.7" +"@swc/core-win32-ia32-msvc@npm:1.13.3": + version: 1.13.3 + resolution: "@swc/core-win32-ia32-msvc@npm:1.13.3" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@swc/core-win32-x64-msvc@npm:1.11.7": - version: 1.11.7 - resolution: "@swc/core-win32-x64-msvc@npm:1.11.7" +"@swc/core-win32-x64-msvc@npm:1.13.3": + version: 1.13.3 + resolution: "@swc/core-win32-x64-msvc@npm:1.13.3" conditions: os=win32 & cpu=x64 languageName: node linkType: hard "@swc/core@npm:^1.4.12": - version: 1.11.7 - resolution: "@swc/core@npm:1.11.7" - dependencies: - "@swc/core-darwin-arm64": 1.11.7 - "@swc/core-darwin-x64": 1.11.7 - "@swc/core-linux-arm-gnueabihf": 1.11.7 - "@swc/core-linux-arm64-gnu": 1.11.7 - "@swc/core-linux-arm64-musl": 1.11.7 - "@swc/core-linux-x64-gnu": 1.11.7 - "@swc/core-linux-x64-musl": 1.11.7 - "@swc/core-win32-arm64-msvc": 1.11.7 - "@swc/core-win32-ia32-msvc": 1.11.7 - "@swc/core-win32-x64-msvc": 1.11.7 + version: 1.13.3 + resolution: "@swc/core@npm:1.13.3" + dependencies: + "@swc/core-darwin-arm64": 1.13.3 + "@swc/core-darwin-x64": 1.13.3 + "@swc/core-linux-arm-gnueabihf": 1.13.3 + "@swc/core-linux-arm64-gnu": 1.13.3 + "@swc/core-linux-arm64-musl": 1.13.3 + "@swc/core-linux-x64-gnu": 1.13.3 + "@swc/core-linux-x64-musl": 1.13.3 + "@swc/core-win32-arm64-msvc": 1.13.3 + "@swc/core-win32-ia32-msvc": 1.13.3 + "@swc/core-win32-x64-msvc": 1.13.3 "@swc/counter": ^0.1.3 - "@swc/types": ^0.1.19 + "@swc/types": ^0.1.23 peerDependencies: - "@swc/helpers": "*" + "@swc/helpers": ">=0.5.17" dependenciesMeta: "@swc/core-darwin-arm64": optional: true @@ -5150,7 +5150,7 @@ __metadata: peerDependenciesMeta: "@swc/helpers": optional: true - checksum: 8c44fd46db23d468643a7bde65c3308f128fd1e460fa0307301e28cc75ab66760cbc81ff3548ac19e4c901d2194db5cee15b106db4cb70a1b44c592b8b5c0030 + checksum: 2f6a1cf1241db40b11c3fa7452da099325b4ee4419e658950221f357a12ea967390414243d51e81fa52d4fcc002f7ae477311b0602d4524a70f95e569902f229 languageName: node linkType: hard @@ -5170,12 +5170,12 @@ __metadata: languageName: node linkType: hard -"@swc/types@npm:^0.1.19": - version: 0.1.19 - resolution: "@swc/types@npm:0.1.19" +"@swc/types@npm:^0.1.23": + version: 0.1.24 + resolution: "@swc/types@npm:0.1.24" dependencies: "@swc/counter": ^0.1.3 - checksum: 167c64b6f7e0c595ba78e3d451215f1ed18eae11681703d3ae75e5b92a2198bbb1bf46824b6be2fe60a66d064316ab5d1e3487f8ef47db97362d96871962bf31 + checksum: b9f186237d082ca9f47457dd46bd294612fbee401b4f181a9afc6f8f802fab161d50ff7024e7bc0d9c4e0ceb9a46a06ea2e5bf14a05412c9e8b7d7e07906d6ec languageName: node linkType: hard From bd9e490eb76705ed4dec2f3f705eb18e4fe313e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maria=20Jos=C3=A9=20Solano?= Date: Fri, 22 Aug 2025 15:54:00 -0700 Subject: [PATCH 146/283] chore: remove typings for `eslint-plugin-import` (#11524) --- package.json | 2 +- typings/eslint-plugin-import.d.ts | 22 ---------------------- yarn.lock | 4 ++-- 3 files changed, 3 insertions(+), 25 deletions(-) delete mode 100644 typings/eslint-plugin-import.d.ts diff --git a/package.json b/package.json index 5e81ac87d512..69ef796db02f 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "cspell": "^9.0.0", "eslint": "^9.26.0", "eslint-plugin-eslint-plugin": "^7.0.0", - "eslint-plugin-import": "^2.31.0", + "eslint-plugin-import": "^2.32.0", "eslint-plugin-jsdoc": "^50.5.0", "eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-perfectionist": "^4.12.3", diff --git a/typings/eslint-plugin-import.d.ts b/typings/eslint-plugin-import.d.ts deleted file mode 100644 index 82819b7a4d37..000000000000 --- a/typings/eslint-plugin-import.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -// TODO: Move this to DefinitelyTyped -declare module 'eslint-plugin-import' { - import type { - ClassicConfig, - Linter, - } from '@typescript-eslint/utils/ts-eslint'; - - declare const exprt: { - configs: { - electron: ClassicConfig.Config; - errors: ClassicConfig.Config; - react: ClassicConfig.Config; - 'react-native': ClassicConfig.Config; - recommended: ClassicConfig.Config; - 'stage-0': ClassicConfig.Config; - typescript: ClassicConfig.Config; - warnings: ClassicConfig.Config; - }; - rules: NonNullable; - }; - export = exprt; -} diff --git a/yarn.lock b/yarn.lock index 661ac2dd5280..66200ea60cf7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6031,7 +6031,7 @@ __metadata: cspell: ^9.0.0 eslint: ^9.26.0 eslint-plugin-eslint-plugin: ^7.0.0 - eslint-plugin-import: ^2.31.0 + eslint-plugin-import: ^2.32.0 eslint-plugin-jsdoc: ^50.5.0 eslint-plugin-jsx-a11y: ^6.10.2 eslint-plugin-perfectionist: ^4.12.3 @@ -9811,7 +9811,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-import@npm:^2.31.0": +"eslint-plugin-import@npm:^2.32.0": version: 2.32.0 resolution: "eslint-plugin-import@npm:2.32.0" dependencies: From 31a73361bd6449974c89b78ef77be0d04e77510b Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 25 Aug 2025 17:17:08 +0000 Subject: [PATCH 147/283] chore(release): publish 8.41.0 --- CHANGELOG.md | 18 ++++ packages/ast-spec/CHANGELOG.md | 9 ++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 8 ++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 8 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 12 +++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 6 ++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 12 +++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 221 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3f19a841802..8147558a4353 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +## 8.41.0 (2025-08-25) + +### 🚀 Features + +- tighten `tsconfigRootDir` validation ([#11463](https://github.com/typescript-eslint/typescript-eslint/pull/11463)) + +### 🩹 Fixes + +- resolve type error in eslint config ([#11500](https://github.com/typescript-eslint/typescript-eslint/pull/11500)) +- **deps:** update babel monorepo ([#11174](https://github.com/typescript-eslint/typescript-eslint/pull/11174)) +- **deps:** update dependency prettier to v3.6.2 ([#11496](https://github.com/typescript-eslint/typescript-eslint/pull/11496)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 5041687ce5a6..c53185791808 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,12 @@ +## 8.41.0 (2025-08-25) + +### 🩹 Fixes + +- **deps:** update dependency prettier to v3.6.2 ([#11496](https://github.com/typescript-eslint/typescript-eslint/pull/11496)) +- **deps:** update babel monorepo ([#11174](https://github.com/typescript-eslint/typescript-eslint/pull/11174)) + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) ### 🚀 Features diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index ba03ff05d456..2bab131a3111 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.40.0", + "version": "8.41.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 89976c5c01fc..e85d9e4f4fc9 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,11 @@ +## 8.41.0 (2025-08-25) + +### 🩹 Fixes + +- **deps:** update dependency prettier to v3.6.2 ([#11496](https://github.com/typescript-eslint/typescript-eslint/pull/11496)) + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) ### 🚀 Features diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 59a5b0a5428a..bafdc946330b 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.40.0", + "version": "8.41.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.40.0", - "@typescript-eslint/type-utils": "8.40.0", - "@typescript-eslint/utils": "8.40.0", - "@typescript-eslint/visitor-keys": "8.40.0", + "@typescript-eslint/scope-manager": "8.41.0", + "@typescript-eslint/type-utils": "8.41.0", + "@typescript-eslint/utils": "8.41.0", + "@typescript-eslint/visitor-keys": "8.41.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.40.0", - "@typescript-eslint/rule-tester": "8.40.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.41.0", + "@typescript-eslint/rule-tester": "8.41.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.40.0", + "@typescript-eslint/parser": "^8.41.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 76a784632769..7aaedf20bf8d 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.41.0 (2025-08-25) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 707c22d668e5..c22e53c3c0a7 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.40.0", + "version": "8.41.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.40.0", - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/typescript-estree": "8.40.0", - "@typescript-eslint/visitor-keys": "8.40.0", + "@typescript-eslint/scope-manager": "8.41.0", + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/typescript-estree": "8.41.0", + "@typescript-eslint/visitor-keys": "8.41.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 811569e0c179..0830fccb4d66 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.41.0 (2025-08-25) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 6baf59992728..adab677e6f7a 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.40.0", + "version": "8.41.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.40.0", - "@typescript-eslint/types": "^8.40.0", + "@typescript-eslint/tsconfig-utils": "^8.41.0", + "@typescript-eslint/types": "^8.41.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 7fe444510994..fde466cf497d 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,11 @@ +## 8.41.0 (2025-08-25) + +### 🩹 Fixes + +- **deps:** update dependency prettier to v3.6.2 ([#11496](https://github.com/typescript-eslint/typescript-eslint/pull/11496)) + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 8b61f154b058..b1692804359c 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.40.0", + "version": "8.41.0", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.40.0", - "@typescript-eslint/utils": "8.40.0", + "@typescript-eslint/type-utils": "8.41.0", + "@typescript-eslint/utils": "8.41.0", "natural-compare": "^1.4.0", "prettier": "3.6.2" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 029a948a3158..d423dad73de2 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.41.0 (2025-08-25) + +### 🚀 Features + +- tighten `tsconfigRootDir` validation ([#11463](https://github.com/typescript-eslint/typescript-eslint/pull/11463)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 775673b300bf..41833305c3ea 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.40.0", + "version": "8.41.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.40.0", - "@typescript-eslint/typescript-estree": "8.40.0", - "@typescript-eslint/utils": "8.40.0", + "@typescript-eslint/parser": "8.41.0", + "@typescript-eslint/typescript-estree": "8.41.0", + "@typescript-eslint/utils": "8.41.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index d8c7ed5095b8..3d79af3dd2df 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.41.0 (2025-08-25) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) ### 🚀 Features diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 2daecf078fd1..1732f314fe6f 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.40.0", + "version": "8.41.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/visitor-keys": "8.40.0" + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/visitor-keys": "8.41.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.40.0", + "@typescript-eslint/typescript-estree": "8.41.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 0550c29f4279..377e6e5a4239 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.41.0 (2025-08-25) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index e0a2b8a748ab..fe9fa734f8e5 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.40.0", + "version": "8.41.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index d1d563254aa8..7f854a1f0c61 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.41.0 (2025-08-25) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 759fb48e783b..57189776f6e9 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.40.0", + "version": "8.41.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/typescript-estree": "8.40.0", - "@typescript-eslint/utils": "8.40.0", + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/typescript-estree": "8.41.0", + "@typescript-eslint/utils": "8.41.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.40.0", + "@typescript-eslint/parser": "8.41.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 362312d7b36c..14ebf6b09635 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.41.0 (2025-08-25) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index e00fed13b14b..1117200eca0a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.40.0", + "version": "8.41.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 581ca1d10193..e80cd18e2adf 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.41.0 (2025-08-25) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) ### 🩹 Fixes diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index f3249437d2ba..38789b0cf809 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.40.0", + "version": "8.41.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.40.0", - "@typescript-eslint/parser": "8.40.0", - "@typescript-eslint/typescript-estree": "8.40.0", - "@typescript-eslint/utils": "8.40.0" + "@typescript-eslint/eslint-plugin": "8.41.0", + "@typescript-eslint/parser": "8.41.0", + "@typescript-eslint/typescript-estree": "8.41.0", + "@typescript-eslint/utils": "8.41.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 89ae1dd46852..59f4cac1abf8 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.41.0 (2025-08-25) + +### 🚀 Features + +- tighten `tsconfigRootDir` validation ([#11463](https://github.com/typescript-eslint/typescript-eslint/pull/11463)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) ### 🚀 Features diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 01df8590e4c4..9ff68a8e6c97 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.40.0", + "version": "8.41.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.40.0", - "@typescript-eslint/tsconfig-utils": "8.40.0", - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/visitor-keys": "8.40.0", + "@typescript-eslint/project-service": "8.41.0", + "@typescript-eslint/tsconfig-utils": "8.41.0", + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/visitor-keys": "8.41.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 4eb5650e43aa..979817e65730 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.41.0 (2025-08-25) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) ### 🩹 Fixes diff --git a/packages/utils/package.json b/packages/utils/package.json index d3549db2065c..77a4ee26b789 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.40.0", + "version": "8.41.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.40.0", - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/typescript-estree": "8.40.0" + "@typescript-eslint/scope-manager": "8.41.0", + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/typescript-estree": "8.41.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index cb5c5f0f33d3..7ad0feec8dc8 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.41.0 (2025-08-25) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.40.0 (2025-08-18) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 6c4e73577c20..1a556efad5c8 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.40.0", + "version": "8.41.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.40.0", + "@typescript-eslint/types": "8.41.0", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 66200ea60cf7..8aa27852b08f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5806,19 +5806,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.40.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.41.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.40.0 - "@typescript-eslint/rule-tester": 8.40.0 - "@typescript-eslint/scope-manager": 8.40.0 - "@typescript-eslint/type-utils": 8.40.0 - "@typescript-eslint/utils": 8.40.0 - "@typescript-eslint/visitor-keys": 8.40.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.41.0 + "@typescript-eslint/rule-tester": 8.41.0 + "@typescript-eslint/scope-manager": 8.41.0 + "@typescript-eslint/type-utils": 8.41.0 + "@typescript-eslint/utils": 8.41.0 + "@typescript-eslint/visitor-keys": 8.41.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5841,7 +5841,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.40.0 + "@typescript-eslint/parser": ^8.41.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -5857,14 +5857,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.40.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.41.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.40.0 - "@typescript-eslint/types": 8.40.0 - "@typescript-eslint/typescript-estree": 8.40.0 - "@typescript-eslint/visitor-keys": 8.40.0 + "@typescript-eslint/scope-manager": 8.41.0 + "@typescript-eslint/types": 8.41.0 + "@typescript-eslint/typescript-estree": 8.41.0 + "@typescript-eslint/visitor-keys": 8.41.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -5878,12 +5878,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.40.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.41.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.40.0 - "@typescript-eslint/types": ^8.40.0 + "@typescript-eslint/tsconfig-utils": ^8.41.0 + "@typescript-eslint/types": ^8.41.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -5894,12 +5894,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.40.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.41.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.40.0 - "@typescript-eslint/utils": 8.40.0 + "@typescript-eslint/type-utils": 8.41.0 + "@typescript-eslint/utils": 8.41.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -5910,15 +5910,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.40.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.41.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.40.0 - "@typescript-eslint/typescript-estree": 8.40.0 - "@typescript-eslint/utils": 8.40.0 + "@typescript-eslint/parser": 8.41.0 + "@typescript-eslint/typescript-estree": 8.41.0 + "@typescript-eslint/utils": 8.41.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5933,13 +5933,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.40.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.40.0 - "@typescript-eslint/typescript-estree": 8.40.0 - "@typescript-eslint/visitor-keys": 8.40.0 + "@typescript-eslint/types": 8.41.0 + "@typescript-eslint/typescript-estree": 8.41.0 + "@typescript-eslint/visitor-keys": 8.41.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -5950,7 +5950,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.40.0, @typescript-eslint/tsconfig-utils@^8.40.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.41.0, @typescript-eslint/tsconfig-utils@^8.41.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -5963,14 +5963,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.40.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.41.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.40.0 - "@typescript-eslint/types": 8.40.0 - "@typescript-eslint/typescript-estree": 8.40.0 - "@typescript-eslint/utils": 8.40.0 + "@typescript-eslint/parser": 8.41.0 + "@typescript-eslint/types": 8.41.0 + "@typescript-eslint/typescript-estree": 8.41.0 + "@typescript-eslint/utils": 8.41.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -5985,7 +5985,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.40.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.40.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.41.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.41.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6058,15 +6058,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.40.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.41.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.40.0 - "@typescript-eslint/tsconfig-utils": 8.40.0 - "@typescript-eslint/types": 8.40.0 - "@typescript-eslint/visitor-keys": 8.40.0 + "@typescript-eslint/project-service": 8.41.0 + "@typescript-eslint/tsconfig-utils": 8.41.0 + "@typescript-eslint/types": 8.41.0 + "@typescript-eslint/visitor-keys": 8.41.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6084,14 +6084,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.40.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.41.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.40.0 - "@typescript-eslint/types": 8.40.0 - "@typescript-eslint/typescript-estree": 8.40.0 + "@typescript-eslint/scope-manager": 8.41.0 + "@typescript-eslint/types": 8.41.0 + "@typescript-eslint/typescript-estree": 8.41.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6103,11 +6103,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.40.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.41.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.40.0 + "@typescript-eslint/types": 8.41.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19626,10 +19626,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.40.0 - "@typescript-eslint/parser": 8.40.0 - "@typescript-eslint/typescript-estree": 8.40.0 - "@typescript-eslint/utils": 8.40.0 + "@typescript-eslint/eslint-plugin": 8.41.0 + "@typescript-eslint/parser": 8.41.0 + "@typescript-eslint/typescript-estree": 8.41.0 + "@typescript-eslint/utils": 8.41.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From fa6d8a542c0020f979fb24f7f89b7bc642c80e34 Mon Sep 17 00:00:00 2001 From: Abhijeet Singh Date: Wed, 27 Aug 2025 23:42:23 +0530 Subject: [PATCH 148/283] docs: fix links pointing to netlify (#11506) docs: fix changelog links pointing to netlify --- tools/release/changelog-renderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/release/changelog-renderer.js b/tools/release/changelog-renderer.js index c12c0711aad8..16e3f5deff7b 100644 --- a/tools/release/changelog-renderer.js +++ b/tools/release/changelog-renderer.js @@ -11,6 +11,6 @@ module.exports = class CustomChangelogRenderer extends ( async render() { const defaultChangelog = await super.render(); // Append our custom messaging to the generated changelog entry - return `${defaultChangelog}\n\nYou can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.`; + return `${defaultChangelog}\n\nYou can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.`; } }; From 3a65920088a37d5a28ebb6f36fb82b7a091d3cb1 Mon Sep 17 00:00:00 2001 From: James Henry Date: Wed, 27 Aug 2025 22:41:22 +0400 Subject: [PATCH 149/283] chore: enable trusted publishing (#11534) --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc7c9d47147e..b914e435b247 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -310,6 +310,10 @@ jobs: node-version: ${{ env.PRIMARY_NODE_VERSION }} registry-url: 'https://registry.npmjs.org' + # 11.5.2 and later required for trusted publishing + - name: Use npm 11.5.2 + run: npm install -g npm@11.5.2 + - name: Build uses: ./.github/actions/prepare-build @@ -321,6 +325,4 @@ jobs: run: npx nx release publish --tag canary --verbose env: NX_CLOUD_DISTRIBUTED_EXECUTION: false - # This secret is only accessible on the GitHub environment "main" - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true From f9fb1043e4ae4f04847681cd17386bba1bd3f1f4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 28 Aug 2025 10:02:12 -0700 Subject: [PATCH 150/283] chore(deps): update dependency knip to v5.63.0 (#11536) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 198 +++++++++++++++++++++++++++--------------------------- 1 file changed, 99 insertions(+), 99 deletions(-) diff --git a/yarn.lock b/yarn.lock index 8aa27852b08f..e17bec9b16b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4087,7 +4087,7 @@ __metadata: languageName: node linkType: hard -"@napi-rs/wasm-runtime@npm:^1.0.1": +"@napi-rs/wasm-runtime@npm:^1.0.3": version: 1.0.3 resolution: "@napi-rs/wasm-runtime@npm:1.0.3" dependencies: @@ -4309,137 +4309,137 @@ __metadata: languageName: node linkType: hard -"@oxc-resolver/binding-android-arm-eabi@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-android-arm-eabi@npm:11.6.1" +"@oxc-resolver/binding-android-arm-eabi@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-android-arm-eabi@npm:11.7.1" conditions: os=android & cpu=arm languageName: node linkType: hard -"@oxc-resolver/binding-android-arm64@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-android-arm64@npm:11.6.1" +"@oxc-resolver/binding-android-arm64@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-android-arm64@npm:11.7.1" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@oxc-resolver/binding-darwin-arm64@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-darwin-arm64@npm:11.6.1" +"@oxc-resolver/binding-darwin-arm64@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-darwin-arm64@npm:11.7.1" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@oxc-resolver/binding-darwin-x64@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-darwin-x64@npm:11.6.1" +"@oxc-resolver/binding-darwin-x64@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-darwin-x64@npm:11.7.1" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@oxc-resolver/binding-freebsd-x64@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-freebsd-x64@npm:11.6.1" +"@oxc-resolver/binding-freebsd-x64@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-freebsd-x64@npm:11.7.1" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.6.1" +"@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.7.1" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm-musleabihf@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-linux-arm-musleabihf@npm:11.6.1" +"@oxc-resolver/binding-linux-arm-musleabihf@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-linux-arm-musleabihf@npm:11.7.1" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm64-gnu@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-linux-arm64-gnu@npm:11.6.1" +"@oxc-resolver/binding-linux-arm64-gnu@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-linux-arm64-gnu@npm:11.7.1" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-arm64-musl@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-linux-arm64-musl@npm:11.6.1" +"@oxc-resolver/binding-linux-arm64-musl@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-linux-arm64-musl@npm:11.7.1" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@oxc-resolver/binding-linux-ppc64-gnu@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-linux-ppc64-gnu@npm:11.6.1" +"@oxc-resolver/binding-linux-ppc64-gnu@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-linux-ppc64-gnu@npm:11.7.1" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-riscv64-gnu@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-linux-riscv64-gnu@npm:11.6.1" +"@oxc-resolver/binding-linux-riscv64-gnu@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-linux-riscv64-gnu@npm:11.7.1" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-riscv64-musl@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-linux-riscv64-musl@npm:11.6.1" +"@oxc-resolver/binding-linux-riscv64-musl@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-linux-riscv64-musl@npm:11.7.1" conditions: os=linux & cpu=riscv64 & libc=musl languageName: node linkType: hard -"@oxc-resolver/binding-linux-s390x-gnu@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-linux-s390x-gnu@npm:11.6.1" +"@oxc-resolver/binding-linux-s390x-gnu@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-linux-s390x-gnu@npm:11.7.1" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-x64-gnu@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-linux-x64-gnu@npm:11.6.1" +"@oxc-resolver/binding-linux-x64-gnu@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-linux-x64-gnu@npm:11.7.1" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@oxc-resolver/binding-linux-x64-musl@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-linux-x64-musl@npm:11.6.1" +"@oxc-resolver/binding-linux-x64-musl@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-linux-x64-musl@npm:11.7.1" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@oxc-resolver/binding-wasm32-wasi@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-wasm32-wasi@npm:11.6.1" +"@oxc-resolver/binding-wasm32-wasi@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-wasm32-wasi@npm:11.7.1" dependencies: - "@napi-rs/wasm-runtime": ^1.0.1 + "@napi-rs/wasm-runtime": ^1.0.3 conditions: cpu=wasm32 languageName: node linkType: hard -"@oxc-resolver/binding-win32-arm64-msvc@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-win32-arm64-msvc@npm:11.6.1" +"@oxc-resolver/binding-win32-arm64-msvc@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-win32-arm64-msvc@npm:11.7.1" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@oxc-resolver/binding-win32-ia32-msvc@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-win32-ia32-msvc@npm:11.6.1" +"@oxc-resolver/binding-win32-ia32-msvc@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-win32-ia32-msvc@npm:11.7.1" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@oxc-resolver/binding-win32-x64-msvc@npm:11.6.1": - version: 11.6.1 - resolution: "@oxc-resolver/binding-win32-x64-msvc@npm:11.6.1" +"@oxc-resolver/binding-win32-x64-msvc@npm:11.7.1": + version: 11.7.1 + resolution: "@oxc-resolver/binding-win32-x64-msvc@npm:11.7.1" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -10798,14 +10798,14 @@ __metadata: languageName: node linkType: hard -"formatly@npm:^0.2.4": - version: 0.2.4 - resolution: "formatly@npm:0.2.4" +"formatly@npm:^0.3.0": + version: 0.3.0 + resolution: "formatly@npm:0.3.0" dependencies: fd-package-json: ^2.0.0 bin: formatly: bin/index.mjs - checksum: 1d5b501a83cb5778e357594b1f3c839de2bae1ee92dc5c0fc367f2dc7f9c3cddb52934c9f261e9ef2cac08931c4a8d2beb1d0f034c9f0b212e81b7e83faca996 + checksum: ef2bf133c048195fc30ced2a20e9acb5251a2a7cf7c2bf67afc71f6bbad78a3f8816b814ee22ec6db1bca7b339fb0d1eddbf168c7d36cc53459c664ff73e8d0d languageName: node linkType: hard @@ -12796,12 +12796,12 @@ __metadata: languageName: node linkType: hard -"jiti@npm:^2.4.2": - version: 2.4.2 - resolution: "jiti@npm:2.4.2" +"jiti@npm:^2.5.1": + version: 2.5.1 + resolution: "jiti@npm:2.5.1" bin: jiti: lib/jiti-cli.mjs - checksum: c6c30c7b6b293e9f26addfb332b63d964a9f143cdd2cf5e946dbe5143db89f7c1b50ad9223b77fb1f6ddb0b9c5ecef995fea024ecf7d2861d285d779cde66e1e + checksum: db901281e01013c27d46d6c5cde5fa817082f32232c92099043df11e135d00ccd1b4356a9ba356a3293e91855bd7437b6df5ae0ae6ad2c384d9bd59df926633c languageName: node linkType: hard @@ -13039,19 +13039,19 @@ __metadata: linkType: hard "knip@npm:^5.41.1": - version: 5.62.0 - resolution: "knip@npm:5.62.0" + version: 5.63.0 + resolution: "knip@npm:5.63.0" dependencies: "@nodelib/fs.walk": ^1.2.3 fast-glob: ^3.3.3 - formatly: ^0.2.4 - jiti: ^2.4.2 + formatly: ^0.3.0 + jiti: ^2.5.1 js-yaml: ^4.1.0 minimist: ^1.2.8 - oxc-resolver: ^11.1.0 + oxc-resolver: ^11.6.2 picocolors: ^1.1.1 picomatch: ^4.0.1 - smol-toml: ^1.3.4 + smol-toml: ^1.4.1 strip-json-comments: 5.0.2 zod: ^3.22.4 zod-validation-error: ^3.0.3 @@ -13061,7 +13061,7 @@ __metadata: bin: knip: bin/knip.js knip-bun: bin/knip-bun.js - checksum: a7b32e2d264b951e65ec7e0009bd27f1bacbe9be8703fa897eb520427b7414babf4c718876f3f01208d8479189061dc921edf44ad849d85b2c6689c858a79ebe + checksum: bbb8eda2469c3f2eddfa19e746732984bd6ac0485e34b650933f172ceecc8e6ac84ff8a481c85dcc3792cba3c135c63ab13f0159c4df4872ad3accb6c0a4cb84 languageName: node linkType: hard @@ -15347,29 +15347,29 @@ __metadata: languageName: node linkType: hard -"oxc-resolver@npm:^11.1.0": - version: 11.6.1 - resolution: "oxc-resolver@npm:11.6.1" - dependencies: - "@oxc-resolver/binding-android-arm-eabi": 11.6.1 - "@oxc-resolver/binding-android-arm64": 11.6.1 - "@oxc-resolver/binding-darwin-arm64": 11.6.1 - "@oxc-resolver/binding-darwin-x64": 11.6.1 - "@oxc-resolver/binding-freebsd-x64": 11.6.1 - "@oxc-resolver/binding-linux-arm-gnueabihf": 11.6.1 - "@oxc-resolver/binding-linux-arm-musleabihf": 11.6.1 - "@oxc-resolver/binding-linux-arm64-gnu": 11.6.1 - "@oxc-resolver/binding-linux-arm64-musl": 11.6.1 - "@oxc-resolver/binding-linux-ppc64-gnu": 11.6.1 - "@oxc-resolver/binding-linux-riscv64-gnu": 11.6.1 - "@oxc-resolver/binding-linux-riscv64-musl": 11.6.1 - "@oxc-resolver/binding-linux-s390x-gnu": 11.6.1 - "@oxc-resolver/binding-linux-x64-gnu": 11.6.1 - "@oxc-resolver/binding-linux-x64-musl": 11.6.1 - "@oxc-resolver/binding-wasm32-wasi": 11.6.1 - "@oxc-resolver/binding-win32-arm64-msvc": 11.6.1 - "@oxc-resolver/binding-win32-ia32-msvc": 11.6.1 - "@oxc-resolver/binding-win32-x64-msvc": 11.6.1 +"oxc-resolver@npm:^11.6.2": + version: 11.7.1 + resolution: "oxc-resolver@npm:11.7.1" + dependencies: + "@oxc-resolver/binding-android-arm-eabi": 11.7.1 + "@oxc-resolver/binding-android-arm64": 11.7.1 + "@oxc-resolver/binding-darwin-arm64": 11.7.1 + "@oxc-resolver/binding-darwin-x64": 11.7.1 + "@oxc-resolver/binding-freebsd-x64": 11.7.1 + "@oxc-resolver/binding-linux-arm-gnueabihf": 11.7.1 + "@oxc-resolver/binding-linux-arm-musleabihf": 11.7.1 + "@oxc-resolver/binding-linux-arm64-gnu": 11.7.1 + "@oxc-resolver/binding-linux-arm64-musl": 11.7.1 + "@oxc-resolver/binding-linux-ppc64-gnu": 11.7.1 + "@oxc-resolver/binding-linux-riscv64-gnu": 11.7.1 + "@oxc-resolver/binding-linux-riscv64-musl": 11.7.1 + "@oxc-resolver/binding-linux-s390x-gnu": 11.7.1 + "@oxc-resolver/binding-linux-x64-gnu": 11.7.1 + "@oxc-resolver/binding-linux-x64-musl": 11.7.1 + "@oxc-resolver/binding-wasm32-wasi": 11.7.1 + "@oxc-resolver/binding-win32-arm64-msvc": 11.7.1 + "@oxc-resolver/binding-win32-ia32-msvc": 11.7.1 + "@oxc-resolver/binding-win32-x64-msvc": 11.7.1 napi-postinstall: ^0.3.0 dependenciesMeta: "@oxc-resolver/binding-android-arm-eabi": @@ -15410,7 +15410,7 @@ __metadata: optional: true "@oxc-resolver/binding-win32-x64-msvc": optional: true - checksum: 9cc70a0a88ed79c186b9f1bc450509bb7a0032b4ff72e5b0e674d8de167c7ea4d82751c6099b024ca2ae673f02352ce83cd0cee7119c2f5cbc4d48d18c982b38 + checksum: 44b60d188ec8f27c193d056317944ad70f2aca5e1435ee4a03d24a07c5b4c460ed57a6a855a3f4b268014d374059199a17ae2c14452e08d2ad6a53c665bf1180 languageName: node linkType: hard @@ -18477,7 +18477,7 @@ __metadata: languageName: node linkType: hard -"smol-toml@npm:^1.3.4, smol-toml@npm:^1.4.1": +"smol-toml@npm:^1.4.1": version: 1.4.2 resolution: "smol-toml@npm:1.4.2" checksum: f12d3fbc2d49396ec523170828a5c9a89bc7740eb7b205f8d8553af18629d936474c1ce55b70c7839aa239a11252e16fd1c3fc955b966b81c9dec00155df4f85 From 5a4d567ba72c97afab536ba7a961d6c1b5abdbd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Thu, 28 Aug 2025 14:17:53 -0400 Subject: [PATCH 151/283] docs: remove extra 'rules' in 'rules rules' (#11535) --- docs/troubleshooting/typed-linting/Performance.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/troubleshooting/typed-linting/Performance.mdx b/docs/troubleshooting/typed-linting/Performance.mdx index 29775150a6d6..bc6ac0fa4769 100644 --- a/docs/troubleshooting/typed-linting/Performance.mdx +++ b/docs/troubleshooting/typed-linting/Performance.mdx @@ -226,7 +226,7 @@ See [Glob pattern in parser's option "project" slows down linting](https://githu ## Third-Party Plugins -### `@stylistic/ts/indent` and other stylistic rules rules +### `@stylistic/ts/indent` and other stylistic rules The [`@stylisic/ts/indent` rule](https://eslint.style/rules/ts/indent#ts-indent) helps ensure your codebase follows a consistent indentation pattern. However this involves a _lot_ of computations across every single token in a file. From 264ca2fad49a298a2963de83746f8e8044229a3b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 29 Aug 2025 01:44:48 +0000 Subject: [PATCH 152/283] fix(deps): update eslint monorepo to v9.33.0 (#11482) * fix(deps): update eslint monorepo to v9.33.0 * update snapshot --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .../schema-snapshots/no-magic-numbers.shot | 4 + yarn.lock | 425 +++--------------- 2 files changed, 74 insertions(+), 355 deletions(-) diff --git a/packages/eslint-plugin/tests/schema-snapshots/no-magic-numbers.shot b/packages/eslint-plugin/tests/schema-snapshots/no-magic-numbers.shot index 6a0d430f638e..394890924c13 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/no-magic-numbers.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/no-magic-numbers.shot @@ -41,18 +41,22 @@ "type": "boolean" }, "ignoreEnums": { + "default": false, "description": "Whether enums used in TypeScript are considered okay.", "type": "boolean" }, "ignoreNumericLiteralTypes": { + "default": false, "description": "Whether numbers used in TypeScript numeric literal types are considered okay.", "type": "boolean" }, "ignoreReadonlyClassProperties": { + "default": false, "description": "Whether `readonly` class properties are considered okay.", "type": "boolean" }, "ignoreTypeIndexes": { + "default": false, "description": "Whether numbers used to index types are okay.", "type": "boolean" } diff --git a/yarn.lock b/yarn.lock index e17bec9b16b7..c3f706af72c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3709,21 +3709,21 @@ __metadata: languageName: node linkType: hard -"@eslint/config-array@npm:^0.20.0": - version: 0.20.0 - resolution: "@eslint/config-array@npm:0.20.0" +"@eslint/config-array@npm:^0.21.0": + version: 0.21.0 + resolution: "@eslint/config-array@npm:0.21.0" dependencies: "@eslint/object-schema": ^2.1.6 debug: ^4.3.1 minimatch: ^3.1.2 - checksum: 55824ea31f0502166a6fea97176c9c25089a0354474cdc72a5f739b1cf6925f44f667bf8f4f3a9dabf1112ab0fa671778ca3f96f1499f31ec42caf84cae55005 + checksum: 84d3ae7cb755af94dc158a74389f4c560757b13f2bb908f598f927b87b70a38e8152015ea2e9557c1b4afc5130ee1356f6cad682050d67aae0468bbef98bc3a8 languageName: node linkType: hard -"@eslint/config-helpers@npm:^0.2.1": - version: 0.2.2 - resolution: "@eslint/config-helpers@npm:0.2.2" - checksum: 8a4091a2c8af5366513647ccad720f184c1b723f04c086755797a3a5cac69dc9013bc8a75453d9fc188fc4364460f0eae9f1584b77b28082e0d26bf48356ae8f +"@eslint/config-helpers@npm:^0.3.1": + version: 0.3.1 + resolution: "@eslint/config-helpers@npm:0.3.1" + checksum: b95c239264078a430761afb344402d517134289a7d8b69a6ff1378ebe5eec9da6ad22b5e6d193b9e02899aeda30817ac47178d5927247092cc6d73a52f8d07c9 languageName: node linkType: hard @@ -3736,6 +3736,15 @@ __metadata: languageName: node linkType: hard +"@eslint/core@npm:^0.15.2": + version: 0.15.2 + resolution: "@eslint/core@npm:0.15.2" + dependencies: + "@types/json-schema": ^7.0.15 + checksum: 535fc4e657760851826ceae325a72dde664b99189bd975715de3526db655c66d7a35b72dbb1c7641ab9201ed4e2130f79c5be51f96c820b5407c3766dcf94f23 + languageName: node + linkType: hard + "@eslint/eslintrc@npm:^3.2.0, @eslint/eslintrc@npm:^3.3.1": version: 3.3.1 resolution: "@eslint/eslintrc@npm:3.3.1" @@ -3753,10 +3762,10 @@ __metadata: languageName: node linkType: hard -"@eslint/js@npm:*, @eslint/js@npm:9.26.0, @eslint/js@npm:^9.26.0": - version: 9.26.0 - resolution: "@eslint/js@npm:9.26.0" - checksum: 40d30f7e5c1585168fc552f953b824f822847d496340e9251e8812b5f401cee129799b3337386f0ea402048b66378c607889d6edf018e19453ae2bcdfc0e2de9 +"@eslint/js@npm:*, @eslint/js@npm:9.34.0, @eslint/js@npm:^9.26.0": + version: 9.34.0 + resolution: "@eslint/js@npm:9.34.0" + checksum: 933d4ba321b1abc83eecde40eb703871ce00f133eedec54cf928b7fedb61706174dd526997c3f151776922412e3d95cb3634f97ef7b5861b4908f9992f403a63 languageName: node linkType: hard @@ -3767,7 +3776,7 @@ __metadata: languageName: node linkType: hard -"@eslint/plugin-kit@npm:^0.2.7, @eslint/plugin-kit@npm:^0.2.8": +"@eslint/plugin-kit@npm:^0.2.7": version: 0.2.8 resolution: "@eslint/plugin-kit@npm:0.2.8" dependencies: @@ -3777,6 +3786,16 @@ __metadata: languageName: node linkType: hard +"@eslint/plugin-kit@npm:^0.3.5": + version: 0.3.5 + resolution: "@eslint/plugin-kit@npm:0.3.5" + dependencies: + "@eslint/core": ^0.15.2 + levn: ^0.4.1 + checksum: 1808d7e2538335b8e4536ef372840e93468ecc6f4a5bf72ad665795290b6a8a72f51ef4ffd8bcfc601b133a5d5f67b59ab256d945f8c825c5c307aad29efaf86 + languageName: node + linkType: hard + "@gerrit0/mini-shiki@npm:^3.2.2": version: 3.3.0 resolution: "@gerrit0/mini-shiki@npm:3.3.0" @@ -4058,24 +4077,6 @@ __metadata: languageName: node linkType: hard -"@modelcontextprotocol/sdk@npm:^1.8.0": - version: 1.11.0 - resolution: "@modelcontextprotocol/sdk@npm:1.11.0" - dependencies: - content-type: ^1.0.5 - cors: ^2.8.5 - cross-spawn: ^7.0.3 - eventsource: ^3.0.2 - express: ^5.0.1 - express-rate-limit: ^7.5.0 - pkce-challenge: ^5.0.0 - raw-body: ^3.0.0 - zod: ^3.23.8 - zod-to-json-schema: ^3.24.1 - checksum: d0ab5cfac6eedc1c2a2bf63fec97021f174a8eb265e8f4189cfa353d4c267cd94359a819b8012e64f4e93ebc283546c2ecc3cb8034a3924b483b85595c5d24a0 - languageName: node - linkType: hard - "@napi-rs/wasm-runtime@npm:0.2.4": version: 0.2.4 resolution: "@napi-rs/wasm-runtime@npm:0.2.4" @@ -6483,16 +6484,6 @@ __metadata: languageName: node linkType: hard -"accepts@npm:^2.0.0": - version: 2.0.0 - resolution: "accepts@npm:2.0.0" - dependencies: - mime-types: ^3.0.0 - negotiator: ^1.0.0 - checksum: 49fe6c050cb6f6ff4e771b4d88324fca4d3127865f2473872e818dca127d809ba3aa8fdfc7acb51dd3c5bade7311ca6b8cfff7015ea6db2f7eb9c8444d223a4f - languageName: node - linkType: hard - "accepts@npm:~1.3.4, accepts@npm:~1.3.5, accepts@npm:~1.3.8": version: 1.3.8 resolution: "accepts@npm:1.3.8" @@ -6528,7 +6519,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.14.0, acorn@npm:^8.15.0, acorn@npm:^8.8.2": +"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.15.0, acorn@npm:^8.8.2": version: 8.15.0 resolution: "acorn@npm:8.15.0" bin: @@ -7266,23 +7257,6 @@ __metadata: languageName: node linkType: hard -"body-parser@npm:^2.2.0": - version: 2.2.0 - resolution: "body-parser@npm:2.2.0" - dependencies: - bytes: ^3.1.2 - content-type: ^1.0.5 - debug: ^4.4.0 - http-errors: ^2.0.0 - iconv-lite: ^0.6.3 - on-finished: ^2.4.1 - qs: ^6.14.0 - raw-body: ^3.0.0 - type-is: ^2.0.0 - checksum: 7fe3a2d288f0b632528d6ccb90052d1a9492c5b79d5716d32c8de1f5fb8237b0d31ee5050e1d0b7ff143a492ff151804612c6e2686a222a1d4c9e2e6531b8fb2 - languageName: node - linkType: hard - "bonjour-service@npm:^1.0.11": version: 1.0.12 resolution: "bonjour-service@npm:1.0.12" @@ -7423,7 +7397,7 @@ __metadata: languageName: node linkType: hard -"bytes@npm:3.1.2, bytes@npm:^3.1.2": +"bytes@npm:3.1.2": version: 3.1.2 resolution: "bytes@npm:3.1.2" checksum: e4bcd3948d289c5127591fbedf10c0b639ccbf00243504e4e127374a15c3bc8eed0d28d4aaab08ff6f1cf2abc0cce6ba3085ed32f4f90e82a5683ce0014e1b6e @@ -8129,16 +8103,7 @@ __metadata: languageName: node linkType: hard -"content-disposition@npm:^1.0.0": - version: 1.0.0 - resolution: "content-disposition@npm:1.0.0" - dependencies: - safe-buffer: 5.2.1 - checksum: b27e2579fefe0ecf78238bb652fbc750671efce8344f0c6f05235b12433e6a965adb40906df1ac1fdde23e8f9f0e58385e44640e633165420f3f47d830ae0398 - languageName: node - linkType: hard - -"content-type@npm:^1.0.5, content-type@npm:~1.0.4": +"content-type@npm:~1.0.4": version: 1.0.5 resolution: "content-type@npm:1.0.5" checksum: 566271e0a251642254cde0f845f9dd4f9856e52d988f4eb0d0dcffbb7a1f8ec98de7a5215fc628f3bce30fe2fb6fd2bc064b562d721658c59b544e2d34ea2766 @@ -8159,13 +8124,6 @@ __metadata: languageName: node linkType: hard -"cookie-signature@npm:^1.2.1": - version: 1.2.2 - resolution: "cookie-signature@npm:1.2.2" - checksum: 1ad4f9b3907c9f3673a0f0a07c0a23da7909ac6c9204c5d80a0ec102fe50ccc45f27fdf496361840d6c132c5bb0037122c0a381f856d070183d1ebe3e5e041ff - languageName: node - linkType: hard - "cookie@npm:0.5.0": version: 0.5.0 resolution: "cookie@npm:0.5.0" @@ -8173,13 +8131,6 @@ __metadata: languageName: node linkType: hard -"cookie@npm:^0.7.1": - version: 0.7.2 - resolution: "cookie@npm:0.7.2" - checksum: 9bf8555e33530affd571ea37b615ccad9b9a34febbf2c950c86787088eb00a8973690833b0f8ebd6b69b753c62669ea60cec89178c1fb007bf0749abed74f93e - languageName: node - linkType: hard - "copy-text-to-clipboard@npm:^3.2.0": version: 3.2.0 resolution: "copy-text-to-clipboard@npm:3.2.0" @@ -8248,16 +8199,6 @@ __metadata: languageName: node linkType: hard -"cors@npm:^2.8.5": - version: 2.8.5 - resolution: "cors@npm:2.8.5" - dependencies: - object-assign: ^4 - vary: ^1 - checksum: ced838404ccd184f61ab4fdc5847035b681c90db7ac17e428f3d81d69e2989d2b680cc254da0e2554f5ed4f8a341820a1ce3d1c16b499f6e2f47a1b9b07b5006 - languageName: node - linkType: hard - "cosmiconfig@npm:^6.0.0": version: 6.0.0 resolution: "cosmiconfig@npm:6.0.0" @@ -8833,7 +8774,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.4.0, debug@npm:^4.4.1": +"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.4.0, debug@npm:^4.4.1": version: 4.4.1 resolution: "debug@npm:4.4.1" dependencies: @@ -8984,7 +8925,7 @@ __metadata: languageName: node linkType: hard -"depd@npm:2.0.0, depd@npm:^2.0.0": +"depd@npm:2.0.0": version: 2.0.0 resolution: "depd@npm:2.0.0" checksum: abbe19c768c97ee2eed6282d8ce3031126662252c58d711f646921c9623f9052e3e1906443066beec1095832f534e57c523b7333f8e7e0d93051ab6baef5ab3a @@ -9318,13 +9259,6 @@ __metadata: languageName: node linkType: hard -"encodeurl@npm:^2.0.0": - version: 2.0.0 - resolution: "encodeurl@npm:2.0.0" - checksum: abf5cd51b78082cf8af7be6785813c33b6df2068ce5191a40ca8b1afe6a86f9230af9a9ce694a5ce4665955e5c1120871826df9c128a642e09c58d592e2807fe - languageName: node - linkType: hard - "encodeurl@npm:~1.0.2": version: 1.0.2 resolution: "encodeurl@npm:1.0.2" @@ -9989,13 +9923,13 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:^8.3.0": - version: 8.3.0 - resolution: "eslint-scope@npm:8.3.0" +"eslint-scope@npm:^8.4.0": + version: 8.4.0 + resolution: "eslint-scope@npm:8.4.0" dependencies: esrecurse: ^4.3.0 estraverse: ^5.2.0 - checksum: 57a58b6716533e25d527089826c4add89a047aecf75e4a88fee05f113ef5a72b85392b304a69bf670646cc3e068354aec70361b9718c2453949a05fc4d9bfe73 + checksum: cf88f42cd5e81490d549dc6d350fe01e6fe420f9d9ea34f134bb359b030e3c4ef888d36667632e448937fe52449f7181501df48c08200e3d3b0fee250d05364e languageName: node linkType: hard @@ -10013,7 +9947,7 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^4.2.0, eslint-visitor-keys@npm:^4.2.1": +"eslint-visitor-keys@npm:^4.2.1": version: 4.2.1 resolution: "eslint-visitor-keys@npm:4.2.1" checksum: 3a77e3f99a49109f6fb2c5b7784bc78f9743b834d238cdba4d66c602c6b52f19ed7bcd0a5c5dbbeae3a8689fd785e76c001799f53d2228b278282cf9f699fff5 @@ -10021,21 +9955,20 @@ __metadata: linkType: hard "eslint@npm:*, eslint@npm:^9.15.0, eslint@npm:^9.26.0": - version: 9.26.0 - resolution: "eslint@npm:9.26.0" + version: 9.34.0 + resolution: "eslint@npm:9.34.0" dependencies: "@eslint-community/eslint-utils": ^4.2.0 "@eslint-community/regexpp": ^4.12.1 - "@eslint/config-array": ^0.20.0 - "@eslint/config-helpers": ^0.2.1 - "@eslint/core": ^0.13.0 + "@eslint/config-array": ^0.21.0 + "@eslint/config-helpers": ^0.3.1 + "@eslint/core": ^0.15.2 "@eslint/eslintrc": ^3.3.1 - "@eslint/js": 9.26.0 - "@eslint/plugin-kit": ^0.2.8 + "@eslint/js": 9.34.0 + "@eslint/plugin-kit": ^0.3.5 "@humanfs/node": ^0.16.6 "@humanwhocodes/module-importer": ^1.0.1 "@humanwhocodes/retry": ^0.4.2 - "@modelcontextprotocol/sdk": ^1.8.0 "@types/estree": ^1.0.6 "@types/json-schema": ^7.0.15 ajv: ^6.12.4 @@ -10043,9 +9976,9 @@ __metadata: cross-spawn: ^7.0.6 debug: ^4.3.2 escape-string-regexp: ^4.0.0 - eslint-scope: ^8.3.0 - eslint-visitor-keys: ^4.2.0 - espree: ^10.3.0 + eslint-scope: ^8.4.0 + eslint-visitor-keys: ^4.2.1 + espree: ^10.4.0 esquery: ^1.5.0 esutils: ^2.0.2 fast-deep-equal: ^3.1.3 @@ -10060,7 +9993,6 @@ __metadata: minimatch: ^3.1.2 natural-compare: ^1.4.0 optionator: ^0.9.3 - zod: ^3.24.2 peerDependencies: jiti: "*" peerDependenciesMeta: @@ -10068,18 +10000,18 @@ __metadata: optional: true bin: eslint: bin/eslint.js - checksum: 9f17db3a3b759ca2435a19ced30f77354761fe159bb357bc7edcc716f4985fd2b8b84e667a85f9ee9ea3cb0f9718e029a822f97ae6b70421c5880c8b3b2214be + checksum: 6de97f6197774821a086783e1bd73b9518c4eb8896165e448a8bb2359142c63cad40faa5dc79bcdc28fab20b57e1376ccbb76a6ae081da5e94baa18d2d3b92fe languageName: node linkType: hard -"espree@npm:^10.0.1, espree@npm:^10.3.0": - version: 10.3.0 - resolution: "espree@npm:10.3.0" +"espree@npm:^10.0.1, espree@npm:^10.3.0, espree@npm:^10.4.0": + version: 10.4.0 + resolution: "espree@npm:10.4.0" dependencies: - acorn: ^8.14.0 + acorn: ^8.15.0 acorn-jsx: ^5.3.2 - eslint-visitor-keys: ^4.2.0 - checksum: 63e8030ff5a98cea7f8b3e3a1487c998665e28d674af08b9b3100ed991670eb3cbb0e308c4548c79e03762753838fbe530c783f17309450d6b47a889fee72bef + eslint-visitor-keys: ^4.2.1 + checksum: 5f9d0d7c81c1bca4bfd29a55270067ff9d575adb8c729a5d7f779c2c7b910bfc68ccf8ec19b29844b707440fc159a83868f22c8e87bbf7cbcb225ed067df6c85 languageName: node linkType: hard @@ -10214,7 +10146,7 @@ __metadata: languageName: node linkType: hard -"etag@npm:^1.8.1, etag@npm:~1.8.1": +"etag@npm:~1.8.1": version: 1.8.1 resolution: "etag@npm:1.8.1" checksum: 571aeb3dbe0f2bbd4e4fadbdb44f325fc75335cd5f6f6b6a091e6a06a9f25ed5392f0863c5442acb0646787446e816f13cbfc6edce5b07658541dff573cab1ff @@ -10252,22 +10184,6 @@ __metadata: languageName: node linkType: hard -"eventsource-parser@npm:^3.0.1": - version: 3.0.1 - resolution: "eventsource-parser@npm:3.0.1" - checksum: 737f78d1330d7c257125c6b2bd374bb50c5588ac81eb83c05cd6af81fce295bd40fd3d3bb3357ba028a688267363f07912a7e6044656033cde7e8f836d840e40 - languageName: node - linkType: hard - -"eventsource@npm:^3.0.2": - version: 3.0.6 - resolution: "eventsource@npm:3.0.6" - dependencies: - eventsource-parser: ^3.0.1 - checksum: ac3bc3cc339b03c46688fde0a340957b8efd7a4d90592ac25b0cd497de2c8ee77259f1162d1beade6e7b37e932d31b5daec323a96215e392c4f5c535a29db36f - languageName: node - linkType: hard - "execa@npm:7.2.0": version: 7.2.0 resolution: "execa@npm:7.2.0" @@ -10333,15 +10249,6 @@ __metadata: languageName: node linkType: hard -"express-rate-limit@npm:^7.5.0": - version: 7.5.0 - resolution: "express-rate-limit@npm:7.5.0" - peerDependencies: - express: ^4.11 || 5 || ^5.0.0-beta.1 - checksum: 2807341039c111eed292e28768aff3c69515cb96ff15799976a44ead776c41931d6947fe3da3cea021fa0490700b1ab468b4832bbed7d231bed63c195d22b959 - languageName: node - linkType: hard - "express@npm:^4.17.3": version: 4.18.1 resolution: "express@npm:4.18.1" @@ -10381,41 +10288,6 @@ __metadata: languageName: node linkType: hard -"express@npm:^5.0.1": - version: 5.1.0 - resolution: "express@npm:5.1.0" - dependencies: - accepts: ^2.0.0 - body-parser: ^2.2.0 - content-disposition: ^1.0.0 - content-type: ^1.0.5 - cookie: ^0.7.1 - cookie-signature: ^1.2.1 - debug: ^4.4.0 - encodeurl: ^2.0.0 - escape-html: ^1.0.3 - etag: ^1.8.1 - finalhandler: ^2.1.0 - fresh: ^2.0.0 - http-errors: ^2.0.0 - merge-descriptors: ^2.0.0 - mime-types: ^3.0.0 - on-finished: ^2.4.1 - once: ^1.4.0 - parseurl: ^1.3.3 - proxy-addr: ^2.0.7 - qs: ^6.14.0 - range-parser: ^1.2.1 - router: ^2.2.0 - send: ^1.1.0 - serve-static: ^2.2.0 - statuses: ^2.0.1 - type-is: ^2.0.1 - vary: ^1.1.2 - checksum: 06e6141780c6c4780111f971ce062c83d4cf4862c40b43caf1d95afcbb58d7422c560503b8c9d04c7271511525d09cbdbe940bcaad63970fd4c1b9f6fd713bdb - languageName: node - linkType: hard - "extend-shallow@npm:^2.0.1": version: 2.0.1 resolution: "extend-shallow@npm:2.0.1" @@ -10616,20 +10488,6 @@ __metadata: languageName: node linkType: hard -"finalhandler@npm:^2.1.0": - version: 2.1.0 - resolution: "finalhandler@npm:2.1.0" - dependencies: - debug: ^4.4.0 - encodeurl: ^2.0.0 - escape-html: ^1.0.3 - on-finished: ^2.4.1 - parseurl: ^1.3.3 - statuses: ^2.0.1 - checksum: 27ca9cc83b1384ba37959eb95bc7e62bc0bf4d6f6af63f6d38821cf7499b113e34b23f96a2a031616817f73986f94deea67c2f558de9daf406790c181a2501df - languageName: node - linkType: hard - "find-cache-dir@npm:^4.0.0": version: 4.0.0 resolution: "find-cache-dir@npm:4.0.0" @@ -10830,13 +10688,6 @@ __metadata: languageName: node linkType: hard -"fresh@npm:^2.0.0": - version: 2.0.0 - resolution: "fresh@npm:2.0.0" - checksum: 38b9828352c6271e2a0dd8bdd985d0100dbbc4eb8b6a03286071dd6f7d96cfaacd06d7735701ad9a95870eb3f4555e67c08db1dcfe24c2e7bb87383c72fae1d2 - languageName: node - linkType: hard - "front-matter@npm:^4.0.2": version: 4.0.2 resolution: "front-matter@npm:4.0.2" @@ -11732,7 +11583,7 @@ __metadata: languageName: node linkType: hard -"http-errors@npm:2.0.0, http-errors@npm:^2.0.0": +"http-errors@npm:2.0.0": version: 2.0.0 resolution: "http-errors@npm:2.0.0" dependencies: @@ -11872,7 +11723,7 @@ __metadata: languageName: node linkType: hard -"iconv-lite@npm:0.6.3, iconv-lite@npm:^0.6.2, iconv-lite@npm:^0.6.3": +"iconv-lite@npm:^0.6.2": version: 0.6.3 resolution: "iconv-lite@npm:0.6.3" dependencies: @@ -12438,13 +12289,6 @@ __metadata: languageName: node linkType: hard -"is-promise@npm:^4.0.0": - version: 4.0.0 - resolution: "is-promise@npm:4.0.0" - checksum: 0b46517ad47b00b6358fd6553c83ec1f6ba9acd7ffb3d30a0bf519c5c69e7147c132430452351b8a9fc198f8dd6c4f76f8e6f5a7f100f8c77d57d9e0f4261a8a - languageName: node - linkType: hard - "is-reference@npm:^3.0.0": version: 3.0.2 resolution: "is-reference@npm:3.0.2" @@ -13888,13 +13732,6 @@ __metadata: languageName: node linkType: hard -"media-typer@npm:^1.1.0": - version: 1.1.0 - resolution: "media-typer@npm:1.1.0" - checksum: a58dd60804df73c672942a7253ccc06815612326dc1c0827984b1a21704466d7cde351394f47649e56cf7415e6ee2e26e000e81b51b3eebb5a93540e8bf93cbd - languageName: node - linkType: hard - "memfs@npm:^3.1.2, memfs@npm:^3.4.3": version: 3.5.3 resolution: "memfs@npm:3.5.3" @@ -13918,13 +13755,6 @@ __metadata: languageName: node linkType: hard -"merge-descriptors@npm:^2.0.0": - version: 2.0.0 - resolution: "merge-descriptors@npm:2.0.0" - checksum: e383332e700a94682d0125a36c8be761142a1320fc9feeb18e6e36647c9edf064271645f5669b2c21cf352116e561914fd8aa831b651f34db15ef4038c86696a - languageName: node - linkType: hard - "merge-stream@npm:^2.0.0": version: 2.0.0 resolution: "merge-stream@npm:2.0.0" @@ -14491,7 +14321,7 @@ __metadata: languageName: node linkType: hard -"mime-db@npm:>= 1.43.0 < 2, mime-db@npm:^1.54.0": +"mime-db@npm:>= 1.43.0 < 2": version: 1.54.0 resolution: "mime-db@npm:1.54.0" checksum: e99aaf2f23f5bd607deb08c83faba5dd25cf2fec90a7cc5b92d8260867ee08dab65312e1a589e60093dc7796d41e5fae013268418482f1db4c7d52d0a0960ac9 @@ -14523,15 +14353,6 @@ __metadata: languageName: node linkType: hard -"mime-types@npm:^3.0.0, mime-types@npm:^3.0.1": - version: 3.0.1 - resolution: "mime-types@npm:3.0.1" - dependencies: - mime-db: ^1.54.0 - checksum: 8d497ad5cb2dd1210ac7d049b5de94af0b24b45a314961e145b44389344604d54752f03bc00bf880c0da60a214be6fb6d423d318104f02c28d95dd8ebeea4fb4 - languageName: node - linkType: hard - "mime@npm:1.6.0": version: 1.6.0 resolution: "mime@npm:1.6.0" @@ -14860,13 +14681,6 @@ __metadata: languageName: node linkType: hard -"negotiator@npm:^1.0.0": - version: 1.0.0 - resolution: "negotiator@npm:1.0.0" - checksum: 20ebfe79b2d2e7cf9cbc8239a72662b584f71164096e6e8896c8325055497c96f6b80cd22c258e8a2f2aa382a787795ec3ee8b37b422a302c7d4381b0d5ecfbb - languageName: node - linkType: hard - "neo-async@npm:^2.6.2": version: 2.6.2 resolution: "neo-async@npm:2.6.2" @@ -15146,7 +14960,7 @@ __metadata: languageName: node linkType: hard -"object-assign@npm:^4, object-assign@npm:^4.1.1": +"object-assign@npm:^4.1.1": version: 4.1.1 resolution: "object-assign@npm:4.1.1" checksum: fcc6e4ea8c7fe48abfbb552578b1c53e0d194086e2e6bbbf59e0a536381a292f39943c6e9628af05b5528aa5e3318bb30d6b2e53cadaf5b8fe9e12c4b69af23f @@ -15234,7 +15048,7 @@ __metadata: languageName: node linkType: hard -"on-finished@npm:2.4.1, on-finished@npm:^2.4.1": +"on-finished@npm:2.4.1": version: 2.4.1 resolution: "on-finished@npm:2.4.1" dependencies: @@ -15618,7 +15432,7 @@ __metadata: languageName: node linkType: hard -"parseurl@npm:^1.3.3, parseurl@npm:~1.3.2, parseurl@npm:~1.3.3": +"parseurl@npm:~1.3.2, parseurl@npm:~1.3.3": version: 1.3.3 resolution: "parseurl@npm:1.3.3" checksum: 407cee8e0a3a4c5cd472559bca8b6a45b82c124e9a4703302326e9ab60fc1081442ada4e02628efef1eb16197ddc7f8822f5a91fd7d7c86b51f530aedb17dfa2 @@ -15734,13 +15548,6 @@ __metadata: languageName: node linkType: hard -"path-to-regexp@npm:^8.0.0": - version: 8.2.0 - resolution: "path-to-regexp@npm:8.2.0" - checksum: 56e13e45962e776e9e7cd72e87a441cfe41f33fd539d097237ceb16adc922281136ca12f5a742962e33d8dda9569f630ba594de56d8b7b6e49adf31803c5e771 - languageName: node - linkType: hard - "path-type@npm:^4.0.0": version: 4.0.0 resolution: "path-type@npm:4.0.0" @@ -15810,13 +15617,6 @@ __metadata: languageName: node linkType: hard -"pkce-challenge@npm:^5.0.0": - version: 5.0.0 - resolution: "pkce-challenge@npm:5.0.0" - checksum: b5cc239f67ed525b49a23a86fdb8f49e3cdb9fd8f5e8612a15f35b553a18e5a43c99db474ffc6232e084c8328d4f2da51557e51ee4e7f8be42f710215df36f3f - languageName: node - linkType: hard - "pkg-dir@npm:^7.0.0": version: 7.0.0 resolution: "pkg-dir@npm:7.0.0" @@ -16828,7 +16628,7 @@ __metadata: languageName: node linkType: hard -"proxy-addr@npm:^2.0.7, proxy-addr@npm:~2.0.7": +"proxy-addr@npm:~2.0.7": version: 2.0.7 resolution: "proxy-addr@npm:2.0.7" dependencies: @@ -16877,15 +16677,6 @@ __metadata: languageName: node linkType: hard -"qs@npm:^6.14.0": - version: 6.14.0 - resolution: "qs@npm:6.14.0" - dependencies: - side-channel: ^1.1.0 - checksum: 189b52ad4e9a0da1a16aff4c58b2a554a8dad9bd7e287c7da7446059b49ca2e33a49e570480e8be406b87fccebf134f51c373cbce36c8c83859efa0c9b71d635 - languageName: node - linkType: hard - "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -16944,18 +16735,6 @@ __metadata: languageName: node linkType: hard -"raw-body@npm:^3.0.0": - version: 3.0.0 - resolution: "raw-body@npm:3.0.0" - dependencies: - bytes: 3.1.2 - http-errors: 2.0.0 - iconv-lite: 0.6.3 - unpipe: 1.0.0 - checksum: 25b7cf7964183db322e819050d758a5abd0f22c51e9f37884ea44a9ed6855a1fb61f8caa8ec5b61d07e69f54db43dbbc08ad98ef84556696d6aa806be247af0e - languageName: node - linkType: hard - "raw-loader@npm:^4.0.2": version: 4.0.2 resolution: "raw-loader@npm:4.0.2" @@ -17853,19 +17632,6 @@ __metadata: languageName: node linkType: hard -"router@npm:^2.2.0": - version: 2.2.0 - resolution: "router@npm:2.2.0" - dependencies: - debug: ^4.4.0 - depd: ^2.0.0 - is-promise: ^4.0.0 - parseurl: ^1.3.3 - path-to-regexp: ^8.0.0 - checksum: 4c3bec8011ed10bb07d1ee860bc715f245fff0fdff991d8319741d2932d89c3fe0a56766b4fa78e95444bc323fd2538e09c8e43bfbd442c2a7fab67456df7fa5 - languageName: node - linkType: hard - "rtlcss@npm:^4.1.0": version: 4.1.1 resolution: "rtlcss@npm:4.1.1" @@ -18114,25 +17880,6 @@ __metadata: languageName: node linkType: hard -"send@npm:^1.1.0, send@npm:^1.2.0": - version: 1.2.0 - resolution: "send@npm:1.2.0" - dependencies: - debug: ^4.3.5 - encodeurl: ^2.0.0 - escape-html: ^1.0.3 - etag: ^1.8.1 - fresh: ^2.0.0 - http-errors: ^2.0.0 - mime-types: ^3.0.1 - ms: ^2.1.3 - on-finished: ^2.4.1 - range-parser: ^1.2.1 - statuses: ^2.0.1 - checksum: 7557ee6c1c257a1c53b402b4fba8ed88c95800b08abe085fc79e0824869274f213491be2efb2df3de228c70e4d40ce2019e5f77b58c42adb97149135420c3f34 - languageName: node - linkType: hard - "serialize-javascript@npm:^4.0.0": version: 4.0.0 resolution: "serialize-javascript@npm:4.0.0" @@ -18193,18 +17940,6 @@ __metadata: languageName: node linkType: hard -"serve-static@npm:^2.2.0": - version: 2.2.0 - resolution: "serve-static@npm:2.2.0" - dependencies: - encodeurl: ^2.0.0 - escape-html: ^1.0.3 - parseurl: ^1.3.3 - send: ^1.2.0 - checksum: 74f39e88f0444aa6732aae3b9597739c47552adecdc83fa32aa42555e76f1daad480d791af73894655c27a2d378275a461e691cead33fb35d8b976f1e2d24665 - languageName: node - linkType: hard - "set-blocking@npm:^2.0.0": version: 2.0.0 resolution: "set-blocking@npm:2.0.0" @@ -18685,7 +18420,7 @@ __metadata: languageName: node linkType: hard -"statuses@npm:2.0.1, statuses@npm:^2.0.1": +"statuses@npm:2.0.1": version: 2.0.1 resolution: "statuses@npm:2.0.1" checksum: 18c7623fdb8f646fb213ca4051be4df7efb3484d4ab662937ca6fbef7ced9b9e12842709872eb3020cc3504b93bde88935c9f6417489627a7786f24f8031cbcb @@ -19504,17 +19239,6 @@ __metadata: languageName: node linkType: hard -"type-is@npm:^2.0.0, type-is@npm:^2.0.1": - version: 2.0.1 - resolution: "type-is@npm:2.0.1" - dependencies: - content-type: ^1.0.5 - media-typer: ^1.1.0 - mime-types: ^3.0.0 - checksum: 0266e7c782238128292e8c45e60037174d48c6366bb2d45e6bd6422b611c193f83409a8341518b6b5f33f8e4d5a959f38658cacfea77f0a3505b9f7ac1ddec8f - languageName: node - linkType: hard - "type-is@npm:~1.6.18": version: 1.6.18 resolution: "type-is@npm:1.6.18" @@ -19979,7 +19703,7 @@ __metadata: languageName: node linkType: hard -"vary@npm:^1, vary@npm:^1.1.2, vary@npm:~1.1.2": +"vary@npm:~1.1.2": version: 1.1.2 resolution: "vary@npm:1.1.2" checksum: ae0123222c6df65b437669d63dfa8c36cee20a504101b2fcd97b8bf76f91259c17f9f2b4d70a1e3c6bbcee7f51b28392833adb6b2770b23b01abec84e369660b @@ -21032,15 +20756,6 @@ __metadata: languageName: node linkType: hard -"zod-to-json-schema@npm:^3.24.1": - version: 3.24.5 - resolution: "zod-to-json-schema@npm:3.24.5" - peerDependencies: - zod: ^3.24.1 - checksum: dc4e5e4c06e9a5494e4b1d8c8363ac907f9d488f36c8e4923e1e5ac4f91f737722f99200cd92a409551e7456d960734d4cabd37935234ca95e290572468ffc08 - languageName: node - linkType: hard - "zod-validation-error@npm:^3.0.3": version: 3.2.0 resolution: "zod-validation-error@npm:3.2.0" @@ -21050,7 +20765,7 @@ __metadata: languageName: node linkType: hard -"zod@npm:^3.22.4, zod@npm:^3.23.8, zod@npm:^3.24.2, zod@npm:^3.25.67": +"zod@npm:^3.22.4, zod@npm:^3.25.67": version: 3.25.67 resolution: "zod@npm:3.25.67" checksum: 56ab904d33b1cd00041ce64ae05b0628fcbfeb7e707fa31cd498a97b540135e4dfe685200c9c62aea307695ee132870b4bc34f035228ea728aa75cc96a4954cb From d7614a74c3609843a0a3aefdd2c0685dec82e7c5 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Sun, 31 Aug 2025 23:35:35 -0600 Subject: [PATCH 153/283] feat: deprecate tseslint.config() (#11531) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * WIP - deprecate tseslint.config() * yup * gud * issue * switch docs to use defineConfig * add back import * lint * more spots * typo * #config-deprecated * touchup * Update docs/getting-started/Quickstart.mdx Co-authored-by: Josh Goldberg ✨ * Update docs/packages/TypeScript_ESLint.mdx Co-authored-by: Josh Goldberg ✨ --------- Co-authored-by: Josh Goldberg ✨ --- docs/getting-started/Quickstart.mdx | 18 +-- docs/getting-started/Typed_Linting.mdx | 5 +- docs/packages/TypeScript_ESLint.mdx | 112 +++++++++++++++--- docs/troubleshooting/faqs/ESLint.mdx | 4 +- docs/troubleshooting/faqs/Frameworks.mdx | 5 +- docs/troubleshooting/faqs/General.mdx | 5 +- .../typed-linting/Monorepos.mdx | 4 +- .../typed-linting/Performance.mdx | 2 +- docs/troubleshooting/typed-linting/index.mdx | 7 +- docs/users/Shared_Configurations.mdx | 23 ++-- docs/users/What_About_Formatting.mdx | 3 +- eslint.config.mjs | 5 +- .../typescript-eslint/src/config-helper.ts | 3 + .../tests/config-helper.test.ts | 2 + .../tests/type-compatibility.test-d.ts | 2 + 15 files changed, 140 insertions(+), 60 deletions(-) diff --git a/docs/getting-started/Quickstart.mdx b/docs/getting-started/Quickstart.mdx index 232fe15966d5..c362a5978ffd 100644 --- a/docs/getting-started/Quickstart.mdx +++ b/docs/getting-started/Quickstart.mdx @@ -35,9 +35,10 @@ Next, create an `eslint.config.mjs` config file in the root of your project, and // @ts-check import eslint from '@eslint/js'; +import { defineConfig } from 'eslint/config'; import tseslint from 'typescript-eslint'; -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, tseslint.configs.recommended, ); @@ -47,21 +48,10 @@ This code will enable our [recommended configuration](../users/Shared_Configurat #### Details -- `tseslint.config(...)` is an **_optional_** helper function — see [`typescript-eslint`'s `config(...)`](../packages/TypeScript_ESLint.mdx#config). +- `defineConfig(...)` is an optional helper function built in to current versions of ESLint. See [the ESLint configuration docs](https://eslint.org/docs/latest/use/configure/configuration-files) for more detail. - `'@eslint/js'` / `eslint.configs.recommended` turns on [eslint's recommended config](https://www.npmjs.com/package/@eslint/js). - `tseslint.configs.recommended` turns on [our recommended config](../users/Shared_Configurations.mdx#recommended). -
-Aside on ESLint's `defineConfig()` - -ESLint also provides a `defineConfig()` helper similar to `tseslint.config()`. -However, there is a types incompatibility issue that causes type errors to incorrectly be reported when mixing typescript-eslint's configs and `defineConfig()`. -For now we recommend using `tseslint.config()` for use with typescript-eslint's configs. - -See [typescript-eslint#10899](https://github.com/typescript-eslint/typescript-eslint/issues/10899) for more details. - -
-
Aside on file extensions @@ -111,7 +101,7 @@ We recommend you consider enabling the following two configs: - [`stylistic`](../users/Shared_Configurations.mdx#stylistic): additional rules that enforce consistent styling without significantly catching bugs or changing logic. ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, // Remove this line tseslint.configs.recommended, diff --git a/docs/getting-started/Typed_Linting.mdx b/docs/getting-started/Typed_Linting.mdx index 95f225038dd3..bc36f5589735 100644 --- a/docs/getting-started/Typed_Linting.mdx +++ b/docs/getting-started/Typed_Linting.mdx @@ -20,9 +20,10 @@ To enable typed linting, there are two small changes you need to make to your co ```js title="eslint.config.mjs" import eslint from '@eslint/js'; +import { defineConfig } from 'eslint/config'; import tseslint from 'typescript-eslint'; -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, // Remove this line tseslint.configs.recommended, @@ -99,7 +100,7 @@ If you enabled the [`strict` shared config](../users/Shared_Configurations.mdx#s ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, // Removed lines start tseslint.configs.strict, diff --git a/docs/packages/TypeScript_ESLint.mdx b/docs/packages/TypeScript_ESLint.mdx index 9fc886d872bd..e2c283adf146 100644 --- a/docs/packages/TypeScript_ESLint.mdx +++ b/docs/packages/TypeScript_ESLint.mdx @@ -16,12 +16,12 @@ This package is the main entrypoint that you can use to consume our tooling with This package exports the following: -| Name | Description | -| --------- | -------------------------------------------------------------------------------------- | -| `config` | A utility function for creating type-safe flat configs -- see [`config(...)`](#config) | -| `configs` | [Shared ESLint (flat) configs](../users/Shared_Configurations.mdx) | -| `parser` | A re-export of [`@typescript-eslint/parser`](./Parser.mdx) | -| `plugin` | A re-export of [`@typescript-eslint/eslint-plugin`](./ESLint_Plugin.mdx) | +| Name | Description | +| --------------------- | ------------------------------------------------------------------------------------------------- | +| `config` (deprecated) | A utility function for creating type-safe flat configs -- see [`config(...)`](#config-deprecated) | +| `configs` | [Shared ESLint (flat) configs](../users/Shared_Configurations.mdx) | +| `parser` | A re-export of [`@typescript-eslint/parser`](./Parser.mdx) | +| `plugin` | A re-export of [`@typescript-eslint/eslint-plugin`](./ESLint_Plugin.mdx) | ## Installation @@ -31,15 +31,16 @@ npm i typescript-eslint ## Usage -We recommend getting started by using the `tseslint.config()` helper function in your ESLint config: +We recommend getting started by using the default ESLint setup with our shared configs. ```js title="eslint.config.mjs" // @ts-check import eslint from '@eslint/js'; +import { defineConfig } from 'eslint/config'; import tseslint from 'typescript-eslint'; -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, tseslint.configs.recommended, ); @@ -47,16 +48,16 @@ export default tseslint.config( This config file exports a flat config that enables both the [core ESLint recommended config](https://www.npmjs.com/package/@eslint/js) and [our recommended config](../users/Shared_Configurations.mdx#recommended). -:::note -ESLint also provides a `defineConfig()` helper similar to `tseslint.config()`. -However, there is a types incompatibility issue that causes type errors to incorrectly be reported when mixing typescript-eslint's configs and `defineConfig()`. -For now we recommend using `tseslint.config()` for use with typescript-eslint configs. +### `config(...)` (deprecated) -See [typescript-eslint#10899](https://github.com/typescript-eslint/typescript-eslint/issues/10899) for more details. +:::danger -::: +The `config(...)` utility function was deprecated in favor of ESLint core's [`defineConfig(...)`]() in [#10935](https://github.com/typescript-eslint/typescript-eslint/issues/10935). +See [the `defineConfig` migration guide later](#migrating-to-defineconfig) for more details. + +The documentation here is preserved for historical reference and migration purposes. -### `config(...)` +::: `tseslint.config(...)` takes in any number of ESLint config objects, each of which may additionally include an `extends` array of configs to extend. `tseslint.config(...)` returns the equivalent ESLint config of applying the rest of the settings for each extension. @@ -114,7 +115,7 @@ Otherwise it _will not_ impact your ability to use our tooling. #### Flat config `extends` -The `tseslint.config()` utility function also adds handling for the `extends` property on flat config objects. +The `tseslint.config(...)` utility function also adds handling for the `extends` property on flat config objects. This allows you to more easily extend shared configs for specific file patterns whilst also overriding rules/options provided by those configs: ```js @@ -168,6 +169,79 @@ export default tseslint.config({ }); ``` +#### Migrating to `defineConfig(...)` + +The core `defineConfig(...)` helper is a nearly exact clone of `tseslint.config(...)` that was [first released in ESLint v9.22.0](https://eslint.org/blog/2025/03/eslint-v9.22.0-released/). +See [the ESLint blog post](https://eslint.org/blog/2025/03/flat-config-extends-define-config-global-ignores/#support-for-older-eslint-versions) for info on how to use `defineConfig(...)` with older versions of ESLint. + +At the time of writing there are a small number of known edge cases in which the two have different functionality. + +{/* https://github.com/prettier/prettier/issues/17816 -- prettier has trouble with the code fences in the custom elements */} + +{/* prettier-ignore */} +1. Overriding `files` in `extends`. + When `files` is provided in both a base object and an extension, `tseslint.config(...)` _overrides_ the `files` property in the extension, whereas `defineConfig(...)` semantically intersects the two provided `files` specifiers. + + + + ```ts title="eslint.config.mjs" + import tseslint from 'typescript-eslint'; + + export default tseslint.config({ + files: ['a.ts'], + extends: [ + { + files: ['b.ts'], + rules: { + 'some-rule': 'error', + }, + }, + ], + }); + + // is equivalent to + + export default { + files: ['a.ts'], + rules: { 'some-rule': 'error' }, + }; + ``` + + + + + ```ts title="eslint.config.mjs" + import { defineConfig } from 'eslint/config'; + + export default defineConfig({ + files: ['a.ts'], + extends: [ + { + files: ['b.ts'], + rules: { + 'some-rule': 'error', + }, + }, + ], + }); + + // is equivalent to + + // The base config technically ensures that 'a.ts' is still included in + // the lint run, but otherwise the config has no effect, due to the + // intersection of 'a.ts' and 'b.ts' being empty. + export default { + files: ['a.ts'], + }; + ``` + + + + +2. Type declarations (only applies to users who typecheck their eslint configs). + There are slight differences in the way types are declared between the two functions, which may cause typechecking errors when you switch from `tseslint.config(...)` to `defineConfig(...)` in some cases (see [#10899](https://github.com/typescript-eslint/typescript-eslint/issues/10899) for an example that used to impact typescript-eslint's own configs). + Type errors such as these do not indicate a runtime problem and can safely be ignored. + ### Manual usage [typescript-eslint's recommended and stylistic configurations](../users/configs) specify typescript-eslint `parser` and `plugin` options for you, so there is no need to manually provide those. @@ -181,10 +255,11 @@ You can declare our plugin and parser in your config via this package, for examp // @ts-check import eslint from '@eslint/js'; +import { defineConfig } from 'eslint/config'; import jestPlugin from 'eslint-plugin-jest'; import tseslint from 'typescript-eslint'; -export default tseslint.config({ +export default defineConfig({ plugins: { // highlight-next-line '@typescript-eslint': tseslint.plugin, @@ -226,10 +301,11 @@ This config: // @ts-check import eslint from '@eslint/js'; +import { defineConfig } from 'eslint/config'; import jestPlugin from 'eslint-plugin-jest'; import tseslint from 'typescript-eslint'; -export default tseslint.config( +export default defineConfig( { // config with just ignores is the replacement for `.eslintignore` ignores: ['**/build/**', '**/dist/**', 'src/some/file/to/ignore.ts'], diff --git a/docs/troubleshooting/faqs/ESLint.mdx b/docs/troubleshooting/faqs/ESLint.mdx index d1a5cdf0d809..a07e16a2f798 100644 --- a/docs/troubleshooting/faqs/ESLint.mdx +++ b/docs/troubleshooting/faqs/ESLint.mdx @@ -49,9 +49,9 @@ Note, that for a mixed project including JavaScript and TypeScript, the `no-unde ```js title="eslint.config.mjs" -import tseslint from 'typescript-eslint'; +import { defineConfig } from 'eslint/config'; -export default tseslint.config( +export default defineConfig( // ... the rest of your config ... { files: ['**/*.{ts,tsx,mts,cts}'], diff --git a/docs/troubleshooting/faqs/Frameworks.mdx b/docs/troubleshooting/faqs/Frameworks.mdx index fc0e559b56fa..f80be6a84296 100644 --- a/docs/troubleshooting/faqs/Frameworks.mdx +++ b/docs/troubleshooting/faqs/Frameworks.mdx @@ -19,7 +19,7 @@ See [Changes to `extraFileExtensions` with `projectService`](../typed-linting/Pe ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( // ... the rest of your config ... { languageOptions: { @@ -61,10 +61,11 @@ If you are running into issues parsing .vue files, it might be because parsers l ```js title="eslint.config.mjs" import tseslint from 'typescript-eslint'; +import { defineConfig } from 'eslint/config'; // Add this line import vueParser from 'vue-eslint-parser'; -export default tseslint.config( +export default defineConfig( // ... the rest of your config ... { languageOptions: { diff --git a/docs/troubleshooting/faqs/General.mdx b/docs/troubleshooting/faqs/General.mdx index 53b752ab9b80..aa04254f59b9 100644 --- a/docs/troubleshooting/faqs/General.mdx +++ b/docs/troubleshooting/faqs/General.mdx @@ -36,7 +36,7 @@ Some examples ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( // ... the rest of your config ... { rules: { @@ -242,9 +242,10 @@ For example, the following config enables only the recommended config's type-che {/* prettier-ignore */} ```js title="eslint.config.mjs" import eslint from '@eslint/js'; +import { defineConfig } from 'eslint/config'; import tseslint from 'typescript-eslint'; -export default tseslint.config( +export default defineConfig( tseslint.configs.recommendedTypeCheckedOnly, { languageOptions: { diff --git a/docs/troubleshooting/typed-linting/Monorepos.mdx b/docs/troubleshooting/typed-linting/Monorepos.mdx index 85cc6ef264db..2364b9defe24 100644 --- a/docs/troubleshooting/typed-linting/Monorepos.mdx +++ b/docs/troubleshooting/typed-linting/Monorepos.mdx @@ -56,7 +56,7 @@ For each file being linted, the first matching project path will be used as its ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, tseslint.configs.recommendedTypeChecked, { @@ -108,7 +108,7 @@ Instead of globs that use `**` to recursively check all folders, prefer paths th ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, tseslint.configs.recommendedTypeChecked, { diff --git a/docs/troubleshooting/typed-linting/Performance.mdx b/docs/troubleshooting/typed-linting/Performance.mdx index bc6ac0fa4769..66b9e2bfbe13 100644 --- a/docs/troubleshooting/typed-linting/Performance.mdx +++ b/docs/troubleshooting/typed-linting/Performance.mdx @@ -180,7 +180,7 @@ Instead of globs that use `**` to recursively check all folders, prefer paths th import eslint from '@eslint/js'; import tseslint from 'typescript-eslint'; -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, tseslint.configs.recommendedRequiringTypeChecking, { diff --git a/docs/troubleshooting/typed-linting/index.mdx b/docs/troubleshooting/typed-linting/index.mdx index 6681b1069b5d..5b76f5c53ad3 100644 --- a/docs/troubleshooting/typed-linting/index.mdx +++ b/docs/troubleshooting/typed-linting/index.mdx @@ -30,9 +30,10 @@ For example, to disable type-checked linting on all `.js` files: ```js title="eslint.config.mjs" +import defineConfig from 'eslint/config'; import tseslint from 'typescript-eslint'; -export default tseslint.config( +export default defineConfig( // ... the rest of your config ... { files: ['**/*.js'], @@ -69,7 +70,7 @@ You can combine ESLint's [overrides](https://eslint.org/docs/latest/use/configur ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, tseslint.configs.recommendedTypeChecked, tseslint.configs.stylisticTypeChecked, @@ -297,7 +298,7 @@ For example, if you use a specific `tsconfig.eslint.json` for linting, you'd spe ```js title="eslint.config.mjs" -export default tseslint.config({ +export default defineConfig({ // ... languageOptions: { parserOptions: { diff --git a/docs/users/Shared_Configurations.mdx b/docs/users/Shared_Configurations.mdx index e77d68bcf6a2..ea4c554e37af 100644 --- a/docs/users/Shared_Configurations.mdx +++ b/docs/users/Shared_Configurations.mdx @@ -21,9 +21,10 @@ See [Getting Started > Quickstart](../getting-started/Quickstart.mdx) first to s // @ts-check import eslint from '@eslint/js'; +import { defineConfig } from 'eslint/config'; import tseslint from 'typescript-eslint'; -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, tseslint.configs.recommended, ); @@ -37,7 +38,7 @@ If your project does not enable [typed linting](../getting-started/Typed_Linting ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, tseslint.configs.recommended, tseslint.configs.stylistic, @@ -70,7 +71,7 @@ If your project enables [typed linting](../getting-started/Typed_Linting.mdx), w ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, tseslint.configs.recommendedTypeChecked, tseslint.configs.stylisticTypeChecked, @@ -127,7 +128,7 @@ These rules are those whose reports are almost always for a bad practice and/or {/* prettier-ignore */} ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( tseslint.configs.recommended, ); ``` @@ -156,7 +157,7 @@ Rules newly added in this configuration are similarly useful to those in `recomm {/* prettier-ignore */} ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( tseslint.configs.recommendedTypeChecked, ); ``` @@ -185,7 +186,7 @@ Rules added in `strict` are more opinionated than recommended rules and might no {/* prettier-ignore */} ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( tseslint.configs.strict, ); ``` @@ -224,7 +225,7 @@ Rules newly added in this configuration are similarly useful (and opinionated) t {/* prettier-ignore */} ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( tseslint.configs.strictTypeChecked, ); ``` @@ -263,7 +264,7 @@ These rules are generally opinionated about enforcing simpler code patterns. {/* prettier-ignore */} ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( tseslint.configs.stylistic, ); ``` @@ -295,7 +296,7 @@ Rules newly added in this configuration are similarly opinionated to those in `s {/* prettier-ignore */} ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( tseslint.configs.stylisticTypeChecked, ); ``` @@ -362,7 +363,7 @@ If you use type-aware rules from other plugins, you will need to manually disabl ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, tseslint.configs.recommendedTypeChecked, { @@ -426,7 +427,7 @@ Additionally, it enables rules that promote using the more modern constructs Typ ```js title="eslint.config.mjs" -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, tseslint.configs.eslintRecommended, ); diff --git a/docs/users/What_About_Formatting.mdx b/docs/users/What_About_Formatting.mdx index a070fdfccfb2..ace2aa4ebd97 100644 --- a/docs/users/What_About_Formatting.mdx +++ b/docs/users/What_About_Formatting.mdx @@ -50,11 +50,12 @@ Using this config by adding it to the end of your `extends`: // @ts-check import eslint from '@eslint/js'; +import { defineConfig } from 'eslint/config'; import someOtherConfig from 'eslint-config-other-configuration-that-enables-formatting-rules'; import prettierConfig from 'eslint-config-prettier'; import tseslint from 'typescript-eslint'; -export default tseslint.config( +export default defineConfig( eslint.configs.recommended, tseslint.configs.recommended, someOtherConfig, diff --git a/eslint.config.mjs b/eslint.config.mjs index b7b469b0dd63..9241cbee26a5 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -15,6 +15,7 @@ import reactPlugin from 'eslint-plugin-react'; import reactHooksPlugin from 'eslint-plugin-react-hooks'; import regexpPlugin from 'eslint-plugin-regexp'; import unicornPlugin from 'eslint-plugin-unicorn'; +import { defineConfig } from 'eslint/config'; import globals from 'globals'; import url from 'node:url'; import tseslint from 'typescript-eslint'; @@ -28,7 +29,7 @@ const restrictNamedDeclarations = { selector: 'ExportNamedDeclaration[declaration=null][source=null]', }; -export default tseslint.config( +export default defineConfig( // register all of the plugins up-front { name: 'register-all-plugins', @@ -43,6 +44,7 @@ export default tseslint.config( // @ts-expect-error -- https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/pull/1038 ['jsx-a11y']: jsxA11yPlugin.flatConfigs.recommended.plugins['jsx-a11y'], ['perfectionist']: perfectionistPlugin, + // @ts-expect-error -- https://github.com/vitest-dev/eslint-plugin-vitest/issues/737 ['vitest']: vitestPlugin, // https://github.com/facebook/react/issues/28313 ['react']: reactPlugin, @@ -363,7 +365,6 @@ export default tseslint.config( // test file specific configuration { extends: [ - // @ts-expect-error -- uses `string` instead of `off` | `readonly` | `writable` for the globals setting. vitestPlugin.configs.env, { rules: { diff --git a/packages/typescript-eslint/src/config-helper.ts b/packages/typescript-eslint/src/config-helper.ts index 51456475734f..758052c62f56 100644 --- a/packages/typescript-eslint/src/config-helper.ts +++ b/packages/typescript-eslint/src/config-helper.ts @@ -88,6 +88,9 @@ export type ConfigArray = TSESLint.FlatConfig.ConfigArray; * }, * ); * ``` + * + * @deprecated ESLint core now provides this functionality via `defineConfig()`, + * which we now recommend instead. See {@link https://typescript-eslint.io/packages/typescript-eslint/#config-deprecated}. */ export function config( ...configs: InfiniteDepthConfigWithExtends[] diff --git a/packages/typescript-eslint/tests/config-helper.test.ts b/packages/typescript-eslint/tests/config-helper.test.ts index 8b4a151a32cf..7b3288df295f 100644 --- a/packages/typescript-eslint/tests/config-helper.test.ts +++ b/packages/typescript-eslint/tests/config-helper.test.ts @@ -2,6 +2,8 @@ import type { TSESLint } from '@typescript-eslint/utils'; import tseslint from '../src/index.js'; +/* eslint @typescript-eslint/no-deprecated: ["error", { "allow": [{ "from": "file", "name": "config", "path": "packages/typescript-eslint/src/config-helper.ts" }] }] */ + describe('config helper', () => { it('works without extends', () => { expect( diff --git a/packages/typescript-eslint/tests/type-compatibility.test-d.ts b/packages/typescript-eslint/tests/type-compatibility.test-d.ts index b0e2f71b81d2..dfcf11cbd2f3 100644 --- a/packages/typescript-eslint/tests/type-compatibility.test-d.ts +++ b/packages/typescript-eslint/tests/type-compatibility.test-d.ts @@ -2,6 +2,8 @@ import { defineConfig } from 'eslint/config'; import tseslint from '../src/index'; +/* eslint @typescript-eslint/no-deprecated: ["error", { "allow": [{ "from": "file", "name": "config", "path": "packages/typescript-eslint/src/config-helper.ts" }] }] */ + describe('test for compatibility with config helpers', () => { test('exported plugin is compatible with tseslint.config()', () => { tseslint.config({ From ee3efa7a112e50fb003530658bce193c990c0b85 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Mon, 1 Sep 2025 19:33:09 +0800 Subject: [PATCH 154/283] feat(typescript-estree): forbid invalid keys in `EnumMember` (#11497) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "fix(typescript-estree): revert #11232 (feat(typescript-estree): forbi…" This reverts commit 76486227715a02a93a7b537f05c22825b764dbc3. * Linting * Revert "Linting" This reverts commit a42f8c7af8b959ebe08011b3b9812c289041eed6. * FIx build script * Fix? * Linting? * fix up type issues --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .../snapshots/1-TSESTree-AST.shot | 1 - .../snapshots/5-AST-Alignment-AST.shot | 1 - .../fixtures/_error_/bigint-name/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 +++ .../bigint-name/snapshots/2-Babel-Error.shot | 10 +++ .../snapshots/3-Alignment-Error.shot | 4 + .../_error_/computed-string-name/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 +++ .../snapshots/2-Babel-Error.shot | 10 +++ .../snapshots/3-Alignment-Error.shot | 4 + .../fixtures/_error_/number-name/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 9 +++ .../number-name/snapshots/2-Babel-Error.shot | 10 +++ .../snapshots/3-Alignment-Error.shot | 4 + .../ast-spec/src/element/TSEnumMember/spec.ts | 45 ++--------- .../snapshots/1-TSESTree-Error.shot | 8 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 8 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 8 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../const-enum/snapshots/1-TSESTree-AST.shot | 2 - .../snapshots/5-AST-Alignment-AST.shot | 16 ++-- .../snapshots/1-TSESTree-AST.shot | 2 - .../snapshots/5-AST-Alignment-AST.shot | 2 - .../snapshots/1-TSESTree-AST.shot | 2 - .../snapshots/5-AST-Alignment-AST.shot | 2 - .../snapshots/1-TSESTree-AST.shot | 2 - .../snapshots/5-AST-Alignment-AST.shot | 2 - .../enum/snapshots/1-TSESTree-AST.shot | 2 - .../enum/snapshots/5-AST-Alignment-AST.shot | 2 - .../fixtures-with-differences-errors.shot | 3 - .../src/rules/naming-convention.ts | 7 +- .../rules/no-unsafe-enum-comparison.test.ts | 81 ------------------- .../rules/prefer-literal-enum-member.test.ts | 14 ---- .../rules/switch-exhaustiveness-check.test.ts | 40 --------- .../src/referencer/Referencer.ts | 5 +- packages/types/src/ts-estree.ts | 5 +- packages/typescript-estree/src/convert.ts | 51 +++++++++--- 39 files changed, 161 insertions(+), 234 deletions(-) create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot index ddd23006e5d0..9a5146151d36 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot @@ -8,7 +8,6 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot index 90fb8dedf846..eeec47153937 100644 --- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot @@ -15,7 +15,6 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts new file mode 100644 index 000000000000..3fcd08d2bc99 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts @@ -0,0 +1,3 @@ +enum Foo { + 1n = 2 +} diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..87ba241f5d40 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > bigint-name > TSESTree - Error`] +TSError + 1 | enum Foo { +> 2 | 1n = 2 + | ^^ An enum member cannot have a numeric name. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..b3afe3afc96e --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > bigint-name > Babel - Error`] +BabelError + 1 | enum Foo { +> 2 | 1n = 2 + | ^ Unexpected token (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..083d80544d72 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > bigint-name > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts new file mode 100644 index 000000000000..2e99a8d3766b --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts @@ -0,0 +1,3 @@ +enum Foo { + ["A"] = 2 +} diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..2079fad90f2e --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > computed-string-name > TSESTree - Error`] +TSError + 1 | enum Foo { +> 2 | ["A"] = 2 + | ^^^^^ Computed property names are not allowed in enums. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..c68571c79318 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > computed-string-name > Babel - Error`] +BabelError + 1 | enum Foo { +> 2 | ["A"] = 2 + | ^ Unexpected token (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..1331cf0d18b9 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > computed-string-name > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts new file mode 100644 index 000000000000..174773e65995 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts @@ -0,0 +1,3 @@ +enum Foo { + 1 = 2 +} diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..8dfacb32e5b9 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > number-name > TSESTree - Error`] +TSError + 1 | enum Foo { +> 2 | 1 = 2 + | ^ An enum member cannot have a numeric name. + 3 | } + 4 | diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..76b2f2b9c62e --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot @@ -0,0 +1,10 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > number-name > Babel - Error`] +BabelError + 1 | enum Foo { +> 2 | 1 = 2 + | ^ Unexpected token (2:2) + 3 | } + 4 | + diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..34e6cebc91e1 --- /dev/null +++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`AST Fixtures > element > TSEnumMember > _error_ > number-name > Error Alignment`] +Both errored diff --git a/packages/ast-spec/src/element/TSEnumMember/spec.ts b/packages/ast-spec/src/element/TSEnumMember/spec.ts index a80e963ad278..a4d1b836f951 100644 --- a/packages/ast-spec/src/element/TSEnumMember/spec.ts +++ b/packages/ast-spec/src/element/TSEnumMember/spec.ts @@ -1,44 +1,15 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; +import type { Identifier } from '../../expression/Identifier/spec'; +import type { StringLiteral } from '../../expression/literal/StringLiteral/spec'; import type { Expression } from '../../unions/Expression'; -import type { - PropertyNameComputed, - PropertyNameNonComputed, -} from '../../unions/PropertyName'; -interface TSEnumMemberBase extends BaseNode { +export interface TSEnumMember extends BaseNode { type: AST_NODE_TYPES.TSEnumMember; - computed: boolean; - id: - | PropertyNameComputed // this should only happen in semantically invalid code (ts error 1164) - | PropertyNameNonComputed; + id: Identifier | StringLiteral; initializer: Expression | undefined; + /** + * @deprecated the enum member is always non-computed. + */ + computed: boolean; } - -/** - * this should only really happen in semantically invalid code (errors 1164 and 2452) - * - * @example - * ```ts - * // VALID: - * enum Foo { ['a'] } - * - * // INVALID: - * const x = 'a'; - * enum Foo { [x] } - * enum Bar { ['a' + 'b'] } - * ``` - */ -export interface TSEnumMemberComputedName extends TSEnumMemberBase { - computed: true; - id: PropertyNameComputed; -} - -export interface TSEnumMemberNonComputedName extends TSEnumMemberBase { - computed: false; - id: PropertyNameNonComputed; -} - -export type TSEnumMember = - | TSEnumMemberComputedName - | TSEnumMemberNonComputedName; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot index c64aaae4a4d8..dc8d857908c8 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-number > TSESTree - Error`] -NO ERROR +TSError + 2 | + 3 | export enum Foo { +> 4 | [1], + | ^^^ Computed property names are not allowed in enums. + 5 | } + 6 | diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot index f5e14d5d4b27..f9ae118971e1 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-number > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot index 866743a38587..90ef25fd26d8 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-string > TSESTree - Error`] -NO ERROR +TSError + 2 | + 3 | export enum Foo { +> 4 | ['baz'], + | ^^^^^^^ Computed property names are not allowed in enums. + 5 | } + 6 | diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot index f58190aa21f3..2dc13fd3d5d2 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-string > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot index 85b95f8e17d3..7e31fde5e0c7 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot @@ -1,4 +1,10 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-var-ref > TSESTree - Error`] -NO ERROR +TSError + 2 | + 3 | export enum Foo { +> 4 | [x], + | ^^^ Computed property names are not allowed in enums. + 5 | } + 6 | diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot index 006e3518ee1f..3909357acf22 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot @@ -1,4 +1,4 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-var-ref > Error Alignment`] -Babel errored but TSESTree didn't +Both errored diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot index 9187f52aade3..238113e5cc58 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot @@ -8,7 +8,6 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -41,7 +40,6 @@ Program { }, TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot index 1c5c321a9cf2..20c84325ce31 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot @@ -15,7 +15,6 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -81,7 +80,6 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -121,12 +119,7 @@ Snapshot Diff: - loc: { - start: { column: 15, line: 3 }, - end: { column: 1, line: 6 }, -+ range: [103, 106], -+ loc: { -+ start: { column: 2, line: 5 }, -+ end: { column: 5, line: 5 }, -+ }, - }, +- }, - }, - const: true, - declare: false, @@ -140,7 +133,12 @@ Snapshot Diff: - loc: { - start: { column: 11, line: 3 }, - end: { column: 14, line: 3 }, -- }, ++ range: [103, 106], ++ loc: { ++ start: { column: 2, line: 5 }, ++ end: { column: 5, line: 5 }, ++ }, + }, - }, + ], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot index 0a35e9756f00..01c4d100b383 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot @@ -11,7 +11,6 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -44,7 +43,6 @@ Program { }, TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot index bc225b94ed0d..603938fb4270 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -19,7 +19,6 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -85,7 +84,6 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot index 15279e8049d7..f946f794f043 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot @@ -11,7 +11,6 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -44,7 +43,6 @@ Program { }, TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot index 695e866e0f98..eff7ba3226bd 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -19,7 +19,6 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -85,7 +84,6 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot index b1554a6d0194..8f42d8de69bf 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot @@ -11,7 +11,6 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -44,7 +43,6 @@ Program { }, TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot index b52051becdfb..10c5f8d572d1 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -19,7 +19,6 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -85,7 +84,6 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot index 513eb9bcd84c..e483a20f2a29 100644 --- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot @@ -8,7 +8,6 @@ Program { members: [ TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], @@ -30,7 +29,6 @@ Program { }, TSEnumMember { type: "TSEnumMember", - computed: false, id: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot index 3c1cbd1bc2a0..544b72e407c8 100644 --- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot @@ -15,7 +15,6 @@ Snapshot Diff: - members: Array [ - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], @@ -59,7 +58,6 @@ Snapshot Diff: }, - TSEnumMember { - type: 'TSEnumMember', -- computed: false, - id: Identifier { - type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index 7051aa777fbb..04b14e7a3730 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -27,9 +27,6 @@ exports[`AST Fixtures > List fixtures with Error differences`] "legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/const-assertions/fixture.ts", - "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/fixture.ts", - "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/fixture.ts", - "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/import-type-error/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/fixture.ts", diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index 03500d825163..839f3e0a1c98 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -631,11 +631,8 @@ export default createRule({ // #region interface - 'TSEnumMember[computed != true]': { - handler: ( - node: TSESTree.TSEnumMemberNonComputedName, - validator, - ): void => { + TSEnumMember: { + handler: (node: TSESTree.TSEnumMember, validator): void => { const id = node.id; const modifiers = new Set(); diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts index b592b7fe513d..89e28f163314 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts @@ -1121,87 +1121,6 @@ ruleTester.run('no-unsafe-enum-comparison', rule, { }, ], }, - { - code: ` - enum ComputedKey { - ['test-key' /* with comment */] = 1, - } - declare const computedKey: ComputedKey; - computedKey === 1; - `, - errors: [ - { - messageId: 'mismatchedCondition', - suggestions: [ - { - messageId: 'replaceValueWithEnum', - output: ` - enum ComputedKey { - ['test-key' /* with comment */] = 1, - } - declare const computedKey: ComputedKey; - computedKey === ComputedKey['test-key']; - `, - }, - ], - }, - ], - }, - { - code: ` - enum ComputedKey { - [\`test-key\` /* with comment */] = 1, - } - declare const computedKey: ComputedKey; - computedKey === 1; - `, - errors: [ - { - messageId: 'mismatchedCondition', - suggestions: [ - { - messageId: 'replaceValueWithEnum', - output: ` - enum ComputedKey { - [\`test-key\` /* with comment */] = 1, - } - declare const computedKey: ComputedKey; - computedKey === ComputedKey[\`test-key\`]; - `, - }, - ], - }, - ], - }, - { - code: ` - enum ComputedKey { - [\`test- - key\` /* with comment */] = 1, - } - declare const computedKey: ComputedKey; - computedKey === 1; - `, - errors: [ - { - messageId: 'mismatchedCondition', - suggestions: [ - { - messageId: 'replaceValueWithEnum', - output: ` - enum ComputedKey { - [\`test- - key\` /* with comment */] = 1, - } - declare const computedKey: ComputedKey; - computedKey === ComputedKey[\`test- - key\`]; - `, - }, - ], - }, - ], - }, { code: ` enum Fruit { diff --git a/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts b/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts index ea670139ccb3..f655c87e9ce2 100644 --- a/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts @@ -54,11 +54,6 @@ enum ValidQuotedKey { ` enum ValidQuotedKeyWithAssignment { 'a' = 1, -} - `, - ` -enum ValidKeyWithComputedSyntaxButNoComputedKey { - ['a'], } `, { @@ -107,15 +102,6 @@ enum Foo { }, { code: ` -enum Foo { - ['A-1'] = 1 << 0, - C = ~Foo['A-1'], -} - `, - options: [{ allowBitwiseExpressions: true }], - }, - { - code: ` enum Foo { A = 1 << 0, B = 1 << 1, diff --git a/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts b/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts index da5b65c8177f..b18e91e4872a 100644 --- a/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts +++ b/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts @@ -2281,46 +2281,6 @@ switch (value) { }, ], }, - { - code: ` - enum Enum { - 'a' = 1, - [\`key-with - - new-line\`] = 2, - } - - declare const a: Enum; - - switch (a) { - } - `, - errors: [ - { - messageId: 'switchIsNotExhaustive', - suggestions: [ - { - messageId: 'addMissingCases', - output: ` - enum Enum { - 'a' = 1, - [\`key-with - - new-line\`] = 2, - } - - declare const a: Enum; - - switch (a) { - case Enum.a: { throw new Error('Not implemented yet: Enum.a case') } - case Enum['key-with\\n\\n new-line']: { throw new Error('Not implemented yet: Enum[\\'key-with\\\\n\\\\n new-line\\'] case') } - } - `, - }, - ], - }, - ], - }, { code: noFormat` enum Enum { diff --git a/packages/scope-manager/src/referencer/Referencer.ts b/packages/scope-manager/src/referencer/Referencer.ts index 1f621d8f7823..562921170751 100644 --- a/packages/scope-manager/src/referencer/Referencer.ts +++ b/packages/scope-manager/src/referencer/Referencer.ts @@ -668,10 +668,7 @@ export class Referencer extends Visitor { name, new TSEnumMemberDefinition(name, member), ); - } else if ( - !member.computed && - member.id.type === AST_NODE_TYPES.Identifier - ) { + } else if (member.id.type === AST_NODE_TYPES.Identifier) { this.currentScope().defineIdentifier( member.id, new TSEnumMemberDefinition(member.id, member), diff --git a/packages/types/src/ts-estree.ts b/packages/types/src/ts-estree.ts index b1a5928a5d2b..1a43962b0231 100644 --- a/packages/types/src/ts-estree.ts +++ b/packages/types/src/ts-estree.ts @@ -194,10 +194,7 @@ declare module './generated/ast-spec' { parent: TSESTree.TSEnumDeclaration; } - interface TSEnumMemberComputedName { - parent: TSESTree.TSEnumBody; - } - interface TSEnumMemberNonComputedName { + interface TSEnumMember { parent: TSESTree.TSEnumBody; } diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index dccb674537c6..150c0ee950ea 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -476,7 +476,7 @@ export class Converter { >( node: Properties, deprecatedKey: Key, - preferredKey: string, + preferredKey: string | undefined, value: Value, ): Properties & Record { let warned = false; @@ -487,10 +487,13 @@ export class Converter { ? (): Value => value : (): Value => { if (!warned) { - process.emitWarning( - `The '${deprecatedKey}' property is deprecated on ${node.type} nodes. Use ${preferredKey} instead. See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`, - 'DeprecationWarning', - ); + let message = `The '${deprecatedKey}' property is deprecated on ${node.type} nodes.`; + if (preferredKey) { + message += ` Use ${preferredKey} instead.`; + } + message += + ' See https://typescript-eslint.io/troubleshooting/faqs/general#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.'; + process.emitWarning(message, 'DeprecationWarning'); warned = true; } @@ -3263,12 +3266,38 @@ export class Converter { } case SyntaxKind.EnumMember: { - return this.createNode(node, { - type: AST_NODE_TYPES.TSEnumMember, - computed: node.name.kind === ts.SyntaxKind.ComputedPropertyName, - id: this.convertChild(node.name), - initializer: node.initializer && this.convertChild(node.initializer), - }); + const computed = node.name.kind === ts.SyntaxKind.ComputedPropertyName; + if (computed) { + this.#throwUnlessAllowInvalidAST( + node.name, + 'Computed property names are not allowed in enums.', + ); + } + + if ( + node.name.kind === SyntaxKind.NumericLiteral || + node.name.kind === SyntaxKind.BigIntLiteral + ) { + this.#throwUnlessAllowInvalidAST( + node.name, + 'An enum member cannot have a numeric name.', + ); + } + + return this.createNode( + node, + this.#withDeprecatedGetter( + { + type: AST_NODE_TYPES.TSEnumMember, + id: this.convertChild(node.name), + initializer: + node.initializer && this.convertChild(node.initializer), + }, + 'computed', + undefined, + computed, + ), + ); } case SyntaxKind.ModuleDeclaration: { From dce536083feee763f19c7098a28218fad6330119 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 1 Sep 2025 07:13:56 -0600 Subject: [PATCH 155/283] chore(typescript-estree): remove dead failure path (#11556) remove dead failure path --- .../src/create-program/useProvidedPrograms.ts | 2 +- packages/typescript-estree/src/parser.ts | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/typescript-estree/src/create-program/useProvidedPrograms.ts b/packages/typescript-estree/src/create-program/useProvidedPrograms.ts index b8e958ed34f2..cd51c92100d2 100644 --- a/packages/typescript-estree/src/create-program/useProvidedPrograms.ts +++ b/packages/typescript-estree/src/create-program/useProvidedPrograms.ts @@ -15,7 +15,7 @@ const log = debug( export function useProvidedPrograms( programInstances: Iterable, parseSettings: ParseSettings, -): ASTAndDefiniteProgram | undefined { +): ASTAndDefiniteProgram { log( 'Retrieving ast for %s from provided program instance(s)', parseSettings.filePath, diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 1c0c6e42aa83..2841d1b1bc39 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -68,13 +68,7 @@ function getProgramAndAST( } if (parseSettings.programs) { - const fromProvidedPrograms = useProvidedPrograms( - parseSettings.programs, - parseSettings, - ); - if (fromProvidedPrograms) { - return fromProvidedPrograms; - } + return useProvidedPrograms(parseSettings.programs, parseSettings); } // no need to waste time creating a program as the caller didn't want parser services From fa156454702398aa2002315f468a360a5508c2e2 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 1 Sep 2025 07:24:01 -0600 Subject: [PATCH 156/283] fix(typescript-eslint): handle non-normalized windows paths produced by jiti (#11546) add workaround --- .../src/getTSConfigRootDirFromStack.ts | 5 +++++ .../tests/getTsconfigRootDirFromStack.test.ts | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts b/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts index 1d4c558eabe4..7e3da09e4ec5 100644 --- a/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts +++ b/packages/typescript-eslint/src/getTSConfigRootDirFromStack.ts @@ -41,6 +41,11 @@ export function getTSConfigRootDirFromStack(): string | undefined { const parsedPath = path.parse(stackFrameFilePath); if (/^eslint\.config\.(c|m)?(j|t)s$/.test(parsedPath.base)) { + if (process.platform === 'win32') { + // workaround for https://github.com/typescript-eslint/typescript-eslint/issues/11530 + // (caused by https://github.com/unjs/jiti/issues/397) + return parsedPath.dir.replaceAll('/', path.sep); + } return parsedPath.dir; } } diff --git a/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts b/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts index 8f37d5833df5..92139b45896a 100644 --- a/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts +++ b/packages/typescript-eslint/tests/getTsconfigRootDirFromStack.test.ts @@ -48,4 +48,26 @@ describe(getTSConfigRootDirFromStack, () => { expect(Error.prepareStackTrace).toBe(dummyFunction); Error.prepareStackTrace = prepareStackTrace; }); + + it.runIf(isWindows)( + 'works when jiti gives non-normalized stack traces on windows', + () => { + vi.spyOn(Error, 'captureStackTrace').mockImplementationOnce( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (target: any, _constructorOpt) => { + target.stack = [ + { + getFileName() { + return 'F:/a/b/eslint.config.ts'; + }, + }, + ]; + }, + ); + + const inferredTsconfigRootDir = getTSConfigRootDirFromStack(); + + expect(inferredTsconfigRootDir).toBe('F:\\a\\b'); + }, + ); }); From 0daf303232f3252076e96dc9821111d02a70e815 Mon Sep 17 00:00:00 2001 From: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> Date: Mon, 1 Sep 2025 07:45:37 -0600 Subject: [PATCH 157/283] chore: use new ESLint rules internally (#11558) * add new rules * adjust comment --- eslint.config.mjs | 2 + .../src/util/getFunctionHeadLoc.ts | 4 +- .../tools/generate-breaking-changes.mts | 1 + packages/rule-tester/src/RuleTester.ts | 4 +- .../src/referencer/ClassVisitor.ts | 117 +----------------- .../tests/eslint-scope/es6-class.test.ts | 1 + .../tests/eslint-scope/es6-object.test.ts | 2 + .../editor/createProvideTwoslashInlay.ts | 9 +- 8 files changed, 16 insertions(+), 124 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 9241cbee26a5..3e5efbf853cd 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -236,7 +236,9 @@ export default defineConfig( 'no-lonely-if': 'error', 'no-mixed-operators': 'error', 'no-process-exit': 'error', + 'no-unassigned-vars': 'error', 'no-unreachable-loop': 'error', + 'no-useless-assignment': 'error', 'no-useless-call': 'error', 'no-useless-computed-key': 'error', 'no-useless-concat': 'error', diff --git a/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts b/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts index 49ab2b742dd9..53987cddc37b 100644 --- a/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts +++ b/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts @@ -154,8 +154,8 @@ export function getFunctionHeadLoc( sourceCode: TSESLint.SourceCode, ): TSESTree.SourceLocation { const parent = node.parent; - let start: TSESTree.Position | null = null; - let end: TSESTree.Position | null = null; + let start: TSESTree.Position; + let end: TSESTree.Position; if ( parent.type === AST_NODE_TYPES.MethodDefinition || diff --git a/packages/eslint-plugin/tools/generate-breaking-changes.mts b/packages/eslint-plugin/tools/generate-breaking-changes.mts index 0ddb3563b976..0d3d0b4a6b1f 100644 --- a/packages/eslint-plugin/tools/generate-breaking-changes.mts +++ b/packages/eslint-plugin/tools/generate-breaking-changes.mts @@ -22,6 +22,7 @@ async function getNewRulesAsOfMajorVersion( // Normally we wouldn't condone using the 'eval' API... // But this is an internal-only script and it's the easiest way to convert // the JS raw text into a runtime object. 🤷 + // eslint-disable-next-line no-unassigned-vars -- assigned by eval let oldRulesObject!: { rules: TypeScriptESLintRules }; eval(`oldRulesObject = ${oldObjectText}`); const oldRuleNames = new Set(Object.keys(oldRulesObject.rules)); diff --git a/packages/rule-tester/src/RuleTester.ts b/packages/rule-tester/src/RuleTester.ts index c81f7296e189..ccf143c1f506 100644 --- a/packages/rule-tester/src/RuleTester.ts +++ b/packages/rule-tester/src/RuleTester.ts @@ -761,8 +761,8 @@ export class RuleTester extends TestFramework { // Verify the code. let initialMessages: Linter.LintMessage[] | null = null; - let messages: Linter.LintMessage[] | null = null; - let fixedResult: SourceCodeFixer.AppliedFixes | null = null; + let messages: Linter.LintMessage[]; + let fixedResult: SourceCodeFixer.AppliedFixes; let passNumber = 0; const outputs: string[] = []; const configWithoutCustomKeys = omitCustomConfigProperties(config); diff --git a/packages/scope-manager/src/referencer/ClassVisitor.ts b/packages/scope-manager/src/referencer/ClassVisitor.ts index 0a8d0b9cf82c..83f44ccc5f33 100644 --- a/packages/scope-manager/src/referencer/ClassVisitor.ts +++ b/packages/scope-manager/src/referencer/ClassVisitor.ts @@ -9,23 +9,18 @@ import { TypeVisitor } from './TypeVisitor'; import { Visitor } from './Visitor'; export class ClassVisitor extends Visitor { - readonly #classNode: TSESTree.ClassDeclaration | TSESTree.ClassExpression; readonly #referencer: Referencer; - constructor( - referencer: Referencer, - node: TSESTree.ClassDeclaration | TSESTree.ClassExpression, - ) { + constructor(referencer: Referencer) { super(referencer); this.#referencer = referencer; - this.#classNode = node; } static visit( referencer: Referencer, node: TSESTree.ClassDeclaration | TSESTree.ClassExpression, ): void { - const classVisitor = new ClassVisitor(referencer, node); + const classVisitor = new ClassVisitor(referencer); classVisitor.visitClass(node); } @@ -97,7 +92,7 @@ export class ClassVisitor extends Visitor { } if (node.value.type === AST_NODE_TYPES.FunctionExpression) { - this.visitMethodFunction(node.value, node); + this.visitMethodFunction(node.value); } else { this.#referencer.visit(node.value); } @@ -105,10 +100,7 @@ export class ClassVisitor extends Visitor { node.decorators.forEach(d => this.#referencer.visit(d)); } - protected visitMethodFunction( - node: TSESTree.FunctionExpression, - methodNode: TSESTree.MethodDefinition, - ): void { + protected visitMethodFunction(node: TSESTree.FunctionExpression): void { if (node.id) { // FunctionExpression with name creates its special scope; // FunctionExpressionNameScope. @@ -122,71 +114,6 @@ export class ClassVisitor extends Visitor { // Consider this function is in the MethodDefinition. this.#referencer.scopeManager.nestFunctionScope(node, true); - /** - * class A { - * @meta // <--- check this - * foo(a: Type) {} - * - * @meta // <--- check this - * foo(): Type {} - * } - */ - let withMethodDecorators = !!methodNode.decorators.length; - /** - * class A { - * foo( - * @meta // <--- check this - * a: Type - * ) {} - * - * set foo( - * @meta // <--- EXCEPT this. TS do nothing for this - * a: Type - * ) {} - * } - */ - withMethodDecorators ||= - methodNode.kind !== 'set' && - node.params.some(param => param.decorators.length); - if (!withMethodDecorators && methodNode.kind === 'set') { - const keyName = getLiteralMethodKeyName(methodNode); - - /** - * class A { - * @meta // <--- check this - * get a() {} - * set ['a'](v: Type) {} - * } - */ - if ( - keyName != null && - this.#classNode.body.body.find( - (node): node is TSESTree.MethodDefinition => - node !== methodNode && - node.type === AST_NODE_TYPES.MethodDefinition && - // Node must both be static or not - node.static === methodNode.static && - getLiteralMethodKeyName(node) === keyName, - )?.decorators.length - ) { - withMethodDecorators = true; - } - } - - /** - * @meta // <--- check this - * class A { - * constructor(a: Type) {} - * } - */ - if ( - !withMethodDecorators && - methodNode.kind === 'constructor' && - this.#classNode.decorators.length - ) { - withMethodDecorators = true; - } - // Process parameter declarations. for (const param of node.params) { this.visitPattern( @@ -337,39 +264,3 @@ export class ClassVisitor extends Visitor { this.visitType(node); } } - -/** - * Only if key is one of [identifier, string, number], ts will combine metadata of accessors . - * class A { - * get a() {} - * set ['a'](v: Type) {} - * - * get [1]() {} - * set [1](v: Type) {} - * - * // Following won't be combined - * get [key]() {} - * set [key](v: Type) {} - * - * get [true]() {} - * set [true](v: Type) {} - * - * get ['a'+'b']() {} - * set ['a'+'b']() {} - * } - */ -function getLiteralMethodKeyName( - node: TSESTree.MethodDefinition, -): number | string | null { - if (node.computed && node.key.type === AST_NODE_TYPES.Literal) { - if ( - typeof node.key.value === 'string' || - typeof node.key.value === 'number' - ) { - return node.key.value; - } - } else if (!node.computed && node.key.type === AST_NODE_TYPES.Identifier) { - return node.key.name; - } - return null; -} diff --git a/packages/scope-manager/tests/eslint-scope/es6-class.test.ts b/packages/scope-manager/tests/eslint-scope/es6-class.test.ts index c7ab81d99077..eaae8dd0210b 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-class.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-class.test.ts @@ -140,6 +140,7 @@ describe('ES6 class', () => { assert.isScopeOfType(scope, ScopeType.global); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBe(false); + expect(variables).toHaveLength(0); scope = scopeManager.scopes[1]; variables = getRealVariables(scope.variables); diff --git a/packages/scope-manager/tests/eslint-scope/es6-object.test.ts b/packages/scope-manager/tests/eslint-scope/es6-object.test.ts index 7f26c43ff780..ffdc8541978d 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-object.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-object.test.ts @@ -19,6 +19,7 @@ describe('ES6 object', () => { assert.isScopeOfType(scope, ScopeType.global); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBe(false); + expect(variables).toHaveLength(0); scope = scopeManager.scopes[1]; variables = getRealVariables(scope.variables); @@ -51,6 +52,7 @@ describe('ES6 object', () => { assert.isScopeOfType(scope, ScopeType.global); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBe(false); + expect(variables).toHaveLength(0); scope = scopeManager.scopes[1]; variables = getRealVariables(scope.variables); diff --git a/packages/website/src/components/editor/createProvideTwoslashInlay.ts b/packages/website/src/components/editor/createProvideTwoslashInlay.ts index e775e80e519a..7ec378b4aff7 100644 --- a/packages/website/src/components/editor/createProvideTwoslashInlay.ts +++ b/packages/website/src/components/editor/createProvideTwoslashInlay.ts @@ -8,14 +8,9 @@ import type * as ts from 'typescript'; import type { SandboxInstance } from './useSandboxServices'; function findTwoshashQueries(code: string): RegExpExecArray[] { - let match: RegExpExecArray | null = null; - const matches: RegExpExecArray[] = []; // RegExp that matches '^//?$' - const twoslashQueryRegex = /^(\s*\/\/\s*\^\?)\s*$/gm; - while ((match = twoslashQueryRegex.exec(code))) { - matches.push(match); - } - return matches; + const twoslashQueryRegex = /^(\s*\/\/\s*\^\?)\s*$/m; + return [...code.matchAll(twoslashQueryRegex)]; } export function createTwoslashInlayProvider( From ffec413f6ffa08516962c5a013835db2bc9d2f39 Mon Sep 17 00:00:00 2001 From: James Henry Date: Tue, 2 Sep 2025 12:58:06 +0400 Subject: [PATCH 158/283] chore: add release.yml with trusted publishing for stable releases (#11566) --- .github/workflows/ci.yml | 38 +---- .github/workflows/release.yml | 252 ++++++++++++++++++++++++++++++++++ 2 files changed, 253 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b914e435b247..d4ec153d22dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,4 @@ +# NOTE: The name of this workflow is significant - it is used as the identifier for the workflow_run trigger in the release workflow name: CI on: @@ -289,40 +290,3 @@ jobs: files: coverage/**/lcov.info flags: unittest name: codecov - - publish_canary_version: - name: Publish the latest code as a canary version - environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job - runs-on: ubuntu-latest - permissions: - id-token: write - needs: [integration_tests, lint_with_build, lint_without_build, unit_tests] - if: github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main' - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 # we need the tags to be available - - - name: Install - uses: ./.github/actions/prepare-install - with: - node-version: ${{ env.PRIMARY_NODE_VERSION }} - registry-url: 'https://registry.npmjs.org' - - # 11.5.2 and later required for trusted publishing - - name: Use npm 11.5.2 - run: npm install -g npm@11.5.2 - - - name: Build - uses: ./.github/actions/prepare-build - - - name: Figure out and apply the next canary version - run: npx tsx tools/release/apply-canary-version.mts - - - name: Publish all packages to npm with the canary tag - # NOTE: this needs to be npx, rather than yarn, to make sure the authenticated npm registry is used - run: npx nx release publish --tag canary --verbose - env: - NX_CLOUD_DISTRIBUTED_EXECUTION: false - NPM_CONFIG_PROVENANCE: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000000..37dfa8860efc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,252 @@ +name: Release + +on: + # Triggered by completed CI runs (we check for successful status in the validate job) on main branch for canary releases + workflow_run: + workflows: ['CI'] + types: [completed] + branches: [main] + + schedule: + # Github actions do not currently support specifying a timezone. + # Run on Mondays at 5pm UTC (1pm Eastern (Summer) Time) + - cron: '0 17 * * 1' + + # Manual trigger for out of band releases and next major version prereleases + workflow_dispatch: + inputs: + release_type: + description: 'Type of release to perform (stable requires core team approval)' + required: true + type: choice + options: + - canary + - stable + default: 'canary' + override_major_version: + description: 'Override major version for canary releases' + required: false + type: string + dry_run: + description: 'Perform a dry run (stable releases only)' + required: false + type: boolean + default: true + force-release-without-changes: + description: 'Whether to do a release regardless of if there have been changes' + required: false + type: boolean + default: false + +# Ensure only one release workflow runs at a time +concurrency: + group: release + cancel-in-progress: false + +env: + PRIMARY_NODE_VERSION: 20 + +# Minimal permissions by default +permissions: + contents: read + +jobs: + # Validation job to ensure secure inputs and determine release type + validate: + name: Validate Release Parameters + runs-on: ubuntu-latest + # Only run on the official repository to avoid wasted compute and unnecessary errors on forks (also an initial albeit weak first layer of protection against unauthorized releases) + if: github.repository == 'typescript-eslint/typescript-eslint' + outputs: + should_release: ${{ steps.validate.outputs.should_release }} + release_type: ${{ steps.validate.outputs.release_type }} + is_canary: ${{ steps.validate.outputs.is_canary }} + is_stable: ${{ steps.validate.outputs.is_stable }} + dry_run: ${{ steps.validate.outputs.dry_run }} + force_release_without_changes: ${{ steps.validate.outputs.force_release_without_changes }} + override_major_version: ${{ steps.validate.outputs.override_major_version }} + steps: + - name: Validate inputs and determine release type + id: validate + env: + # Ensure user input is treated as data by passing them as environment variables + INPUT_RELEASE_TYPE: ${{ inputs.release_type }} + INPUT_OVERRIDE_MAJOR: ${{ inputs.override_major_version }} + INPUT_DRY_RUN: ${{ inputs.dry_run }} + INPUT_FORCE_RELEASE: ${{ inputs.force_release_without_changes }} + run: | + SHOULD_RELEASE="false" + + # Determine release type based on trigger + if [[ "${{ github.event_name }}" == "schedule" ]]; then + RELEASE_TYPE="stable" + SHOULD_RELEASE="true" + elif [[ "${{ github.event_name }}" == "workflow_run" ]]; then + # Only release canary if the CI workflow succeeded + if [[ "${{ github.event.workflow_run.conclusion }}" == "success" ]]; then + RELEASE_TYPE="canary" + SHOULD_RELEASE="true" + else + echo "CI workflow did not succeed, skipping canary release" + RELEASE_TYPE="canary" + SHOULD_RELEASE="false" + fi + elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + RELEASE_TYPE="$INPUT_RELEASE_TYPE" + SHOULD_RELEASE="true" + else + echo "::error::Unsupported trigger event: ${{ github.event_name }}" + exit 1 + fi + + # Validate release type + if [[ "$RELEASE_TYPE" != "canary" && "$RELEASE_TYPE" != "stable" ]]; then + echo "::error::Invalid release type: $RELEASE_TYPE. Must be 'canary' or 'stable'" + exit 1 + fi + + # Set outputs + echo "should_release=$SHOULD_RELEASE" >> $GITHUB_OUTPUT + echo "release_type=$RELEASE_TYPE" >> $GITHUB_OUTPUT + echo "is_canary=$([[ "$RELEASE_TYPE" == "canary" ]] && echo "true" || echo "false")" >> $GITHUB_OUTPUT + echo "is_stable=$([[ "$RELEASE_TYPE" == "stable" ]] && echo "true" || echo "false")" >> $GITHUB_OUTPUT + + # Handle dry run for stable releases + if [[ "$RELEASE_TYPE" == "stable" ]]; then + if [[ "${{ github.event_name }}" == "schedule" ]]; then + # Scheduled releases are never dry runs + echo "dry_run=false" >> $GITHUB_OUTPUT + else + # Manual stable releases default to dry run unless explicitly disabled + echo "dry_run=${INPUT_DRY_RUN:-true}" >> $GITHUB_OUTPUT + fi + else + echo "dry_run=false" >> $GITHUB_OUTPUT + fi + + # Handle force release without changes for stable releases + if [[ "$RELEASE_TYPE" == "stable" && "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "force_release_without_changes=${INPUT_FORCE_RELEASE:-false}" >> $GITHUB_OUTPUT + else + echo "force_release_without_changes=false" >> $GITHUB_OUTPUT + fi + + # Validate and handle override major version for canary releases + if [[ "$RELEASE_TYPE" == "canary" && "${{ github.event_name }}" == "workflow_dispatch" && -n "$INPUT_OVERRIDE_MAJOR" ]]; then + if [[ ! "$INPUT_OVERRIDE_MAJOR" =~ ^[0-9]+$ ]]; then + echo "::error::Invalid override major version format: $INPUT_OVERRIDE_MAJOR. Must be a positive integer." + exit 1 + fi + echo "override_major_version=$INPUT_OVERRIDE_MAJOR" >> $GITHUB_OUTPUT + else + echo "override_major_version=" >> $GITHUB_OUTPUT + fi + + echo "Validated release configuration:" + echo "- Should release: $SHOULD_RELEASE" + echo "- Release type: $RELEASE_TYPE" + echo "- Is canary: $([[ "$RELEASE_TYPE" == "canary" ]] && echo "true" || echo "false")" + echo "- Is stable: $([[ "$RELEASE_TYPE" == "stable" ]] && echo "true" || echo "false")" + if [[ "$RELEASE_TYPE" == "stable" ]]; then + echo "- Dry run: ${INPUT_DRY_RUN:-true}" + echo "- Force release without changes: ${INPUT_FORCE_RELEASE:-false}" + fi + if [[ "$RELEASE_TYPE" == "canary" && -n "$INPUT_OVERRIDE_MAJOR" ]]; then + echo "- Override major version: $INPUT_OVERRIDE_MAJOR" + fi + + # Do not require npm-registry environment (and therefore manual approvals) for canary releases + # npm trusted publishing should already go a long way to protecting against unauthorized releases + canary_release: + name: Publish Canary Release + runs-on: ubuntu-latest + needs: [validate] + # Only run on the official repository to avoid wasted compute and unnecessary errors on forks (also an initial albeit weak first layer of protection against unauthorized releases) + # Also ensure validation passed and we're releasing a canary version + if: github.repository == 'typescript-eslint/typescript-eslint' && needs.validate.outputs.should_release == 'true' && needs.validate.outputs.is_canary == 'true' + permissions: + contents: read # No need to write to the repository for canary releases + id-token: write # Required for trusted publishing + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + # We need the full history for version calculation + fetch-depth: 0 + + - name: Install dependencies + uses: ./.github/actions/prepare-install + with: + node-version: ${{ env.PRIMARY_NODE_VERSION }} + registry-url: 'https://registry.npmjs.org' + + # Use specific npm version required for trusted publishing + - name: Use npm 11.5.2 + run: npm install -g npm@11.5.2 + + - name: Build packages + uses: ./.github/actions/prepare-build + + - name: Calculate and apply canary version + run: npx tsx tools/release/apply-canary-version.mts + env: + # Use the validated override major version from the validate job, if set + OVERRIDE_MAJOR_VERSION: ${{ needs.validate.outputs.override_major_version }} + + - name: Publish canary packages + # NOTE: this needs to be npx, rather than yarn, to make sure the authenticated npm registry is used + run: npx nx release publish --tag canary --verbose + env: + # Enable npm provenance + NPM_CONFIG_PROVENANCE: true + # Disable distributed execution here for predictability + NX_CLOUD_DISTRIBUTED_EXECUTION: false + + stable_release: + name: Publish Stable Release + runs-on: ubuntu-latest + environment: npm-registry # Require core team approvals for stable releases as an ultimate layer of protection against unauthorized releases + needs: [validate] + # Only run on the official repository to avoid wasted compute and unnecessary errors on forks (also an initial albeit weak first layer of protection against unauthorized releases) + # Also ensure validation passed and we're releasing a stable version + if: github.repository == 'typescript-eslint/typescript-eslint' && needs.validate.outputs.should_release == 'true' && needs.validate.outputs.is_stable == 'true' + permissions: + contents: write # Need to create releases and push tags + id-token: write # Required for trusted publishing + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + # Need full history for changelog generation + fetch-depth: 0 + + - name: Install dependencies + uses: ./.github/actions/prepare-install + with: + node-version: ${{ env.PRIMARY_NODE_VERSION }} + registry-url: 'https://registry.npmjs.org' + + # Use specific npm version required for trusted publishing + - name: Use npm 11.5.2 + run: npm install -g npm@11.5.2 + + - name: Build packages + uses: ./.github/actions/prepare-build + + - name: Configure git user for automated commits + run: | + git config --global user.email "typescript-eslint[bot]@users.noreply.github.com" + git config --global user.name "typescript-eslint[bot]" + + - name: Run stable release + run: npx tsx tools/release/release.mts --dry-run=${{ needs.validate.outputs.dry_run }} --force-release-without-changes=${{ needs.validate.outputs.force_release_without_changes }} --verbose + env: + # Enable npm provenance + NPM_CONFIG_PROVENANCE: true + # Disable distributed execution here for predictability + NX_CLOUD_DISTRIBUTED_EXECUTION: false + + - name: Force update the website branch to match the latest release + run: | + git branch -f website + git push -f origin website From 459ec6415ac901b6ed4e11638a36d6ebcfda4f7b Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Tue, 2 Sep 2025 13:45:31 +0400 Subject: [PATCH 159/283] chore: release workflow adjustments --- .github/workflows/release.yml | 43 ++++++++++---------------- tools/release/apply-canary-version.mts | 3 +- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 37dfa8860efc..7529bfc67c0f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,8 +28,8 @@ on: required: false type: string dry_run: - description: 'Perform a dry run (stable releases only)' - required: false + description: 'Perform a dry run' + required: true type: boolean default: true force-release-without-changes: @@ -111,16 +111,11 @@ jobs: echo "is_canary=$([[ "$RELEASE_TYPE" == "canary" ]] && echo "true" || echo "false")" >> $GITHUB_OUTPUT echo "is_stable=$([[ "$RELEASE_TYPE" == "stable" ]] && echo "true" || echo "false")" >> $GITHUB_OUTPUT - # Handle dry run for stable releases - if [[ "$RELEASE_TYPE" == "stable" ]]; then - if [[ "${{ github.event_name }}" == "schedule" ]]; then - # Scheduled releases are never dry runs - echo "dry_run=false" >> $GITHUB_OUTPUT - else - # Manual stable releases default to dry run unless explicitly disabled - echo "dry_run=${INPUT_DRY_RUN:-true}" >> $GITHUB_OUTPUT - fi + # Handle dry run for manual releases (defaults to true) + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "dry_run=${INPUT_DRY_RUN:-true}" >> $GITHUB_OUTPUT else + # Automated releases (schedule, workflow_run) are never dry runs echo "dry_run=false" >> $GITHUB_OUTPUT fi @@ -145,21 +140,14 @@ jobs: echo "Validated release configuration:" echo "- Should release: $SHOULD_RELEASE" echo "- Release type: $RELEASE_TYPE" - echo "- Is canary: $([[ "$RELEASE_TYPE" == "canary" ]] && echo "true" || echo "false")" - echo "- Is stable: $([[ "$RELEASE_TYPE" == "stable" ]] && echo "true" || echo "false")" - if [[ "$RELEASE_TYPE" == "stable" ]]; then - echo "- Dry run: ${INPUT_DRY_RUN:-true}" - echo "- Force release without changes: ${INPUT_FORCE_RELEASE:-false}" - fi - if [[ "$RELEASE_TYPE" == "canary" && -n "$INPUT_OVERRIDE_MAJOR" ]]; then - echo "- Override major version: $INPUT_OVERRIDE_MAJOR" - fi + echo "- Dry run: $INPUT_DRY_RUN" + echo "- Force release without changes: ${INPUT_FORCE_RELEASE:-false}" + echo "- Override major version (for canary only): $INPUT_OVERRIDE_MAJOR" - # Do not require npm-registry environment (and therefore manual approvals) for canary releases - # npm trusted publishing should already go a long way to protecting against unauthorized releases canary_release: name: Publish Canary Release runs-on: ubuntu-latest + environment: npm-registry # This environment is required by the trusted publishing configuration on npm needs: [validate] # Only run on the official repository to avoid wasted compute and unnecessary errors on forks (also an initial albeit weak first layer of protection against unauthorized releases) # Also ensure validation passed and we're releasing a canary version @@ -188,14 +176,13 @@ jobs: uses: ./.github/actions/prepare-build - name: Calculate and apply canary version - run: npx tsx tools/release/apply-canary-version.mts + run: yarn tsx tools/release/apply-canary-version.mts env: # Use the validated override major version from the validate job, if set OVERRIDE_MAJOR_VERSION: ${{ needs.validate.outputs.override_major_version }} - name: Publish canary packages - # NOTE: this needs to be npx, rather than yarn, to make sure the authenticated npm registry is used - run: npx nx release publish --tag canary --verbose + run: yarn nx release publish --tag canary --verbose --dry-run=${{ needs.validate.outputs.dry_run }} env: # Enable npm provenance NPM_CONFIG_PROVENANCE: true @@ -205,7 +192,7 @@ jobs: stable_release: name: Publish Stable Release runs-on: ubuntu-latest - environment: npm-registry # Require core team approvals for stable releases as an ultimate layer of protection against unauthorized releases + environment: npm-registry # This environment is required by the trusted publishing configuration on npm needs: [validate] # Only run on the official repository to avoid wasted compute and unnecessary errors on forks (also an initial albeit weak first layer of protection against unauthorized releases) # Also ensure validation passed and we're releasing a stable version @@ -239,7 +226,7 @@ jobs: git config --global user.name "typescript-eslint[bot]" - name: Run stable release - run: npx tsx tools/release/release.mts --dry-run=${{ needs.validate.outputs.dry_run }} --force-release-without-changes=${{ needs.validate.outputs.force_release_without_changes }} --verbose + run: yarn release --dry-run=${{ needs.validate.outputs.dry_run }} --force-release-without-changes=${{ needs.validate.outputs.force_release_without_changes }} --verbose env: # Enable npm provenance NPM_CONFIG_PROVENANCE: true @@ -247,6 +234,8 @@ jobs: NX_CLOUD_DISTRIBUTED_EXECUTION: false - name: Force update the website branch to match the latest release + # Only update the website branch if we're not doing a dry run + if: needs.validate.outputs.dry_run == 'false' run: | git branch -f website git push -f origin website diff --git a/tools/release/apply-canary-version.mts b/tools/release/apply-canary-version.mts index 049dd3b06d96..523a56536367 100644 --- a/tools/release/apply-canary-version.mts +++ b/tools/release/apply-canary-version.mts @@ -4,6 +4,7 @@ import semver from 'semver'; // We are either releasing a canary version of the latest major version, or one for the next major. const overrideMajorVersion = process.env.OVERRIDE_MAJOR_VERSION; +const isDryRun = process.env.DRY_RUN === 'true'; const preid = 'alpha'; @@ -83,7 +84,7 @@ if (!nextCanaryVersion) { console.log(`\nApplying next canary version with Nx`); -const command = `nx release version ${nextCanaryVersion}`; +const command = `nx release version ${nextCanaryVersion}${isDryRun ? ' --dry-run' : ''}`; console.log(`\n> ${command}\n`); From e6807802d7f1e91fffb048312a2f70a0644de007 Mon Sep 17 00:00:00 2001 From: James Henry Date: Tue, 2 Sep 2025 14:23:56 +0400 Subject: [PATCH 160/283] chore: update nx to latest 21.4.1 (#11567) --- package.json | 10 +-- yarn.lock | 245 ++++++++++++++++++++++++++------------------------- 2 files changed, 132 insertions(+), 123 deletions(-) diff --git a/package.json b/package.json index 69ef796db02f..3edb1ac900d0 100644 --- a/package.json +++ b/package.json @@ -54,10 +54,10 @@ "@eslint/compat": "^1.2.4", "@eslint/eslintrc": "^3.2.0", "@eslint/js": "^9.26.0", - "@nx/devkit": "21.2.3", - "@nx/js": "21.2.3", - "@nx/vite": "21.2.3", - "@nx/workspace": "21.2.3", + "@nx/devkit": "21.4.1", + "@nx/js": "21.4.1", + "@nx/vite": "21.4.1", + "@nx/workspace": "21.4.1", "@swc/core": "^1.4.12", "@types/debug": "^4.1.12", "@types/eslint-plugin-jsx-a11y": "^6.10.0", @@ -93,7 +93,7 @@ "knip": "^5.41.1", "lint-staged": "^15.2.2", "markdownlint-cli": "^0.45.0", - "nx": "21.2.3", + "nx": "21.4.1", "prettier": "3.6.2", "rimraf": "^5.0.5", "semver": "7.7.0", diff --git a/yarn.lock b/yarn.lock index c3f706af72c0..35b4b02ef4e0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3900,6 +3900,29 @@ __metadata: languageName: node linkType: hard +"@jest/diff-sequences@npm:30.0.1": + version: 30.0.1 + resolution: "@jest/diff-sequences@npm:30.0.1" + checksum: e5f931ca69c15a9b3a9b23b723f51ffc97f031b2f3ca37f901333dab99bd4dfa1ad4192a5cd893cd1272f7602eb09b9cfb5fc6bb62a0232c96fb8b5e96094970 + languageName: node + linkType: hard + +"@jest/get-type@npm:30.1.0": + version: 30.1.0 + resolution: "@jest/get-type@npm:30.1.0" + checksum: e2a95fbb49ce2d15547db8af5602626caf9b05f62a5e583b4a2de9bd93a2bfe7175f9bbb2b8a5c3909ce261d467b6991d7265bb1d547cb60e7e97f571f361a70 + languageName: node + linkType: hard + +"@jest/schemas@npm:30.0.5": + version: 30.0.5 + resolution: "@jest/schemas@npm:30.0.5" + dependencies: + "@sinclair/typebox": ^0.34.0 + checksum: 7a4fc4166f688947c22d81e61aaf2cb22f178dbf6ee806b0931b75136899d426a72a8330762f27f0cf6f79da0d2a56f49a22fe09f5f80df95a683ed237a0f3b0 + languageName: node + linkType: hard + "@jest/schemas@npm:^29.6.3": version: 29.6.3 resolution: "@jest/schemas@npm:29.6.3" @@ -4144,27 +4167,28 @@ __metadata: languageName: node linkType: hard -"@nx/devkit@npm:21.2.3": - version: 21.2.3 - resolution: "@nx/devkit@npm:21.2.3" +"@nx/devkit@npm:21.4.1": + version: 21.4.1 + resolution: "@nx/devkit@npm:21.4.1" dependencies: ejs: ^3.1.7 enquirer: ~2.3.6 ignore: ^5.0.4 minimatch: 9.0.3 + nx: 21.4.1 semver: ^7.5.3 tmp: ~0.2.1 tslib: ^2.3.0 yargs-parser: 21.1.1 peerDependencies: - nx: 21.2.3 - checksum: 3db18a83a29d5577e89266880d6449d9e1677512adc47bdf0a2fd4448809247a964658555a809ca8f8c3197560e5f08ae3cf12244b9b87329cea6399406ca25a + nx: ">= 20 <= 22" + checksum: 37797c3d785de1068b6ae5a646d8ac1e716ce691c4b05fba489b9c89f432ce1ab716a3e27fe262f8d75cdcdec0a576594b34bee7d61c6b1a94d2ca9f9cfe83ed languageName: node linkType: hard -"@nx/js@npm:21.2.3": - version: 21.2.3 - resolution: "@nx/js@npm:21.2.3" +"@nx/js@npm:21.4.1": + version: 21.4.1 + resolution: "@nx/js@npm:21.4.1" dependencies: "@babel/core": ^7.23.2 "@babel/plugin-proposal-decorators": ^7.22.7 @@ -4173,8 +4197,8 @@ __metadata: "@babel/preset-env": ^7.23.2 "@babel/preset-typescript": ^7.22.5 "@babel/runtime": ^7.22.6 - "@nx/devkit": 21.2.3 - "@nx/workspace": 21.2.3 + "@nx/devkit": 21.4.1 + "@nx/workspace": 21.4.1 "@zkochan/js-yaml": 0.0.7 babel-plugin-const-enum: ^1.0.1 babel-plugin-macros: ^3.1.0 @@ -4200,113 +4224,114 @@ __metadata: peerDependenciesMeta: verdaccio: optional: true - checksum: d2a79a4ca57bd6251362c8853dddc52f6ea51b7da96913611f73ae44e24d562d9f9d8afa002822932d3e246b605f69e363c5c22db8962d14d5e210eae84a9693 + checksum: 5fc495473f2c522da73c7be62f0f59824bbf321dc6f151e2e3d9d23271a496c4a9f9f978c518843899046218334d3b44e2072277661572f952c8bc0a0b2f2674 languageName: node linkType: hard -"@nx/nx-darwin-arm64@npm:21.2.3": - version: 21.2.3 - resolution: "@nx/nx-darwin-arm64@npm:21.2.3" +"@nx/nx-darwin-arm64@npm:21.4.1": + version: 21.4.1 + resolution: "@nx/nx-darwin-arm64@npm:21.4.1" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@nx/nx-darwin-x64@npm:21.2.3": - version: 21.2.3 - resolution: "@nx/nx-darwin-x64@npm:21.2.3" +"@nx/nx-darwin-x64@npm:21.4.1": + version: 21.4.1 + resolution: "@nx/nx-darwin-x64@npm:21.4.1" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@nx/nx-freebsd-x64@npm:21.2.3": - version: 21.2.3 - resolution: "@nx/nx-freebsd-x64@npm:21.2.3" +"@nx/nx-freebsd-x64@npm:21.4.1": + version: 21.4.1 + resolution: "@nx/nx-freebsd-x64@npm:21.4.1" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@nx/nx-linux-arm-gnueabihf@npm:21.2.3": - version: 21.2.3 - resolution: "@nx/nx-linux-arm-gnueabihf@npm:21.2.3" +"@nx/nx-linux-arm-gnueabihf@npm:21.4.1": + version: 21.4.1 + resolution: "@nx/nx-linux-arm-gnueabihf@npm:21.4.1" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@nx/nx-linux-arm64-gnu@npm:21.2.3": - version: 21.2.3 - resolution: "@nx/nx-linux-arm64-gnu@npm:21.2.3" +"@nx/nx-linux-arm64-gnu@npm:21.4.1": + version: 21.4.1 + resolution: "@nx/nx-linux-arm64-gnu@npm:21.4.1" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@nx/nx-linux-arm64-musl@npm:21.2.3": - version: 21.2.3 - resolution: "@nx/nx-linux-arm64-musl@npm:21.2.3" +"@nx/nx-linux-arm64-musl@npm:21.4.1": + version: 21.4.1 + resolution: "@nx/nx-linux-arm64-musl@npm:21.4.1" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@nx/nx-linux-x64-gnu@npm:21.2.3": - version: 21.2.3 - resolution: "@nx/nx-linux-x64-gnu@npm:21.2.3" +"@nx/nx-linux-x64-gnu@npm:21.4.1": + version: 21.4.1 + resolution: "@nx/nx-linux-x64-gnu@npm:21.4.1" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@nx/nx-linux-x64-musl@npm:21.2.3": - version: 21.2.3 - resolution: "@nx/nx-linux-x64-musl@npm:21.2.3" +"@nx/nx-linux-x64-musl@npm:21.4.1": + version: 21.4.1 + resolution: "@nx/nx-linux-x64-musl@npm:21.4.1" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@nx/nx-win32-arm64-msvc@npm:21.2.3": - version: 21.2.3 - resolution: "@nx/nx-win32-arm64-msvc@npm:21.2.3" +"@nx/nx-win32-arm64-msvc@npm:21.4.1": + version: 21.4.1 + resolution: "@nx/nx-win32-arm64-msvc@npm:21.4.1" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@nx/nx-win32-x64-msvc@npm:21.2.3": - version: 21.2.3 - resolution: "@nx/nx-win32-x64-msvc@npm:21.2.3" +"@nx/nx-win32-x64-msvc@npm:21.4.1": + version: 21.4.1 + resolution: "@nx/nx-win32-x64-msvc@npm:21.4.1" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@nx/vite@npm:21.2.3": - version: 21.2.3 - resolution: "@nx/vite@npm:21.2.3" +"@nx/vite@npm:21.4.1": + version: 21.4.1 + resolution: "@nx/vite@npm:21.4.1" dependencies: - "@nx/devkit": 21.2.3 - "@nx/js": 21.2.3 + "@nx/devkit": 21.4.1 + "@nx/js": 21.4.1 "@phenomnomnominal/tsquery": ~5.0.1 - "@swc/helpers": ~0.5.0 ajv: ^8.0.0 enquirer: ~2.3.6 picomatch: 4.0.2 semver: ^7.6.3 tsconfig-paths: ^4.1.2 + tslib: ^2.3.0 peerDependencies: vite: ^5.0.0 || ^6.0.0 vitest: ^1.3.1 || ^2.0.0 || ^3.0.0 - checksum: cc274da699980816d52927ac037e9f206978853fc4d97c98a08eef8ae542b8ec392e19cf39a2c66889da392853d1553f2179dd8fb223833b3729dcfd8cd68e75 + checksum: 40311ee8134f484d32785087c3bfc5bec250e956b6098bd42613add7342b0fe2fa385286e427e120f744835daf58bbf7b7dff32dcb07ee046ed2b11ea8eadc46 languageName: node linkType: hard -"@nx/workspace@npm:21.2.3": - version: 21.2.3 - resolution: "@nx/workspace@npm:21.2.3" +"@nx/workspace@npm:21.4.1": + version: 21.4.1 + resolution: "@nx/workspace@npm:21.4.1" dependencies: - "@nx/devkit": 21.2.3 + "@nx/devkit": 21.4.1 "@zkochan/js-yaml": 0.0.7 chalk: ^4.1.0 enquirer: ~2.3.6 - nx: 21.2.3 + nx: 21.4.1 picomatch: 4.0.2 + semver: ^7.6.3 tslib: ^2.3.0 yargs-parser: 21.1.1 - checksum: 6381eb146a0b9b4786452161f7179fcb5f1301b2aa0608ab522b02a0a8e73cdf80097ba68f454dbea94aae31c3b2eb7b23572152fb6cfb6df31b1d6f5a42b4f2 + checksum: fab3ca1f4c780191e5b8855df7a36dd687a6413de89677f11d4b89517421288db26a3d01d2d76fc1ceb551171a6cb72706dfa780ad408ec038d94311e4bb75eb languageName: node linkType: hard @@ -4846,6 +4871,13 @@ __metadata: languageName: node linkType: hard +"@sinclair/typebox@npm:^0.34.0": + version: 0.34.41 + resolution: "@sinclair/typebox@npm:0.34.41" + checksum: dbcfdc55caef47ef5b728c2bc6979e50d00ee943b63eaaf604551be9a039187cdd256d810b790e61fdf63131df54b236149aef739d83bfe9a594a9863ac28115 + languageName: node + linkType: hard + "@sindresorhus/is@npm:^4.6.0": version: 4.6.0 resolution: "@sindresorhus/is@npm:4.6.0" @@ -5162,15 +5194,6 @@ __metadata: languageName: node linkType: hard -"@swc/helpers@npm:~0.5.0": - version: 0.5.17 - resolution: "@swc/helpers@npm:0.5.17" - dependencies: - tslib: ^2.8.0 - checksum: 085e13b536323945dfc3a270debf270bda6dfc80a1c68fd2ed08f7cbdfcbdaeead402650b5b10722e54e4a24193afc8a3c6f63d3d6d719974e7470557fb415bd - languageName: node - linkType: hard - "@swc/types@npm:^0.1.23": version: 0.1.24 resolution: "@swc/types@npm:0.1.24" @@ -6007,10 +6030,10 @@ __metadata: "@eslint/compat": ^1.2.4 "@eslint/eslintrc": ^3.2.0 "@eslint/js": ^9.26.0 - "@nx/devkit": 21.2.3 - "@nx/js": 21.2.3 - "@nx/vite": 21.2.3 - "@nx/workspace": 21.2.3 + "@nx/devkit": 21.4.1 + "@nx/js": 21.4.1 + "@nx/vite": 21.4.1 + "@nx/workspace": 21.4.1 "@swc/core": ^1.4.12 "@types/debug": ^4.1.12 "@types/eslint-plugin-jsx-a11y": ^6.10.0 @@ -6046,7 +6069,7 @@ __metadata: knip: ^5.41.1 lint-staged: ^15.2.2 markdownlint-cli: ^0.45.0 - nx: 21.2.3 + nx: 21.4.1 prettier: 3.6.2 rimraf: ^5.0.5 semver: 7.7.0 @@ -6759,7 +6782,7 @@ __metadata: languageName: node linkType: hard -"ansi-styles@npm:^5.0.0": +"ansi-styles@npm:^5.2.0": version: 5.2.0 resolution: "ansi-styles@npm:5.2.0" checksum: d7f4e97ce0623aea6bc0d90dcd28881ee04cba06c570b97fd3391bd7a268eedfd9d5e2dd4fdcbdd82b8105df5faf6f24aaedc08eaf3da898e702db5948f63469 @@ -8995,13 +9018,6 @@ __metadata: languageName: node linkType: hard -"diff-sequences@npm:^29.6.3": - version: 29.6.3 - resolution: "diff-sequences@npm:29.6.3" - checksum: f4914158e1f2276343d98ff5b31fc004e7304f5470bf0f1adb2ac6955d85a531a6458d33e87667f98f6ae52ebd3891bb47d420bb48a5bd8b7a27ee25b20e33aa - languageName: node - linkType: hard - "dir-glob@npm:^3.0.1": version: 3.0.1 resolution: "dir-glob@npm:3.0.1" @@ -12564,22 +12580,15 @@ __metadata: languageName: node linkType: hard -"jest-diff@npm:^29.4.1": - version: 29.7.0 - resolution: "jest-diff@npm:29.7.0" +"jest-diff@npm:^30.0.2": + version: 30.1.2 + resolution: "jest-diff@npm:30.1.2" dependencies: - chalk: ^4.0.0 - diff-sequences: ^29.6.3 - jest-get-type: ^29.6.3 - pretty-format: ^29.7.0 - checksum: 08e24a9dd43bfba1ef07a6374e5af138f53137b79ec3d5cc71a2303515335898888fa5409959172e1e05de966c9e714368d15e8994b0af7441f0721ee8e1bb77 - languageName: node - linkType: hard - -"jest-get-type@npm:^29.6.3": - version: 29.6.3 - resolution: "jest-get-type@npm:29.6.3" - checksum: 88ac9102d4679d768accae29f1e75f592b760b44277df288ad76ce5bf038c3f5ce3719dea8aa0f035dac30e9eb034b848ce716b9183ad7cc222d029f03e92205 + "@jest/diff-sequences": 30.0.1 + "@jest/get-type": 30.1.0 + chalk: ^4.1.2 + pretty-format: 30.0.5 + checksum: 15f350b664f5fe00190cbd36dbe2fd477010bf471b9fb3b2b0b1a40ce4241b10595a05203fcb86aea7720d2be225419efc3d1afa921966b0371d33120c563eec languageName: node linkType: hard @@ -14875,21 +14884,21 @@ __metadata: languageName: node linkType: hard -"nx@npm:21.2.3": - version: 21.2.3 - resolution: "nx@npm:21.2.3" +"nx@npm:21.4.1": + version: 21.4.1 + resolution: "nx@npm:21.4.1" dependencies: "@napi-rs/wasm-runtime": 0.2.4 - "@nx/nx-darwin-arm64": 21.2.3 - "@nx/nx-darwin-x64": 21.2.3 - "@nx/nx-freebsd-x64": 21.2.3 - "@nx/nx-linux-arm-gnueabihf": 21.2.3 - "@nx/nx-linux-arm64-gnu": 21.2.3 - "@nx/nx-linux-arm64-musl": 21.2.3 - "@nx/nx-linux-x64-gnu": 21.2.3 - "@nx/nx-linux-x64-musl": 21.2.3 - "@nx/nx-win32-arm64-msvc": 21.2.3 - "@nx/nx-win32-x64-msvc": 21.2.3 + "@nx/nx-darwin-arm64": 21.4.1 + "@nx/nx-darwin-x64": 21.4.1 + "@nx/nx-freebsd-x64": 21.4.1 + "@nx/nx-linux-arm-gnueabihf": 21.4.1 + "@nx/nx-linux-arm64-gnu": 21.4.1 + "@nx/nx-linux-arm64-musl": 21.4.1 + "@nx/nx-linux-x64-gnu": 21.4.1 + "@nx/nx-linux-x64-musl": 21.4.1 + "@nx/nx-win32-arm64-msvc": 21.4.1 + "@nx/nx-win32-x64-msvc": 21.4.1 "@yarnpkg/lockfile": ^1.1.0 "@yarnpkg/parsers": 3.0.2 "@zkochan/js-yaml": 0.0.7 @@ -14905,7 +14914,7 @@ __metadata: flat: ^5.0.2 front-matter: ^4.0.2 ignore: ^5.0.4 - jest-diff: ^29.4.1 + jest-diff: ^30.0.2 jsonc-parser: 3.2.0 lines-and-columns: 2.0.3 minimatch: 9.0.3 @@ -14956,7 +14965,7 @@ __metadata: bin: nx: bin/nx.js nx-cloud: bin/nx-cloud.js - checksum: faaef03d763f6da739f8108c3f8fe4ad5dd30926d15b279508266e8a272164b5d53598fb3ff5b636ee665bb8e9782ccc2a3134cb6c977b577c5c16d5f20722bd + checksum: babf4d271031fad5e300509310dd65cc1f3198c37a880ceb0c2eec105a61fcd903fa6fba4f597669b08b1c92445998f82f5f2cffab1a94ff45b015389bcb0515 languageName: node linkType: hard @@ -16525,14 +16534,14 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:^29.7.0": - version: 29.7.0 - resolution: "pretty-format@npm:29.7.0" +"pretty-format@npm:30.0.5": + version: 30.0.5 + resolution: "pretty-format@npm:30.0.5" dependencies: - "@jest/schemas": ^29.6.3 - ansi-styles: ^5.0.0 - react-is: ^18.0.0 - checksum: 032c1602383e71e9c0c02a01bbd25d6759d60e9c7cf21937dde8357aa753da348fcec5def5d1002c9678a8524d5fe099ad98861286550ef44de8808cc61e43b6 + "@jest/schemas": 30.0.5 + ansi-styles: ^5.2.0 + react-is: ^18.3.1 + checksum: 0772b7432ff4083483dc12b5b9a1904a1a8f2654936af2a5fa3ba5dfa994a4c7ef843f132152894fd96203a09e0ef80dab2e99dabebd510da86948ed91238fed languageName: node linkType: hard @@ -16842,10 +16851,10 @@ __metadata: languageName: node linkType: hard -"react-is@npm:^18.0.0": - version: 18.2.0 - resolution: "react-is@npm:18.2.0" - checksum: e72d0ba81b5922759e4aff17e0252bd29988f9642ed817f56b25a3e217e13eea8a7f2322af99a06edb779da12d5d636e9fda473d620df9a3da0df2a74141d53e +"react-is@npm:^18.3.1": + version: 18.3.1 + resolution: "react-is@npm:18.3.1" + checksum: e20fe84c86ff172fc8d898251b7cc2c43645d108bf96d0b8edf39b98f9a2cae97b40520ee7ed8ee0085ccc94736c4886294456033304151c3f94978cec03df21 languageName: node linkType: hard @@ -19179,7 +19188,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.3, tslib@npm:^2.3.0, tslib@npm:^2.4.0, tslib@npm:^2.6.0, tslib@npm:^2.8.0": +"tslib@npm:^2.0.3, tslib@npm:^2.3.0, tslib@npm:^2.4.0, tslib@npm:^2.6.0": version: 2.8.1 resolution: "tslib@npm:2.8.1" checksum: e4aba30e632b8c8902b47587fd13345e2827fa639e7c3121074d5ee0880723282411a8838f830b55100cbe4517672f84a2472667d355b81e8af165a55dc6203a From f53173096180c0e4852e7feeda32c52300604866 Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Tue, 2 Sep 2025 14:39:56 +0400 Subject: [PATCH 161/283] chore: debug patch --- .../@nx-js-npm-21.4.1-e583e899cd.patch | 27 ++++ .yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch | 15 +++ package.json | 4 +- yarn.lock | 127 ++++++++++++++++++ 4 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 .yarn/patches/@nx-js-npm-21.4.1-e583e899cd.patch create mode 100644 .yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch diff --git a/.yarn/patches/@nx-js-npm-21.4.1-e583e899cd.patch b/.yarn/patches/@nx-js-npm-21.4.1-e583e899cd.patch new file mode 100644 index 000000000000..7e3f9a38d3f5 --- /dev/null +++ b/.yarn/patches/@nx-js-npm-21.4.1-e583e899cd.patch @@ -0,0 +1,27 @@ +diff --git a/src/executors/release-publish/release-publish.impl.js b/src/executors/release-publish/release-publish.impl.js +index bfdca6db24e01ee98cf7130b5351e39079222121..5a185e6bdd8f457a0bd66d80cdc8a5483ce69e81 100644 +--- a/src/executors/release-publish/release-publish.impl.js ++++ b/src/executors/release-publish/release-publish.impl.js +@@ -33,6 +33,9 @@ async function runExecutor(options, context) { + const packageJsonPath = (0, path_1.join)(packageRoot, 'package.json'); + const packageJson = (0, devkit_1.readJsonFile)(packageJsonPath); + const packageName = packageJson.name; ++ ++ console.log({ isDryRun, isVerbose: context.isVerbose }); ++ + /** + * Whether or not dynamically replacing local dependency protocols (such as "workspace:*") is supported during `nx release publish` is + * dependent on the package manager the user is using. +@@ -214,6 +217,12 @@ Please update the local dependency on "${depName}" to be a valid semantic versio + if (isDryRun) { + publishCommandSegments.push(`--dry-run`); + } ++ if (context.isVerbose) { ++ console.log(''); ++ console.log('Running publish command:'); ++ console.log(publishCommandSegments.join(' ')); ++ console.log(''); ++ } + try { + const output = (0, child_process_1.execSync)(publishCommandSegments.join(' '), { + maxBuffer: LARGE_BUFFER, diff --git a/.yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch b/.yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch new file mode 100644 index 000000000000..2d301892a832 --- /dev/null +++ b/.yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch @@ -0,0 +1,15 @@ +diff --git a/src/command-line/release/publish.js b/src/command-line/release/publish.js +index c20f0a7ddda51a283ffb5cb8591784cbe07b9a5a..36ff6d2b7312147529538d2204e7e22b31bbdb4f 100644 +--- a/src/command-line/release/publish.js ++++ b/src/command-line/release/publish.js +@@ -130,6 +130,10 @@ async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, ex + */ + process.env.NX_DRY_RUN = 'true'; + } ++ if (args.verbose) { ++ // Ensure the executor context is set appropriately for verbose logging ++ process.env.NX_VERBOSE_LOGGING = 'true'; ++ } + if (args.firstRelease) { + overrides.firstRelease = args.firstRelease; + } diff --git a/package.json b/package.json index 3edb1ac900d0..c88f009bf48c 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,9 @@ "eslint-plugin-eslint-plugin@^5.5.0": "patch:eslint-plugin-eslint-plugin@npm%3A5.5.1#./.yarn/patches/eslint-plugin-eslint-plugin-npm-5.5.1-4206c2506d.patch", "react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch", "tsx": "^4.7.2", - "typescript": "5.9.2" + "typescript": "5.9.2", + "nx@21.4.1": "patch:nx@npm%3A21.4.1#./.yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch", + "@nx/js@21.4.1": "patch:@nx/js@npm%3A21.4.1#./.yarn/patches/@nx-js-npm-21.4.1-e583e899cd.patch" }, "packageManager": "yarn@3.8.2", "nx": { diff --git a/yarn.lock b/yarn.lock index 35b4b02ef4e0..e3934b0c2640 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4228,6 +4228,48 @@ __metadata: languageName: node linkType: hard +"@nx/js@patch:@nx/js@npm%3A21.4.1#./.yarn/patches/@nx-js-npm-21.4.1-e583e899cd.patch::locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A.": + version: 21.4.1 + resolution: "@nx/js@patch:@nx/js@npm%3A21.4.1#./.yarn/patches/@nx-js-npm-21.4.1-e583e899cd.patch::version=21.4.1&hash=da636c&locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A." + dependencies: + "@babel/core": ^7.23.2 + "@babel/plugin-proposal-decorators": ^7.22.7 + "@babel/plugin-transform-class-properties": ^7.22.5 + "@babel/plugin-transform-runtime": ^7.23.2 + "@babel/preset-env": ^7.23.2 + "@babel/preset-typescript": ^7.22.5 + "@babel/runtime": ^7.22.6 + "@nx/devkit": 21.4.1 + "@nx/workspace": 21.4.1 + "@zkochan/js-yaml": 0.0.7 + babel-plugin-const-enum: ^1.0.1 + babel-plugin-macros: ^3.1.0 + babel-plugin-transform-typescript-metadata: ^0.3.1 + chalk: ^4.1.0 + columnify: ^1.6.0 + detect-port: ^1.5.1 + enquirer: ~2.3.6 + ignore: ^5.0.4 + js-tokens: ^4.0.0 + jsonc-parser: 3.2.0 + npm-package-arg: 11.0.1 + npm-run-path: ^4.0.1 + ora: 5.3.0 + picocolors: ^1.1.0 + picomatch: 4.0.2 + semver: ^7.5.3 + source-map-support: 0.5.19 + tinyglobby: ^0.2.12 + tslib: ^2.3.0 + peerDependencies: + verdaccio: ^6.0.5 + peerDependenciesMeta: + verdaccio: + optional: true + checksum: fa477f67274a6f61fbae7d69cce7926ee01ec8d8cec01af2cdf85d6a9a5625291b50465afe89a31311628f36356ae294f82e12d03d308babe84fc5f353b35d44 + languageName: node + linkType: hard + "@nx/nx-darwin-arm64@npm:21.4.1": version: 21.4.1 resolution: "@nx/nx-darwin-arm64@npm:21.4.1" @@ -14969,6 +15011,91 @@ __metadata: languageName: node linkType: hard +"nx@patch:nx@npm%3A21.4.1#./.yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch::locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A.": + version: 21.4.1 + resolution: "nx@patch:nx@npm%3A21.4.1#./.yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch::version=21.4.1&hash=fcaf6a&locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A." + dependencies: + "@napi-rs/wasm-runtime": 0.2.4 + "@nx/nx-darwin-arm64": 21.4.1 + "@nx/nx-darwin-x64": 21.4.1 + "@nx/nx-freebsd-x64": 21.4.1 + "@nx/nx-linux-arm-gnueabihf": 21.4.1 + "@nx/nx-linux-arm64-gnu": 21.4.1 + "@nx/nx-linux-arm64-musl": 21.4.1 + "@nx/nx-linux-x64-gnu": 21.4.1 + "@nx/nx-linux-x64-musl": 21.4.1 + "@nx/nx-win32-arm64-msvc": 21.4.1 + "@nx/nx-win32-x64-msvc": 21.4.1 + "@yarnpkg/lockfile": ^1.1.0 + "@yarnpkg/parsers": 3.0.2 + "@zkochan/js-yaml": 0.0.7 + axios: ^1.8.3 + chalk: ^4.1.0 + cli-cursor: 3.1.0 + cli-spinners: 2.6.1 + cliui: ^8.0.1 + dotenv: ~16.4.5 + dotenv-expand: ~11.0.6 + enquirer: ~2.3.6 + figures: 3.2.0 + flat: ^5.0.2 + front-matter: ^4.0.2 + ignore: ^5.0.4 + jest-diff: ^30.0.2 + jsonc-parser: 3.2.0 + lines-and-columns: 2.0.3 + minimatch: 9.0.3 + node-machine-id: 1.1.12 + npm-run-path: ^4.0.1 + open: ^8.4.0 + ora: 5.3.0 + resolve.exports: 2.0.3 + semver: ^7.5.3 + string-width: ^4.2.3 + tar-stream: ~2.2.0 + tmp: ~0.2.1 + tree-kill: ^1.2.2 + tsconfig-paths: ^4.1.2 + tslib: ^2.3.0 + yaml: ^2.6.0 + yargs: ^17.6.2 + yargs-parser: 21.1.1 + peerDependencies: + "@swc-node/register": ^1.8.0 + "@swc/core": ^1.3.85 + dependenciesMeta: + "@nx/nx-darwin-arm64": + optional: true + "@nx/nx-darwin-x64": + optional: true + "@nx/nx-freebsd-x64": + optional: true + "@nx/nx-linux-arm-gnueabihf": + optional: true + "@nx/nx-linux-arm64-gnu": + optional: true + "@nx/nx-linux-arm64-musl": + optional: true + "@nx/nx-linux-x64-gnu": + optional: true + "@nx/nx-linux-x64-musl": + optional: true + "@nx/nx-win32-arm64-msvc": + optional: true + "@nx/nx-win32-x64-msvc": + optional: true + peerDependenciesMeta: + "@swc-node/register": + optional: true + "@swc/core": + optional: true + bin: + nx: bin/nx.js + nx-cloud: bin/nx-cloud.js + checksum: c420de892f6830440da6040223f89767e96ed1ba5f2f28d5a75573b5f5bd59126b40ebfbd5936041128863b9172085faa86f68ee50747adabb1af2ac8f0b5f33 + languageName: node + linkType: hard + "object-assign@npm:^4.1.1": version: 4.1.1 resolution: "object-assign@npm:4.1.1" From 327e1edf06b5dbf5497f7a5d3f9fa71d3bcdce03 Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Tue, 2 Sep 2025 15:13:18 +0400 Subject: [PATCH 162/283] chore: remove debug patches, update release workflow to support first-release --- .github/workflows/release.yml | 23 +++- .../@nx-js-npm-21.4.1-e583e899cd.patch | 27 ---- .yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch | 15 --- package.json | 4 +- tools/release/release.mts | 48 +++++++ yarn.lock | 127 ------------------ 6 files changed, 68 insertions(+), 176 deletions(-) delete mode 100644 .yarn/patches/@nx-js-npm-21.4.1-e583e899cd.patch delete mode 100644 .yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7529bfc67c0f..587e2fb1bee2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,12 @@ on: required: true type: boolean default: true - force-release-without-changes: + first_release: + description: 'Whether one or more packages are being released for the first time' + required: false + type: boolean + default: false + force_release_without_changes: description: 'Whether to do a release regardless of if there have been changes' required: false type: boolean @@ -64,6 +69,7 @@ jobs: is_stable: ${{ steps.validate.outputs.is_stable }} dry_run: ${{ steps.validate.outputs.dry_run }} force_release_without_changes: ${{ steps.validate.outputs.force_release_without_changes }} + first_release: ${{ steps.validate.outputs.first_release }} override_major_version: ${{ steps.validate.outputs.override_major_version }} steps: - name: Validate inputs and determine release type @@ -74,6 +80,7 @@ jobs: INPUT_OVERRIDE_MAJOR: ${{ inputs.override_major_version }} INPUT_DRY_RUN: ${{ inputs.dry_run }} INPUT_FORCE_RELEASE: ${{ inputs.force_release_without_changes }} + INPUT_FIRST_RELEASE: ${{ inputs.first_release }} run: | SHOULD_RELEASE="false" @@ -126,6 +133,13 @@ jobs: echo "force_release_without_changes=false" >> $GITHUB_OUTPUT fi + # Handle first release flag (only for manual releases) + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "first_release=${INPUT_FIRST_RELEASE:-false}" >> $GITHUB_OUTPUT + else + echo "first_release=false" >> $GITHUB_OUTPUT + fi + # Validate and handle override major version for canary releases if [[ "$RELEASE_TYPE" == "canary" && "${{ github.event_name }}" == "workflow_dispatch" && -n "$INPUT_OVERRIDE_MAJOR" ]]; then if [[ ! "$INPUT_OVERRIDE_MAJOR" =~ ^[0-9]+$ ]]; then @@ -141,7 +155,8 @@ jobs: echo "- Should release: $SHOULD_RELEASE" echo "- Release type: $RELEASE_TYPE" echo "- Dry run: $INPUT_DRY_RUN" - echo "- Force release without changes: ${INPUT_FORCE_RELEASE:-false}" + echo "- Force release without changes: $INPUT_FORCE_RELEASE" + echo "- First release: $INPUT_FIRST_RELEASE" echo "- Override major version (for canary only): $INPUT_OVERRIDE_MAJOR" canary_release: @@ -182,7 +197,7 @@ jobs: OVERRIDE_MAJOR_VERSION: ${{ needs.validate.outputs.override_major_version }} - name: Publish canary packages - run: yarn nx release publish --tag canary --verbose --dry-run=${{ needs.validate.outputs.dry_run }} + run: yarn nx release publish --tag canary --verbose --dry-run=${{ needs.validate.outputs.dry_run }} --first-release=${{ needs.validate.outputs.first_release }} env: # Enable npm provenance NPM_CONFIG_PROVENANCE: true @@ -226,7 +241,7 @@ jobs: git config --global user.name "typescript-eslint[bot]" - name: Run stable release - run: yarn release --dry-run=${{ needs.validate.outputs.dry_run }} --force-release-without-changes=${{ needs.validate.outputs.force_release_without_changes }} --verbose + run: yarn release --dry-run=${{ needs.validate.outputs.dry_run }} --force-release-without-changes=${{ needs.validate.outputs.force_release_without_changes }} --first-release=${{ needs.validate.outputs.first_release }} --verbose env: # Enable npm provenance NPM_CONFIG_PROVENANCE: true diff --git a/.yarn/patches/@nx-js-npm-21.4.1-e583e899cd.patch b/.yarn/patches/@nx-js-npm-21.4.1-e583e899cd.patch deleted file mode 100644 index 7e3f9a38d3f5..000000000000 --- a/.yarn/patches/@nx-js-npm-21.4.1-e583e899cd.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/src/executors/release-publish/release-publish.impl.js b/src/executors/release-publish/release-publish.impl.js -index bfdca6db24e01ee98cf7130b5351e39079222121..5a185e6bdd8f457a0bd66d80cdc8a5483ce69e81 100644 ---- a/src/executors/release-publish/release-publish.impl.js -+++ b/src/executors/release-publish/release-publish.impl.js -@@ -33,6 +33,9 @@ async function runExecutor(options, context) { - const packageJsonPath = (0, path_1.join)(packageRoot, 'package.json'); - const packageJson = (0, devkit_1.readJsonFile)(packageJsonPath); - const packageName = packageJson.name; -+ -+ console.log({ isDryRun, isVerbose: context.isVerbose }); -+ - /** - * Whether or not dynamically replacing local dependency protocols (such as "workspace:*") is supported during `nx release publish` is - * dependent on the package manager the user is using. -@@ -214,6 +217,12 @@ Please update the local dependency on "${depName}" to be a valid semantic versio - if (isDryRun) { - publishCommandSegments.push(`--dry-run`); - } -+ if (context.isVerbose) { -+ console.log(''); -+ console.log('Running publish command:'); -+ console.log(publishCommandSegments.join(' ')); -+ console.log(''); -+ } - try { - const output = (0, child_process_1.execSync)(publishCommandSegments.join(' '), { - maxBuffer: LARGE_BUFFER, diff --git a/.yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch b/.yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch deleted file mode 100644 index 2d301892a832..000000000000 --- a/.yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/command-line/release/publish.js b/src/command-line/release/publish.js -index c20f0a7ddda51a283ffb5cb8591784cbe07b9a5a..36ff6d2b7312147529538d2204e7e22b31bbdb4f 100644 ---- a/src/command-line/release/publish.js -+++ b/src/command-line/release/publish.js -@@ -130,6 +130,10 @@ async function runPublishOnProjects(args, projectGraph, nxJson, projectNames, ex - */ - process.env.NX_DRY_RUN = 'true'; - } -+ if (args.verbose) { -+ // Ensure the executor context is set appropriately for verbose logging -+ process.env.NX_VERBOSE_LOGGING = 'true'; -+ } - if (args.firstRelease) { - overrides.firstRelease = args.firstRelease; - } diff --git a/package.json b/package.json index c88f009bf48c..3edb1ac900d0 100644 --- a/package.json +++ b/package.json @@ -113,9 +113,7 @@ "eslint-plugin-eslint-plugin@^5.5.0": "patch:eslint-plugin-eslint-plugin@npm%3A5.5.1#./.yarn/patches/eslint-plugin-eslint-plugin-npm-5.5.1-4206c2506d.patch", "react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch", "tsx": "^4.7.2", - "typescript": "5.9.2", - "nx@21.4.1": "patch:nx@npm%3A21.4.1#./.yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch", - "@nx/js@21.4.1": "patch:@nx/js@npm%3A21.4.1#./.yarn/patches/@nx-js-npm-21.4.1-e583e899cd.patch" + "typescript": "5.9.2" }, "packageManager": "yarn@3.8.2", "nx": { diff --git a/tools/release/release.mts b/tools/release/release.mts index 43544c261523..6c6e1f7d799b 100644 --- a/tools/release/release.mts +++ b/tools/release/release.mts @@ -6,6 +6,12 @@ import { } from 'nx/release/index.js'; import yargs from 'yargs'; +if (process.env.CI !== 'true') { + throw new Error( + 'Releases cannot be run outside of CI, we use trusted publishing which requires an authenticated GitHub Actions environment', + ); +} + const options = await yargs(process.argv.slice(2)) .version(false) .option('version', { @@ -31,12 +37,19 @@ const options = await yargs(process.argv.slice(2)) description: 'Whether or not to enable verbose logging, defaults to false', type: 'boolean', }) + .option('firstRelease', { + default: false, + description: + 'Whether or not one of more of the packages are being released for the first time', + type: 'boolean', + }) .parseAsync(); const { projectsVersionData, workspaceVersion } = await releaseVersion({ specifier: options.version, // stage package.json updates to be committed later by the changelog command dryRun: options.dryRun, + firstRelease: options.firstRelease, stageChanges: true, verbose: options.verbose, }); @@ -54,6 +67,7 @@ if (!options.dryRun) { // This will create a release on GitHub await releaseChangelog({ dryRun: options.dryRun, + firstRelease: options.firstRelease, verbose: options.verbose, version: workspaceVersion, versionData: projectsVersionData, @@ -69,11 +83,45 @@ if (!options.forceReleaseWithoutChanges && workspaceVersion === null) { process.exit(0); } +/** + * In order for the `npm publish --dry-run` to produce any kind of valuable output, we have to + * modify the package versions on disk to a unique version before running it, otherwise it will + * simply print `You cannot publish over the previously published versions: X.X.X`. + * + * Therefore we will leverage our apply-canary-version.mts script to do this for us in this case. + */ +if (options.dryRun) { + console.log( + '⚠️ NOTE: Applying canary version to package.json files so that dry-run publishing produces useful output...', + ); + execaSync('yarn', ['tsx', 'tools/release/apply-canary-version.mts']); + console.log( + '✅ Applied canary version to package.json files so that dry-run publishing produces useful output\n', + ); +} + const publishProjectsResult = await releasePublish({ dryRun: options.dryRun, + firstRelease: options.firstRelease, verbose: options.verbose, }); +// Revert all temporary changes +if (options.dryRun) { + console.log( + '⚠️ NOTE: Reverting temporary package.json changes related to dry-run publishing...', + ); + execaSync('git', [ + 'checkout', + 'packages/**/package.json', + 'package.json', + 'yarn.lock', + ]); + console.log( + '✅ Reverted temporary package.json changes related to dry-run publishing\n', + ); +} + // eslint-disable-next-line no-process-exit process.exit( // If any of the individual project publish tasks returned a non-zero exit code, exit with code 1 diff --git a/yarn.lock b/yarn.lock index e3934b0c2640..35b4b02ef4e0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4228,48 +4228,6 @@ __metadata: languageName: node linkType: hard -"@nx/js@patch:@nx/js@npm%3A21.4.1#./.yarn/patches/@nx-js-npm-21.4.1-e583e899cd.patch::locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A.": - version: 21.4.1 - resolution: "@nx/js@patch:@nx/js@npm%3A21.4.1#./.yarn/patches/@nx-js-npm-21.4.1-e583e899cd.patch::version=21.4.1&hash=da636c&locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A." - dependencies: - "@babel/core": ^7.23.2 - "@babel/plugin-proposal-decorators": ^7.22.7 - "@babel/plugin-transform-class-properties": ^7.22.5 - "@babel/plugin-transform-runtime": ^7.23.2 - "@babel/preset-env": ^7.23.2 - "@babel/preset-typescript": ^7.22.5 - "@babel/runtime": ^7.22.6 - "@nx/devkit": 21.4.1 - "@nx/workspace": 21.4.1 - "@zkochan/js-yaml": 0.0.7 - babel-plugin-const-enum: ^1.0.1 - babel-plugin-macros: ^3.1.0 - babel-plugin-transform-typescript-metadata: ^0.3.1 - chalk: ^4.1.0 - columnify: ^1.6.0 - detect-port: ^1.5.1 - enquirer: ~2.3.6 - ignore: ^5.0.4 - js-tokens: ^4.0.0 - jsonc-parser: 3.2.0 - npm-package-arg: 11.0.1 - npm-run-path: ^4.0.1 - ora: 5.3.0 - picocolors: ^1.1.0 - picomatch: 4.0.2 - semver: ^7.5.3 - source-map-support: 0.5.19 - tinyglobby: ^0.2.12 - tslib: ^2.3.0 - peerDependencies: - verdaccio: ^6.0.5 - peerDependenciesMeta: - verdaccio: - optional: true - checksum: fa477f67274a6f61fbae7d69cce7926ee01ec8d8cec01af2cdf85d6a9a5625291b50465afe89a31311628f36356ae294f82e12d03d308babe84fc5f353b35d44 - languageName: node - linkType: hard - "@nx/nx-darwin-arm64@npm:21.4.1": version: 21.4.1 resolution: "@nx/nx-darwin-arm64@npm:21.4.1" @@ -15011,91 +14969,6 @@ __metadata: languageName: node linkType: hard -"nx@patch:nx@npm%3A21.4.1#./.yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch::locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A.": - version: 21.4.1 - resolution: "nx@patch:nx@npm%3A21.4.1#./.yarn/patches/nx-npm-21.4.1-9a72b10ddb.patch::version=21.4.1&hash=fcaf6a&locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A." - dependencies: - "@napi-rs/wasm-runtime": 0.2.4 - "@nx/nx-darwin-arm64": 21.4.1 - "@nx/nx-darwin-x64": 21.4.1 - "@nx/nx-freebsd-x64": 21.4.1 - "@nx/nx-linux-arm-gnueabihf": 21.4.1 - "@nx/nx-linux-arm64-gnu": 21.4.1 - "@nx/nx-linux-arm64-musl": 21.4.1 - "@nx/nx-linux-x64-gnu": 21.4.1 - "@nx/nx-linux-x64-musl": 21.4.1 - "@nx/nx-win32-arm64-msvc": 21.4.1 - "@nx/nx-win32-x64-msvc": 21.4.1 - "@yarnpkg/lockfile": ^1.1.0 - "@yarnpkg/parsers": 3.0.2 - "@zkochan/js-yaml": 0.0.7 - axios: ^1.8.3 - chalk: ^4.1.0 - cli-cursor: 3.1.0 - cli-spinners: 2.6.1 - cliui: ^8.0.1 - dotenv: ~16.4.5 - dotenv-expand: ~11.0.6 - enquirer: ~2.3.6 - figures: 3.2.0 - flat: ^5.0.2 - front-matter: ^4.0.2 - ignore: ^5.0.4 - jest-diff: ^30.0.2 - jsonc-parser: 3.2.0 - lines-and-columns: 2.0.3 - minimatch: 9.0.3 - node-machine-id: 1.1.12 - npm-run-path: ^4.0.1 - open: ^8.4.0 - ora: 5.3.0 - resolve.exports: 2.0.3 - semver: ^7.5.3 - string-width: ^4.2.3 - tar-stream: ~2.2.0 - tmp: ~0.2.1 - tree-kill: ^1.2.2 - tsconfig-paths: ^4.1.2 - tslib: ^2.3.0 - yaml: ^2.6.0 - yargs: ^17.6.2 - yargs-parser: 21.1.1 - peerDependencies: - "@swc-node/register": ^1.8.0 - "@swc/core": ^1.3.85 - dependenciesMeta: - "@nx/nx-darwin-arm64": - optional: true - "@nx/nx-darwin-x64": - optional: true - "@nx/nx-freebsd-x64": - optional: true - "@nx/nx-linux-arm-gnueabihf": - optional: true - "@nx/nx-linux-arm64-gnu": - optional: true - "@nx/nx-linux-arm64-musl": - optional: true - "@nx/nx-linux-x64-gnu": - optional: true - "@nx/nx-linux-x64-musl": - optional: true - "@nx/nx-win32-arm64-msvc": - optional: true - "@nx/nx-win32-x64-msvc": - optional: true - peerDependenciesMeta: - "@swc-node/register": - optional: true - "@swc/core": - optional: true - bin: - nx: bin/nx.js - nx-cloud: bin/nx-cloud.js - checksum: c420de892f6830440da6040223f89767e96ed1ba5f2f28d5a75573b5f5bd59126b40ebfbd5936041128863b9172085faa86f68ee50747adabb1af2ac8f0b5f33 - languageName: node - linkType: hard - "object-assign@npm:^4.1.1": version: 4.1.1 resolution: "object-assign@npm:4.1.1" From 0e228423ce62fd2bff80a23c523493c783a62318 Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Tue, 2 Sep 2025 15:42:54 +0400 Subject: [PATCH 163/283] chore: allowed actors for releases --- .github/CODEOWNERS | 3 +++ .github/workflows/release.yml | 24 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000000..ed3d277f03cc --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,3 @@ +# Critical workflow files require approval from core maintainers +.github/workflows/release.yml @JamesHenry @bradzacher @JoshuaKGoldberg +.github/workflows/ci.yml @JamesHenry @bradzacher @JoshuaKGoldberg diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 587e2fb1bee2..9433294fd2a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ on: workflow_dispatch: inputs: release_type: - description: 'Type of release to perform (stable requires core team approval)' + description: 'Type of release to perform' required: true type: choice options: @@ -112,6 +112,28 @@ jobs: exit 1 fi + # Security: For manual triggers, only allow core maintainers to run releases + if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + ALLOWED_ACTORS=("JamesHenry" "bradzacher" "JoshuaKGoldberg") + ACTOR="${{ github.actor }}" + IS_ALLOWED="false" + + for allowed in "${ALLOWED_ACTORS[@]}"; do + if [[ "$ACTOR" == "$allowed" ]]; then + IS_ALLOWED="true" + break + fi + done + + if [[ "$IS_ALLOWED" != "true" ]]; then + echo "::error::User '$ACTOR' is not authorized to trigger manual releases." + echo "::error::Only the following users can trigger manual releases: ${ALLOWED_ACTORS[*]}" + exit 1 + fi + + echo "✅ Authorized user '$ACTOR' triggering manual release" + fi + # Set outputs echo "should_release=$SHOULD_RELEASE" >> $GITHUB_OUTPUT echo "release_type=$RELEASE_TYPE" >> $GITHUB_OUTPUT From 75188b0a79cd6d2744ee454b2b12506eecccbb9e Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Tue, 2 Sep 2025 15:56:53 +0400 Subject: [PATCH 164/283] chore: use fine-grained token --- .github/workflows/release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9433294fd2a8..0a23b7d8df4a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -235,7 +235,7 @@ jobs: # Also ensure validation passed and we're releasing a stable version if: github.repository == 'typescript-eslint/typescript-eslint' && needs.validate.outputs.should_release == 'true' && needs.validate.outputs.is_stable == 'true' permissions: - contents: write # Need to create releases and push tags + contents: read id-token: write # Required for trusted publishing steps: - name: Checkout @@ -243,6 +243,9 @@ jobs: with: # Need full history for changelog generation fetch-depth: 0 + ref: main + # Check out the repo with a specific fine-grained PAT to allow pushing back to the repo + token: ${{ secrets.GH_FINE_GRAINED_PAT }} - name: Install dependencies uses: ./.github/actions/prepare-install @@ -269,6 +272,8 @@ jobs: NPM_CONFIG_PROVENANCE: true # Disable distributed execution here for predictability NX_CLOUD_DISTRIBUTED_EXECUTION: false + # Use the specific fine-grained PAT to allow pushing back to the repo + GH_TOKEN: ${{ secrets.GH_FINE_GRAINED_PAT }} - name: Force update the website branch to match the latest release # Only update the website branch if we're not doing a dry run From d13590979dc4130525d7b321230298dcdebc176f Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Tue, 2 Sep 2025 11:59:35 +0000 Subject: [PATCH 165/283] chore(release): publish 8.42.0 --- CHANGELOG.md | 17 ++++ packages/ast-spec/CHANGELOG.md | 6 ++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin/CHANGELOG.md | 8 ++ packages/eslint-plugin/package.json | 16 +-- packages/parser/CHANGELOG.md | 6 ++ packages/parser/package.json | 10 +- packages/project-service/CHANGELOG.md | 6 ++ packages/project-service/package.json | 6 +- .../CHANGELOG.md | 6 ++ .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 6 ++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 ++ packages/scope-manager/package.json | 8 +- packages/tsconfig-utils/CHANGELOG.md | 6 ++ packages/tsconfig-utils/package.json | 2 +- packages/type-utils/CHANGELOG.md | 6 ++ packages/type-utils/package.json | 10 +- packages/types/CHANGELOG.md | 6 ++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 16 +++ packages/typescript-eslint/package.json | 10 +- packages/typescript-estree/CHANGELOG.md | 6 ++ packages/typescript-estree/package.json | 10 +- packages/utils/CHANGELOG.md | 6 ++ packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 ++ packages/visitor-keys/package.json | 4 +- yarn.lock | 98 +++++++++---------- 30 files changed, 213 insertions(+), 100 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8147558a4353..1001310182fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,20 @@ +## 8.42.0 (2025-09-02) + +### 🚀 Features + +- deprecate tseslint.config() ([#11531](https://github.com/typescript-eslint/typescript-eslint/pull/11531)) + +### 🩹 Fixes + +- **deps:** update eslint monorepo to v9.33.0 ([#11482](https://github.com/typescript-eslint/typescript-eslint/pull/11482)) +- **typescript-eslint:** handle non-normalized windows paths produced by jiti ([#11546](https://github.com/typescript-eslint/typescript-eslint/pull/11546)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index c53185791808..49423544d22b 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.42.0 (2025-09-02) + +This was a version bump only for ast-spec to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) ### 🩹 Fixes diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 2bab131a3111..3fa74192b434 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.41.0", + "version": "8.42.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index e85d9e4f4fc9..6553f6fdfe46 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,11 @@ +## 8.42.0 (2025-09-02) + +### 🩹 Fixes + +- **deps:** update eslint monorepo to v9.33.0 ([#11482](https://github.com/typescript-eslint/typescript-eslint/pull/11482)) + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) ### 🩹 Fixes diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index bafdc946330b..283b912e44ce 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.41.0", + "version": "8.42.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.41.0", - "@typescript-eslint/type-utils": "8.41.0", - "@typescript-eslint/utils": "8.41.0", - "@typescript-eslint/visitor-keys": "8.41.0", + "@typescript-eslint/scope-manager": "8.42.0", + "@typescript-eslint/type-utils": "8.42.0", + "@typescript-eslint/utils": "8.42.0", + "@typescript-eslint/visitor-keys": "8.42.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.41.0", - "@typescript-eslint/rule-tester": "8.41.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.42.0", + "@typescript-eslint/rule-tester": "8.42.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.41.0", + "@typescript-eslint/parser": "^8.42.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 7aaedf20bf8d..f0699726e8d7 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.42.0 (2025-09-02) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index c22e53c3c0a7..25b9494e7bb5 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.41.0", + "version": "8.42.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.41.0", - "@typescript-eslint/types": "8.41.0", - "@typescript-eslint/typescript-estree": "8.41.0", - "@typescript-eslint/visitor-keys": "8.41.0", + "@typescript-eslint/scope-manager": "8.42.0", + "@typescript-eslint/types": "8.42.0", + "@typescript-eslint/typescript-estree": "8.42.0", + "@typescript-eslint/visitor-keys": "8.42.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 0830fccb4d66..874fb6a1cb4f 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.42.0 (2025-09-02) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index adab677e6f7a..213c332c8818 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.41.0", + "version": "8.42.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.41.0", - "@typescript-eslint/types": "^8.41.0", + "@typescript-eslint/tsconfig-utils": "^8.42.0", + "@typescript-eslint/types": "^8.42.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index fde466cf497d..5f273061627d 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.42.0 (2025-09-02) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) ### 🩹 Fixes diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index b1692804359c..d9a9c1a9d62d 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.41.0", + "version": "8.42.0", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.41.0", - "@typescript-eslint/utils": "8.41.0", + "@typescript-eslint/type-utils": "8.42.0", + "@typescript-eslint/utils": "8.42.0", "natural-compare": "^1.4.0", "prettier": "3.6.2" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index d423dad73de2..3382f5b61dc8 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.42.0 (2025-09-02) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) ### 🚀 Features diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 41833305c3ea..3e8f7d2e624e 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.41.0", + "version": "8.42.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.41.0", - "@typescript-eslint/typescript-estree": "8.41.0", - "@typescript-eslint/utils": "8.41.0", + "@typescript-eslint/parser": "8.42.0", + "@typescript-eslint/typescript-estree": "8.42.0", + "@typescript-eslint/utils": "8.42.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 3d79af3dd2df..6f66a69047d6 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.42.0 (2025-09-02) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 1732f314fe6f..4bddb0326989 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.41.0", + "version": "8.42.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.41.0", - "@typescript-eslint/visitor-keys": "8.41.0" + "@typescript-eslint/types": "8.42.0", + "@typescript-eslint/visitor-keys": "8.42.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.41.0", + "@typescript-eslint/typescript-estree": "8.42.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 377e6e5a4239..6702a80306ee 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.42.0 (2025-09-02) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index fe9fa734f8e5..581a2ac87076 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.41.0", + "version": "8.42.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 7f854a1f0c61..cc2def818109 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.42.0 (2025-09-02) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 57189776f6e9..6b5a34063b08 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.41.0", + "version": "8.42.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.41.0", - "@typescript-eslint/typescript-estree": "8.41.0", - "@typescript-eslint/utils": "8.41.0", + "@typescript-eslint/types": "8.42.0", + "@typescript-eslint/typescript-estree": "8.42.0", + "@typescript-eslint/utils": "8.42.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.41.0", + "@typescript-eslint/parser": "8.42.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 14ebf6b09635..c23735280c72 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.42.0 (2025-09-02) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 1117200eca0a..6f791504315b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.41.0", + "version": "8.42.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index e80cd18e2adf..fbc52575d507 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,19 @@ +## 8.42.0 (2025-09-02) + +### 🚀 Features + +- deprecate tseslint.config() ([#11531](https://github.com/typescript-eslint/typescript-eslint/pull/11531)) + +### 🩹 Fixes + +- **typescript-eslint:** handle non-normalized windows paths produced by jiti ([#11546](https://github.com/typescript-eslint/typescript-eslint/pull/11546)) + +### ❤️ Thank You + +- Kirk Waiblinger @kirkwaiblinger + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 38789b0cf809..f4d605563c98 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.41.0", + "version": "8.42.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.41.0", - "@typescript-eslint/parser": "8.41.0", - "@typescript-eslint/typescript-estree": "8.41.0", - "@typescript-eslint/utils": "8.41.0" + "@typescript-eslint/eslint-plugin": "8.42.0", + "@typescript-eslint/parser": "8.42.0", + "@typescript-eslint/typescript-estree": "8.42.0", + "@typescript-eslint/utils": "8.42.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 59f4cac1abf8..c11a9eed239e 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.42.0 (2025-09-02) + +This was a version bump only for typescript-estree to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) ### 🚀 Features diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 9ff68a8e6c97..ff47e8b02713 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.41.0", + "version": "8.42.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.41.0", - "@typescript-eslint/tsconfig-utils": "8.41.0", - "@typescript-eslint/types": "8.41.0", - "@typescript-eslint/visitor-keys": "8.41.0", + "@typescript-eslint/project-service": "8.42.0", + "@typescript-eslint/tsconfig-utils": "8.42.0", + "@typescript-eslint/types": "8.42.0", + "@typescript-eslint/visitor-keys": "8.42.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 979817e65730..c6af51658d4b 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.42.0 (2025-09-02) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index 77a4ee26b789..3e8d5744d499 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.41.0", + "version": "8.42.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.41.0", - "@typescript-eslint/types": "8.41.0", - "@typescript-eslint/typescript-estree": "8.41.0" + "@typescript-eslint/scope-manager": "8.42.0", + "@typescript-eslint/types": "8.42.0", + "@typescript-eslint/typescript-estree": "8.42.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 7ad0feec8dc8..f18689f963b1 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.42.0 (2025-09-02) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.41.0 (2025-08-25) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 1a556efad5c8..04e6678f79d6 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.41.0", + "version": "8.42.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/types": "8.42.0", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 35b4b02ef4e0..b1c732c57839 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5830,19 +5830,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.41.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.42.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.41.0 - "@typescript-eslint/rule-tester": 8.41.0 - "@typescript-eslint/scope-manager": 8.41.0 - "@typescript-eslint/type-utils": 8.41.0 - "@typescript-eslint/utils": 8.41.0 - "@typescript-eslint/visitor-keys": 8.41.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.42.0 + "@typescript-eslint/rule-tester": 8.42.0 + "@typescript-eslint/scope-manager": 8.42.0 + "@typescript-eslint/type-utils": 8.42.0 + "@typescript-eslint/utils": 8.42.0 + "@typescript-eslint/visitor-keys": 8.42.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5865,7 +5865,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.41.0 + "@typescript-eslint/parser": ^8.42.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -5881,14 +5881,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.41.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.42.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.41.0 - "@typescript-eslint/types": 8.41.0 - "@typescript-eslint/typescript-estree": 8.41.0 - "@typescript-eslint/visitor-keys": 8.41.0 + "@typescript-eslint/scope-manager": 8.42.0 + "@typescript-eslint/types": 8.42.0 + "@typescript-eslint/typescript-estree": 8.42.0 + "@typescript-eslint/visitor-keys": 8.42.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -5902,12 +5902,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.41.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.42.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.41.0 - "@typescript-eslint/types": ^8.41.0 + "@typescript-eslint/tsconfig-utils": ^8.42.0 + "@typescript-eslint/types": ^8.42.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -5918,12 +5918,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.41.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.42.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.41.0 - "@typescript-eslint/utils": 8.41.0 + "@typescript-eslint/type-utils": 8.42.0 + "@typescript-eslint/utils": 8.42.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -5934,15 +5934,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.41.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.42.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.41.0 - "@typescript-eslint/typescript-estree": 8.41.0 - "@typescript-eslint/utils": 8.41.0 + "@typescript-eslint/parser": 8.42.0 + "@typescript-eslint/typescript-estree": 8.42.0 + "@typescript-eslint/utils": 8.42.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5957,13 +5957,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.42.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.41.0 - "@typescript-eslint/typescript-estree": 8.41.0 - "@typescript-eslint/visitor-keys": 8.41.0 + "@typescript-eslint/types": 8.42.0 + "@typescript-eslint/typescript-estree": 8.42.0 + "@typescript-eslint/visitor-keys": 8.42.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -5974,7 +5974,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.41.0, @typescript-eslint/tsconfig-utils@^8.41.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.42.0, @typescript-eslint/tsconfig-utils@^8.42.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -5987,14 +5987,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.41.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.42.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.41.0 - "@typescript-eslint/types": 8.41.0 - "@typescript-eslint/typescript-estree": 8.41.0 - "@typescript-eslint/utils": 8.41.0 + "@typescript-eslint/parser": 8.42.0 + "@typescript-eslint/types": 8.42.0 + "@typescript-eslint/typescript-estree": 8.42.0 + "@typescript-eslint/utils": 8.42.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6009,7 +6009,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.41.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.41.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.42.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.42.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6082,15 +6082,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.41.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.42.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.41.0 - "@typescript-eslint/tsconfig-utils": 8.41.0 - "@typescript-eslint/types": 8.41.0 - "@typescript-eslint/visitor-keys": 8.41.0 + "@typescript-eslint/project-service": 8.42.0 + "@typescript-eslint/tsconfig-utils": 8.42.0 + "@typescript-eslint/types": 8.42.0 + "@typescript-eslint/visitor-keys": 8.42.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6108,14 +6108,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.41.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.42.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.41.0 - "@typescript-eslint/types": 8.41.0 - "@typescript-eslint/typescript-estree": 8.41.0 + "@typescript-eslint/scope-manager": 8.42.0 + "@typescript-eslint/types": 8.42.0 + "@typescript-eslint/typescript-estree": 8.42.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6127,11 +6127,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.41.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.42.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.41.0 + "@typescript-eslint/types": 8.42.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19359,10 +19359,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.41.0 - "@typescript-eslint/parser": 8.41.0 - "@typescript-eslint/typescript-estree": 8.41.0 - "@typescript-eslint/utils": 8.41.0 + "@typescript-eslint/eslint-plugin": 8.42.0 + "@typescript-eslint/parser": 8.42.0 + "@typescript-eslint/typescript-estree": 8.42.0 + "@typescript-eslint/utils": 8.42.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" From 9ea09a544fe546b9e239afecbac11b19257f1dcf Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Tue, 2 Sep 2025 16:27:21 +0400 Subject: [PATCH 166/283] chore: update CODEOWNERS --- .github/CODEOWNERS | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ed3d277f03cc..a1eb95ebcfbd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,2 @@ -# Critical workflow files require approval from core maintainers -.github/workflows/release.yml @JamesHenry @bradzacher @JoshuaKGoldberg -.github/workflows/ci.yml @JamesHenry @bradzacher @JoshuaKGoldberg +# All files in the .github directory require approval from core maintainers +.github/** @JamesHenry @bradzacher @JoshuaKGoldberg From eb4ecd8c156133265eb13dd4228521df74ba9b7b Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Wed, 3 Sep 2025 15:14:24 +0400 Subject: [PATCH 167/283] chore: update workflows --- .github/workflows/a11y-alt-bot.yml | 2 ++ .../workflows/breaking-change-validation.yml | 27 ++++++++++++++++ .github/workflows/ci.yml | 1 + .github/workflows/cleanup-cache.yml | 20 ++++++------ .github/workflows/lock.yml | 9 +++--- .github/workflows/nx-migrate.yml | 2 ++ .github/workflows/pr-labels.yml | 32 ------------------- .github/workflows/pr-review-requested.yml | 24 ++++++++------ ...-pr-titles.yml => pr-title-validation.yml} | 12 +++++-- .github/workflows/prettier-update.yml | 2 ++ .../semantic-breaking-change-pr-test.yml | 20 ------------ 11 files changed, 72 insertions(+), 79 deletions(-) create mode 100644 .github/workflows/breaking-change-validation.yml delete mode 100644 .github/workflows/pr-labels.yml rename .github/workflows/{semantic-pr-titles.yml => pr-title-validation.yml} (77%) delete mode 100644 .github/workflows/semantic-breaking-change-pr-test.yml diff --git a/.github/workflows/a11y-alt-bot.yml b/.github/workflows/a11y-alt-bot.yml index 10afa17f6b1b..f59ac53a8dc6 100644 --- a/.github/workflows/a11y-alt-bot.yml +++ b/.github/workflows/a11y-alt-bot.yml @@ -2,6 +2,7 @@ name: Accessibility-alt-text-bot on: issues: types: [opened, edited] + # NOTE: Never use pull_request_target here because that would populate secrets for forks pull_request: types: [opened, edited] issue_comment: @@ -13,6 +14,7 @@ on: discussion_comment: types: [created, edited] +# IMPORTANT: Minimal permissions necessary for this workflow to function permissions: issues: write pull-requests: write diff --git a/.github/workflows/breaking-change-validation.yml b/.github/workflows/breaking-change-validation.yml new file mode 100644 index 000000000000..1ea6d8b26cde --- /dev/null +++ b/.github/workflows/breaking-change-validation.yml @@ -0,0 +1,27 @@ +# IMPORTANT: Do not reuse old name of "Semantic Breaking Change PR Test" here +name: Breaking Change Validation + +on: + # WARNING: Using pull_request_target here because we want to validate PRs on forks + # pull_request_target can be UNSAFE because it runs in the TARGET repo context (not fork context). + # DO NOT CHECK OUT THE REPO IN THIS WORKFLOW + pull_request_target: + types: + - opened + - edited + - synchronize + - labeled + - unlabeled + +# IMPORTANT: Minimal permissions necessary for this workflow to function +permissions: + pull-requests: read + +jobs: + validate: + name: Validate Breaking Change PR + runs-on: ubuntu-latest + steps: + - uses: ./.github/actions/breaking-pr-check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4ec153d22dd..91e78e2a606a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: push: branches: - main + # NOTE: Never use pull_request_target here because that would populate secrets for forks pull_request: branches: - '**' diff --git a/.github/workflows/cleanup-cache.yml b/.github/workflows/cleanup-cache.yml index 21cb7a3df7b0..e7ce232378c3 100644 --- a/.github/workflows/cleanup-cache.yml +++ b/.github/workflows/cleanup-cache.yml @@ -1,34 +1,34 @@ # https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries -name: cleanup caches by a branch +name: Cleanup caches for the current PR branch on: + # NOTE: Never use pull_request_target here because that would populate secrets for forks pull_request: types: - closed +# IMPORTANT: Minimal permissions necessary for this workflow to function +permissions: + actions: write + jobs: cleanup: runs-on: ubuntu-latest steps: - - name: Check out code - uses: actions/checkout@v4 - - name: Cleanup + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh extension install actions/gh-actions-cache - REPO=${{ github.repository }} BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge" echo "Fetching list of cache key" - cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 ) + cacheKeysForPR=$(gh cache list -R $REPO --ref $BRANCH | cut -f 1) ## Setting this to not fail the workflow while deleting cache keys. set +e echo "Deleting caches..." for cacheKey in $cacheKeysForPR do - gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm + gh cache delete $cacheKey -R $REPO done echo "Done" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index ae557bfdd433..b23b1d49c03a 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -4,14 +4,13 @@ on: schedule: - cron: '0 0 * * *' -permissions: {} +# IMPORTANT: Minimal permissions necessary for this workflow to function +permissions: + issues: write # to lock issues (dessant/lock-threads) + pull-requests: write # to lock PRs (dessant/lock-threads) jobs: lock: - permissions: - issues: write # to lock issues (dessant/lock-threads) - pull-requests: write # to lock PRs (dessant/lock-threads) - runs-on: ubuntu-latest steps: - uses: dessant/lock-threads@v5.0.1 diff --git a/.github/workflows/nx-migrate.yml b/.github/workflows/nx-migrate.yml index 6eb61b7714cb..5b0d8db9f9d4 100644 --- a/.github/workflows/nx-migrate.yml +++ b/.github/workflows/nx-migrate.yml @@ -7,6 +7,8 @@ name: Nx Migrate on: + # NOTE: Never use pull_request_target here because that would populate secrets for forks + # Renovate creates branches directly on the main repo and acts like a trusted contributor pull_request: branches: [main] paths: diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml deleted file mode 100644 index 3f8770b799db..000000000000 --- a/.github/workflows/pr-labels.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Pull Request Labels - -on: - pull_request: - types: [labeled, opened, synchronize, unlabeled] - -jobs: - label: - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - # - # WARNING!!!!!!!!!!! - # - # THIS ACTION WAS COMPROMISED: https://www.stepsecurity.io/blog/harden-runner-detection-tj-actions-changed-files-action-is-compromised - # - # DO NOT RE-ENABLE THIS WORKFLOW WITH THIS IN USE!!!!! - # - # steps: - # - id: changed-stable-configs - # uses: tj-actions/changed-files@v44.5.2 - # with: - # files: packages/{eslint-plugin,typescript-eslint}/src/configs/{recommended,stylistic}* - # - if: steps.changed-stable-configs.outputs.any_changed == 'true' - # uses: mheap/github-action-required-labels@5.5.0 - # with: - # add_comment: true - # count: 1 - # labels: breaking change - # message: '🤖 Beep boop! PRs that change our stable preset configs must be labeled with `breaking change`.' - # mode: minimum diff --git a/.github/workflows/pr-review-requested.yml b/.github/workflows/pr-review-requested.yml index edfdbbdafb97..61c220e239cd 100644 --- a/.github/workflows/pr-review-requested.yml +++ b/.github/workflows/pr-review-requested.yml @@ -1,3 +1,17 @@ +name: PR Review Requested + +on: + # WARNING: Using pull_request_target here because we need write permissions to remove labels from fork PRs + # pull_request_target can be UNSAFE because it runs in the TARGET repo context (not fork context). + # DO NOT CHECK OUT THE REPO IN THIS WORKFLOW + pull_request_target: + types: + - review_requested + +# IMPORTANT: Minimal permissions necessary for this workflow to function +permissions: + pull-requests: write + jobs: pr_review_requested: runs-on: ubuntu-latest @@ -11,13 +25,3 @@ jobs: run: | echo "Don't worry if the previous step failed." echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221." - -name: PR Review Requested - -on: - pull_request_target: - types: - - review_requested - -permissions: - pull-requests: write diff --git a/.github/workflows/semantic-pr-titles.yml b/.github/workflows/pr-title-validation.yml similarity index 77% rename from .github/workflows/semantic-pr-titles.yml rename to .github/workflows/pr-title-validation.yml index b206297b3896..175ce9457a5e 100644 --- a/.github/workflows/semantic-pr-titles.yml +++ b/.github/workflows/pr-title-validation.yml @@ -1,14 +1,22 @@ -name: Semantic PR Titles +# IMPORTANT: Do not reuse old name of "Semantic PR Titles" here +name: PR Title Validation on: + # WARNING: Using pull_request_target here because we want to validate PRs on forks + # pull_request_target can be UNSAFE because it runs in the TARGET repo context (not fork context). + # DO NOT CHECK OUT THE REPO IN THIS WORKFLOW pull_request_target: types: - opened - edited - synchronize +# IMPORTANT: Minimal permissions necessary for this workflow to function +permissions: + pull-requests: read + jobs: - main: + validate: name: Validate PR title runs-on: ubuntu-latest steps: diff --git a/.github/workflows/prettier-update.yml b/.github/workflows/prettier-update.yml index 5cd44a2d7a13..bdfb4d9fd05e 100644 --- a/.github/workflows/prettier-update.yml +++ b/.github/workflows/prettier-update.yml @@ -4,6 +4,8 @@ name: Prettier Update on: + # NOTE: Never use pull_request_target here because that would populate secrets for forks + # Renovate creates branches directly on the main repo and acts like a trusted contributor pull_request: branches: [main] paths: diff --git a/.github/workflows/semantic-breaking-change-pr-test.yml b/.github/workflows/semantic-breaking-change-pr-test.yml deleted file mode 100644 index 46d4627b3fdc..000000000000 --- a/.github/workflows/semantic-breaking-change-pr-test.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Semantic Breaking Change PR - -on: - pull_request_target: - types: - - opened - - edited - - synchronize - - labeled - - unlabeled - -jobs: - main: - name: Validate Breaking Change PR - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/breaking-pr-check - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e9e41466883f9e48dfbe87dffe7054cc3ce84197 Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Wed, 3 Sep 2025 15:19:16 +0400 Subject: [PATCH 168/283] chore: delete lock.yml --- .github/workflows/lock.yml | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .github/workflows/lock.yml diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml deleted file mode 100644 index b23b1d49c03a..000000000000 --- a/.github/workflows/lock.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: 'Lock threads' - -on: - schedule: - - cron: '0 0 * * *' - -# IMPORTANT: Minimal permissions necessary for this workflow to function -permissions: - issues: write # to lock issues (dessant/lock-threads) - pull-requests: write # to lock PRs (dessant/lock-threads) - -jobs: - lock: - runs-on: ubuntu-latest - steps: - - uses: dessant/lock-threads@v5.0.1 - with: - add-issue-labels: 'locked due to age' - github-token: ${{ github.token }} - issue-inactive-days: '7' - issue-lock-reason: 'resolved' - issue-comment: '' - pr-inactive-days: '7' - pr-lock-reason: 'resolved' - pr-comment: '' From 2ec83b9e0742d45b49d046b4ba0930389ec7bd5f Mon Sep 17 00:00:00 2001 From: Yukihiro Hasegawa <49516827+y-hsgw@users.noreply.github.com> Date: Wed, 3 Sep 2025 20:27:10 +0900 Subject: [PATCH 169/283] fix(type-utils): add union type support to TypeOrValueSpecifier (#11526) * feat: enhance typeMatchesSpecifier to handle union types * test: add tests * fix: update typeMatchesSpecifier to require all union types to match * test: add tests --- .../tests/rules/only-throw-error.test.ts | 31 +++++++++++++++++++ .../type-utils/src/TypeOrValueSpecifier.ts | 4 +++ .../tests/TypeOrValueSpecifier.test.ts | 11 +++++++ 3 files changed, 46 insertions(+) diff --git a/packages/eslint-plugin/tests/rules/only-throw-error.test.ts b/packages/eslint-plugin/tests/rules/only-throw-error.test.ts index 6f60f01b8405..500454d0a9cb 100644 --- a/packages/eslint-plugin/tests/rules/only-throw-error.test.ts +++ b/packages/eslint-plugin/tests/rules/only-throw-error.test.ts @@ -191,6 +191,19 @@ throw new Map(); }, { code: ` +function func() { + let err: Promise | Promise; + throw err; +} + `, + options: [ + { + allow: ['Promise'], + }, + ], + }, + { + code: ` try { } catch (e) { throw e; @@ -615,6 +628,24 @@ function fun(t: T): void { }, { code: ` +function func() { + let err: Promise | Promise | void; + throw err; +} + `, + errors: [ + { + messageId: 'object', + }, + ], + options: [ + { + allow: ['Promise'], + }, + ], + }, + { + code: ` class UnknownError implements Error {} throw new UnknownError(); `, diff --git a/packages/type-utils/src/TypeOrValueSpecifier.ts b/packages/type-utils/src/TypeOrValueSpecifier.ts index bbfb99ddcc78..553c8a4225bf 100644 --- a/packages/type-utils/src/TypeOrValueSpecifier.ts +++ b/packages/type-utils/src/TypeOrValueSpecifier.ts @@ -169,6 +169,10 @@ export function typeMatchesSpecifier( specifier: TypeOrValueSpecifier, program: ts.Program, ): boolean { + if (tsutils.isUnionType(type)) { + return type.types.every(t => typeMatchesSpecifier(t, specifier, program)); + } + const wholeTypeMatches = ((): boolean => { if (tsutils.isIntrinsicErrorType(type)) { return false; diff --git a/packages/type-utils/tests/TypeOrValueSpecifier.test.ts b/packages/type-utils/tests/TypeOrValueSpecifier.test.ts index a28d22f36b71..3d3429fbb3d1 100644 --- a/packages/type-utils/tests/TypeOrValueSpecifier.test.ts +++ b/packages/type-utils/tests/TypeOrValueSpecifier.test.ts @@ -179,6 +179,7 @@ describe('TypeOrValueSpecifier', () => { ['interface Foo {prop: string}; type Test = Foo;', 'RegExp'], ['type Test = RegExp;', 'Foo'], ['type Test = RegExp;', 'BigInt'], + ['type Test = RegExp | BigInt;', 'BigInt'], ] as const satisfies [string, TypeOrValueSpecifier][])( "doesn't match a mismatched universal string specifier: %s\n\t%s", ([code, typeOrValueSpecifier], { expect }) => { @@ -267,6 +268,10 @@ describe('TypeOrValueSpecifier', () => { 'interface Foo {prop: string}; type Test = Foo;', { from: 'file', name: 'Bar' }, ], + [ + 'interface Foo {prop: string}; type Test = Foo | string;', + { from: 'file', name: 'Foo' }, + ], [ 'interface Foo {prop: string}; type Test = Foo;', { from: 'file', name: ['Bar', 'Baz'] }, @@ -306,6 +311,7 @@ describe('TypeOrValueSpecifier', () => { it.for([ ['type Test = RegExp;', { from: 'lib', name: 'BigInt' }], + ['type Test = RegExp | BigInt;', { from: 'lib', name: 'BigInt' }], ['type Test = RegExp;', { from: 'lib', name: ['BigInt', 'Date'] }], ] as const satisfies [string, TypeOrValueSpecifier][])( "doesn't match a mismatched lib specifier: %s\n\t%s", @@ -326,6 +332,7 @@ describe('TypeOrValueSpecifier', () => { it.for([ ['type Test = string;', { from: 'lib', name: 'number' }], + ['type Test = string | number;', { from: 'lib', name: 'number' }], ['type Test = string;', { from: 'lib', name: ['number', 'boolean'] }], ] as const satisfies [string, TypeOrValueSpecifier][])( "doesn't match a mismatched intrinsic type specifier: %s\n\t%s", @@ -545,6 +552,10 @@ describe('TypeOrValueSpecifier', () => { 'import type {Node} from "typescript"; type Test = Node;', { from: 'package', name: 'Symbol', package: 'typescript' }, ], + [ + 'import type {Node} from "typescript"; type Test = Node | Symbol;', + { from: 'package', name: 'Node', package: 'typescript' }, + ], [ 'import type {Node} from "typescript"; type Test = Node;', { from: 'package', name: ['Symbol', 'Checker'], package: 'typescript' }, From 08e242c5e71114897a6c609e0df3058fe716f7bb Mon Sep 17 00:00:00 2001 From: Yukihiro Hasegawa <49516827+y-hsgw@users.noreply.github.com> Date: Wed, 3 Sep 2025 20:27:58 +0900 Subject: [PATCH 170/283] fix(eslint-plugin): [no-non-null-assertion] do not suggest optional chain on LHS of assignment (#11489) * fix: disable suggestion when non-null assertion is used as an assignee * test: add tests * chore: fix lint errors * test: remove noFormat * test: fix test output * chore: fix lint * test: fix test output * test: fix test output --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .../src/rules/no-non-null-assertion.ts | 4 ++- .../tests/rules/no-non-null-assertion.test.ts | 34 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts index fd66c1cef9b0..bc7c9ecf226e 100644 --- a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts @@ -4,6 +4,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { createRule, + isAssignee, isNonNullAssertionPunctuator, nullThrows, NullThrowsReasons, @@ -53,7 +54,8 @@ export default createRule<[], MessageIds>({ if ( node.parent.type === AST_NODE_TYPES.MemberExpression && - node.parent.object === node + node.parent.object === node && + !isAssignee(node.parent) ) { if (!node.parent.optional) { if (node.parent.computed) { diff --git a/packages/eslint-plugin/tests/rules/no-non-null-assertion.test.ts b/packages/eslint-plugin/tests/rules/no-non-null-assertion.test.ts index 98dde42f9943..137effe702cc 100644 --- a/packages/eslint-plugin/tests/rules/no-non-null-assertion.test.ts +++ b/packages/eslint-plugin/tests/rules/no-non-null-assertion.test.ts @@ -387,5 +387,39 @@ x?. }, ], }, + { + code: ` +document.querySelector('input')!.files = new FileList(); + `, + errors: [ + { + column: 1, + endColumn: 33, + line: 2, + messageId: 'noNonNull', + }, + ], + }, + { + code: ` +hoge.files = document.querySelector('input')!.files; + `, + errors: [ + { + column: 14, + endColumn: 46, + line: 2, + messageId: 'noNonNull', + suggestions: [ + { + messageId: 'suggestOptionalChain', + output: ` +hoge.files = document.querySelector('input')?.files; + `, + }, + ], + }, + ], + }, ], }); From 9529ac1493758f24b3b5d9bd2fb9cd0623a4b4ca Mon Sep 17 00:00:00 2001 From: Dima Date: Wed, 3 Sep 2025 12:28:44 +0100 Subject: [PATCH 171/283] fix(rule-tester): normalize paths before checking if they escape cwd (#11525) * fix(rule-tester): normalize paths before checking if they escape cwd * added test cases --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- packages/rule-tester/src/RuleTester.ts | 2 +- packages/rule-tester/tests/filename.test.ts | 72 +++++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/packages/rule-tester/src/RuleTester.ts b/packages/rule-tester/src/RuleTester.ts index ccf143c1f506..bd0d8cede4eb 100644 --- a/packages/rule-tester/src/RuleTester.ts +++ b/packages/rule-tester/src/RuleTester.ts @@ -210,7 +210,7 @@ export class RuleTester extends TestFramework { // file name (`foo.ts`), don't change the base path. if ( filename != null && - (path.isAbsolute(filename) || filename.startsWith('..')) + (path.isAbsolute(filename) || path.normalize(filename).startsWith('..')) ) { basePath = path.parse( path.resolve(basePath ?? process.cwd(), filename), diff --git a/packages/rule-tester/tests/filename.test.ts b/packages/rule-tester/tests/filename.test.ts index 0e9656702e95..8f3442cf670a 100644 --- a/packages/rule-tester/tests/filename.test.ts +++ b/packages/rule-tester/tests/filename.test.ts @@ -57,6 +57,42 @@ describe('rule tester filename', () => { errors: [{ messageId: 'foo' }], filename: '../foo.js', }, + { + name: 'non-normalized relative path starting with ./', + code: '_', + errors: [{ messageId: 'foo' }], + filename: './../../escaped/cwd/file.ts', + }, + { + name: 'non-normalized relative path ./../', + code: '_', + errors: [{ messageId: 'foo' }], + filename: './../foo.js', + }, + { + name: 'non-normalized relative path with multiple ./', + code: '_', + errors: [{ messageId: 'foo' }], + filename: '././../foo.js', + }, + { + name: 'non-normalized path a/../../', + code: '_', + errors: [{ messageId: 'foo' }], + filename: 'a/../../file.ts', + }, + { + name: 'non-normalized path a/b/../c', + code: '_', + errors: [{ messageId: 'foo' }], + filename: 'a/b/../c', + }, + { + name: 'non-normalized path with multiple slashes', + code: '_', + errors: [{ messageId: 'foo' }], + filename: 'a/////////////../../../b', + }, ], valid: [], }); @@ -81,6 +117,42 @@ describe('rule tester filename', () => { errors: [{ messageId: 'foo' }], filename: '../foo.js', }, + { + name: 'non-normalized relative path starting with ./', + code: '_', + errors: [{ messageId: 'foo' }], + filename: './../../escaped/cwd/file.ts', + }, + { + name: 'non-normalized relative path ./../', + code: '_', + errors: [{ messageId: 'foo' }], + filename: './../foo.js', + }, + { + name: 'non-normalized relative path with multiple ./', + code: '_', + errors: [{ messageId: 'foo' }], + filename: '././../foo.js', + }, + { + name: 'non-normalized path a/../../', + code: '_', + errors: [{ messageId: 'foo' }], + filename: 'a/../../file.ts', + }, + { + name: 'non-normalized path a/b/../c', + code: '_', + errors: [{ messageId: 'foo' }], + filename: 'a/b/../c', + }, + { + name: 'non-normalized path with multiple slashes', + code: '_', + errors: [{ messageId: 'foo' }], + filename: 'a/////////////../../../b', + }, ], valid: [], }); From 42cf79edf5e745192392ac4feadf8ac17031a30e Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Wed, 3 Sep 2025 15:35:13 +0400 Subject: [PATCH 172/283] chore: inline breaking change PR action --- .github/actions/breaking-pr-check/action.yml | 61 ------------------- .../workflows/breaking-change-validation.yml | 58 +++++++++++++++++- 2 files changed, 55 insertions(+), 64 deletions(-) delete mode 100644 .github/actions/breaking-pr-check/action.yml diff --git a/.github/actions/breaking-pr-check/action.yml b/.github/actions/breaking-pr-check/action.yml deleted file mode 100644 index c132bb404d8c..000000000000 --- a/.github/actions/breaking-pr-check/action.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Validate Breaking Change PR -description: Validate breaking change PR title and description - -runs: - using: 'composite' - steps: - - name: Check PR title and body using github-script - uses: actions/github-script@v7 - with: - github-token: ${{ env.GITHUB_TOKEN }} - script: | - async function getPullRequest() { - const pr = context.payload.pull_request; - if (!pr) { - throw new Error("This action can only be run on pull_request events."); - } - - const owner = pr.base.repo.owner.login; - const repo = pr.base.repo.name; - const pull_number = pr.number; - - const { data } = await github.rest.pulls.get({ - owner, - repo, - pull_number, - }); - - return data; - } - - function checkTitle(title) { - if (/^[a-z]+(\([a-z-]+\))?!: /.test(title)) { - throw new Error( - `Do not use exclamation mark ('!') to indicate breaking change in the PR Title.`, - ); - } - } - - function checkDescription(body, labels) { - if (!labels.some(label => label.name === 'breaking change')) { - return; - } - - const [firstLine, secondLine] = body.split(/\r?\n/); - - if (!firstLine || !/^BREAKING CHANGE:/.test(firstLine)) { - throw new Error( - `Breaking change PR body should start with "BREAKING CHANGE:". See https://typescript-eslint.io/maintenance/releases#2-merging-breaking-changes.`, - ); - } - - if (!secondLine) { - throw new Error( - `The description of breaking change is missing. See https://typescript-eslint.io/maintenance/releases#2-merging-breaking-changes.`, - ); - } - } - - const pr = await getPullRequest(); - checkTitle(pr.title); - checkDescription(pr.body ?? '', pr.labels); diff --git a/.github/workflows/breaking-change-validation.yml b/.github/workflows/breaking-change-validation.yml index 1ea6d8b26cde..a441c68d250a 100644 --- a/.github/workflows/breaking-change-validation.yml +++ b/.github/workflows/breaking-change-validation.yml @@ -22,6 +22,58 @@ jobs: name: Validate Breaking Change PR runs-on: ubuntu-latest steps: - - uses: ./.github/actions/breaking-pr-check - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Check PR title and body + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + async function getPullRequest() { + const pr = context.payload.pull_request; + if (!pr) { + throw new Error("This action can only be run on pull_request events."); + } + + const owner = pr.base.repo.owner.login; + const repo = pr.base.repo.name; + const pull_number = pr.number; + + const { data } = await github.rest.pulls.get({ + owner, + repo, + pull_number, + }); + + return data; + } + + function checkTitle(title) { + if (/^[a-z]+(\([a-z-]+\))?!: /.test(title)) { + throw new Error( + `Do not use exclamation mark ('!') to indicate breaking change in the PR Title.`, + ); + } + } + + function checkDescription(body, labels) { + if (!labels.some(label => label.name === 'breaking change')) { + return; + } + + const [firstLine, secondLine] = body.split(/\r?\n/); + + if (!firstLine || !/^BREAKING CHANGE:/.test(firstLine)) { + throw new Error( + `Breaking change PR body should start with "BREAKING CHANGE:". See https://typescript-eslint.io/maintenance/releases#2-merging-breaking-changes.`, + ); + } + + if (!secondLine) { + throw new Error( + `The description of breaking change is missing. See https://typescript-eslint.io/maintenance/releases#2-merging-breaking-changes.`, + ); + } + } + + const pr = await getPullRequest(); + checkTitle(pr.title); + checkDescription(pr.body ?? '', pr.labels); From 96792827ba7a922b461dc4c105e73f183f287bf6 Mon Sep 17 00:00:00 2001 From: JamesHenry Date: Wed, 3 Sep 2025 15:52:55 +0400 Subject: [PATCH 173/283] chore: permissions for cache cleanup --- .github/workflows/cleanup-cache.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cleanup-cache.yml b/.github/workflows/cleanup-cache.yml index e7ce232378c3..b57bcabcb3fc 100644 --- a/.github/workflows/cleanup-cache.yml +++ b/.github/workflows/cleanup-cache.yml @@ -9,6 +9,7 @@ on: # IMPORTANT: Minimal permissions necessary for this workflow to function permissions: actions: write + contents: write jobs: cleanup: From f9975aa70cdb4f2b5bb4ec8360ff55c4b9cccde0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 3 Sep 2025 15:54:00 +0400 Subject: [PATCH 174/283] chore(deps): update dependency @types/node to v22.18.0 (#11562) --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b1c732c57839..16472e11fb10 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5599,11 +5599,11 @@ __metadata: linkType: hard "@types/node@npm:^22.0.0": - version: 22.17.2 - resolution: "@types/node@npm:22.17.2" + version: 22.18.0 + resolution: "@types/node@npm:22.18.0" dependencies: undici-types: ~6.21.0 - checksum: 2a82f96abcf25104efa6e9b8231616e039e5e0854f07e9ce4fdf821d30eaac30a80ec3cafefb36d2af8bd7c9594cfda337887bd85bb5c2031ba0f7e23a3d588d + checksum: a110b66f079ea882be1e300e72978cd3a5e7be8217b362b72152e09f64087731a235a0557fca72d621912a8ba1347d9ba49468c35755dd2581edb7f3f6e016e2 languageName: node linkType: hard From c068a4fd12f23e4f31c4dd9c8676ba1a91d33eb0 Mon Sep 17 00:00:00 2001 From: Dima Date: Wed, 3 Sep 2025 16:34:18 +0100 Subject: [PATCH 175/283] fix(scope-manager): exclude Program from DefinitionBase node types (#11469) * fix: exclude Program from DefinitionBase node types * fix eslint * Add NodeWithParent type --------- Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com> --- .../src/rules/no-confusing-void-expression.ts | 17 +++++++++-------- .../src/util/collectUnusedVariables.ts | 10 ++++------ .../src/definition/DefinitionBase.ts | 4 ++-- .../ImplicitGlobalVariableDefinition.ts | 4 ++-- .../scope-manager/src/referencer/Reference.ts | 4 ++-- packages/types/src/ts-estree.ts | 1 + packages/utils/src/ts-estree.ts | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts b/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts index 1efacdaf5ae1..9534acef8ee2 100644 --- a/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts +++ b/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts @@ -1,4 +1,8 @@ -import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { + NodeWithParent, + TSESLint, + TSESTree, +} from '@typescript-eslint/utils'; import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'ts-api-utils'; @@ -300,8 +304,8 @@ export default createRule({ * @param node The void expression node to check. * @returns Invalid ancestor node if it was found. `null` otherwise. */ - function findInvalidAncestor(node: TSESTree.Node): InvalidAncestor | null { - const parent = nullThrows(node.parent, NullThrowsReasons.MissingParent); + function findInvalidAncestor(node: NodeWithParent): InvalidAncestor | null { + const parent = node.parent; if ( parent.type === AST_NODE_TYPES.SequenceExpression && node !== parent.expressions[parent.expressions.length - 1] @@ -365,17 +369,14 @@ export default createRule({ /** Checks whether the return statement is the last statement in a function body. */ function isFinalReturn(node: TSESTree.ReturnStatement): boolean { // the parent must be a block - const block = nullThrows(node.parent, NullThrowsReasons.MissingParent); + const block = node.parent; if (block.type !== AST_NODE_TYPES.BlockStatement) { // e.g. `if (cond) return;` (not in a block) return false; } // the block's parent must be a function - const blockParent = nullThrows( - block.parent, - NullThrowsReasons.MissingParent, - ); + const blockParent = block.parent; if ( ![ AST_NODE_TYPES.ArrowFunctionExpression, diff --git a/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/packages/eslint-plugin/src/util/collectUnusedVariables.ts index 983eb1472c14..3e7172e2ca45 100644 --- a/packages/eslint-plugin/src/util/collectUnusedVariables.ts +++ b/packages/eslint-plugin/src/util/collectUnusedVariables.ts @@ -438,8 +438,8 @@ function isMergableExported(variable: ScopeVariable): boolean { if ( (MERGABLE_TYPES.has(def.node.type) && - def.node.parent?.type === AST_NODE_TYPES.ExportNamedDeclaration) || - def.node.parent?.type === AST_NODE_TYPES.ExportDefaultDeclaration + def.node.parent.type === AST_NODE_TYPES.ExportNamedDeclaration) || + def.node.parent.type === AST_NODE_TYPES.ExportDefaultDeclaration ) { return true; } @@ -458,14 +458,12 @@ function isExported(variable: ScopeVariable): boolean { let node = definition.node; if (node.type === AST_NODE_TYPES.VariableDeclarator) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - node = node.parent!; + node = node.parent; } else if (definition.type === TSESLint.Scope.DefinitionType.Parameter) { return false; } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - return node.parent!.type.startsWith('Export'); + return node.parent.type.startsWith('Export'); }); } diff --git a/packages/scope-manager/src/definition/DefinitionBase.ts b/packages/scope-manager/src/definition/DefinitionBase.ts index de4260ea888d..87b9cfb0eea4 100644 --- a/packages/scope-manager/src/definition/DefinitionBase.ts +++ b/packages/scope-manager/src/definition/DefinitionBase.ts @@ -1,4 +1,4 @@ -import type { TSESTree } from '@typescript-eslint/types'; +import type { NodeWithParent, TSESTree } from '@typescript-eslint/types'; import type { DefinitionType } from './DefinitionType'; @@ -8,7 +8,7 @@ const generator = createIdGenerator(); export abstract class DefinitionBase< Type extends DefinitionType, - Node extends TSESTree.Node, + Node extends NodeWithParent, Parent extends TSESTree.Node | null, Name extends TSESTree.Node, > { diff --git a/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts b/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts index fa36527502c4..23bc4dedfd30 100644 --- a/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts +++ b/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts @@ -1,11 +1,11 @@ -import type { TSESTree } from '@typescript-eslint/types'; +import type { NodeWithParent, TSESTree } from '@typescript-eslint/types'; import { DefinitionBase } from './DefinitionBase'; import { DefinitionType } from './DefinitionType'; export class ImplicitGlobalVariableDefinition extends DefinitionBase< DefinitionType.ImplicitGlobalVariable, - TSESTree.Node, + NodeWithParent, null, TSESTree.BindingName > { diff --git a/packages/scope-manager/src/referencer/Reference.ts b/packages/scope-manager/src/referencer/Reference.ts index 6487f8ff36e4..f5d1d3549d9e 100644 --- a/packages/scope-manager/src/referencer/Reference.ts +++ b/packages/scope-manager/src/referencer/Reference.ts @@ -1,4 +1,4 @@ -import type { TSESTree } from '@typescript-eslint/types'; +import type { NodeWithParent, TSESTree } from '@typescript-eslint/types'; import type { Scope } from '../scope'; import type { Variable } from '../variable'; @@ -12,7 +12,7 @@ export enum ReferenceFlag { } export interface ReferenceImplicitGlobal { - node: TSESTree.Node; + node: NodeWithParent; pattern: TSESTree.BindingName; ref?: Reference; } diff --git a/packages/types/src/ts-estree.ts b/packages/types/src/ts-estree.ts index 1a43962b0231..33092006c987 100644 --- a/packages/types/src/ts-estree.ts +++ b/packages/types/src/ts-estree.ts @@ -251,3 +251,4 @@ declare module './generated/ast-spec' { } export * as TSESTree from './generated/ast-spec'; +export type NodeWithParent = Exclude; diff --git a/packages/utils/src/ts-estree.ts b/packages/utils/src/ts-estree.ts index 6c61253a1f05..41cb2bf119b9 100644 --- a/packages/utils/src/ts-estree.ts +++ b/packages/utils/src/ts-estree.ts @@ -1,11 +1,11 @@ // for convenience's sake - export the types directly from here so consumers // don't need to reference/install both packages in their code - export { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, } from '@typescript-eslint/types'; +export type { NodeWithParent } from '@typescript-eslint/types'; export type { ParserServices, From f0e64eb8b74a9a11a1aca59e1516daf3de6f9993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=AF=BC=EA=B0=90=EC=9E=90=28Minji=20Kim=29?= <68915238+mouse0429@users.noreply.github.com> Date: Thu, 4 Sep 2025 00:56:26 +0900 Subject: [PATCH 176/283] fix(eslint-plugin): [no-unnecessary-type-conversion] only report ~~ on integer literal types (#11517) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Josh Goldberg ✨ --- .../rules/no-unnecessary-type-conversion.ts | 52 ++++++++-- .../no-unnecessary-type-conversion.shot | 2 +- .../no-unnecessary-type-conversion.test.ts | 94 +++++++++++++++---- 3 files changed, 119 insertions(+), 29 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts index 09af31518b11..088b8768b3af 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts @@ -57,7 +57,7 @@ export default createRule({ typeFlag: ts.TypeFlags, typeString: 'boolean' | 'number', violation: string, - isDoubleOperator: boolean, // !! or ~~ + isDoubleOperator: boolean, // !! ) { const outerNode = isDoubleOperator ? node.parent : node; const type = services.getTypeAtLocation(node.argument); @@ -351,13 +351,49 @@ export default createRule({ 'UnaryExpression[operator = "~"] > UnaryExpression[operator = "~"]'( node: TSESTree.UnaryExpression, ): void { - handleUnaryOperator( - node, - ts.TypeFlags.NumberLike, - 'number', - 'Using ~~ on a number', - true, - ); + const outerNode = node.parent; + const type = services.getTypeAtLocation(node.argument); + + if ( + tsutils.unionConstituents(type).every(t => { + return ( + isTypeFlagSet(t, ts.TypeFlags.NumberLiteral) && + Number.isInteger((t as ts.NumberLiteralType).value) + ); + }) + ) { + const wrappingFixerParams = { + node: outerNode, + innerNode: [node.argument], + sourceCode: context.sourceCode, + }; + + context.report({ + loc: { + start: outerNode.loc.start, + end: { + column: node.loc.start.column + 1, + line: node.loc.start.line, + }, + }, + messageId: 'unnecessaryTypeConversion', + data: { type: 'number', violation: 'Using ~~ on an integer' }, + suggest: [ + { + messageId: 'suggestRemove', + fix: getWrappingFixer(wrappingFixerParams), + }, + { + messageId: 'suggestSatisfies', + data: { type: 'number' }, + fix: getWrappingFixer({ + ...wrappingFixerParams, + wrap: expr => `${expr} satisfies number`, + }), + }, + ], + }); + } }, }; }, diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unnecessary-type-conversion.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unnecessary-type-conversion.shot index 1231d273a43f..7d55981cea0f 100644 --- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unnecessary-type-conversion.shot +++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unnecessary-type-conversion.shot @@ -14,7 +14,7 @@ Number(123); +123; ~ Using the unary + operator on a number does not change the type or value of the number. ~~123; -~~ Using ~~ on a number does not change the type or value of the number. +~~ Using ~~ on an integer does not change the type or value of the number. Boolean(true); ~~~~~~~ Passing a boolean to Boolean() does not change the type or value of the boolean. diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts index e0aaadacee2d..50995fb3a90d 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts @@ -29,6 +29,10 @@ ruleTester.run('no-unnecessary-type-conversion', rule, { "Number('2');", "+'2';", "~~'2';", + '~~1.1;', + '~~-1.1;', + '~~(1.5 + 2.3);', + '~~(1 / 3);', 'Boolean(0);', '!!0;', 'BigInt(3);', @@ -578,26 +582,6 @@ let str = 'asdf'; }, ], }, - { - code: '2 * ~~(2 + 2);', - errors: [ - { - column: 5, - endColumn: 7, - messageId: 'unnecessaryTypeConversion', - suggestions: [ - { - messageId: 'suggestRemove', - output: '2 * (2 + 2);', - }, - { - messageId: 'suggestSatisfies', - output: '2 * ((2 + 2) satisfies number);', - }, - ], - }, - ], - }, { code: 'false && !!(false || true);', errors: [ @@ -720,5 +704,75 @@ let str = 'asdf'; }, ], }, + { + code: '~~1;', + errors: [ + { + column: 1, + endColumn: 3, + messageId: 'unnecessaryTypeConversion', + suggestions: [ + { + messageId: 'suggestRemove', + output: '1;', + }, + { + messageId: 'suggestSatisfies', + output: '1 satisfies number;', + }, + ], + }, + ], + }, + { + code: '~~-1;', + errors: [ + { + column: 1, + endColumn: 3, + messageId: 'unnecessaryTypeConversion', + suggestions: [ + { + messageId: 'suggestRemove', + output: '(-1);', + }, + { + messageId: 'suggestSatisfies', + output: '(-1) satisfies number;', + }, + ], + }, + ], + }, + { + code: ` + declare const threeOrFour: 3 | 4; + ~~threeOrFour; + `, + errors: [ + { + column: 9, + endColumn: 11, + line: 3, + messageId: 'unnecessaryTypeConversion', + suggestions: [ + { + messageId: 'suggestRemove', + output: ` + declare const threeOrFour: 3 | 4; + threeOrFour; + `, + }, + { + messageId: 'suggestSatisfies', + output: ` + declare const threeOrFour: 3 | 4; + threeOrFour satisfies number; + `, + }, + ], + }, + ], + }, ], }); From f77a31d44b7492bac23ca4ff3ad3f29aa7f6d7cf Mon Sep 17 00:00:00 2001 From: tao <2471314@gmail.com> Date: Fri, 5 Sep 2025 18:56:03 +0800 Subject: [PATCH 177/283] fix(eslint-plugin): [consistent-type-exports] fix declaration shadowing (#11457) fix type shadowing --- .../src/rules/consistent-type-exports.ts | 23 +++++++--------- .../rules/consistent-type-exports.test.ts | 26 +++++++++++++++++++ 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/packages/eslint-plugin/src/rules/consistent-type-exports.ts b/packages/eslint-plugin/src/rules/consistent-type-exports.ts index 324a622255d7..f70d59618514 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-exports.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-exports.ts @@ -1,7 +1,6 @@ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; -import * as tsutils from 'ts-api-utils'; import * as ts from 'typescript'; import { @@ -91,22 +90,18 @@ export default createRule({ function isSymbolTypeBased( symbol: ts.Symbol | undefined, ): boolean | undefined { - if (!symbol) { - return undefined; + while (symbol && symbol.flags & ts.SymbolFlags.Alias) { + symbol = checker.getAliasedSymbol(symbol); + if ( + symbol.getDeclarations()?.find(ts.isTypeOnlyImportOrExportDeclaration) + ) { + return true; + } } - - const aliasedSymbol = tsutils.isSymbolFlagSet( - symbol, - ts.SymbolFlags.Alias, - ) - ? checker.getAliasedSymbol(symbol) - : symbol; - - if (checker.isUnknownSymbol(aliasedSymbol)) { + if (!symbol || checker.isUnknownSymbol(symbol)) { return undefined; } - - return !(aliasedSymbol.flags & ts.SymbolFlags.Value); + return !(symbol.flags & ts.SymbolFlags.Value); } return { diff --git a/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts index 8508cd75ae77..b513411d676d 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts @@ -64,6 +64,11 @@ export { NonTypeNS }; "export type * as foo from './consistent-type-exports/type-only-exports';", "export type * as foo from './consistent-type-exports/type-only-reexport';", "export * as foo from './consistent-type-exports/value-reexport';", + ` +import * as Foo from './consistent-type-exports'; +type Foo = 1; +export { Foo } + `, ], invalid: [ { @@ -483,5 +488,26 @@ export { export type * as foo from './consistent-type-exports/type-only-reexport'; `, }, + { + code: ` + import type * as Foo from './consistent-type-exports'; + type Foo = 1; + export { Foo }; + `, + errors: [ + { + column: 9, + endColumn: 24, + endLine: 4, + line: 4, + messageId: 'typeOverValue', + }, + ], + output: ` + import type * as Foo from './consistent-type-exports'; + type Foo = 1; + export type { Foo }; + `, + }, ], }); From f780c1d5da41f5749b5384d7cf2eb4f3304a7c38 Mon Sep 17 00:00:00 2001 From: Nicolas Le Cam Date: Mon, 8 Sep 2025 16:04:29 +0200 Subject: [PATCH 178/283] fix(typescript-estree): match filenames starting with a period when using glob in allowDefaultProject (#11537)/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(typescript-estree): match filenames starting with a period when using glob in allowDefaultProject Signed-off-by: Nicolas Le Cam * Update packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts Co-authored-by: Josh Goldberg ✨ --------- Signed-off-by: Nicolas Le Cam Co-authored-by: Josh Goldberg ✨ --- .../src/useProgramFromProjectService.ts | 6 +++-- .../lib/useProgramFromProjectService.test.ts | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/packages/typescript-estree/src/useProgramFromProjectService.ts b/packages/typescript-estree/src/useProgramFromProjectService.ts index 9a046ee2c907..9a365029de02 100644 --- a/packages/typescript-estree/src/useProgramFromProjectService.ts +++ b/packages/typescript-estree/src/useProgramFromProjectService.ts @@ -1,4 +1,4 @@ -import type { ProjectServiceAndMetadata as ProjectServiceAndMetadata } from '@typescript-eslint/project-service'; +import type { ProjectServiceAndMetadata } from '@typescript-eslint/project-service'; import debug from 'debug'; import { minimatch } from 'minimatch'; @@ -316,5 +316,7 @@ function filePathMatchedBy( filePath: string, allowDefaultProject: string[] | undefined, ): boolean { - return !!allowDefaultProject?.some(pattern => minimatch(filePath, pattern)); + return !!allowDefaultProject?.some(pattern => + minimatch(filePath, pattern, { dot: true }), + ); } diff --git a/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts b/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts index e07add99d30e..48e62e1c39b6 100644 --- a/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts +++ b/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts @@ -624,4 +624,31 @@ If you absolutely need more files included, set parserOptions.projectService.max )}\`) is non-standard. It should be added to your existing \`parserOptions.extraFileExtensions\`.`, ); }); + + it('matches filenames starting with a period', () => { + const { service } = createMockProjectService(); + + const filePath = `.prettierrc.js`; + + const program = { getSourceFile: vi.fn() }; + + mockGetProgram.mockReturnValueOnce(program); + + service.openClientFile.mockReturnValueOnce({ + configFileName: 'tsconfig.json', + }); + mockCreateProjectProgram.mockReturnValueOnce(program); + + const actual = useProgramFromProjectService( + createProjectServiceSettings({ + allowDefaultProject: ['*.js'], + service, + }), + { ...mockParseSettings, filePath }, + false, + new Set(), + ); + + expect(actual).toBe(program); + }); }); From 5d15bc21fe6cabdd72e5c12161e01c3a98360eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=86=A1=EC=9E=AC=EC=9A=B1?= Date: Mon, 8 Sep 2025 23:06:57 +0900 Subject: [PATCH 179/283] fix(eslint-plugin): [no-floating-promises] allowForKnownSafeCalls now supports function names (fixes #11423) (#11430) * Chore: add test cases for no-floating-promises allowForKnownSafeCalls option Add test cases to verify that function name-based allowForKnownSafeCalls configuration works correctly for locally defined async functions. * Fix: no-floating-promises allowForKnownSafeCalls not working for function names (#11423) The allowForKnownSafeCalls option was only checking type-based matching and not value-based matching, causing function name specifications like ["myAsyncFunction"] to be ignored. Now properly checks both value and type matching using valueMatchesSomeSpecifier. * Chore: update docs and snapshots for no-floating-promises fix - Remove skipValidation from allowForKnownSafeCalls example - Update test snapshots after fixing function name matching * refactor: rename isKnownSafePromiseReturn -> isKnownSafePromiseCall --- .../docs/rules/no-floating-promises.mdx | 2 +- .../src/rules/no-floating-promises.ts | 16 +++++++++-- .../no-floating-promises.shot | 1 - .../tests/rules/no-floating-promises.test.ts | 28 +++++++++++++++++++ 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/no-floating-promises.mdx b/packages/eslint-plugin/docs/rules/no-floating-promises.mdx index 12bf7465b537..977b10b2a078 100644 --- a/packages/eslint-plugin/docs/rules/no-floating-promises.mdx +++ b/packages/eslint-plugin/docs/rules/no-floating-promises.mdx @@ -258,7 +258,7 @@ unsafe('...', () => {}); -```ts option='{"allowForKnownSafeCalls":[{"from":"file","name":"safe","path":"input.ts"}]}' skipValidation +```ts option='{"allowForKnownSafeCalls":[{"from":"file","name":"safe","path":"input.ts"}]}' declare function safe(...args: unknown[]): Promise; safe('...', () => {}); diff --git a/packages/eslint-plugin/src/rules/no-floating-promises.ts b/packages/eslint-plugin/src/rules/no-floating-promises.ts index 50965093ee98..32ecbe741681 100644 --- a/packages/eslint-plugin/src/rules/no-floating-promises.ts +++ b/packages/eslint-plugin/src/rules/no-floating-promises.ts @@ -16,6 +16,7 @@ import { readonlynessOptionsSchema, skipChainExpression, typeMatchesSomeSpecifier, + valueMatchesSomeSpecifier, } from '../util'; import { parseCatchCall, @@ -142,7 +143,7 @@ export default createRule({ const expression = skipChainExpression(node.expression); - if (isKnownSafePromiseReturn(expression)) { + if (isKnownSafePromiseCall(expression)) { return; } @@ -235,13 +236,24 @@ export default createRule({ ]; } - function isKnownSafePromiseReturn(node: TSESTree.Node): boolean { + function isKnownSafePromiseCall(node: TSESTree.Node): boolean { if (node.type !== AST_NODE_TYPES.CallExpression) { return false; } const type = services.getTypeAtLocation(node.callee); + if ( + valueMatchesSomeSpecifier( + node.callee, + allowForKnownSafeCalls, + services.program, + type, + ) + ) { + return true; + } + return typeMatchesSomeSpecifier( type, allowForKnownSafeCalls, diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-floating-promises.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-floating-promises.shot index 8cdd60d375d6..9a5130ce0c07 100644 --- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-floating-promises.shot +++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-floating-promises.shot @@ -135,4 +135,3 @@ Options: {"allowForKnownSafeCalls":[{"from":"file","name":"safe","path":"input.t declare function safe(...args: unknown[]): Promise; safe('...', () => {}); -~~~~~~~~~~~~~~~~~~~~~~ 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. diff --git a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts index 3c5dc458476d..e2a272f6f3dc 100644 --- a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts +++ b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts @@ -868,6 +868,34 @@ declare function createMyThenable(): MyThenable; createMyThenable(); `, + { + code: ` +const randomAsyncFunction = async () => { + return Promise.resolve(true); +}; + +randomAsyncFunction(); + `, + options: [ + { + allowForKnownSafeCalls: ['randomAsyncFunction'], + }, + ], + }, + { + code: ` +async function myAsyncFunction() { + return Promise.resolve('test'); +} + +myAsyncFunction(); + `, + options: [ + { + allowForKnownSafeCalls: ['myAsyncFunction'], + }, + ], + }, ], invalid: [ From b44fde88c76b4e1c27a0263af82fb040903bc35d Mon Sep 17 00:00:00 2001 From: Nicolas Le Cam Date: Mon, 8 Sep 2025 16:07:27 +0200 Subject: [PATCH 180/283] chore: enable ESLint no-useless-rename rule on project (#11576) chore: enable no-useless-rename rule on project Signed-off-by: Nicolas Le Cam --- eslint.config.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint.config.mjs b/eslint.config.mjs index 3e5efbf853cd..6f0bc78c5100 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -242,6 +242,7 @@ export default defineConfig( 'no-useless-call': 'error', 'no-useless-computed-key': 'error', 'no-useless-concat': 'error', + 'no-useless-rename': 'error', 'no-var': 'error', 'no-void': ['error', { allowAsStatement: true }], 'object-shorthand': 'error', From 8154204f1235ce33d13b57d265674f80fd48f90c Mon Sep 17 00:00:00 2001 From: Younsang Na <77400131+nayounsang@users.noreply.github.com> Date: Mon, 8 Sep 2025 23:07:49 +0900 Subject: [PATCH 181/283] docs: mark rules that are frozen on rules index page (#11467) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: mark these rule as frozen * docs: add section for frozen * docs: show snowflake for frozen rule in rule table * docs: section for frozen info in the rule * chore: generate config * feat: add frozen property at docs meta data * Revert "feat: mark these rule as frozen" This reverts commit 3447143ccb8991b6ef5fbe5b2e68f905a7631750. * feat: mark these rule as frozen with frozen property * Revert "chore: generate config" This reverts commit 081c034df75f29ff0259d59d91c682bae8341b01. * docs: mark as frozen with emoji on rule docs * fix: lint * fix: use inline flex * refactor: JSDoc more info * Update packages/utils/src/ts-eslint/Rule.ts --------- Co-authored-by: Josh Goldberg ✨ --- packages/eslint-plugin/docs/rules/README.md | 13 +++++++++++++ .../eslint-plugin/src/rules/default-param-last.ts | 1 + packages/eslint-plugin/src/rules/dot-notation.ts | 1 + .../eslint-plugin/src/rules/init-declarations.ts | 1 + packages/eslint-plugin/src/rules/member-ordering.ts | 1 + .../eslint-plugin/src/rules/naming-convention.ts | 1 + .../eslint-plugin/src/rules/no-magic-numbers.ts | 1 + .../eslint-plugin/src/rules/prefer-destructuring.ts | 1 + packages/utils/src/ts-eslint/Rule.ts | 5 +++++ .../website/src/components/RulesTable/index.tsx | 9 ++++++--- .../src/components/RulesTable/styles.module.css | 6 ++++++ .../src/theme/MDXComponents/RuleAttributes.tsx | 12 ++++++++++++ 12 files changed, 49 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md index 75c5723d748a..1cb9c5435fa1 100644 --- a/packages/eslint-plugin/docs/rules/README.md +++ b/packages/eslint-plugin/docs/rules/README.md @@ -55,3 +55,16 @@ module.exports = { ``` [Search for `🧱 extension rule`s](?=extension#rules) in this page to see all extension rules. + +## Frozen Rules + +When rules are feature complete, they are marked as frozen (indicated with ❄️ in the documentation). This applies to standalone rules that are complete, as well as [extension rules](#extension-rules) whose underlying core ESLint rules are frozen. After that point, we expect users to use [disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) when they find an edge case that isn’t covered. + +When a rule is frozen, it means: + +- **Bug fixes**: We will still fix confirmed bugs. +- **New ECMAScript features**: We will ensure compatibility with new ECMAScript features, meaning the rule will not break on new syntax. +- **TypeScript support**: We will ensure compatibility with TypeScript syntax, meaning the rule will not break on TypeScript syntax and violations are appropriate for TypeScript. +- **New options**: We will not add any new options unless an option is the only way to fix a bug or support a newly-added ECMAScript feature. + +If you find that a frozen rule would work better for you with a change, we recommend copying the rule source code and modifying it to fit your needs. diff --git a/packages/eslint-plugin/src/rules/default-param-last.ts b/packages/eslint-plugin/src/rules/default-param-last.ts index 1d120720d26c..edfa85842df8 100644 --- a/packages/eslint-plugin/src/rules/default-param-last.ts +++ b/packages/eslint-plugin/src/rules/default-param-last.ts @@ -11,6 +11,7 @@ export default createRule({ docs: { description: 'Enforce default parameters to be last', extendsBaseRule: true, + frozen: true, }, messages: { shouldBeLast: 'Default parameters should be last.', diff --git a/packages/eslint-plugin/src/rules/dot-notation.ts b/packages/eslint-plugin/src/rules/dot-notation.ts index 82e164df1cf5..98caa79f7328 100644 --- a/packages/eslint-plugin/src/rules/dot-notation.ts +++ b/packages/eslint-plugin/src/rules/dot-notation.ts @@ -35,6 +35,7 @@ export default createRule({ docs: { description: 'Enforce dot notation whenever possible', extendsBaseRule: true, + frozen: true, recommended: 'stylistic', requiresTypeChecking: true, }, diff --git a/packages/eslint-plugin/src/rules/init-declarations.ts b/packages/eslint-plugin/src/rules/init-declarations.ts index 16b3f87e713c..fafc9a404f12 100644 --- a/packages/eslint-plugin/src/rules/init-declarations.ts +++ b/packages/eslint-plugin/src/rules/init-declarations.ts @@ -24,6 +24,7 @@ export default createRule({ description: 'Require or disallow initialization in variable declarations', extendsBaseRule: true, + frozen: true, }, hasSuggestions: baseRule.meta.hasSuggestions, messages: baseRule.meta.messages, diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index 7ae9ec7627cf..f930292bf3f2 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -728,6 +728,7 @@ export default createRule({ type: 'suggestion', docs: { description: 'Require a consistent member declaration order', + frozen: true, }, messages: { incorrectGroupOrder: diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index 839f3e0a1c98..17ba46233b45 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -70,6 +70,7 @@ export default createRule({ description: 'Enforce naming conventions for everything across a codebase', // technically only requires type checking if the user uses "type" modifiers + frozen: true, requiresTypeChecking: true, }, messages: { diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts index 6ecddefd0645..04b48b3a1daa 100644 --- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts +++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts @@ -53,6 +53,7 @@ export default createRule({ docs: { description: 'Disallow magic numbers', extendsBaseRule: true, + frozen: true, }, messages: baseRule.meta.messages, schema: [schema], diff --git a/packages/eslint-plugin/src/rules/prefer-destructuring.ts b/packages/eslint-plugin/src/rules/prefer-destructuring.ts index a3afb125a301..40c0de88ba40 100644 --- a/packages/eslint-plugin/src/rules/prefer-destructuring.ts +++ b/packages/eslint-plugin/src/rules/prefer-destructuring.ts @@ -76,6 +76,7 @@ export default createRule({ docs: { description: 'Require destructuring from arrays and/or objects', extendsBaseRule: true, + frozen: true, requiresTypeChecking: true, }, fixable: baseRule.meta.fixable, diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 3b40254b0a6e..49e461b89934 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -25,6 +25,11 @@ export interface RuleMetaDataDocs { * The URL of the rule's docs. */ url?: string; + + /** + * Mark this rule as feature-frozen. + */ + frozen?: boolean; } export interface ExternalSpecifier { diff --git a/packages/website/src/components/RulesTable/index.tsx b/packages/website/src/components/RulesTable/index.tsx index 6f25e27e951d..68315eb926c9 100644 --- a/packages/website/src/components/RulesTable/index.tsx +++ b/packages/website/src/components/RulesTable/index.tsx @@ -55,9 +55,12 @@ function RuleRow({ return (
- - @typescript-eslint/{rule.name} - +
+ + @typescript-eslint/{rule.name} + + {rule.docs.frozen && ❄️} +

{interpolateCode(rule.docs.description)}