@pumpn/eslint-config 17.2.3 → 18.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 (209) hide show
  1. package/_common/_exports.js +5 -0
  2. package/_common/all-extensions/_exports.js +1 -0
  3. package/_common/all-extensions/js-extensions.js +10 -0
  4. package/_common/all-extensions.js +6 -0
  5. package/_common/convert-extensions-to-glob.js +12 -0
  6. package/_common/js-jsx-extensions.js +3 -0
  7. package/_common/ts-extensions.js +10 -0
  8. package/_common/ts-jsx-extensions.js +3 -0
  9. package/config/_common/_exports.js +5 -0
  10. package/config/_common/add-prefix-to-rules.js +13 -0
  11. package/config/_common/core-json-rules.js +24 -0
  12. package/config/_common/json-plugins.js +9 -0
  13. package/config/_common/pick-unicorn-rules-for-language/_exports.js +2 -0
  14. package/config/_common/pick-unicorn-rules-for-language/pick-rules-for-language.js +52 -0
  15. package/config/_common/pick-unicorn-rules-for-language/unicorn/_exports.js +9 -0
  16. package/config/_common/pick-unicorn-rules-for-language/unicorn/binary-group-length.js +3 -0
  17. package/config/_common/pick-unicorn-rules-for-language/unicorn/hexadecimal-group-length.js +3 -0
  18. package/config/_common/pick-unicorn-rules-for-language/unicorn/maximum-nested-calls.js +3 -0
  19. package/config/_common/pick-unicorn-rules-for-language/unicorn/number-group-length.js +3 -0
  20. package/config/_common/pick-unicorn-rules-for-language/unicorn/octal-group-length.js +3 -0
  21. package/config/_common/pick-unicorn-rules-for-language/unicorn/patterns.js +28 -0
  22. package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-consistency-rules/_exports.js +1 -0
  23. package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-consistency-rules/consistent-function-style.js +3 -0
  24. package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-consistency-rules.js +66 -0
  25. package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-preference-rules.js +199 -0
  26. package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-redundancy-rules.js +47 -0
  27. package/config/_common/pick-unicorn-rules-for-language/unicorn.js +368 -0
  28. package/config/_common/pick-unicorn-rules-for-language.js +14 -0
  29. package/config/_exports.js +11 -0
  30. package/config/converted-globals.js +16 -0
  31. package/config/css-config/_exports.js +2 -0
  32. package/config/css-config/css-plugins.js +9 -0
  33. package/config/css-config/css-rules/_exports.js +1 -0
  34. package/config/css-config/css-rules/core-css-rules.js +25 -0
  35. package/config/css-config/css-rules.js +10 -0
  36. package/config/css-config.js +17 -0
  37. package/config/default-glob.js +6 -0
  38. package/config/html-config/_exports.js +2 -0
  39. package/config/html-config/html-plugins.js +9 -0
  40. package/config/html-config/html-rules/_exports.js +1 -0
  41. package/config/html-config/html-rules/core-html-rules/_exports.js +4 -0
  42. package/config/html-config/html-rules/core-html-rules/core-html-accessibility-rules.js +28 -0
  43. package/config/html-config/html-rules/core-html-rules/core-html-best-practice-rules.js +42 -0
  44. package/config/html-config/html-rules/core-html-rules/core-html-seo-rules.js +16 -0
  45. package/config/html-config/html-rules/core-html-rules/core-html-style-rules.js +23 -0
  46. package/config/html-config/html-rules/core-html-rules.js +27 -0
  47. package/config/html-config/html-rules.js +10 -0
  48. package/config/html-config.js +12 -0
  49. package/config/json-config/_exports.js +1 -0
  50. package/config/json-config/json-rules.js +9 -0
  51. package/config/json-config.js +13 -0
  52. package/config/jsonc-config/_exports.js +1 -0
  53. package/config/jsonc-config/jsonc-rules.js +9 -0
  54. package/config/jsonc-config.js +26 -0
  55. package/config/jsx-glob/_exports.js +1 -0
  56. package/config/jsx-glob/jsx-extensions.js +6 -0
  57. package/config/jsx-glob.js +7 -0
  58. package/config/md-config/_exports.js +2 -0
  59. package/config/md-config/md-plugins.js +9 -0
  60. package/config/md-config/md-rules/_exports.js +1 -0
  61. package/config/md-config/md-rules/core-md-rules.js +30 -0
  62. package/config/md-config/md-rules.js +10 -0
  63. package/config/md-config.js +15 -0
  64. package/{plugins.js → config/plugins.js} +7 -6
  65. package/{rules → config/rules}/_common/_exports.js +0 -1
  66. package/{rules → config/rules}/_exports.js +1 -4
  67. package/config/rules/better-tailwindcss/correctness.js +13 -0
  68. package/config/rules/better-tailwindcss/stylistic.js +42 -0
  69. package/config/rules/better-tailwindcss.js +15 -0
  70. package/config/rules/command.js +17 -0
  71. package/config/rules/depend.js +17 -0
  72. package/config/rules/eslint-comments/best-practices.js +14 -0
  73. package/config/rules/eslint-comments/stylistic-issues.js +17 -0
  74. package/config/rules/eslint-comments.js +15 -0
  75. package/config/rules/import-x/helpful-warnings.js +26 -0
  76. package/config/rules/import-x/module-systems.js +14 -0
  77. package/config/rules/import-x/static-analysis.js +40 -0
  78. package/config/rules/import-x/style-guide/_exports.js +1 -0
  79. package/config/rules/import-x/style-guide/max-dependencies.js +3 -0
  80. package/config/rules/import-x/style-guide.js +94 -0
  81. package/config/rules/import-x.js +22 -0
  82. package/config/rules/jsdoc.js +464 -0
  83. package/config/rules/no-secrets/_exports.js +1 -0
  84. package/config/rules/no-secrets/tolerance.js +3 -0
  85. package/config/rules/no-secrets.js +30 -0
  86. package/config/rules/perfectionist.js +331 -0
  87. package/config/rules/promise.js +53 -0
  88. package/config/rules/react/core.js +69 -0
  89. package/config/rules/react/debug.js +14 -0
  90. package/config/rules/react/dom.js +25 -0
  91. package/config/rules/react/jsx.js +23 -0
  92. package/config/rules/react/naming-convention.js +12 -0
  93. package/config/rules/react/rsc.js +10 -0
  94. package/config/rules/react/web-api.js +15 -0
  95. package/config/rules/react.js +28 -0
  96. package/config/rules/regexp/best-practices.js +47 -0
  97. package/config/rules/regexp/possible-errors.js +31 -0
  98. package/config/rules/regexp/stylistic-issues.js +79 -0
  99. package/config/rules/regexp.js +20 -0
  100. package/config/rules/security.js +31 -0
  101. package/config/rules/sonarjs/problem.js +134 -0
  102. package/config/rules/sonarjs/suggestion.js +167 -0
  103. package/config/rules/sonarjs.js +15 -0
  104. package/config/rules/stylistic/_common/_exports.js +1 -0
  105. package/{rules → config/rules}/stylistic/_exports.js +1 -1
  106. package/config/rules/stylistic/brackets/_exports.js +2 -0
  107. package/config/rules/stylistic/brackets/min-elements-for-curly-newline.js +3 -0
  108. package/config/rules/stylistic/brackets/wrap-multilines-default.js +3 -0
  109. package/config/rules/stylistic/brackets.js +90 -0
  110. package/config/rules/stylistic/commas.js +18 -0
  111. package/config/rules/stylistic/comments.js +13 -0
  112. package/config/rules/stylistic/disallow.js +36 -0
  113. package/config/rules/stylistic/indent.js +19 -0
  114. package/config/rules/stylistic/jsx.js +42 -0
  115. package/config/rules/stylistic/linebreaks/_exports.js +1 -0
  116. package/config/rules/stylistic/linebreaks/max-ignored-chain-depth.js +3 -0
  117. package/config/rules/stylistic/linebreaks.js +67 -0
  118. package/config/rules/stylistic/misc.js +49 -0
  119. package/config/rules/stylistic/operators.js +31 -0
  120. package/config/rules/stylistic/quotes.js +12 -0
  121. package/config/rules/stylistic/semis.js +19 -0
  122. package/config/rules/stylistic/spacing.js +68 -0
  123. package/config/rules/stylistic/types.js +12 -0
  124. package/config/rules/stylistic.js +40 -0
  125. package/config/rules/suggestions/_exports.js +9 -0
  126. package/config/rules/suggestions/max-classes-per-file.js +3 -0
  127. package/config/rules/suggestions/max-depth.js +3 -0
  128. package/config/rules/suggestions/max-identifier-length.js +3 -0
  129. package/config/rules/suggestions/max-lines-per-file.js +3 -0
  130. package/config/rules/suggestions/max-lines-per-function.js +3 -0
  131. package/config/rules/suggestions/max-nested-callbacks.js +3 -0
  132. package/config/rules/suggestions/max-parameters.js +3 -0
  133. package/config/rules/suggestions/max-statements.js +3 -0
  134. package/config/rules/suggestions/min-identifier-length.js +3 -0
  135. package/{rules → config/rules}/suggestions.js +17 -15
  136. package/config/rules.js +50 -0
  137. package/config/ts-glob.js +6 -0
  138. package/config.js +51 -53
  139. package/package.json +51 -38
  140. package/.ls-lint.yml +0 -6
  141. package/.vscode/settings.json +0 -18
  142. package/deno.json +0 -78
  143. package/deno.lock +0 -1632
  144. package/eslint.config.js +0 -25
  145. package/rules/better-tailwindcss/correctness.js +0 -7
  146. package/rules/better-tailwindcss/stylistic.js +0 -38
  147. package/rules/better-tailwindcss.js +0 -19
  148. package/rules/command.js +0 -12
  149. package/rules/depend.js +0 -12
  150. package/rules/eslint-comments/best-practices.js +0 -9
  151. package/rules/eslint-comments/stylistic-issues.js +0 -12
  152. package/rules/eslint-comments.js +0 -19
  153. package/rules/import-x/helpful-warnings.js +0 -21
  154. package/rules/import-x/module-systems.js +0 -9
  155. package/rules/import-x/static-analysis.js +0 -35
  156. package/rules/import-x/style-guide.js +0 -89
  157. package/rules/import-x.js +0 -19
  158. package/rules/jsdoc.js +0 -433
  159. package/rules/no-secrets.js +0 -25
  160. package/rules/perfectionist.js +0 -318
  161. package/rules/promise.js +0 -48
  162. package/rules/react/core.js +0 -59
  163. package/rules/react/debug.js +0 -6
  164. package/rules/react/dom.js +0 -15
  165. package/rules/react/jsx.js +0 -18
  166. package/rules/react/naming-convention.js +0 -6
  167. package/rules/react/rsc.js +0 -5
  168. package/rules/react/web-api.js +0 -10
  169. package/rules/react.js +0 -19
  170. package/rules/regexp/best-practices.js +0 -42
  171. package/rules/regexp/possible-errors.js +0 -26
  172. package/rules/regexp/stylistic-issues.js +0 -74
  173. package/rules/regexp.js +0 -19
  174. package/rules/security.js +0 -25
  175. package/rules/sonarjs/problem.js +0 -123
  176. package/rules/sonarjs/suggestion.js +0 -135
  177. package/rules/sonarjs.js +0 -19
  178. package/rules/stylistic/_common/_exports.js +0 -3
  179. package/rules/stylistic/brackets.js +0 -87
  180. package/rules/stylistic/commas.js +0 -13
  181. package/rules/stylistic/comments.js +0 -8
  182. package/rules/stylistic/disallow.js +0 -31
  183. package/rules/stylistic/indent.js +0 -14
  184. package/rules/stylistic/jsx.js +0 -37
  185. package/rules/stylistic/linebreaks.js +0 -63
  186. package/rules/stylistic/misc.js +0 -45
  187. package/rules/stylistic/operators.js +0 -26
  188. package/rules/stylistic/quotes.js +0 -7
  189. package/rules/stylistic/semis.js +0 -14
  190. package/rules/stylistic/spacing.js +0 -63
  191. package/rules/stylistic/types.js +0 -7
  192. package/rules/stylistic.js +0 -19
  193. package/rules/unicorn.js +0 -306
  194. package/rules.js +0 -19
  195. package/scripts/update-import-map.js +0 -47
  196. package/scripts/update-package-json.js +0 -66
  197. package/scripts/update-tsconfig.js +0 -46
  198. package/tsconfig.json +0 -27
  199. /package/{rules → config}/_common/tab-width.js +0 -0
  200. /package/{rules → config/rules}/_common/maximum-line-length.js +0 -0
  201. /package/{rules → config/rules}/better-tailwindcss/_exports.js +0 -0
  202. /package/{rules → config/rules}/eslint-comments/_exports.js +0 -0
  203. /package/{rules → config/rules}/import-x/_exports.js +0 -0
  204. /package/{rules → config/rules}/layout-and-formatting.js +0 -0
  205. /package/{rules → config/rules}/possible-problems.js +0 -0
  206. /package/{rules → config/rules}/react/_exports.js +0 -0
  207. /package/{rules → config/rules}/regexp/_exports.js +0 -0
  208. /package/{rules → config/rules}/sonarjs/_exports.js +0 -0
  209. /package/{rules → config/rules}/stylistic/_common/min-items-for-array-newline.js +0 -0
