@pumpn/eslint-config 11.1.2 → 12.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.
Files changed (68) hide show
  1. package/.ls-lint.yml +6 -0
  2. package/.tool-versions +1 -0
  3. package/.vscode/settings.json +7 -0
  4. package/config.js +91 -62
  5. package/deno.json +40 -0
  6. package/deno.lock +3152 -0
  7. package/eslint.config.js +13 -0
  8. package/import-map.json +26 -0
  9. package/jsdoc.json +51 -0
  10. package/package.json +24 -17
  11. package/plugins.js +40 -0
  12. package/rules/_exports.js +21 -0
  13. package/rules/eslint-comments/_exports.js +2 -0
  14. package/rules/eslint-comments/best-practices.js +10 -0
  15. package/rules/eslint-comments/stylistic-issues.js +12 -0
  16. package/rules/eslint-comments.js +12 -0
  17. package/rules/github.js +27 -0
  18. package/rules/import/_exports.js +4 -0
  19. package/rules/import/helpful-warnings.js +18 -0
  20. package/rules/import/module-systems.js +9 -0
  21. package/rules/import/static-analysis.js +71 -0
  22. package/rules/import/style-guide.js +86 -0
  23. package/rules/import.js +12 -0
  24. package/rules/jsdoc.js +255 -54
  25. package/rules/jsx-a11y.js +139 -0
  26. package/rules/layout-and-formatting.js +4 -260
  27. package/rules/no-secrets.js +18 -0
  28. package/rules/no-unsanitized.js +6 -0
  29. package/rules/perfectionist.js +267 -0
  30. package/rules/possible-problems.js +74 -15
  31. package/rules/promise.js +25 -0
  32. package/rules/react.js +105 -2
  33. package/rules/redos.js +15 -0
  34. package/rules/regexp/_exports.js +3 -0
  35. package/rules/regexp/best-practices.js +43 -0
  36. package/rules/regexp/possible-errors.js +26 -0
  37. package/rules/regexp/stylistic-issues.js +62 -0
  38. package/rules/regexp.js +12 -0
  39. package/rules/security.js +18 -0
  40. package/rules/sonarjs/_exports.js +2 -0
  41. package/rules/sonarjs/bug-detection.js +14 -0
  42. package/rules/sonarjs/code-smell-detection.js +37 -0
  43. package/rules/sonarjs.js +12 -0
  44. package/rules/stylistic/_common/_exports.js +3 -0
  45. package/rules/stylistic/_common/min-items-for-array-newline.js +3 -0
  46. package/rules/stylistic/_exports.js +13 -0
  47. package/rules/stylistic/brackets.js +79 -0
  48. package/rules/stylistic/commas.js +13 -0
  49. package/rules/stylistic/comments.js +23 -0
  50. package/rules/stylistic/disallow.js +31 -0
  51. package/rules/stylistic/indent.js +12 -0
  52. package/rules/stylistic/jsx.js +35 -0
  53. package/rules/stylistic/linebreaks.js +74 -0
  54. package/rules/stylistic/misc.js +32 -0
  55. package/rules/stylistic/operators.js +26 -0
  56. package/rules/stylistic/quotes.js +7 -0
  57. package/rules/stylistic/semis.js +14 -0
  58. package/rules/stylistic/spacing.js +53 -0
  59. package/rules/stylistic/types.js +7 -0
  60. package/rules/stylistic.js +12 -0
  61. package/rules/suggestions.js +152 -135
  62. package/rules/tailwindcss.js +11 -0
  63. package/rules/unicorn.js +200 -0
  64. package/rules.js +11 -14
  65. package/.np-config.cjs +0 -1
  66. package/addons/deno.js +0 -15
  67. package/addons.js +0 -1
  68. package/rules/imports.js +0 -135
