From b2fb1b3c3ae9cf58850031c767f8c958465ad9cc Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 29 Aug 2024 13:22:14 +0200 Subject: [PATCH] feat!: require ESLint v9.5+ --- README.md | 4 +++- package.json | 4 ++-- pnpm-lock.yaml | 13 ++++++++----- src/configs/ignores.ts | 1 + src/factory.ts | 10 ++++++++-- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2984217414..c7806125ea 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,12 @@ - Single quotes, no semi - Using [ESLint Stylistic](https://github.com/eslint-stylistic/eslint-stylistic) - Respects `.gitignore` by default -- Supports ESLint v9 or v8.50.0+ +- Requires ESLint v9.5.0+ > [!IMPORTANT] > Since v1.0.0, this config is rewritten to the new [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new), check the [release note](https://github.com/antfu/eslint-config/releases/tag/v1.0.0) for more details. +> +> Since v3.0.0, ESLint v9.5.0+ is now required. ## Usage diff --git a/package.json b/package.json index 69169ba3e6..4955cebc0b 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "@prettier/plugin-xml": "^3.4.1", "@unocss/eslint-plugin": ">=0.50.0", "astro-eslint-parser": "^1.0.2", - "eslint": ">=8.40.0", + "eslint": "^9.5.0", "eslint-plugin-astro": "^1.2.0", "eslint-plugin-format": ">=0.1.0", "eslint-plugin-react-hooks": "^4.6.0", @@ -103,7 +103,7 @@ "@typescript-eslint/eslint-plugin": "^8.3.0", "@typescript-eslint/parser": "^8.3.0", "@vitest/eslint-plugin": "^1.1.0", - "eslint-config-flat-gitignore": "^0.2.0", + "eslint-config-flat-gitignore": "^0.3.0", "eslint-flat-config-utils": "^0.3.1", "eslint-merge-processors": "^0.1.0", "eslint-plugin-antfu": "^2.3.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 91221799e1..f845a74863 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,8 +36,8 @@ importers: specifier: ^1.1.0 version: 1.1.0(@typescript-eslint/utils@8.3.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4)(vitest@2.0.5(@types/node@22.5.1)) eslint-config-flat-gitignore: - specifier: ^0.2.0 - version: 0.2.0 + specifier: ^0.3.0 + version: 0.3.0(eslint@9.9.1(jiti@1.21.6)) eslint-flat-config-utils: specifier: ^0.3.1 version: 0.3.1 @@ -1624,8 +1624,10 @@ packages: peerDependencies: eslint: ^9.9.1 - eslint-config-flat-gitignore@0.2.0: - resolution: {integrity: sha512-s4lsQLYX+76FCt3PZPwdLwWlqssa5SLufl2gopFmCo3PETOLY3OW5IrD3/l2R0FfYEJvd9BRJ19yJ+yfc5oW3g==} + eslint-config-flat-gitignore@0.3.0: + resolution: {integrity: sha512-0Ndxo4qGhcewjTzw52TK06Mc00aDtHNTdeeW2JfONgDcLkRO/n/BteMRzNVpLQYxdCC/dFEilfM9fjjpGIJ9Og==} + peerDependencies: + eslint: ^9.9.1 eslint-flat-config-utils@0.3.1: resolution: {integrity: sha512-eFT3EaoJN1hlN97xw4FIEX//h0TiFUobgl2l5uLkIwhVN9ahGq95Pbs+i1/B5UACA78LO3rco3JzuvxLdTUOPA==} @@ -4747,9 +4749,10 @@ snapshots: eslint: 9.9.1(jiti@1.21.6) semver: 7.6.3 - eslint-config-flat-gitignore@0.2.0: + eslint-config-flat-gitignore@0.3.0(eslint@9.9.1(jiti@1.21.6)): dependencies: '@eslint/compat': 1.1.1 + eslint: 9.9.1(jiti@1.21.6) find-up-simple: 1.0.0 eslint-flat-config-utils@0.3.1: diff --git a/src/configs/ignores.ts b/src/configs/ignores.ts index 3729e52fba..830fd68706 100644 --- a/src/configs/ignores.ts +++ b/src/configs/ignores.ts @@ -8,6 +8,7 @@ export async function ignores(userIgnores: string[] = []): Promise [r(enableGitignore)])) + configs.push(interopDefault(import('eslint-config-flat-gitignore')).then(r => [r({ + name: 'antfu/gitignore', + ...enableGitignore, + })])) } else { - configs.push(interopDefault(import('eslint-config-flat-gitignore')).then(r => [r({ strict: false })])) + configs.push(interopDefault(import('eslint-config-flat-gitignore')).then(r => [r({ + name: 'antfu/gitignore', + strict: false, + })])) } }