@@ -1,63 +0,0 @@
1
- const spacingRules = {
2
- "@stylistic/arrow-spacing": [
3
- "error",
4
- {
5
- before: true,
6
- after: true
7
- }
8
- ],
9
- "@stylistic/block-spacing": ["error", "always"],
10
- "@stylistic/computed-property-spacing": ["error", "never"],
11
- "@stylistic/exp-list-style": [
12
- "error",
13
- {
14
- multiLine: {
15
- minItems: 0
16
- },
17
- overrides: {
18
- "[]": "off",
19
- "{}": { singleLine: { spacing: "always" } }
20
- },
21
- singleLine: {
22
- maxItems: 3,
23
- spacing: "never"
24
- }
25
- }
26
- ],
27
- "@stylistic/function-call-spacing": ["error", "never"],
28
- "@stylistic/generator-star-spacing": ["error", "after"],
29
- "@stylistic/key-spacing": [
30
- "error",
31
- {
32
- beforeColon: false,
33
- afterColon: true,
34
- mode: "strict"
35
- }
36
- ],
37
- "@stylistic/keyword-spacing": [
38
- "error",
39
- {
40
- before: true,
41
- after: true
42
- }
43
- ],
44
- "@stylistic/rest-spread-spacing": ["error", "never"],
45
- "@stylistic/space-before-blocks": ["error", "always"],
46
- "@stylistic/switch-colon-spacing": [
47
- "error",
48
- {
49
- before: false,
50
- after: true
51
- }
52
- ],
53
- "@stylistic/template-tag-spacing": ["error", "never"],
54
- "@stylistic/yield-star-spacing": [
55
- "error",
56
- {
57
- before: false,
58
- after: true
59
- }
60
- ]
61
- };
62
-
63
- export default spacingRules;
@@ -1,7 +0,0 @@
1
- const typesRules = {
2
- "@stylistic/type-annotation-spacing": "error",
3
- "@stylistic/type-generic-spacing": "error",
4
- "@stylistic/type-named-tuple-spacing": "error"
5
- };
6
-
7
- export default typesRules;
@@ -1,19 +0,0 @@
1
- import * as stylisticRuleSets from "./stylistic/_exports.js";
2
-
3
- /**
4
- * @import { Linter } from "eslint";
5
- */
6
-
7
- /**
8
- * @satisfies {Linter.RulesRecord}
9
- */
10
- const stylisticRules = Object.values(stylisticRuleSets)
11
- .reduce(
12
- (allRules, ruleSet) => ({
13
- ...allRules,
14
- ...ruleSet
15
- }),
16
- {}
17
- );
18
-
19
- export default stylisticRules;
package/rules/unicorn.js DELETED
@@ -1,306 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint";
3
- */
4
-
5
- const hexadecimalGroupLength = 2;
6
- const binaryGroupLength = 4;
7
- const octalGroupLength = 4;
8
- const numberGroupLength = 3;
9
-
10
- const patterns = {
11
- "'": "’",
12
- "(?<=“[^“]*?\\s)['‘]([^'‘]+?)['’](?=\\s[^“]*?”)": "‘$1’",
13
- "(?<=[!?])”\\.(?=(?:(?:\\s+[\\p{Letter}\\p{Number}])|$))": "”",
14
- "(?<=[!?])\\.": "",
15
- "(?<=[\\p{Letter}\\p{Number}] )-+(?= [\\p{Letter}\\p{Number}])": "—",
16
- "(?<=\\p{Punctuation})\\p{Zs}{2,}(?=[\\p{Letter}\\p{Number}])": " ",
17
- "([\"'])((?:\\\\.|[^\\\\])*?)\\1": "“$2”",
18
- "-->": "⟶",
19
- "->": "→",
20
- "\\.”\\.(?=(?:(?:\\s+[\\p{Letter}\\p{Number}])|$))": ".”",
21
- "<-": "←",
22
- "<--": "⟵",
23
- "<-->": "⟷",
24
- "<->": "↔",
25
- "<=": "≤",
26
- "<==": "⇐",
27
- "<===": "⟸",
28
- "<==>": "⟺",
29
- "<=>": "⇔",
30
- "===>": "⟹",
31
- "==>": "⇒",
32
- ">=": "≥",
33
- "\\.\\.(?=(?:(?:\\s+[\\p{Letter}\\p{Number}])|$))": ".",
34
- "\\.\\.\\.": "…"
35
- };
36
-
37
- /**
38
- * @satisfies {Linter.RulesRecord}
39
- */
40
- const unicornRules = {
41
- "unicorn/better-dom-traversing": "error",
42
- "unicorn/catch-error-name": "error",
43
- "unicorn/consistent-assert": "error",
44
- "unicorn/consistent-compound-words": "error",
45
- "unicorn/consistent-date-clone": "error",
46
- "unicorn/consistent-destructuring": "error",
47
- "unicorn/consistent-empty-array-spread": "error",
48
- "unicorn/consistent-existence-index-check": "error",
49
- "unicorn/consistent-function-scoping": "error",
50
- "unicorn/consistent-json-file-read": "error",
51
- "unicorn/consistent-template-literal-escape": "error",
52
- "unicorn/custom-error-definition": "error",
53
- "unicorn/dom-node-dataset": "error",
54
- "unicorn/empty-brace-spaces": "error",
55
- "unicorn/error-message": "error",
56
- "unicorn/escape-case": ["error", "uppercase"],
57
- "unicorn/expiring-todo-comments": [
58
- "error",
59
- {
60
- allowWarningComments: false,
61
- terms: ["todo", "fixme"]
62
- }
63
- ],
64
- "unicorn/explicit-length-check": "error",
65
- "unicorn/filename-case": [
66
- "error",
67
- {
68
- case: "kebabCase",
69
- ignore: [/\(_[_a-z][\-_a-z]+\)/v]
70
- }
71
- ],
72
- "unicorn/import-style": "error",
73
- "unicorn/isolated-functions": [
74
- "error",
75
- {
76
- comments: ["@isolated"],
77
- functions: ["makeSynchronous"],
78
- overrideGlobals: undefined,
79
- selectors: []
80
- }
81
- ],
82
- "unicorn/new-for-builtins": "error",
83
- "unicorn/no-abusive-eslint-disable": "error",
84
- "unicorn/no-accessor-recursion": "error",
85
- "unicorn/no-anonymous-default-export": "error",
86
- "unicorn/no-array-callback-reference": "off",
87
- "unicorn/no-array-fill-with-reference-type": "error",
88
- "unicorn/no-array-for-each": "error",
89
- "unicorn/no-array-from-fill": "error",
90
- "unicorn/no-array-method-this-argument": "error",
91
- "unicorn/no-array-reduce": "off",
92
- "unicorn/no-array-reverse": "error",
93
- "unicorn/no-array-sort": "off",
94
- "unicorn/no-await-expression-member": "error",
95
- "unicorn/no-await-in-promise-methods": "error",
96
- "unicorn/no-blob-to-file": "error",
97
- "unicorn/no-canvas-to-image": "error",
98
- "unicorn/no-confusing-array-splice": "error",
99
- "unicorn/no-console-spaces": "error",
100
- "unicorn/no-document-cookie": "error",
101
- "unicorn/no-duplicate-set-values": "error",
102
- "unicorn/no-empty-file": ["error", { allowComments: true }],
103
- "unicorn/no-exports-in-scripts": "error",
104
- "unicorn/no-for-loop": "error",
105
- "unicorn/no-hex-escape": "error",
106
- "unicorn/no-immediate-mutation": "error",
107
- "unicorn/no-incorrect-query-selector": "error",
108
- "unicorn/no-instanceof-array": "error",
109
- "unicorn/no-instanceof-builtins": "error",
110
- "unicorn/no-invalid-fetch-options": "error",
111
- "unicorn/no-invalid-file-input-accept": "error",
112
- "unicorn/no-invalid-remove-event-listener": "error",
113
- "unicorn/no-keyword-prefix": [
114
- "error",
115
- {
116
- disallowedPrefixes: ["new"],
117
- onlyCamelCase: true
118
- }
119
- ],
120
- "unicorn/no-late-current-target-access": "error",
121
- "unicorn/no-lonely-if": "error",
122
- "unicorn/no-magic-array-flat-depth": "error",
123
- "unicorn/no-manually-wrapped-comments": "error",
124
- "unicorn/no-named-default": "error",
125
- "unicorn/no-negated-condition": "error",
126
- "unicorn/no-negation-in-equality-check": "error",
127
- "unicorn/no-nested-ternary": "error",
128
- "unicorn/no-new-array": "error",
129
- "unicorn/no-new-buffer": "error",
130
- "unicorn/no-null": "off",
131
- "unicorn/no-object-as-default-parameter": "error",
132
- "unicorn/no-process-exit": "error",
133
- "unicorn/no-single-promise-in-promise-methods": "error",
134
- "unicorn/no-static-only-class": "error",
135
- "unicorn/no-thenable": "error",
136
- "unicorn/no-this-assignment": "error",
137
- "unicorn/no-this-outside-of-class": "error",
138
- "unicorn/no-typeof-undefined": "error",
139
- "unicorn/no-unnecessary-array-flat-depth": "error",
140
- "unicorn/no-unnecessary-array-splice-count": "error",
141
- "unicorn/no-unnecessary-await": "error",
142
- "unicorn/no-unnecessary-nested-ternary": "error",
143
- "unicorn/no-unnecessary-polyfills": "error",
144
- "unicorn/no-unnecessary-slice-end": "error",
145
- "unicorn/no-unreadable-array-destructuring": "error",
146
- "unicorn/no-unreadable-iife": "error",
147
- "unicorn/no-unused-array-method-return": "error",
148
- "unicorn/no-unused-properties": "error",
149
- "unicorn/no-useless-collection-argument": "error",
150
- "unicorn/no-useless-error-capture-stack-trace": "error",
151
- "unicorn/no-useless-fallback-in-spread": "error",
152
- "unicorn/no-useless-iterator-to-array": "error",
153
- "unicorn/no-useless-length-check": "error",
154
- "unicorn/no-useless-promise-resolve-reject": "error",
155
- "unicorn/no-useless-spread": "error",
156
- "unicorn/no-useless-switch-case": "error",
157
- "unicorn/no-useless-undefined": "off",
158
- "unicorn/no-zero-fractions": "error",
159
- "unicorn/number-literal-case": [
160
- "error",
161
- {
162
- hexadecimalValue: "uppercase"
163
- }
164
- ],
165
- "unicorn/numeric-separators-style": [
166
- "error",
167
- {
168
- binary: {
169
- minimumDigits: 0,
170
- groupLength: binaryGroupLength
171
- },
172
- hexadecimal: {
173
- minimumDigits: 0,
174
- groupLength: hexadecimalGroupLength
175
- },
176
- number: {
177
- minimumDigits: 0,
178
- fractionGroupLength: Infinity,
179
- groupLength: numberGroupLength
180
- },
181
- octal: {
182
- minimumDigits: 0,
183
- groupLength: octalGroupLength
184
- },
185
- onlyIfContainsSeparator: false
186
- }
187
- ],
188
- "unicorn/prefer-add-event-listener": "error",
189
- "unicorn/prefer-array-find": "error",
190
- "unicorn/prefer-array-flat": "error",
191
- "unicorn/prefer-array-flat-map": "error",
192
- "unicorn/prefer-array-index-of": "error",
193
- "unicorn/prefer-array-last-methods": "error",
194
- "unicorn/prefer-array-some": "error",
195
- "unicorn/prefer-at": "error",
196
- "unicorn/prefer-bigint-literals": "error",
197
- "unicorn/prefer-blob-reading-methods": "error",
198
- "unicorn/prefer-class-fields": "error",
199
- "unicorn/prefer-classlist-toggle": "error",
200
- "unicorn/prefer-code-point": "error",
201
- "unicorn/prefer-date-now": "error",
202
- "unicorn/prefer-default-parameters": "error",
203
- "unicorn/prefer-dom-node-append": "error",
204
- "unicorn/prefer-dom-node-remove": "error",
205
- "unicorn/prefer-dom-node-text-content": "error",
206
- "unicorn/prefer-event-target": "error",
207
- "unicorn/prefer-export-from": "error",
208
- "unicorn/prefer-get-or-insert-computed": "error",
209
- "unicorn/prefer-global-this": "error",
210
- "unicorn/prefer-https": "error",
211
- "unicorn/prefer-import-meta-properties": "error",
212
- "unicorn/prefer-includes": "error",
213
- "unicorn/prefer-includes-over-repeated-comparisons": "error",
214
- "unicorn/prefer-iterator-concat": "off",
215
- "unicorn/prefer-iterator-to-array-at-end": "error",
216
- "unicorn/prefer-json-parse-buffer": "off",
217
- "unicorn/prefer-keyboard-event-key": "error",
218
- "unicorn/prefer-logical-operator-over-ternary": "error",
219
- "unicorn/prefer-math-abs": "error",
220
- "unicorn/prefer-math-min-max": "error",
221
- "unicorn/prefer-math-trunc": "error",
222
- "unicorn/prefer-modern-dom-apis": "error",
223
- "unicorn/prefer-modern-math-apis": "error",
224
- "unicorn/prefer-module": "error",
225
- "unicorn/prefer-native-coercion-functions": "error",
226
- "unicorn/prefer-negative-index": "error",
227
- "unicorn/prefer-node-protocol": "error",
228
- "unicorn/prefer-number-properties": [
229
- "error",
230
- {
231
- checkInfinity: false
232
- }
233
- ],
234
- "unicorn/prefer-object-from-entries": "error",
235
- "unicorn/prefer-optional-catch-binding": "error",
236
- "unicorn/prefer-prototype-methods": "error",
237
- "unicorn/prefer-query-selector": "error",
238
- "unicorn/prefer-queue-microtask": [
239
- "error",
240
- {
241
- checkSetImmediate: true,
242
- checkSetTimeout: true
243
- }
244
- ],
245
- "unicorn/prefer-reflect-apply": "error",
246
- "unicorn/prefer-regexp-test": "error",
247
- "unicorn/prefer-response-static-json": "error",
248
- "unicorn/prefer-set-has": "error",
249
- "unicorn/prefer-set-size": "error",
250
- "unicorn/prefer-simple-condition-first": "error",
251
- "unicorn/prefer-single-call": "error",
252
- "unicorn/prefer-split-limit": "error",
253
- "unicorn/prefer-spread": "error",
254
- "unicorn/prefer-string-match-all": "error",
255
- "unicorn/prefer-string-pad-start-end": "error",
256
- "unicorn/prefer-string-raw": "error",
257
- "unicorn/prefer-string-repeat": "error",
258
- "unicorn/prefer-string-replace-all": "error",
259
- "unicorn/prefer-string-slice": "error",
260
- "unicorn/prefer-string-starts-ends-with": "error",
261
- "unicorn/prefer-string-trim-start-end": "error",
262
- "unicorn/prefer-structured-clone": "error",
263
- "unicorn/prefer-switch": "error",
264
- "unicorn/prefer-ternary": ["error", "only-single-line"],
265
- "unicorn/prefer-top-level-await": "error",
266
- "unicorn/prefer-type-error": "error",
267
- "unicorn/prevent-abbreviations": "error",
268
- "unicorn/relative-url-style": "error",
269
- "unicorn/require-array-join-separator": "error",
270
- "unicorn/require-css-escape": "error",
271
- "unicorn/require-module-attributes": "error",
272
- "unicorn/require-module-specifiers": "error",
273
- "unicorn/require-number-to-fixed-digits-argument": "error",
274
- "unicorn/require-passive-events": "error",
275
- "unicorn/require-post-message-target-origin": "off",
276
- "unicorn/string-content": [
277
- "off",
278
- {
279
- patterns
280
- }
281
- ],
282
- "unicorn/switch-case-braces": ["error", "avoid"],
283
- "unicorn/switch-case-break-position": "error",
284
- "unicorn/template-indent": [
285
- "error",
286
- {
287
- comments: ["HTML", "indent"],
288
- functions: ["dedent", "stripIndent"],
289
- indent: "\t",
290
- selectors: ["TemplateLiteral"],
291
- tags: [
292
- "outdent",
293
- "dedent",
294
- "gql",
295
- "sql",
296
- "html",
297
- "styled"
298
- ]
299
- }
300
- ],
301
- "unicorn/text-encoding-identifier-case": ["error", { withDash: true }],
302
- "unicorn/throw-new-error": "error",
303
- "unicorn/try-complexity": "error"
304
- };
305
-
306
- export default unicornRules;
package/rules.js DELETED
@@ -1,19 +0,0 @@
1
- import * as ruleSets from "./rules/_exports.js";
2
-
3
- /**
4
- * @import { Linter } from "eslint";
5
- */
6
-
7
- /**
8
- * @satisfies {Linter.RulesRecord}
9
- */
10
- const rules = Object.values(ruleSets)
11
- .reduce(
12
- (allRules, ruleSet) => /** @type {const} */ ({
13
- ...allRules,
14
- ...ruleSet
15
- }),
16
- {}
17
- );
18
-
19
- export default rules;
@@ -1,47 +0,0 @@
1
- import { join } from "@std/path";
2
-
3
- const {
4
- cwd,
5
- readTextFile,
6
- writeTextFile
7
- } = Deno;
8
-
9
- const packageJsonFilePath = join(cwd(), "package.json");
10
- const packageJsonFileContent = await readTextFile(packageJsonFilePath);
11
- const packageJson = JSON.parse(packageJsonFileContent);
12
-
13
- const importMapFilePath = join(cwd(), "deno.json");
14
- const importMapFileContent = await readTextFile(importMapFilePath);
15
- const importMap = JSON.parse(importMapFileContent);
16
-
17
- const collator = new Intl.Collator("en", {
18
- numeric: true
19
- });
20
-
21
- const updatedImportMap = {
22
- ...importMap,
23
- imports: Object.fromEntries(
24
-
25
- Object.entries({
26
- ...importMap.imports,
27
- ...Object.fromEntries(
28
- Object.entries(
29
- packageJson.dependencies
30
- )
31
- .map(([packageName, packageVersion]) => [packageName, `npm:${packageName}@${packageVersion}`])
32
- )
33
- })
34
- .toSorted((
35
- [packageNameA],
36
- [packageNameB]
37
- ) => collator.compare(
38
- packageNameA,
39
- packageNameB
40
- ))
41
- )
42
- };
43
-
44
- await writeTextFile(
45
- importMapFilePath,
46
- JSON.stringify(updatedImportMap, null, "\t")
47
- );
@@ -1,66 +0,0 @@
1
- import { join } from "@std/path";
2
-
3
- import denoJson from "../deno.json" with { type: "json" };
4
- import packageJson from "../package.json" with { type: "json" };
5
-
6
- const {
7
- cwd,
8
- writeTextFile
9
- } = Deno;
10
-
11
- const packageJsonFilePath = join(cwd(), "package.json");
12
-
13
- const collator = new Intl.Collator("en", {
14
- numeric: true
15
- });
16
-
17
- /**
18
- * Parses the version from a URL.
19
- *
20
- * @param {string} url - The URL to parse.
21
- * @returns {string} - The parsed version.
22
- */
23
- const parseVersion = (url) => url.replace(/^npm:.*?@(?=[^@]+$)/v, "");
24
-
25
- /**
26
- * Converts import map entries to a sorted array of tuples with specificer and version.
27
- *
28
- * @param {readonly (readonly [string, string])[]} entries - The import map entries to convert.
29
- * @returns {readonly (readonly [string, string])[]} - The sorted array of tuples.
30
- */
31
- const convertImportMapEntries = (entries) => entries
32
- .map(([specificer, url]) => /** @type {const} */ ([specificer, parseVersion(url)]))
33
- .toSorted((
34
- [packageNameA],
35
- [packageNameB]
36
- ) => collator.compare(
37
- packageNameA,
38
- packageNameB
39
- ));
40
-
41
- const updatedPackageJson = {
42
- ...packageJson,
43
- dependencies: Object.fromEntries(
44
- convertImportMapEntries(
45
- Object.entries(denoJson.imports)
46
- .filter(([specifier, url]) => url.startsWith("npm:") && specifier !== "eslint")
47
- )
48
- ),
49
- devDependencies: Object.fromEntries(
50
- convertImportMapEntries(
51
- Object.entries(denoJson.imports)
52
- .filter(([specifier, url]) => url.startsWith("npm:") && specifier === "eslint")
53
- )
54
- ),
55
- peerDependencies: Object.fromEntries(
56
- convertImportMapEntries(
57
- Object.entries(denoJson.imports)
58
- .filter(([specifier, url]) => url.startsWith("npm:") && specifier === "eslint")
59
- )
60
- )
61
- };
62
-
63
- await writeTextFile(
64
- packageJsonFilePath,
65
- JSON.stringify(updatedPackageJson, null, "\t")
66
- );
@@ -1,46 +0,0 @@
1
- import { join } from "@std/path";
2
-
3
- const {
4
- cwd,
5
- readTextFile,
6
- writeTextFile
7
- } = Deno;
8
-
9
- const denoJsonFilePath = join(cwd(), "deno.json");
10
- const denoJsonFileContent = await readTextFile(denoJsonFilePath);
11
- const denoJson = JSON.parse(denoJsonFileContent);
12
-
13
- const tsconfigFilePath = join(cwd(), "tsconfig.json");
14
- const tsconfigFileContent = await readTextFile(tsconfigFilePath);
15
- const tsconfig = JSON.parse(tsconfigFileContent);
16
-
17
- const collator = new Intl.Collator("en", {
18
- numeric: true
19
- });
20
-
21
- const updatedTsconfig = {
22
- ...tsconfig,
23
- compilerOptions: Object.fromEntries(
24
- Object.entries({
25
- ...tsconfig.compilerOptions,
26
- ...Object.fromEntries(
27
- Object.entries(
28
- denoJson.compilerOptions
29
- )
30
- .filter(([key]) => key !== "lib")
31
- )
32
- })
33
- .toSorted((
34
- [keyA],
35
- [keyB]
36
- ) => collator.compare(
37
- keyA,
38
- keyB
39
- ))
40
- )
41
- };
42
-
43
- await writeTextFile(
44
- tsconfigFilePath,
45
- JSON.stringify(updatedTsconfig, null, "\t")
46
- );
package/tsconfig.json DELETED
@@ -1,27 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "allowJs": true,
4
- "allowUnreachableCode": false,
5
- "allowUnusedLabels": false,
6
- "alwaysStrict": true,
7
- "checkJs": true,
8
- "exactOptionalPropertyTypes": true,
9
- "jsx": "react-jsx",
10
- "jsxImportSource": "preact",
11
- "noErrorTruncation": true,
12
- "noFallthroughCasesInSwitch": false,
13
- "noImplicitAny": true,
14
- "noImplicitOverride": true,
15
- "noImplicitReturns": true,
16
- "noImplicitThis": true,
17
- "noPropertyAccessFromIndexSignature": false,
18
- "noUncheckedIndexedAccess": false,
19
- "noUnusedLocals": false,
20
- "noUnusedParameters": false,
21
- "strict": true,
22
- "noEmit": true
23
- },
24
- "include": [
25
- "./**/*"
26
- ]
27
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes