Skip to content

Commit ed7c44d

Browse files
authored
docs: Use ESLint defineConfig and extends (#402)
Since [March of this year](https://eslint.org/blog/2025/03/flat-config-extends-define-config-global-ignores/#bringing-back-extends), ESLint supports and [recommends](https://eslint.org/docs/latest/use/configure/configuration-files#extending-configurations) using `defineConfig` and `extends` for flat configurations (instead of having to manually spread the pieces of the configuration).
1 parent c0937d7 commit ed7c44d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ file patterns.
3838
(**eslint.config.js**)
3939

4040
```javascript
41+
import { defineConfig } from '@eslint/config'
4142
import playwright from 'eslint-plugin-playwright'
4243

43-
export default [
44+
export default defineConfig([
4445
{
45-
...playwright.configs['flat/recommended'],
4646
files: ['tests/**'],
47+
extends: [playwright.configs['flat/recommended']],
4748
rules: {
48-
...playwright.configs['flat/recommended'].rules,
4949
// Customize Playwright rules
5050
// ...
5151
},
5252
},
53-
]
53+
])
5454
```
5555

5656
[Legacy config](https://eslint.org/docs/latest/use/configure/configuration-files)

0 commit comments

Comments
 (0)