package/rules/jsdoc.js CHANGED
@@ -1,57 +1,81 @@
1
- export default {
2
- "jsdoc/check-access": ["warn"],
3
- "jsdoc/check-alignment": ["warn", "always"],
4
- "jsdoc/check-examples": [
5
- "off",
1
+ const jsdocRules = {
2
+ "jsdoc/check-access": "warn",
3
+ "jsdoc/check-alignment": "warn",
4
+ // TODO [eslint-plugin-jsdoc@>=49]: enable when https://github.com/eslint/eslint/issues/14745 is fixed
5
+ "jsdoc/check-examples": "off",
6
+ "jsdoc/check-indentation": "warn",
7
+ "jsdoc/check-line-alignment": "off",
8
+ "jsdoc/check-param-names": "warn",
9
+ "jsdoc/check-property-names": "warn",
10
+ "jsdoc/check-syntax": "warn",
11
+ "jsdoc/check-tag-names": [
12
+ "warn",
13
+ {
14
+ definedTags: ["category", "component"]
15
+ }
16
+ ],
17
+ "jsdoc/check-types": "warn",
18
+ "jsdoc/check-values": "warn",
19
+ "jsdoc/empty-tags": "warn",
20
+ "jsdoc/implements-on-classes": "warn",
21
+ "jsdoc/imports-as-dependencies": "off",
22
+ "jsdoc/informative-docs": "warn",
23
+ "jsdoc/match-description": "off",
24
+ "jsdoc/match-name": "off",
25
+ "jsdoc/multiline-blocks": "warn",
26
+ "jsdoc/no-bad-blocks": ["warn", { preventAllMultiAsteriskBlocks: true }],
27
+ "jsdoc/no-blank-block-descriptions": "off",
28
+ "jsdoc/no-blank-blocks": "off",
29
+ "jsdoc/no-defaults": "warn",
30
+ "jsdoc/no-missing-syntax": "off",
31
+ "jsdoc/no-multi-asterisks": "warn",
32
+ "jsdoc/no-restricted-syntax": "off",
33
+ "jsdoc/no-types": "off",
34
+ "jsdoc/no-undefined-types": [
35
+ "warn",
6
36
  {
7
- matchingFileName: "jsdoc-example.js"
37
+ definedTypes: ["Iterable", "IterableIterator"]
8
38
  }
9
39
  ],
10
- "jsdoc/check-indentation": [
40
+ "jsdoc/require-asterisk-prefix": [
11
41
  "warn",
42
+ "always",
12
43
  {
13
- excludeTags: ["description", "example"]
44
+ tags: {
45
+ any: ["typedef"]
46
+ }
14
47
  }
15
48
  ],
16
- "jsdoc/check-param-names": ["warn"],
17
- "jsdoc/check-property-names": ["warn"],
18
- "jsdoc/check-syntax": ["warn"],
19
- "jsdoc/check-tag-names": ["warn"],
20
- "jsdoc/check-types": ["warn"],
21
- "jsdoc/check-values": ["warn"],
22
- "jsdoc/empty-tags": ["warn"],
23
- "jsdoc/implements-on-classes": ["warn"],
24
- "jsdoc/match-description": ["warn"],
25
- "jsdoc/no-bad-blocks": ["warn"],
26
- "jsdoc/no-defaults": ["warn"],
27
- "jsdoc/no-undefined-types": ["warn"],
28
49
  "jsdoc/require-description": [
29
50
  "warn",
30
51
  {
31
- contexts: [
32
- "Program",
33
- "ArrowFunctionExpression",
34
- "FunctionDeclaration",
35
- "FunctionExpression",
36
- "VariableDeclaration"
37
- ]
52
+ contexts: ["any"],
53
+ descriptionStyle: "body"
54
+ }
55
+ ],
56
+ "jsdoc/require-description-complete-sentence": "warn",
57
+ "jsdoc/require-example": "warn",
58
+ "jsdoc/require-file-overview": [
59
+ "off",
60
+ {
61
+ tags: {
62
+ file: {
63
+ initialCommentsOnly: true,
64
+ mustExist: true,
65
+ preventDuplicates: true
66
+ },
67
+ license: {
68
+ initialCommentsOnly: true,
69
+ mustExist: true,
70
+ preventDuplicates: true
71
+ }
72
+ }
38
73
  }
39
74
  ],
40
- "jsdoc/require-description-complete-sentence": ["warn"],
41
- "jsdoc/require-example": ["off"],
42
- "jsdoc/require-file-overview": ["off"],
43
- "jsdoc/require-hyphen-before-param-description": ["warn"],
75
+ "jsdoc/require-hyphen-before-param-description": ["warn", "always"],
44
76
  "jsdoc/require-jsdoc": [
45
77
  "warn",
46
78
  {
47
- contexts: [
48
- "ArrowFunctionExpression",
49
- "ClassDeclaration",
50
- "ClassExpression",
51
- "FunctionDeclaration",
52
- "FunctionExpression"
53
- ],
54
- publicOnly: true,
55
79
  require: {
56
80
  ArrowFunctionExpression: true,
57
81
  ClassDeclaration: true,
@@ -62,22 +86,199 @@ export default {
62
86
  }
63
87
  }
64
88
  ],
65
- "jsdoc/require-param": ["warn"],
66
- "jsdoc/require-param-description": ["warn"],
67
- "jsdoc/require-param-name": ["warn"],
68
- "jsdoc/require-param-type": ["warn"],
69
- "jsdoc/require-property": ["warn"],
70
- "jsdoc/require-property-description": ["warn"],
71
- "jsdoc/require-property-name": ["warn"],
72
- "jsdoc/require-property-type": ["warn"],
73
- "jsdoc/require-returns": ["warn"],
74
- "jsdoc/require-returns-check": ["warn"],
75
- "jsdoc/require-returns-description": ["warn"],
76
- "jsdoc/require-returns-type": ["warn"],
89
+ "jsdoc/require-param": ["warn", { unnamedRootBase: ["options"] }],
90
+ "jsdoc/require-param-description": [
91
+ "warn",
92
+ {
93
+ setDefaultDestructuredRootDescription: true
94
+ }
95
+ ],
96
+ "jsdoc/require-param-name": "warn",
97
+ "jsdoc/require-param-type": "warn",
98
+ "jsdoc/require-property": "warn",
99
+ "jsdoc/require-property-description": "warn",
100
+ "jsdoc/require-property-name": "warn",
101
+ "jsdoc/require-property-type": "warn",
102
+ "jsdoc/require-returns": "warn",
103
+ "jsdoc/require-returns-check": "warn",
104
+ "jsdoc/require-returns-description": "warn",
105
+ "jsdoc/require-returns-type": "warn",
106
+ "jsdoc/require-throws": "warn",
107
+ "jsdoc/require-yields": "warn",
108
+ "jsdoc/require-yields-check": "warn",
109
+ "jsdoc/sort-tags": [
110
+ "warn",
111
+ {
112
+ tagSequence: [
113
+ {
114
+ tags: [
115
+ // Brief descriptions
116
+ "summary",
117
+ "typeSummary",
118
+
119
+ // Module/file-level
120
+ "module",
121
+ "exports",
122
+ "file",
123
+ "fileoverview",
124
+ "overview",
125
+
126
+ // Identifying (name, type)
127
+ "template",
128
+ "typedef",
129
+ "interface",
130
+ "record",
131
+ "name",
132
+ "kind",
133
+ "type",
134
+ "alias",
135
+ "external",
136
+ "host",
137
+ "callback",
138
+ "func",
139
+ "function",
140
+ "method",
141
+ "class",
142
+ "constructor",
143
+
144
+ // Relationships
145
+ "modifies",
146
+ "mixes",
147
+ "mixin",
148
+ "mixinClass",
149
+ "mixinFunction",
150
+ "namespace",
151
+ "borrows",
152
+ "constructs",
153
+ "lends",
154
+ "implements",
155
+ "requires",
156
+
157
+ // Long descriptions
158
+ "desc",
159
+ "description",
160
+ "classdesc",
161
+ "tutorial",
162
+ "copyright",
163
+ "license",
164
+
165
+ // Simple annotations
166
+ "const",
167
+ "constant",
168
+ "final",
169
+ "global",
170
+ "readonly",
171
+ "abstract",
172
+ "virtual",
173
+ "var",
174
+ "member",
175
+ "memberof",
176
+ "memberof!",
177
+ "inner",
178
+ "instance",
179
+ "inheritdoc",
180
+ "inheritDoc",
181
+ "override",
182
+ "hideconstructor",
183
+ "component",
184
+
185
+ // Core function/object info
186
+ "param",
187
+ "arg",
188
+ "argument",
189
+ "prop",
190
+ "property",
191
+ "return",
192
+ "returns",
193
+
194
+ // Important behavior details
195
+ "async",
196
+ "generator",
197
+ "default",
198
+ "defaultvalue",
199
+ "enum",
200
+ "augments",
201
+ "extends",
202
+ "throws",
203
+ "exception",
204
+ "yield",
205
+ "yields",
206
+ "event",
207
+ "fires",
208
+ "emits",
209
+ "listens",
210
+ "this",
211
+
212
+ // Access
213
+ "static",
214
+ "private",
215
+ "protected",
216
+ "public",
217
+ "access",
218
+ "package",
219
+
220
+ "-other",
221
+
222
+ // Supplementary descriptions
223
+ "see",
224
+ "example",
225
+
226
+ // METADATA
227
+
228
+ // Other Closure (undocumented) metadata
229
+ "closurePrimitive",
230
+ "customElement",
231
+ "expose",
232
+ "hidden",
233
+ "idGenerator",
234
+ "meaning",
235
+ "ngInject",
236
+ "owner",
237
+ "wizaction",
238
+
239
+ // Other Closure (documented) metadata
240
+ "define",
241
+ "dict",
242
+ "export",
243
+ "externs",
244
+ "implicitCast",
245
+ "noalias",
246
+ "nocollapse",
247
+ "nocompile",
248
+ "noinline",
249
+ "nosideeffects",
250
+ "polymer",
251
+ "polymerBehavior",
252
+ "preserve",
253
+ "struct",
254
+ "suppress",
255
+ "unrestricted",
256
+
257
+ // @homer0/prettier-plugin-jsdoc metadata
258
+ "category",
259
+
260
+ // Non-Closure metadata
261
+ "ignore",
262
+ "author",
263
+ "version",
264
+ "variation",
265
+ "since",
266
+ "deprecated",
267
+ "todo"
268
+ ]
269
+ }
270
+ ]
271
+ }
272
+ ],
77
273
  "jsdoc/tag-lines": [
78
274
  "warn",
79
- "any",
80
- { startLines: 1 }
275
+ "never",
276
+ {
277
+ startLines: 1
278
+ }
81
279
  ],
82
- "jsdoc/valid-types": ["warn"]
280
+ "jsdoc/text-escaping": "off",
281
+ "jsdoc/valid-types": "off"
83
282
  };
283
+
284
+ export default jsdocRules;
@@ -0,0 +1,139 @@
1
+ const jsxA11yRules = {
2
+ "jsx-a11y/alt-text": "error",
3
+ "jsx-a11y/anchor-ambiguous-text": [
4
+ "error",
5
+ {
6
+ words: [
7
+ "this",
8
+ "more",
9
+ "read here",
10
+ "read more"
11
+ ]
12
+ }
13
+ ],
14
+ "jsx-a11y/anchor-has-content": "error",
15
+ "jsx-a11y/anchor-is-valid": "error",
16
+ "jsx-a11y/aria-activedescendant-has-tabindex": "error",
17
+ "jsx-a11y/aria-props": "error",
18
+ "jsx-a11y/aria-proptypes": "error",
19
+ "jsx-a11y/aria-role": "error",
20
+ "jsx-a11y/aria-unsupported-elements": "error",
21
+ "jsx-a11y/autocomplete-valid": "error",
22
+ "jsx-a11y/click-events-have-key-events": "error",
23
+ "jsx-a11y/control-has-associated-label": [
24
+ "error",
25
+ {
26
+ ignoreElements: [
27
+ "audio",
28
+ "canvas",
29
+ "embed",
30
+ "input",
31
+ "textarea",
32
+ "tr",
33
+ "video"
34
+ ],
35
+ ignoreRoles: [
36
+ "grid",
37
+ "listbox",
38
+ "menu",
39
+ "menubar",
40
+ "radiogroup",
41
+ "row",
42
+ "tablist",
43
+ "toolbar",
44
+ "tree",
45
+ "treegrid"
46
+ ],
47
+ includeRoles: ["alert", "dialog"]
48
+ }
49
+ ],
50
+ "jsx-a11y/heading-has-content": "error",
51
+ "jsx-a11y/html-has-lang": "error",
52
+ "jsx-a11y/iframe-has-title": "error",
53
+ "jsx-a11y/img-redundant-alt": "error",
54
+ "jsx-a11y/interactive-supports-focus": [
55
+ "error",
56
+ {
57
+ tabbable: [
58
+ "button",
59
+ "checkbox",
60
+ "link",
61
+ "progressbar",
62
+ "searchbox",
63
+ "slider",
64
+ "spinbutton",
65
+ "switch",
66
+ "textbox"
67
+ ]
68
+ }
69
+ ],
70
+ "jsx-a11y/label-has-associated-control": "error",
71
+ "jsx-a11y/lang": "error",
72
+ "jsx-a11y/media-has-caption": "error",
73
+ "jsx-a11y/mouse-events-have-key-events": "error",
74
+ "jsx-a11y/no-access-key": "error",
75
+ "jsx-a11y/no-aria-hidden-on-focusable": "error",
76
+ "jsx-a11y/no-autofocus": "off",
77
+ "jsx-a11y/no-distracting-elements": "error",
78
+ "jsx-a11y/no-interactive-element-to-noninteractive-role": [
79
+ "error",
80
+ {
81
+ canvas: ["img"],
82
+ td: ["cell"],
83
+ tr: ["none", "presentation"]
84
+ }
85
+ ],
86
+ "jsx-a11y/no-noninteractive-element-interactions": [
87
+ "error",
88
+ {
89
+ body: ["onError", "onLoad"],
90
+ iframe: ["onError", "onLoad"],
91
+ img: ["onError", "onLoad"]
92
+ }
93
+ ],
94
+ "jsx-a11y/no-noninteractive-element-to-interactive-role": [
95
+ "error",
96
+ {
97
+ fieldset: ["radiogroup", "presentation"],
98
+ li: [
99
+ "menuitem",
100
+ "menuitemradio",
101
+ "menuitemcheckbox",
102
+ "option",
103
+ "row",
104
+ "tab",
105
+ "treeitem"
106
+ ],
107
+ ol: [
108
+ "listbox",
109
+ "menu",
110
+ "menubar",
111
+ "radiogroup",
112
+ "tablist",
113
+ "tree",
114
+ "treegrid"
115
+ ],
116
+ table: ["grid"],
117
+ td: ["gridcell"],
118
+ ul: [
119
+ "listbox",
120
+ "menu",
121
+ "menubar",
122
+ "radiogroup",
123
+ "tablist",
124
+ "tree",
125
+ "treegrid"
126
+ ]
127
+ }
128
+ ],
129
+ "jsx-a11y/no-noninteractive-tabindex": "error",
130
+ "jsx-a11y/no-redundant-roles": "error",
131
+ "jsx-a11y/no-static-element-interactions": "error",
132
+ "jsx-a11y/prefer-tag-over-role": "error",
133
+ "jsx-a11y/role-has-required-aria-props": "error",
134
+ "jsx-a11y/role-supports-aria-props": "error",
135
+ "jsx-a11y/scope": "error",
136
+ "jsx-a11y/tabindex-no-positive": "error"
137
+ };
138
+
139
+ export default jsxA11yRules;