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
> This is currently an experimental feature and may have bugs. To enable it, pass the `--experimental-nested-config` option in the command-line.
257
-
258
-
It is possible to have multiple configuration files within the same project, and Oxlint will automatically detect the presence of these files and use them in addition to the top-level configuration file. The files must be named `.oxlintrc.json` for this to work.
259
-
260
-
For example, consider the following project structure:
261
-
262
-
```
263
-
my-project/
264
-
├── .oxlintrc.json
265
-
├── src/
266
-
│ ├── index.js
267
-
├── package1/
268
-
│ ├── .oxlintrc.json
269
-
│ └── index.js
270
-
└── package2/
271
-
├── .oxlintrc.json
272
-
└── index.js
273
-
```
274
-
275
-
Oxlint will always use the nearest configuration file to the file currently being processed and use that for linting. In the example hierarchy above, that means:
276
-
277
-
-`src/index.js` will be linted using `my-project/.oxlintrc.json`
278
-
-`package1/index.js` will be linted using `my-project/package1/.oxlintrc.json`
279
-
-`package2/index.js` will be linted using `my-project/package2/.oxlintrc.json`
280
-
281
-
Configuration files are not automatically merged, and the configuration in a child configuration file will not affect the parent configuration. However, options passed in the command-line will override any configuration file, regardless of whether it is in the parent or child directory. In addition, using the `--config` option to specify a singular file for configuration will disable the use of nested configuration files.
282
-
283
-
## Extending configuration files
284
-
285
-
Files can use configuration from other files by using the `extends` property in a configuration file. The value of the `extends` property is an array of file paths to other configuration files, which are resolved relative to the location of the configuration file. Files may be called anything and do not need to be called `.oxlintrc.json`, but still need to be valid JSON configuration files.
286
-
287
-
```jsonc
288
-
// oxlint-typescript.json
289
-
{
290
-
"plugins": ["typescript"],
291
-
"rules": {
292
-
"typescript/no-explicit-any":"error"
293
-
}
294
-
}
295
-
// .oxlintrc.json
296
-
{
297
-
"extends": ["oxlint-typescript.json"],
298
-
"rules": {
299
-
"no-unused-vars":"warn"
300
-
}
301
-
}
302
-
```
303
-
304
-
Not all properties can be extended, but the following properties are supported:
> This is currently an experimental feature and may have bugs. To enable it, pass the `--experimental-nested-config` option in the command-line.
12
+
13
+
It is possible to have multiple configuration files within the same project, and Oxlint will automatically detect the presence of these files and use them in addition to the top-level configuration file. The files must be named `.oxlintrc.json` for this to work.
14
+
15
+
For example, consider the following project structure:
16
+
17
+
```
18
+
my-project/
19
+
├── .oxlintrc.json
20
+
├── src/
21
+
│ ├── index.js
22
+
├── package1/
23
+
│ ├── .oxlintrc.json
24
+
│ └── index.js
25
+
└── package2/
26
+
├── .oxlintrc.json
27
+
└── index.js
28
+
```
29
+
30
+
Oxlint will always use the nearest configuration file to the file currently being processed and use that for linting. In the example hierarchy above, that means:
31
+
32
+
-`src/index.js` will be linted using `my-project/.oxlintrc.json`
33
+
-`package1/index.js` will be linted using `my-project/package1/.oxlintrc.json`
34
+
-`package2/index.js` will be linted using `my-project/package2/.oxlintrc.json`
35
+
36
+
Configuration files are not automatically merged, and the configuration in a child configuration file will not affect the parent configuration. However, options passed in the command-line will override any configuration file, regardless of whether it is in the parent or child directory. In addition, using the `--config` option to specify a singular file for configuration will disable the use of nested configuration files.
37
+
38
+
## Extending configuration files
39
+
40
+
Files can use configuration from other files by using the `extends` property in a configuration file. The value of the `extends` property is an array of file paths to other configuration files, which are resolved relative to the location of the configuration file. Files may be called anything and do not need to be called `.oxlintrc.json`, but still need to be valid JSON configuration files.
41
+
42
+
```jsonc
43
+
// oxlint-typescript.json
44
+
{
45
+
"plugins": ["typescript"],
46
+
"rules": {
47
+
"typescript/no-explicit-any":"error"
48
+
}
49
+
}
50
+
// .oxlintrc.json
51
+
{
52
+
"extends": ["oxlint-typescript.json"],
53
+
"rules": {
54
+
"no-unused-vars":"warn"
55
+
}
56
+
}
57
+
```
58
+
59
+
Not all properties can be extended, but the following properties are supported:
0 commit comments