From 1c0ce9acf1cf092a61e00d84fece98b1b68ffb15 Mon Sep 17 00:00:00 2001 From: injurka Date: Tue, 12 Mar 2024 17:52:54 +0300 Subject: [PATCH] fix: cli-suggest-remove-files --- src/cli/run.ts | 3 ++- test/cli.spec.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cli/run.ts b/src/cli/run.ts index 0d4fd43cb3..a7f0d55ae8 100644 --- a/src/cli/run.ts +++ b/src/cli/run.ts @@ -99,7 +99,8 @@ module.exports = antfu({\n${antfuConfig}\n}) const files = fs.readdirSync(cwd) const legacyConfig: string[] = [] files.forEach((file) => { - if (file.includes('eslint') || file.includes('prettier')) + if (/eslint|prettier/.test(file) + && !/eslint.config./.test(file)) legacyConfig.push(file) }) if (legacyConfig.length) { diff --git a/test/cli.spec.ts b/test/cli.spec.ts index 04604bd00f..1ae995f0e5 100644 --- a/test/cli.spec.ts +++ b/test/cli.spec.ts @@ -86,5 +86,5 @@ it('suggest remove unnecessary files', async () => { const { stdout } = await run() expect(stdout).toContain('you can now remove those files manually') - expect(stdout).toContain('.eslintignore, .eslintrc.yml, .prettierc, .prettierignore, eslint.config.js') + expect(stdout).toContain('.eslintignore, .eslintrc.yml, .prettierc, .prettierignore') })