Skip to content

Commit

Permalink
feat!: require ESLint v9.5+
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Aug 29, 2024
1 parent 91cc1bf commit b2fb1b3
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
13 changes: 8 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/configs/ignores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export async function ignores(userIgnores: string[] = []): Promise<TypedFlatConf
...GLOB_EXCLUDE,
...userIgnores,
],
name: 'antfu/ignores',
},
]
}
10 changes: 8 additions & 2 deletions src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,16 @@ export function antfu(

if (enableGitignore) {
if (typeof enableGitignore !== 'boolean') {
configs.push(interopDefault(import('eslint-config-flat-gitignore')).then(r => [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,
})]))
}
}

Expand Down

0 comments on commit b2fb1b3

Please sign in to comment.