You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/1.packages/0.module.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ All-in-one ESLint integration for Nuxt. It generates a project-aware [ESLint fla
7
7
:::callout{icon="i-ph-lightbulb-duotone"}
8
8
This module is designed for the [new ESLint flat config format](https://eslint.org/docs/latest/use/configure/configuration-files-new) which is the [default format since ESLint v9](https://eslint.org/blog/2024/04/eslint-v9.0.0-released/). Flat config is supported since ESLint v8.45.0 so you can use any version of ESLint later than that. We recommend you to use the latest version of ESLint to get the best experience.
9
9
<br><br>
10
-
The legacy `.eslintrc` config is **not supported** by this module. We highly recommend you to migrate over the flat config to be future-proof. If you still want to use the legacy format, you might need to manually config with [`@nuxt/eslint-config`](/packages/config), which will missing some features like project-aware settings tho.
10
+
The legacy `.eslintrc` config is **not supported** by this module. We highly recommend you to migrate over the flat config to be future-proof.
Copy file name to clipboardExpand all lines: docs/content/1.packages/1.config.md
+8-55
Original file line number
Diff line number
Diff line change
@@ -18,16 +18,9 @@ Source code on GitHub
18
18
::
19
19
20
20
21
-
## Config Formats
21
+
## Configurations
22
22
23
-
This package provides two different ESLint configs:
24
-
25
-
-[Flat Config](#flat-config-format) - Customizable future-proof config for the [new flat config format](https://eslint.org/docs/latest/use/configure/configuration-files-new).
26
-
-[Legacy Config](#legacy-config-format) - Unopinionated static config for the legacy `.eslintrc` format.
27
-
28
-
## Flat Config Format
29
-
30
-
The flat config format is the future of ESLint and is designed to be more flexible and project-aware. The entry `@nuxt/eslint-config/flat` provides a factory function to create a project-aware ESLint config for Nuxt 3 projects. It is unopinionated by default but customizable by passing options to the factory function. Used by [`@nuxt/eslint`](/packages/module) module to generate project-aware ESLint config.
23
+
Since version v1.0, we provide in the flat config format. The entry `@nuxt/eslint-config` provides a factory function to create a project-aware ESLint config for Nuxt 3 projects. It is unopinionated by default but customizable by passing options to the factory function. Used by [`@nuxt/eslint`](/packages/module) module to generate project-aware ESLint config.
31
24
32
25
1. Install this package and `eslint` in your `devDependencies`.
33
26
@@ -46,10 +39,10 @@ bun add -D @nuxt/eslint-config eslint
46
39
```
47
40
::
48
41
49
-
2. Import the config factory function from `@nuxt/eslint-config/flat` entry in your `eslint.config.mjs`:
42
+
2. Import the config factory function from `@nuxt/eslint-config` entry in your `eslint.config.mjs`:
@@ -71,7 +64,7 @@ You might also want to add a script entry to your `package.json`:
71
64
Note that `createConfigForNuxt()` returns a chainable [`FlatConfigComposer` instance](https://github.com/antfu/eslint-flat-config-utils#composer) from [`eslint-flat-config-utils`](https://github.com/antfu/eslint-flat-config-utils) which allows you to manipulate the ESLint flat config with ease. If you want to combine with other configs, you can use the `.append()` method:
The legacy config configures TypeScript and Vue integration for ESLint. It is unopinionated and static, and does not contains stylistic rules or project-aware settings.
131
-
132
-
1. Install this package and `eslint` in your `devDependencies`.
133
-
134
-
::code-group
135
-
```bash [yarn]
136
-
yarn add --dev @nuxt/eslint-config eslint
137
-
```
138
-
```bash [npm]
139
-
npm install --save-dev @nuxt/eslint-config eslint
140
-
```
141
-
```bash [pnpm]
142
-
pnpm add -D @nuxt/eslint-config eslint
143
-
```
144
-
```bash [bun]
145
-
bun add -D @nuxt/eslint-config eslint
146
-
```
147
-
::
148
-
149
-
2. Extend the default Nuxt config by creating an `.eslintrc.cjs`:
150
-
151
-
```js [.eslintrc.cjs]
152
-
module.exports= {
153
-
root:true,
154
-
extends: ["@nuxt/eslint-config"],
155
-
};
156
-
```
157
-
158
-
You might also want to add a script entry to your `package.json`:
159
-
160
-
```json [package.json]
161
-
{
162
-
"scripts": {
163
-
"lint": "eslint ."
164
-
}
165
-
}
166
-
```
167
-
168
121
## ESLint Stylistic
169
122
170
123
Similar to the [ESLint Module](https://eslint.nuxt.com/packages/module#eslint-stylistic), you can opt-in by setting `stylistic` to `true` in the `features` module options.
0 commit comments