@fast-china/eslint-config 2.1.7 → 2.1.8

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.
Files changed (88) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/CONTRIBUTING.md +2 -2
  3. package/README.md +66 -142
  4. package/README.zh.md +64 -142
  5. package/dist/configs/environment.mjs +2 -0
  6. package/dist/configs/environment.mjs.map +1 -1
  7. package/dist/configs/ignores.mjs +0 -1
  8. package/dist/configs/ignores.mjs.map +1 -1
  9. package/dist/configs/import.mjs +4 -1
  10. package/dist/configs/import.mjs.map +1 -1
  11. package/dist/configs/index.d.mts +2 -2
  12. package/dist/configs/index.mjs +2 -2
  13. package/dist/configs/javascript.mjs +3 -1
  14. package/dist/configs/javascript.mjs.map +1 -1
  15. package/dist/configs/json.mjs +3 -1
  16. package/dist/configs/json.mjs.map +1 -1
  17. package/dist/configs/markdown.d.mts +2 -1
  18. package/dist/configs/markdown.mjs +4 -2
  19. package/dist/configs/markdown.mjs.map +1 -1
  20. package/dist/configs/prettier.mjs +1 -1
  21. package/dist/configs/prettier.mjs.map +1 -1
  22. package/dist/configs/sort-package.d.mts +1 -1
  23. package/dist/configs/sort-package.mjs +1 -1
  24. package/dist/configs/sort-package.mjs.map +1 -1
  25. package/dist/configs/sort-tsconfig.d.mts +2 -2
  26. package/dist/configs/sort-tsconfig.mjs +2 -2
  27. package/dist/configs/sort-tsconfig.mjs.map +1 -1
  28. package/dist/configs/typescript.d.mts +11 -7
  29. package/dist/configs/typescript.mjs +25 -22
  30. package/dist/configs/typescript.mjs.map +1 -1
  31. package/dist/configs/uniapp.mjs +19 -13
  32. package/dist/configs/uniapp.mjs.map +1 -1
  33. package/dist/configs/vue.d.mts +18 -3
  34. package/dist/configs/vue.mjs +59 -9
  35. package/dist/configs/vue.mjs.map +1 -1
  36. package/dist/constants/index.d.mts +4 -0
  37. package/dist/constants/index.mjs +5 -1
  38. package/dist/constants/index.mjs.map +1 -1
  39. package/dist/index.d.mts +37 -58
  40. package/dist/index.mjs +43 -47
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/rules/angular.d.mts +28 -0
  43. package/dist/rules/angular.mjs +28 -0
  44. package/dist/rules/angular.mjs.map +1 -1
  45. package/dist/rules/common.d.mts +16 -6
  46. package/dist/rules/common.mjs +16 -13
  47. package/dist/rules/common.mjs.map +1 -1
  48. package/dist/rules/import.d.mts +9 -0
  49. package/dist/rules/import.mjs +24 -0
  50. package/dist/rules/import.mjs.map +1 -1
  51. package/dist/rules/index.d.mts +2 -2
  52. package/dist/rules/index.mjs +2 -2
  53. package/dist/rules/javascript.d.mts +18 -0
  54. package/dist/rules/javascript.mjs +18 -0
  55. package/dist/rules/javascript.mjs.map +1 -1
  56. package/dist/rules/lodash.d.mts +2 -0
  57. package/dist/rules/lodash.mjs +6 -2
  58. package/dist/rules/lodash.mjs.map +1 -1
  59. package/dist/rules/react.d.mts +13 -0
  60. package/dist/rules/react.mjs +13 -0
  61. package/dist/rules/react.mjs.map +1 -1
  62. package/dist/rules/regexp.d.mts +25 -0
  63. package/dist/rules/regexp.mjs +25 -0
  64. package/dist/rules/regexp.mjs.map +1 -1
  65. package/dist/rules/sort-package.d.mts +3 -1
  66. package/dist/rules/sort-package.mjs +3 -1
  67. package/dist/rules/sort-package.mjs.map +1 -1
  68. package/dist/rules/sort-tsconfig.d.mts +3 -1
  69. package/dist/rules/sort-tsconfig.mjs +3 -1
  70. package/dist/rules/sort-tsconfig.mjs.map +1 -1
  71. package/dist/rules/typescript.d.mts +81 -13
  72. package/dist/rules/typescript.mjs +83 -15
  73. package/dist/rules/typescript.mjs.map +1 -1
  74. package/dist/rules/vue.d.mts +65 -10
  75. package/dist/rules/vue.mjs +41 -14
  76. package/dist/rules/vue.mjs.map +1 -1
  77. package/docs/engineering-audit.zh.md +45 -49
  78. package/docs/rules/angular.zh.md +721 -0
  79. package/docs/rules/core.zh.md +3031 -0
  80. package/docs/rules/index.zh.md +38 -0
  81. package/docs/rules/json.zh.md +784 -0
  82. package/docs/rules/markdown.zh.md +449 -0
  83. package/docs/rules/react.zh.md +2091 -0
  84. package/docs/rules/typescript.zh.md +2051 -0
  85. package/docs/rules/vue.zh.md +3016 -0
  86. package/docs/rules-risk.md +85 -91
  87. package/docs/rules-risk.zh.md +76 -82
  88. package/package.json +4 -2
