@prowise/eslint-config-linting-rules 2.4.7 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.js +1 -1
- package/eslint.config.js +24 -6
- package/front-react.js +2 -2
- package/front-solid.js +0 -2
- package/next.js +2 -2
- package/package.json +1 -1
- package/rules/baseSettings.js +322 -624
- package/rules/file-progress.js +62 -0
- package/rules/jsdoc-newline-before-returns.js +48 -0
- package/rules/jsdoc-optional-param-brackets.js +351 -0
- package/rules/jsdoc-single-line.js +44 -0
- package/rules/jsx-pascal-case-rule.js +1 -1
- package/rules/plugin-import-rules.js +13 -192
- package/rules/plugin-jsdoc-rules.js +81 -116
- package/rules/plugin-jsx-a11y-rules.js +1 -1
- package/rules/plugin-next-rules.js +28 -36
- package/rules/plugin-node-rules.js +72 -36
- package/rules/plugin-react-rules.js +111 -627
- package/rules/plugin-stylistic-rules.js +126 -84
- package/rules/plugin-typescript-rules.js +90 -200
- package/rules/plugin-vitest-rules.js +209 -21
- package/eslint.back.js +0 -9
- package/rules/plugin-solid-rules.js +0 -136
- package/rules/test-rules.js +0 -331
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import jsdocPlugin from "eslint-plugin-jsdoc";
|
|
2
|
+
import jsdocNewlineBeforeReturns from "./jsdoc-newline-before-returns.js";
|
|
3
|
+
import jsdocOptionalParamBrackets from "./jsdoc-optional-param-brackets.js";
|
|
4
|
+
import jsdocSingleLine from "./jsdoc-single-line.js";
|
|
2
5
|
|
|
3
6
|
export default {
|
|
4
7
|
/*
|
|
@@ -9,61 +12,52 @@ export default {
|
|
|
9
12
|
* 💭 requires type information
|
|
10
13
|
*/
|
|
11
14
|
|
|
12
|
-
plugins: {
|
|
15
|
+
plugins: {
|
|
16
|
+
"jsdoc": jsdocPlugin,
|
|
17
|
+
"jsdoc-x": {
|
|
18
|
+
rules: {
|
|
19
|
+
"newline-before-returns": jsdocNewlineBeforeReturns,
|
|
20
|
+
"optional-param-brackets": jsdocOptionalParamBrackets,
|
|
21
|
+
"single-line": jsdocSingleLine,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
13
25
|
|
|
14
26
|
rules: {
|
|
15
27
|
/**
|
|
16
28
|
* Checks that `@access` tags have a valid value ✅
|
|
17
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
29
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-access.md
|
|
18
30
|
*/
|
|
19
|
-
"jsdoc/check-access": "
|
|
31
|
+
"jsdoc/check-access": "error",
|
|
20
32
|
|
|
21
33
|
/**
|
|
22
34
|
* Reports invalid alignment of JSDoc block asterisks ✅
|
|
23
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
24
|
-
*/
|
|
25
|
-
"jsdoc/check-alignment": "warn",
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Ensures that (JavaScript) examples within JSDoc adhere to ESLint rules
|
|
29
|
-
* https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-examples.
|
|
30
|
-
*/
|
|
31
|
-
// "jsdoc/check-examples": "off",
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Reports invalid padding inside JSDoc blocks
|
|
35
|
-
* https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-indentation.
|
|
36
|
-
*/
|
|
37
|
-
// "jsdoc/check-indentation": "off",
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Reports invalid alignment of JSDoc block lines
|
|
41
|
-
* https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-check-line-alignment.
|
|
35
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-alignment.md
|
|
42
36
|
*/
|
|
43
|
-
|
|
37
|
+
"jsdoc/check-alignment": "error",
|
|
44
38
|
|
|
45
39
|
/**
|
|
46
40
|
* Ensures that parameter names in JSDoc match those in the function declaration ✅
|
|
47
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
41
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-param-names.md
|
|
48
42
|
*/
|
|
49
|
-
"jsdoc/check-param-names": ["
|
|
43
|
+
"jsdoc/check-param-names": ["error", { checkDestructured: false, allowExtraTrailingParamDocs: true }],
|
|
50
44
|
|
|
51
45
|
/**
|
|
52
46
|
* Ensures that property names in JSDoc are not duplicated on the same block and that nested
|
|
53
47
|
* properties have defined roots ✅
|
|
54
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
48
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-property-names.md
|
|
55
49
|
*/
|
|
56
50
|
"jsdoc/check-property-names": "warn",
|
|
57
51
|
|
|
58
52
|
/**
|
|
59
53
|
* Reports against syntax not valid for the mode (e.g., Google Closure Compiler in non-Closure mode)
|
|
60
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
54
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-syntax.md
|
|
61
55
|
*/
|
|
62
56
|
"jsdoc/check-syntax": "warn",
|
|
63
57
|
|
|
64
58
|
/**
|
|
65
59
|
* Reports invalid block tag names ✅
|
|
66
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
60
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-tag-names.md
|
|
67
61
|
* Defined tags are valid typedoc tags
|
|
68
62
|
*/
|
|
69
63
|
"jsdoc/check-tag-names": ["warn", {
|
|
@@ -91,31 +85,31 @@ export default {
|
|
|
91
85
|
|
|
92
86
|
/**
|
|
93
87
|
* Reports invalid types ✅
|
|
94
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
88
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-types.md
|
|
95
89
|
*/
|
|
96
90
|
"jsdoc/check-types": "warn",
|
|
97
91
|
|
|
98
92
|
/**
|
|
99
93
|
* This rule checks the values for a handful of tags: `@version`, `@since`, `@license` and `@author` ✅
|
|
100
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
94
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-values.md
|
|
101
95
|
*/
|
|
102
96
|
"jsdoc/check-values": "warn",
|
|
103
97
|
|
|
104
98
|
/**
|
|
105
99
|
* Expects specific tags to be empty of any content ✅
|
|
106
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
100
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/empty-tags.md
|
|
107
101
|
*/
|
|
108
102
|
"jsdoc/empty-tags": "warn",
|
|
109
103
|
|
|
110
104
|
/**
|
|
111
105
|
* Reports an issue with any non-constructor function using `@implements ✅
|
|
112
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
106
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/implements-on-classes.md
|
|
113
107
|
*/
|
|
114
108
|
"jsdoc/implements-on-classes": "warn",
|
|
115
109
|
|
|
116
110
|
/**
|
|
117
111
|
* Enforces a regular expression pattern on descriptions
|
|
118
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
112
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/match-description.md
|
|
119
113
|
*/
|
|
120
114
|
"jsdoc/match-description": [
|
|
121
115
|
"error",
|
|
@@ -126,107 +120,61 @@ export default {
|
|
|
126
120
|
],
|
|
127
121
|
/**
|
|
128
122
|
* Controls how and whether jsdoc blocks can be expressed as single or multiple line blocks ✅
|
|
129
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
123
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/multiline-blocks.md
|
|
130
124
|
*/
|
|
131
125
|
"jsdoc/multiline-blocks": "warn",
|
|
132
126
|
|
|
133
127
|
/**
|
|
134
128
|
* This rule checks for multi-line-style comments which fail to meet the criteria of a jsdoc block
|
|
135
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
129
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-bad-blocks.md
|
|
136
130
|
*/
|
|
137
131
|
"jsdoc/no-bad-blocks": "warn",
|
|
138
132
|
|
|
139
133
|
/**
|
|
140
134
|
* His rule reports defaults being used on the relevant portion of `@param` or `@default`
|
|
141
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
135
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-defaults.md
|
|
142
136
|
*/
|
|
143
137
|
"jsdoc/no-defaults": "warn",
|
|
144
138
|
|
|
145
139
|
/**
|
|
146
|
-
*
|
|
147
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
148
|
-
*/
|
|
149
|
-
// "jsdoc/no-missing-syntax": "off",
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* ✅
|
|
153
|
-
* https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-multi-asterisks.
|
|
140
|
+
* Prevents use of multiple asterisks at the beginning of lines. ✅
|
|
141
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-multi-asterisks.md
|
|
154
142
|
*/
|
|
155
143
|
"jsdoc/no-multi-asterisks": "warn",
|
|
156
144
|
|
|
157
|
-
/**
|
|
158
|
-
* Reports when certain comment structures are present
|
|
159
|
-
* https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-restricted-syntax.
|
|
160
|
-
*/
|
|
161
|
-
// "jsdoc/no-restricted-syntax": "off",
|
|
162
|
-
|
|
163
145
|
/**
|
|
164
146
|
* This rule reports types being used on `@param` or `@returns`
|
|
165
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
147
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-types.md
|
|
166
148
|
*/
|
|
167
149
|
"jsdoc/no-types": "warn",
|
|
168
150
|
|
|
169
151
|
/**
|
|
170
152
|
* Checks that types in jsdoc comments are defined ✅
|
|
171
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
153
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-undefined-types.md
|
|
172
154
|
*/
|
|
173
155
|
"jsdoc/no-undefined-types": "warn",
|
|
174
156
|
|
|
175
157
|
/**
|
|
176
158
|
* Checks that types in jsdoc comments are defined
|
|
177
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
159
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-undefined-types.md
|
|
178
160
|
*/
|
|
179
161
|
"jsdoc/require-asterisk-prefix": "warn",
|
|
180
162
|
|
|
181
163
|
/**
|
|
182
164
|
* Requires that all functions have a description
|
|
183
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
165
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-description.md
|
|
184
166
|
*/
|
|
185
|
-
"jsdoc/require-description": "
|
|
167
|
+
"jsdoc/require-description": "error",
|
|
186
168
|
|
|
187
169
|
/**
|
|
188
|
-
* Requires
|
|
189
|
-
*
|
|
190
|
-
* https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-description-complete-sentence.
|
|
191
|
-
*
|
|
192
|
-
* This is disabled for the following reason:
|
|
193
|
-
*
|
|
194
|
-
* - It makes a lot of mistakes, such as considering two words a sentence
|
|
195
|
-
* or considering an URL a sentence.
|
|
196
|
-
* - It gets in the way of developer productivity, if you need a spell checker
|
|
197
|
-
* or sentence tool, install one in your IDE.
|
|
198
|
-
* - The autofixer is very liberal with its autofixing of dots at the end
|
|
199
|
-
* of the sentence, which often leads to wrong dots. Therefore, readability
|
|
200
|
-
* actually gets worse.
|
|
201
|
-
*
|
|
202
|
-
* In conclusion, if you write JSDocs, please actually take time to write,
|
|
203
|
-
* instead of relying on some broken jsdoc rule.
|
|
204
|
-
*
|
|
205
|
-
* If you cannot do that, PR reviewers should call you out on it.
|
|
170
|
+
* Requires a hyphen before the `@param` description (and optionally before `@property` descriptions).
|
|
171
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-hyphen-before-param-description.md
|
|
206
172
|
*/
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Requires that all functions have examples
|
|
211
|
-
* https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-example.
|
|
212
|
-
*/
|
|
213
|
-
// "jsdoc/require-example": "off",
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Checks that all files have one `@file`, `@fileoverview`, or `@overview` tag at the beginning of the file
|
|
217
|
-
* https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-file-overview.
|
|
218
|
-
*/
|
|
219
|
-
// "jsdoc/require-file-overview": "off",
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Requires a hyphen before the `@param` description
|
|
223
|
-
* https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-hyphen-before-param-description.
|
|
224
|
-
*/
|
|
225
|
-
// "jsdoc/require-hyphen-before-param-description": "off",
|
|
173
|
+
"jsdoc/require-hyphen-before-param-description": ["error", "always"],
|
|
226
174
|
|
|
227
175
|
/**
|
|
228
176
|
* Require JSDoc comments ✅
|
|
229
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
177
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-jsdoc.md
|
|
230
178
|
*/
|
|
231
179
|
"jsdoc/require-jsdoc": [
|
|
232
180
|
"error",
|
|
@@ -257,105 +205,122 @@ export default {
|
|
|
257
205
|
|
|
258
206
|
/**
|
|
259
207
|
* Requires that all function parameters are documented ✅
|
|
260
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
208
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param.md
|
|
261
209
|
*/
|
|
262
|
-
"jsdoc/require-param": "
|
|
210
|
+
"jsdoc/require-param": ["error", { checkDestructured: false }],
|
|
263
211
|
|
|
264
212
|
/**
|
|
265
213
|
* Requires that each `@param` tag has a `description` value ✅
|
|
266
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
214
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-description.md
|
|
267
215
|
*/
|
|
268
|
-
"jsdoc/require-param-description": "
|
|
216
|
+
"jsdoc/require-param-description": "error",
|
|
269
217
|
|
|
270
218
|
/**
|
|
271
219
|
* Requires that all function parameters have names ✅
|
|
272
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
220
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-name.md
|
|
273
221
|
*/
|
|
274
|
-
"jsdoc/require-param-name": "
|
|
222
|
+
"jsdoc/require-param-name": "error",
|
|
275
223
|
|
|
276
224
|
/**
|
|
277
225
|
* Requires that each `@param` tag has a `type` value ✅
|
|
278
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
226
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-param-type.md
|
|
279
227
|
*/
|
|
280
|
-
|
|
228
|
+
"jsdoc/require-param-type": "off",
|
|
281
229
|
|
|
282
230
|
/**
|
|
283
231
|
* Requires that all `@typedef` and `@namespace` tags have `@property` when their type ✅
|
|
284
232
|
* is a plain `object`, `Object`, or `PlainObject
|
|
285
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
233
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property.md
|
|
286
234
|
*/
|
|
287
|
-
|
|
235
|
+
"jsdoc/require-property": "off",
|
|
288
236
|
|
|
289
237
|
/**
|
|
290
238
|
* Requires that each `@property` tag has a `description` value ✅
|
|
291
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
239
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-description.md
|
|
292
240
|
*/
|
|
293
241
|
"jsdoc/require-property-description": "warn",
|
|
294
242
|
|
|
295
243
|
/**
|
|
296
244
|
* Requires that all function `@property` tags have names ✅
|
|
297
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
245
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-name.md
|
|
298
246
|
*/
|
|
299
247
|
"jsdoc/require-property-name": "warn",
|
|
300
248
|
|
|
301
249
|
/**
|
|
302
250
|
* Requires that each `@property` tag has a `type` value ✅
|
|
303
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
251
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-type.md
|
|
304
252
|
*/
|
|
305
253
|
"jsdoc/require-property-type": "warn",
|
|
306
254
|
|
|
307
255
|
/**
|
|
308
256
|
* Requires that returns are documented ✅
|
|
309
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
257
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns.md
|
|
310
258
|
*/
|
|
311
259
|
"jsdoc/require-returns": "warn",
|
|
312
260
|
|
|
313
261
|
/**
|
|
314
262
|
* Requires a return statement in function body if a `@returns` tag is specified in jsdoc comment ✅
|
|
315
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
263
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-check.md
|
|
316
264
|
*/
|
|
317
265
|
"jsdoc/require-returns-check": "warn",
|
|
318
266
|
|
|
319
267
|
/**
|
|
320
268
|
* Requires that the `@returns` tag has a `description` value ✅
|
|
321
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
269
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-description.md
|
|
322
270
|
*/
|
|
323
271
|
"jsdoc/require-returns-description": "warn",
|
|
324
272
|
|
|
325
273
|
/**
|
|
326
274
|
* Requires that `@returns` tag has `type` value ✅
|
|
327
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
275
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns-type.md
|
|
328
276
|
*/
|
|
329
277
|
// "jsdoc/require-returns-type": "off",
|
|
330
278
|
|
|
331
279
|
/**
|
|
332
280
|
* Requires that throw statements are documented
|
|
333
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
281
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-throws.md
|
|
334
282
|
*/
|
|
335
|
-
"jsdoc/require-throws": "
|
|
283
|
+
"jsdoc/require-throws": "off",
|
|
336
284
|
|
|
337
285
|
/**
|
|
338
286
|
* Requires yields are documented ✅
|
|
339
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
287
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields.md
|
|
340
288
|
*/
|
|
341
289
|
"jsdoc/require-yields": "warn",
|
|
342
290
|
|
|
343
291
|
/**
|
|
344
292
|
* Requires a yield statement in function body if a `@yields` tag is specified in jsdoc comment ✅
|
|
345
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
293
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-yields-check.md
|
|
346
294
|
*/
|
|
347
295
|
"jsdoc/require-yields-check": "warn",
|
|
348
296
|
|
|
349
297
|
/**
|
|
350
298
|
* Enforces lines (or no lines) between tags ✅
|
|
351
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
299
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/tag-lines.md
|
|
352
300
|
*/
|
|
353
301
|
"jsdoc/tag-lines": ["warn", "any", { startLines: 1 }],
|
|
354
302
|
|
|
355
303
|
/**
|
|
356
304
|
* Requires all types to be valid JSDoc or Closure compiler types without syntax errors ✅
|
|
357
|
-
* https://github.com/gajus/eslint-plugin-jsdoc
|
|
305
|
+
* https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/valid-types.md
|
|
358
306
|
*/
|
|
359
307
|
"jsdoc/valid-types": "warn",
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Enforce a blank JSDoc line immediately before the @returns tag.
|
|
311
|
+
*/
|
|
312
|
+
"jsdoc-x/newline-before-returns": "off",
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Enforce brackets around optional parameter names in JSDoc @param tags.
|
|
316
|
+
* When a parameter has a `?` in its TypeScript signature or has a default value,
|
|
317
|
+
* the JSDoc @param tag should use brackets: `@param [paramName]` instead of `@param paramName`.
|
|
318
|
+
*/
|
|
319
|
+
"jsdoc-x/optional-param-brackets": "off",
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Enforce single-line JSDoc comments to use inline format.
|
|
323
|
+
*/
|
|
324
|
+
"jsdoc-x/single-line": "off",
|
|
360
325
|
},
|
|
361
326
|
};
|
|
@@ -1,107 +1,99 @@
|
|
|
1
1
|
import nextPlugin from "@next/eslint-plugin-next";
|
|
2
2
|
|
|
3
|
-
/*
|
|
4
|
-
* ✅ recommended
|
|
5
|
-
* 🔒 strict
|
|
6
|
-
* 🔧 fixable
|
|
7
|
-
* 💡 has suggestion
|
|
8
|
-
* 💭 requires type information
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
3
|
export default {
|
|
4
|
+
/*
|
|
5
|
+
* ✅ recommended
|
|
6
|
+
* 🔒 strict
|
|
7
|
+
* 🔧 fixable
|
|
8
|
+
* 💡 has suggestion
|
|
9
|
+
* 💭 requires type information
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
12
|
plugins: {
|
|
13
13
|
next: nextPlugin,
|
|
14
14
|
},
|
|
15
15
|
|
|
16
16
|
rules: {
|
|
17
|
-
// warnings
|
|
18
|
-
|
|
19
17
|
/**
|
|
20
|
-
* Enforce font-display behavior with Google Fonts.
|
|
18
|
+
* Enforce font-display behavior with Google Fonts. ✅
|
|
21
19
|
* https://nextjs.org/docs/messages/google-font-display
|
|
22
20
|
*/
|
|
23
21
|
"next/google-font-display": "warn",
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
|
-
* Ensure preconnect is used with Google Fonts.
|
|
24
|
+
* Ensure preconnect is used with Google Fonts. ✅
|
|
27
25
|
* https://nextjs.org/docs/messages/google-font-preconnect
|
|
28
26
|
*/
|
|
29
27
|
"next/google-font-preconnect": "warn",
|
|
30
28
|
|
|
31
29
|
/**
|
|
32
|
-
* Prefer next/script component when using the inline script for Google Analytics.
|
|
30
|
+
* Prefer next/script component when using the inline script for Google Analytics. ✅
|
|
33
31
|
* https://nextjs.org/docs/messages/next-script-for-ga
|
|
34
32
|
*/
|
|
35
33
|
"next/next-script-for-ga": "warn",
|
|
36
34
|
|
|
37
35
|
/**
|
|
38
|
-
* Prevent client components from being async functions.
|
|
36
|
+
* Prevent client components from being async functions. ✅
|
|
39
37
|
* https://nextjs.org/docs/messages/no-async-client-component
|
|
40
38
|
*/
|
|
41
39
|
"next/no-async-client-component": "warn",
|
|
42
40
|
|
|
43
41
|
/**
|
|
44
|
-
* Prevent usage of next/script's beforeInteractive strategy outside of pages/_document.js.
|
|
42
|
+
* Prevent usage of next/script's beforeInteractive strategy outside of pages/_document.js. ✅
|
|
45
43
|
* https://nextjs.org/docs/messages/no-before-interactive-script-outside-document
|
|
46
44
|
*/
|
|
47
45
|
"next/no-before-interactive-script-outside-document": "warn",
|
|
48
46
|
|
|
49
47
|
/**
|
|
50
|
-
* Prevent manual stylesheet tags.
|
|
48
|
+
* Prevent manual stylesheet tags. ✅
|
|
51
49
|
* https://nextjs.org/docs/messages/no-css-tags
|
|
52
50
|
*/
|
|
53
51
|
"next/no-css-tags": "warn",
|
|
54
52
|
|
|
55
53
|
/**
|
|
56
|
-
* Prevent usage of <head> element.
|
|
54
|
+
* Prevent usage of <head> element. ✅
|
|
57
55
|
* https://nextjs.org/docs/messages/no-head-element
|
|
58
56
|
*/
|
|
59
57
|
"next/no-head-element": "warn",
|
|
60
58
|
|
|
61
59
|
/**
|
|
62
|
-
* Prevent usage of <
|
|
63
|
-
* https://nextjs.org/docs/messages/no-html-link-for-pages
|
|
64
|
-
*/
|
|
65
|
-
"next/no-html-link-for-pages": "warn",
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Prevent usage of <img> element due to slower LCP and higher bandwidth.
|
|
60
|
+
* Prevent usage of <img> element due to slower LCP and higher bandwidth. ✅
|
|
69
61
|
* https://nextjs.org/docs/messages/no-img-element
|
|
70
62
|
*/
|
|
71
63
|
"next/no-img-element": "warn",
|
|
72
64
|
|
|
73
65
|
/**
|
|
74
66
|
* Prevent page-only custom fonts.
|
|
75
|
-
* https://nextjs.org/docs/messages/no-page-custom-font
|
|
67
|
+
* https://nextjs.org/docs/messages/no-page-custom-font ✅
|
|
76
68
|
*/
|
|
77
69
|
"next/no-page-custom-font": "warn",
|
|
78
70
|
|
|
79
71
|
/**
|
|
80
|
-
* Prevent usage of styled-jsx in pages/_document.js.
|
|
72
|
+
* Prevent usage of styled-jsx in pages/_document.js. ✅
|
|
81
73
|
* https://nextjs.org/docs/messages/no-styled-jsx-in-document
|
|
82
74
|
*/
|
|
83
75
|
"next/no-styled-jsx-in-document": "warn",
|
|
84
76
|
|
|
85
77
|
/**
|
|
86
|
-
* Prevent synchronous scripts.
|
|
78
|
+
* Prevent synchronous scripts. ✅
|
|
87
79
|
* https://nextjs.org/docs/messages/no-sync-scripts
|
|
88
80
|
*/
|
|
89
81
|
"next/no-sync-scripts": "warn",
|
|
90
82
|
|
|
91
83
|
/**
|
|
92
|
-
* Prevent usage of <title> with Head component from next/document.
|
|
84
|
+
* Prevent usage of <title> with Head component from next/document. ✅
|
|
93
85
|
* https://nextjs.org/docs/messages/no-title-in-document-head
|
|
94
86
|
*/
|
|
95
87
|
"next/no-title-in-document-head": "warn",
|
|
96
88
|
|
|
97
89
|
/**
|
|
98
|
-
* Prevent common typos in Next.js's data fetching functions
|
|
90
|
+
* Prevent common typos in Next.js's data fetching functions. ✅
|
|
99
91
|
* https://nextjs.org/docs
|
|
100
92
|
*/
|
|
101
93
|
"next/no-typos": "warn",
|
|
102
94
|
|
|
103
95
|
/**
|
|
104
|
-
* Prevent duplicate polyfills from Polyfill.io.
|
|
96
|
+
* Prevent duplicate polyfills from Polyfill.io. ✅
|
|
105
97
|
* https://nextjs.org/docs/messages/no-unwanted-polyfillio
|
|
106
98
|
*/
|
|
107
99
|
"next/no-unwanted-polyfillio": "warn",
|
|
@@ -109,37 +101,37 @@ export default {
|
|
|
109
101
|
// errors
|
|
110
102
|
|
|
111
103
|
/**
|
|
112
|
-
* Enforce id attribute on next/script components with inline content
|
|
104
|
+
* Enforce id attribute on next/script components with inline content. ✅
|
|
113
105
|
* https://nextjs.org/docs/messages/inline-script-id
|
|
114
106
|
*/
|
|
115
107
|
"next/inline-script-id": "error",
|
|
116
108
|
|
|
117
109
|
/**
|
|
118
|
-
* Prevent assignment to the module variable.
|
|
110
|
+
* Prevent assignment to the module variable. ✅
|
|
119
111
|
* https://nextjs.org/docs/messages/no-assign-module-variable
|
|
120
112
|
*/
|
|
121
113
|
"next/no-assign-module-variable": "error",
|
|
122
114
|
|
|
123
115
|
/**
|
|
124
|
-
* Prevent importing next/document outside of pages/_document.js
|
|
116
|
+
* Prevent importing next/document outside of pages/_document.js ✅
|
|
125
117
|
* https://nextjs.org/docs/messages/no-document-import-in-page
|
|
126
118
|
*/
|
|
127
119
|
"next/no-document-import-in-page": "error",
|
|
128
120
|
|
|
129
121
|
/**
|
|
130
|
-
* Prevent duplicate usage of <Head> in pages/_document.js
|
|
122
|
+
* Prevent duplicate usage of <Head> in pages/_document.js ✅
|
|
131
123
|
* https://nextjs.org/docs/messages/no-duplicate-head
|
|
132
124
|
*/
|
|
133
125
|
"next/no-duplicate-head": "error",
|
|
134
126
|
|
|
135
127
|
/**
|
|
136
|
-
* Prevent usage of next/head in pages/_document.js.
|
|
128
|
+
* Prevent usage of next/head in pages/_document.js. ✅
|
|
137
129
|
* https://nextjs.org/docs/messages/no-head-import-in-document
|
|
138
130
|
*/
|
|
139
131
|
"next/no-head-import-in-document": "error",
|
|
140
132
|
|
|
141
133
|
/**
|
|
142
|
-
* Prevent usage of next/script in next/head component.
|
|
134
|
+
* Prevent usage of next/script in next/head component. ✅
|
|
143
135
|
* https://nextjs.org/docs/messages/no-script-component-in-head
|
|
144
136
|
*/
|
|
145
137
|
"next/no-script-component-in-head": "error",
|