From 9fc7d194062f4b8e6940af86367c65243e6e5690 Mon Sep 17 00:00:00 2001 From: Gilmore Davidson <gilmoreorless@gmail.com> Date: Mon, 5 Aug 2024 19:34:43 +1000 Subject: [PATCH] fix(presets): Add typescript-eslint top-level package to eslint preset (#30585) --- lib/config/presets/__snapshots__/index.spec.ts.snap | 3 +++ lib/config/presets/index.spec.ts | 7 ++++--- lib/config/presets/internal/packages.ts | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/config/presets/__snapshots__/index.spec.ts.snap b/lib/config/presets/__snapshots__/index.spec.ts.snap index 433ee0a7f9..8b6669ff81 100644 --- a/lib/config/presets/__snapshots__/index.spec.ts.snap +++ b/lib/config/presets/__snapshots__/index.spec.ts.snap @@ -123,6 +123,7 @@ exports[`config/presets/index resolvePreset resolves eslint 1`] = ` "@eslint/**", "@types/eslint__**", "@typescript-eslint/**", + "typescript-eslint", "eslint**", ], } @@ -141,6 +142,7 @@ exports[`config/presets/index resolvePreset resolves linters 1`] = ` "@eslint/**", "@types/eslint__**", "@typescript-eslint/**", + "typescript-eslint", "eslint**", "friendsofphp/php-cs-fixer", "squizlabs/php_codesniffer", @@ -174,6 +176,7 @@ exports[`config/presets/index resolvePreset resolves nested groups 1`] = ` "@eslint/**", "@types/eslint__**", "@typescript-eslint/**", + "typescript-eslint", "eslint**", "friendsofphp/php-cs-fixer", "squizlabs/php_codesniffer", diff --git a/lib/config/presets/index.spec.ts b/lib/config/presets/index.spec.ts index 8443eea157..4e550fb892 100644 --- a/lib/config/presets/index.spec.ts +++ b/lib/config/presets/index.spec.ts @@ -248,6 +248,7 @@ describe('config/presets/index', () => { '@eslint/**', '@types/eslint__**', '@typescript-eslint/**', + 'typescript-eslint', 'eslint**', ], }, @@ -259,14 +260,14 @@ describe('config/presets/index', () => { config.extends = ['packages:eslint']; const res = await presets.resolveConfigPresets(config); expect(res).toMatchSnapshot(); - expect(res.matchPackageNames).toHaveLength(7); + expect(res.matchPackageNames).toHaveLength(8); }); it('resolves linters', async () => { config.extends = ['packages:linters']; const res = await presets.resolveConfigPresets(config); expect(res).toMatchSnapshot(); - expect(res.matchPackageNames).toHaveLength(17); + expect(res.matchPackageNames).toHaveLength(18); }); it('resolves nested groups', async () => { @@ -275,7 +276,7 @@ describe('config/presets/index', () => { expect(res).toMatchSnapshot(); const rule = res.packageRules![0]; expect(rule.automerge).toBeTrue(); - expect(rule.matchPackageNames).toHaveLength(17); + expect(rule.matchPackageNames).toHaveLength(18); }); it('migrates automerge in presets', async () => { diff --git a/lib/config/presets/internal/packages.ts b/lib/config/presets/internal/packages.ts index 1056e63497..20ddc9de38 100644 --- a/lib/config/presets/internal/packages.ts +++ b/lib/config/presets/internal/packages.ts @@ -29,6 +29,7 @@ export const presets: Record<string, Preset> = { '@eslint/**', '@types/eslint__**', '@typescript-eslint/**', + 'typescript-eslint', 'eslint**', ], }, -- GitLab