@@ -0,0 +1,449 @@
1
+ <!-- 此文件由 scripts/rules-docs.ts 生成,请勿手工编辑。 -->
2
+
3
+ # Markdown
4
+
5
+ 本页记录当前依赖版本和仓库配置最终产生的 17 条规则。每条规则均列出实际严重级别、生效范围、上游说明、常见报告以及错误/正确示例。
6
+
7
+ ## 第三方预置规则(17 条)
8
+
9
+ ### `markdown/fenced-code-language`
10
+
11
+ 检查该规则对应的代码约束。上游说明:Require languages for fenced code blocks
12
+
13
+ - 生效级别与范围:error: Markdown
14
+ - 自动修复:不支持或上游未声明
15
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/fenced-code-language.md)
16
+ - 常见报告:`Missing code block language.`;`Code block language "{{lang}}" is not allowed.`
17
+ - 示例类型:第三方预置规则的直接代码示例
18
+
19
+ 错误示例:
20
+
21
+ <!-- prettier-ignore -->
22
+ ````markdown
23
+ ```
24
+ const ready = true;
25
+ ```
26
+ ````
27
+
28
+ 正确示例:
29
+
30
+ <!-- prettier-ignore -->
31
+ ````markdown
32
+ ```js
33
+ const ready = true;
34
+ ```
35
+ ````
36
+
37
+ ### `markdown/heading-increment`
38
+
39
+ 检查该规则对应的代码约束。上游说明:Enforce heading levels increment by one
40
+
41
+ - 生效级别与范围:error: Markdown
42
+ - 自动修复:不支持或上游未声明
43
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/heading-increment.md)
44
+ - 常见报告:`Heading level skipped from {{fromLevel}} to {{toLevel}}.`
45
+ - 示例类型:第三方预置规则的直接代码示例
46
+
47
+ 错误示例:
48
+
49
+ <!-- prettier-ignore -->
50
+ ````markdown
51
+ # Guide
52
+
53
+ ### Setup
54
+ ````
55
+
56
+ 正确示例:
57
+
58
+ <!-- prettier-ignore -->
59
+ ````markdown
60
+ # Guide
61
+
62
+ ## Setup
63
+ ````
64
+
65
+ ### `markdown/no-duplicate-definitions`
66
+
67
+ 禁止出现该规则定义的不安全、无效或易误解结构。上游说明:Disallow duplicate definitions
68
+
69
+ - 生效级别与范围:error: Markdown
70
+ - 自动修复:不支持或上游未声明
71
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/no-duplicate-definitions.md)
72
+ - 常见报告:`Unexpected duplicate definition '{{ identifier }}' (label: '{{ label }}') found. First defined at line {{ firstLine }} (label: '{{ firstLabel }}').`;`Unexpected duplicate footnote definition '{{ identifier }}' (label: '{{ label }}') found. First defined at line {{ firstLine }} (label: '{{ firstLabel }}').`
73
+ - 示例类型:第三方预置规则的直接代码示例
74
+
75
+ 错误示例:
76
+
77
+ <!-- prettier-ignore -->
78
+ ````markdown
79
+ [docs]: https://example.com/a
80
+ [docs]: https://example.com/b
81
+ ````
82
+
83
+ 正确示例:
84
+
85
+ <!-- prettier-ignore -->
86
+ ````markdown
87
+ [docs]: https://example.com/a
88
+ [api]: https://example.com/b
89
+ ````
90
+
91
+ ### `markdown/no-empty-definitions`
92
+
93
+ 禁止出现该规则定义的不安全、无效或易误解结构。上游说明:Disallow empty definitions
94
+
95
+ - 生效级别与范围:error: Markdown
96
+ - 自动修复:不支持或上游未声明
97
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/no-empty-definitions.md)
98
+ - 常见报告:`Unexpected empty definition '{{ identifier }}' (label: '{{ label }}') found.`;`Unexpected empty footnote definition '{{ identifier }}' (label: '{{ label }}') found.`
99
+ - 示例类型:第三方预置规则的直接代码示例
100
+
101
+ 错误示例:
102
+
103
+ <!-- prettier-ignore -->
104
+ ````markdown
105
+ [docs]: #
106
+ ````
107
+
108
+ 正确示例:
109
+
110
+ <!-- prettier-ignore -->
111
+ ````markdown
112
+ [Guide][docs]
113
+
114
+ [docs]: https://example.com/docs
115
+ ````
116
+
117
+ ### `markdown/no-empty-images`
118
+
119
+ 禁止出现该规则定义的不安全、无效或易误解结构。上游说明:Disallow empty images
120
+
121
+ - 生效级别与范围:error: Markdown
122
+ - 自动修复:不支持或上游未声明
123
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/no-empty-images.md)
124
+ - 常见报告:`Unexpected empty image found.`
125
+ - 示例类型:第三方预置规则的直接代码示例
126
+
127
+ 错误示例:
128
+
129
+ <!-- prettier-ignore -->
130
+ ````markdown
131
+ ![Fast logo]()
132
+ ````
133
+
134
+ 正确示例:
135
+
136
+ <!-- prettier-ignore -->
137
+ ````markdown
138
+ ![Fast logo](/logo.png)
139
+ ````
140
+
141
+ ### `markdown/no-empty-links`
142
+
143
+ 禁止出现该规则定义的不安全、无效或易误解结构。上游说明:Disallow empty links
144
+
145
+ - 生效级别与范围:error: Markdown
146
+ - 自动修复:不支持或上游未声明
147
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/no-empty-links.md)
148
+ - 常见报告:`Unexpected empty link found.`
149
+ - 示例类型:第三方预置规则的直接代码示例
150
+
151
+ 错误示例:
152
+
153
+ <!-- prettier-ignore -->
154
+ ````markdown
155
+ [Fast]()
156
+ ````
157
+
158
+ 正确示例:
159
+
160
+ <!-- prettier-ignore -->
161
+ ````markdown
162
+ [Fast](https://example.com)
163
+ ````
164
+
165
+ ### `markdown/no-invalid-label-refs`
166
+
167
+ 禁止出现该规则定义的不安全、无效或易误解结构。上游说明:Disallow invalid label references
168
+
169
+ - 生效级别与范围:error: Markdown
170
+ - 自动修复:不支持或上游未声明
171
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/no-invalid-label-refs.md)
172
+ - 常见报告:`Label reference '{{label}}' is invalid due to white space between [ and ].`
173
+ - 示例类型:第三方预置规则的直接代码示例
174
+
175
+ 错误示例:
176
+
177
+ <!-- prettier-ignore -->
178
+ ````markdown
179
+ [Guide][ ]
180
+ ````
181
+
182
+ 正确示例:
183
+
184
+ <!-- prettier-ignore -->
185
+ ````markdown
186
+ [Guide][guide]
187
+
188
+ [guide]: /guide
189
+ ````
190
+
191
+ ### `markdown/no-missing-atx-heading-space`
192
+
193
+ 禁止出现该规则定义的不安全、无效或易误解结构。上游说明:Disallow headings without a space after the hash characters
194
+
195
+ - 生效级别与范围:error: Markdown
196
+ - 自动修复:支持;执行前仍应检查语义和差异
197
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-atx-heading-space.md)
198
+ - 常见报告:`Missing space {{position}} hash(es) on ATX style heading.`
199
+ - 示例类型:第三方预置规则的直接代码示例
200
+
201
+ 错误示例:
202
+
203
+ <!-- prettier-ignore -->
204
+ ````markdown
205
+ ##Setup
206
+ ````
207
+
208
+ 正确示例:
209
+
210
+ <!-- prettier-ignore -->
211
+ ````markdown
212
+ ## Setup
213
+ ````
214
+
215
+ ### `markdown/no-missing-label-refs`
216
+
217
+ 禁止出现该规则定义的不安全、无效或易误解结构。上游说明:Disallow missing label references
218
+
219
+ - 生效级别与范围:error: Markdown
220
+ - 自动修复:不支持或上游未声明
221
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-label-refs.md)
222
+ - 常见报告:`Label reference '{{label}}' not found.`
223
+ - 示例类型:第三方预置规则的直接代码示例
224
+
225
+ 错误示例:
226
+
227
+ <!-- prettier-ignore -->
228
+ ````markdown
229
+ [Guide][missing]
230
+ ````
231
+
232
+ 正确示例:
233
+
234
+ <!-- prettier-ignore -->
235
+ ````markdown
236
+ [Guide][guide]
237
+
238
+ [guide]: /guide
239
+ ````
240
+
241
+ ### `markdown/no-missing-link-fragments`
242
+
243
+ 禁止出现该规则定义的不安全、无效或易误解结构。上游说明:Disallow link fragments that do not reference valid headings
244
+
245
+ - 生效级别与范围:error: Markdown
246
+ - 自动修复:不支持或上游未声明
247
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-link-fragments.md)
248
+ - 常见报告:`Link fragment '#{{fragment}}' does not reference a heading or anchor in this document.`
249
+ - 示例类型:第三方预置规则的直接代码示例
250
+
251
+ 错误示例:
252
+
253
+ <!-- prettier-ignore -->
254
+ ````markdown
255
+ [Install](#missing)
256
+ ````
257
+
258
+ 正确示例:
259
+
260
+ <!-- prettier-ignore -->
261
+ ````markdown
262
+ ## Install
263
+
264
+ [Install](#install)
265
+ ````
266
+
267
+ ### `markdown/no-multiple-h1`
268
+
269
+ 禁止出现该规则定义的不安全、无效或易误解结构。上游说明:Disallow multiple H1 headings in the same document
270
+
271
+ - 生效级别与范围:error: Markdown
272
+ - 自动修复:不支持或上游未声明
273
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/no-multiple-h1.md)
274
+ - 常见报告:`Unexpected additional H1 heading found.`
275
+ - 示例类型:第三方预置规则的直接代码示例
276
+
277
+ 错误示例:
278
+
279
+ <!-- prettier-ignore -->
280
+ ````markdown
281
+ # Guide
282
+
283
+ # API
284
+ ````
285
+
286
+ 正确示例:
287
+
288
+ <!-- prettier-ignore -->
289
+ ````markdown
290
+ # Guide
291
+
292
+ ## API
293
+ ````
294
+
295
+ ### `markdown/no-reference-like-urls`
296
+
297
+ 禁止出现该规则定义的不安全、无效或易误解结构。上游说明:Disallow URLs that match defined reference identifiers
298
+
299
+ - 生效级别与范围:error: Markdown
300
+ - 自动修复:支持;执行前仍应检查语义和差异
301
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/no-reference-like-urls.md)
302
+ - 常见报告:`Unexpected resource {{type}} ('{{prefix}}[text](url)') with URL that matches a definition identifier. Use '[text][id]' syntax instead.`
303
+ - 示例类型:第三方预置规则的直接代码示例
304
+
305
+ 错误示例:
306
+
307
+ <!-- prettier-ignore -->
308
+ ````markdown
309
+ [docs]: /guide
310
+
311
+ [Guide](docs)
312
+ ````
313
+
314
+ 正确示例:
315
+
316
+ <!-- prettier-ignore -->
317
+ ````markdown
318
+ [docs]: /guide
319
+
320
+ [Guide][docs]
321
+ ````
322
+
323
+ ### `markdown/no-reversed-media-syntax`
324
+
325
+ 禁止出现该规则定义的不安全、无效或易误解结构。上游说明:Disallow reversed link and image syntax
326
+
327
+ - 生效级别与范围:error: Markdown
328
+ - 自动修复:支持;执行前仍应检查语义和差异
329
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/no-reversed-media-syntax.md)
330
+ - 常见报告:`Unexpected reversed syntax found. Use [label](URL) syntax instead.`
331
+ - 示例类型:第三方预置规则的直接代码示例
332
+
333
+ 错误示例:
334
+
335
+ <!-- prettier-ignore -->
336
+ ````markdown
337
+ (Guide)[/guide]
338
+ ````
339
+
340
+ 正确示例:
341
+
342
+ <!-- prettier-ignore -->
343
+ ````markdown
344
+ [Guide](/guide)
345
+ ````
346
+
347
+ ### `markdown/no-space-in-emphasis`
348
+
349
+ 禁止出现该规则定义的不安全、无效或易误解结构。上游说明:Disallow spaces around emphasis markers
350
+
351
+ - 生效级别与范围:error: Markdown
352
+ - 自动修复:支持;执行前仍应检查语义和差异
353
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/no-space-in-emphasis.md)
354
+ - 常见报告:`Unexpected space around emphasis marker.`
355
+ - 示例类型:第三方预置规则的直接代码示例
356
+
357
+ 错误示例:
358
+
359
+ <!-- prettier-ignore -->
360
+ ````markdown
361
+ ** emphasized **
362
+ ````
363
+
364
+ 正确示例:
365
+
366
+ <!-- prettier-ignore -->
367
+ ````markdown
368
+ **emphasized**
369
+ ````
370
+
371
+ ### `markdown/no-unused-definitions`
372
+
373
+ 禁止出现该规则定义的不安全、无效或易误解结构。上游说明:Disallow unused definitions
374
+
375
+ - 生效级别与范围:error: Markdown
376
+ - 自动修复:不支持或上游未声明
377
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/no-unused-definitions.md)
378
+ - 常见报告:`Unexpected unused definition '{{ identifier }}' (label: '{{ label }}') found.`;`Unexpected unused footnote definition '{{ identifier }}' (label: '{{ label }}') found.`
379
+ - 示例类型:第三方预置规则的直接代码示例
380
+
381
+ 错误示例:
382
+
383
+ <!-- prettier-ignore -->
384
+ ````markdown
385
+ Text only.
386
+
387
+ [docs]: /guide
388
+ ````
389
+
390
+ 正确示例:
391
+
392
+ <!-- prettier-ignore -->
393
+ ````markdown
394
+ [Guide][docs]
395
+
396
+ [docs]: /guide
397
+ ````
398
+
399
+ ### `markdown/require-alt-text`
400
+
401
+ 要求补齐该规则所需的声明、属性或结构。上游说明:Require alternative text for images
402
+
403
+ - 生效级别与范围:error: Markdown
404
+ - 自动修复:不支持或上游未声明
405
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/require-alt-text.md)
406
+ - 常见报告:`Alternative text for image is required.`
407
+ - 示例类型:第三方预置规则的直接代码示例
408
+
409
+ 错误示例:
410
+
411
+ <!-- prettier-ignore -->
412
+ ````markdown
413
+ ![](/chart.png)
414
+ ````
415
+
416
+ 正确示例:
417
+
418
+ <!-- prettier-ignore -->
419
+ ````markdown
420
+ ![Request volume chart](/chart.png)
421
+ ````
422
+
423
+ ### `markdown/table-column-count`
424
+
425
+ 检查该规则对应的代码约束。上游说明:Disallow data rows in a GitHub Flavored Markdown table from having more cells than the header row
426
+
427
+ - 生效级别与范围:error: Markdown
428
+ - 自动修复:不支持或上游未声明
429
+ - 规则来源:[官方文档](https://github.com/eslint/markdown/blob/main/docs/rules/table-column-count.md)
430
+ - 常见报告:`Table column count mismatch (Expected: {{expectedCells}}, Actual: {{actualCells}}), extra data starting here will be ignored.`;`Table column count mismatch (Expected: {{expectedCells}}, Actual: {{actualCells}}), row might be missing data.`
431
+ - 示例类型:第三方预置规则的直接代码示例
432
+
433
+ 错误示例:
434
+
435
+ <!-- prettier-ignore -->
436
+ ````markdown
437
+ | Name | Value |
438
+ | --- | --- |
439
+ | A | 1 | extra |
440
+ ````
441
+
442
+ 正确示例:
443
+
444
+ <!-- prettier-ignore -->
445
+ ````markdown
446
+ | Name | Value |
447
+ | --- | --- |
448
+ | A | 1 |
449
+ ````