Skip to content

Commit 488034c

Browse files
committed
docs: use defineConfig helper from ESLint >= 9.22
1 parent c3f42b4 commit 488034c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ Please also make sure that you have `prettier` and `eslint` installed.
2424
Import `@vue/eslint-config-prettier` in `eslint.config.js` (or `eslint.config.mjs`), and put it in the configuration array – **after** other configs that you want to override.
2525

2626
```js
27+
import { defineConfig } from "eslint/config";
2728
import someConfig from "some-other-config-you-use";
2829
import prettierConfig from "@vue/eslint-config-prettier";
2930

30-
export default [someConfig, prettierConfig];
31+
export default defineConfig([someConfig, prettierConfig]);
3132
```
3233

3334
Make sure to put it **last**, so it gets the chance to override other configs.
@@ -49,10 +50,11 @@ Running prettier inside the linter slows down the linting process, might clutter
4950
So we offered an additional ruleset to support this workflow:
5051

5152
```js
53+
import { defineConfig } from "eslint/config";
5254
import someConfig from "some-other-config-you-use";
5355
import skipFormattingConfig from "@vue/eslint-config-prettier/skip-formatting";
5456

55-
export default [someConfig, skipFormattingConfig];
57+
export default defineConfig([someConfig, skipFormattingConfig]);
5658
```
5759

5860
Formatting issues won't be reported with this config.

eslint.config.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { defineConfig } from "eslint/config";
12
import skipFormattingConfig from "./skip-formatting.js";
23

3-
export default [
4+
export default defineConfig([
45
{
56
name: "app/files-to-lint",
67
files: ["*.js"],
78
},
9+
810
skipFormattingConfig
9-
];
11+
]);

0 commit comments

Comments
 (0)