@@ -4,66 +4,230 @@ module.exports = {
4
4
env : {
5
5
node : true ,
6
6
} ,
7
-
7
+ plugins : [
8
+ 'node' ,
9
+ ] ,
8
10
rules : {
9
11
/**
10
- * not enforce return after a callback
11
- * @see http://eslint.org/docs/rules/callback-return
12
+ * disallow new operators with calls to require
13
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-new-require.md
14
+ */
15
+ 'node/no-new-require' : 'error' ,
16
+
17
+ /**
18
+ * enforce either Buffer or require("buffer").Buffer
19
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/buffer.md
20
+ */
21
+ 'node/prefer-global/buffer' : [ 'error' , 'always' ] ,
22
+
23
+ /**
24
+ * enforce either console or require("console")
25
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/console.md
26
+ */
27
+ 'node/prefer-global/console' : [ 'error' , 'always' ] ,
28
+
29
+ /**
30
+ * enforce either process or require("process")
31
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/process.md
32
+ */
33
+ 'node/prefer-global/process' : [ 'error' , 'always' ] ,
34
+
35
+ /**
36
+ * enforce either TextDecoder or require("util").TextDecoder
37
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/text-decoder.md
38
+ */
39
+ 'node/prefer-global/text-decoder' : 'off' ,
40
+
41
+ /**
42
+ * enforce either TextEncoder or require("util").TextEncoder
43
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/text-encoder.md
44
+ */
45
+ 'node/prefer-global/text-encoder' : 'off' ,
46
+
47
+ /**
48
+ * enforce either URLSearchParams or require("url").URLSearchParams
49
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/url-search-params.md
50
+ */
51
+ 'node/prefer-global/url-search-params' : 'off' ,
52
+
53
+ /**
54
+ * enforce either URL or require("url").URL
55
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-global/url.md
56
+ */
57
+ 'node/prefer-global/url' : 'off' ,
58
+
59
+ /**
60
+ * enforce require("dns").promises
61
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-promises/dns.md
62
+ */
63
+ 'node/prefer-promises/dns' : 'warn' ,
64
+
65
+ /**
66
+ * enforce require("fs").promises
67
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/prefer-promises/fs.md
68
+ */
69
+ 'node/prefer-promises/fs' : 'warn' ,
70
+
71
+ /**
72
+ * disallow import declarations which import private modules
73
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unpublished-import.md
74
+ */
75
+ 'node/no-unpublished-import' : 'off' ,
76
+
77
+ /**
78
+ * disallow unsupported ECMAScript built-ins on the specified version
79
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unsupported-features/es-builtins.md
80
+ */
81
+ 'node/no-unsupported-features/es-builtins' : 'off' ,
82
+
83
+ /**
84
+ * suggest correct usage of shebang
85
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/shebang.md
86
+ */
87
+ 'node/shebang' : 'off' ,
88
+
89
+ /**
90
+ * disallow unsupported ECMAScript syntax on the specified version
91
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unsupported-features/es-syntax.md
92
+ */
93
+ 'node/no-unsupported-features/es-syntax' : 'off' ,
94
+
95
+ /**
96
+ * disallow unsupported Node.js built-in APIs on the specified version
97
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unsupported-features/node-builtins.md
98
+ */
99
+ 'node/no-unsupported-features/node-builtins' : 'off' ,
100
+
101
+ /**
102
+ * make process.exit() expressions the same code path as throw
103
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/process-exit-as-throw.md
104
+ */
105
+ 'node/process-exit-as-throw' : 'off' ,
106
+
107
+ /**
108
+ * disallow deprecated APIs
109
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md
110
+ */
111
+ 'node/no-deprecated-api' : 'off' ,
112
+
113
+ /**
114
+ * require error handling in callbacks
115
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/handle-callback-err.md
116
+ */
117
+ 'node/handle-callback-err' : 'off' ,
118
+
119
+ /**
120
+ * ensure Node.js-style error-first callback pattern is followed
121
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-callback-literal.md
122
+ */
123
+ 'node/no-callback-literal' : 'off' ,
124
+
125
+ /**
126
+ * disallow the assignment to exports
127
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-exports-assign.md
128
+ */
129
+ 'node/no-exports-assign' : 'off' ,
130
+
131
+ /**
132
+ * disallow import declarations which import extraneous modules
133
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-extraneous-import.md
134
+ */
135
+ 'node/no-extraneous-import' : 'off' ,
136
+
137
+ /**
138
+ * disallow require() expressions which import extraneous modules
139
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-extraneous-require.md
140
+ */
141
+ 'node/no-extraneous-require' : 'off' ,
142
+
143
+ /**
144
+ * disallow import declarations which import non-existence modules
145
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-missing-import.md
146
+ */
147
+ 'node/no-missing-import' : 'off' ,
148
+
149
+ /**
150
+ * disallow require() expressions which import non-existence modules
151
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-missing-require.md
152
+ */
153
+ 'node/no-missing-require' : 'off' ,
154
+
155
+ /**
156
+ * disallow string concatenation with __dirname and __filename
157
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-path-concat.md
158
+ */
159
+ 'node/no-path-concat' : 'off' ,
160
+
161
+ /**
162
+ * disallow the use of process.exit()
163
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-process-exit.md
164
+ */
165
+ 'node/no-process-exit' : 'off' ,
166
+
167
+ /**
168
+ * disallow bin files that npm ignores
169
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unpublished-bin.md
170
+ */
171
+ 'node/no-unpublished-bin' : 'off' ,
172
+
173
+ /**
174
+ * disallow require() expressions which import private modules
175
+ * @see https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-unpublished-require.md
12
176
*/
13
- 'callback-return ' : 'off' ,
177
+ 'node/no-unpublished-require ' : 'off' ,
14
178
15
179
/**
16
- * not require all requires be top-level
17
- * @see http ://eslint.org/ docs/rules/global-require
180
+ * require return statements after callbacks
181
+ * @see https ://github.com/mysticatea/eslint-plugin-node/blob/master/ docs/rules/callback-return.md
18
182
*/
19
- 'global-require ' : 'off' ,
183
+ 'node/callback-return ' : 'off' ,
20
184
21
185
/**
22
- * not enforces error handling in callbacks (node environment)
23
- * @see http ://eslint.org/ docs/rules/handle-callback-err
186
+ * enforce the style of file extensions in import declarations
187
+ * @see https ://github.com/mysticatea/eslint-plugin-node/blob/master/ docs/rules/file-extension-in-import.md
24
188
*/
25
- 'handle-callback-err ' : 'off' ,
189
+ 'node/file-extension-in-import ' : 'off' ,
26
190
27
191
/**
28
- * allow mixing regular variable and require declarations
29
- * @see http ://eslint.org/ docs/rules/no-mixed-requires
192
+ * equire require() calls to be placed at top-level module scope
193
+ * @see https ://github.com/mysticatea/eslint-plugin-node/blob/master/ docs/rules/global-require.md
30
194
*/
31
- 'no-mixed-requires ' : 'off' ,
195
+ 'node/global-require ' : 'off' ,
32
196
33
197
/**
34
- * allow use of new operator with the require function
35
- * @see http ://eslint.org/ docs/rules/no-new-require
198
+ * disallow require calls to be mixed with regular variable declarations
199
+ * @see https ://github.com/mysticatea/eslint-plugin-node/blob/master/ docs/rules/no-mixed-requires.md
36
200
*/
37
- 'no-new-require ' : 'off' ,
201
+ 'node/ no-mixed-requires ' : 'off' ,
38
202
39
203
/**
40
- * allow string concatenation with __dirname and __filename
41
- * @see http ://eslint.org/ docs/rules/no-path-concat
204
+ * disallow the use of process.env
205
+ * @see https ://github.com/mysticatea/eslint-plugin-node/blob/master/ docs/rules/no-process-env.md
42
206
*/
43
- 'no-path-concat ' : 'off' ,
207
+ 'node/ no-process-env ' : 'off' ,
44
208
45
209
/**
46
- * allow use of process.env
47
- * @see http ://eslint.org/ docs/rules/no-process-env
210
+ * disallow specified modules when loaded by import declarations
211
+ * @see https ://github.com/mysticatea/eslint-plugin-node/blob/master/ docs/rules/no-restricted-import.md
48
212
*/
49
- 'no-process-env ' : 'off' ,
213
+ 'node/ no-restricted-import ' : 'off' ,
50
214
51
215
/**
52
- * allow process.exit()
53
- * @see http ://eslint.org/ docs/rules/no-process-exit
216
+ * disallow specified modules when loaded by require
217
+ * @see https ://github.com/mysticatea/eslint-plugin-node/blob/master/ docs/rules/no-restricted-require.md
54
218
*/
55
- 'no-process-exit ' : 'off' ,
219
+ 'node/ no-restricted-require ' : 'off' ,
56
220
57
221
/**
58
- * not restrict usage of specified node modules
59
- * @see http ://eslint.org/ docs/rules/no-restricted-modules
222
+ * disallow synchronous methods
223
+ * @see https ://github.com/mysticatea/eslint-plugin-node/blob/master/ docs/rules/no-sync.md
60
224
*/
61
- 'no-restricted-modules ' : 'off' ,
225
+ 'node/ no-sync ' : 'off' ,
62
226
63
227
/**
64
- * allow use of synchronous methods
65
- * @see http ://eslint.org/ docs/rules/no-sync
228
+ * enforce either module.exports or exports
229
+ * @see https ://github.com/mysticatea/eslint-plugin-node/blob/master/ docs/rules/exports-style.md
66
230
*/
67
- 'no-sync ' : 'off' ,
231
+ 'node/exports-style ' : 'off' ,
68
232
} ,
69
233
} ;
0 commit comments