File tree Expand file tree Collapse file tree 2 files changed +30
-9
lines changed Expand file tree Collapse file tree 2 files changed +30
-9
lines changed Original file line number Diff line number Diff line change @@ -21,24 +21,26 @@ npm install eslint-plugin-<%= pluginId %> --save-dev
21
21
In your [ configuration file] ( https://eslint.org/docs/latest/use/configure/configuration-files#configuration-file ) , import the plugin ` eslint-plugin-<%= pluginId %> ` and add ` <%= pluginId %> ` to the ` plugins ` key:
22
22
23
23
``` js
24
+ import { defineConfig } from " eslint/config" ;
24
25
import <%= pluginId %> from " eslint-plugin-<%= pluginId %>" ;
25
26
26
- export default [
27
+ export default defineConfig ( [
27
28
{
28
29
plugins: {
29
30
< %= pluginId % >
30
31
}
31
32
}
32
- ];
33
+ ]) ;
33
34
```
34
35
35
36
<% if (hasRules) { %>
36
37
Then configure the rules you want to use under the ` rules ` key.
37
38
38
39
``` js
40
+ import { defineConfig } from " eslint/config" ;
39
41
import <%= pluginId %> from " eslint-plugin-<%= pluginId %>" ;
40
42
41
- export default [
43
+ export default defineConfig ( [
42
44
{
43
45
plugins: {
44
46
< %= pluginId % >
@@ -47,7 +49,7 @@ export default [
47
49
" <%= pluginId %>/rule-name" : " warn"
48
50
}
49
51
}
50
- ];
52
+ ]) ;
51
53
```
52
54
53
55
<% } %>
Original file line number Diff line number Diff line change
1
+ import { defineConfig } from "eslint/config" ;
1
2
import pluginJs from "@eslint/js" ;
2
3
import pluginNode from "eslint-plugin-n" ;
3
4
import eslintPlugin from "eslint-plugin-eslint-plugin" ;
4
5
5
- export default [
6
- pluginJs . configs . recommended ,
7
- ...pluginNode . configs [ "flat/mixed-esm-and-cjs" ] ,
8
- eslintPlugin . configs [ "flat/recommended" ]
9
- ] ;
6
+ export default defineConfig ( [
7
+ {
8
+ name : "eslint/js" ,
9
+ plugins : {
10
+ js : pluginJs ,
11
+ } ,
12
+ extends : [ "js/recommended" ] ,
13
+ } ,
14
+ {
15
+ name : "eslint/node" ,
16
+ plugins : {
17
+ n : pluginNode ,
18
+ } ,
19
+ extends : [ "n/mixed-esm-and-cjs" ] ,
20
+ } ,
21
+ {
22
+ name : "eslint/eslint-plugin" ,
23
+ plugins : {
24
+ "eslint-plugin" : eslintPlugin ,
25
+ } ,
26
+ extends : [ "eslint-plugin/recommended" ] ,
27
+ }
28
+ ] ) ;
You can’t perform that action at this time.
0 commit comments