@haltcase/style 8.0.0-canary.8 → 8.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 (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +235 -0
  3. package/package.json +151 -172
  4. package/LICENSE.md +0 -382
  5. package/dist/types/eslint/configs/browser.d.ts +0 -8
  6. package/dist/types/eslint/configs/cjs.d.ts +0 -4
  7. package/dist/types/eslint/configs/internal/base.d.ts +0 -76
  8. package/dist/types/eslint/configs/internal/commonjs.d.ts +0 -4
  9. package/dist/types/eslint/configs/internal/es2015.d.ts +0 -4
  10. package/dist/types/eslint/configs/internal/simple-import-sort.d.ts +0 -4
  11. package/dist/types/eslint/configs/internal/tsdoc.d.ts +0 -4
  12. package/dist/types/eslint/configs/internal/unicorn.d.ts +0 -4
  13. package/dist/types/eslint/configs/internal/utils/typescript.d.ts +0 -6
  14. package/dist/types/eslint/configs/next.d.ts +0 -8
  15. package/dist/types/eslint/configs/node.d.ts +0 -8
  16. package/dist/types/eslint/configs/playwright-test.d.ts +0 -4
  17. package/dist/types/eslint/configs/react.d.ts +0 -8
  18. package/dist/types/eslint/configs/typescript.d.ts +0 -10
  19. package/dist/types/eslint/constants.d.ts +0 -14
  20. package/dist/types/eslint/index.d.ts +0 -12
  21. package/dist/types/eslint/rules/best-practice.d.ts +0 -5
  22. package/dist/types/eslint/rules/imports.d.ts +0 -5
  23. package/dist/types/eslint/rules/jsx-a11y.d.ts +0 -5
  24. package/dist/types/eslint/rules/playwright-test.d.ts +0 -8
  25. package/dist/types/eslint/rules/possible-errors.d.ts +0 -8
  26. package/dist/types/eslint/rules/react-x.d.ts +0 -8
  27. package/dist/types/eslint/rules/react.d.ts +0 -11
  28. package/dist/types/eslint/rules/stylistic-jsx.d.ts +0 -8
  29. package/dist/types/eslint/rules/stylistic.d.ts +0 -8
  30. package/dist/types/eslint/rules/typescript/extension.d.ts +0 -5
  31. package/dist/types/eslint/rules/typescript/import.d.ts +0 -5
  32. package/dist/types/eslint/rules/typescript/index.d.ts +0 -8
  33. package/dist/types/eslint/rules/typescript/naming-convention.d.ts +0 -5
  34. package/dist/types/eslint/rules/variables.d.ts +0 -8
  35. package/dist/types/eslint/withFiles.d.ts +0 -2
  36. package/dist/types/prettier/index.d.ts +0 -12
  37. package/dist/types/stylelint/_base.d.ts +0 -1
  38. package/dist/types/stylelint/index.d.ts +0 -2
  39. package/dist/types/stylelint/modules.d.ts +0 -2
  40. package/dist/types/stylelint/standard.d.ts +0 -1
  41. package/dist/types/stylelint/tailwind.d.ts +0 -2
  42. package/eslint/configs/browser.js +0 -27
  43. package/eslint/configs/cjs.js +0 -13
  44. package/eslint/configs/internal/base.js +0 -205
  45. package/eslint/configs/internal/commonjs.js +0 -22
  46. package/eslint/configs/internal/es2015.js +0 -72
  47. package/eslint/configs/internal/simple-import-sort.js +0 -27
  48. package/eslint/configs/internal/tsdoc.js +0 -20
  49. package/eslint/configs/internal/unicorn.js +0 -750
  50. package/eslint/configs/internal/utils/typescript.js +0 -53
  51. package/eslint/configs/next.js +0 -54
  52. package/eslint/configs/node.js +0 -27
  53. package/eslint/configs/playwright-test.js +0 -21
  54. package/eslint/configs/react.js +0 -114
  55. package/eslint/configs/typescript.js +0 -125
  56. package/eslint/constants.js +0 -27
  57. package/eslint/index.js +0 -33
  58. package/eslint/rules/best-practice.js +0 -256
  59. package/eslint/rules/imports.js +0 -94
  60. package/eslint/rules/jsx-a11y.js +0 -21
  61. package/eslint/rules/playwright-test.js +0 -27
  62. package/eslint/rules/possible-errors.js +0 -40
  63. package/eslint/rules/react-x.js +0 -78
  64. package/eslint/rules/react.js +0 -24
  65. package/eslint/rules/stylistic-jsx.js +0 -17
  66. package/eslint/rules/stylistic.js +0 -85
  67. package/eslint/rules/typescript/extension.js +0 -74
  68. package/eslint/rules/typescript/import.js +0 -23
  69. package/eslint/rules/typescript/index.js +0 -114
  70. package/eslint/rules/typescript/naming-convention.js +0 -121
  71. package/eslint/rules/variables.js +0 -36
  72. package/eslint/withFiles.js +0 -15
  73. package/prettier/index.js +0 -39
  74. package/readme.md +0 -415
  75. package/stylelint/_base.js +0 -45
  76. package/stylelint/index.js +0 -20
  77. package/stylelint/modules.js +0 -32
  78. package/stylelint/standard.js +0 -4
  79. package/stylelint/tailwind.js +0 -16
  80. package/typescript/tsconfig.base.json +0 -14
  81. package/typescript/tsconfig.bundler.json +0 -17
  82. package/typescript/tsconfig.next.json +0 -36
  83. package/typescript/tsconfig.node-ts.json +0 -10
  84. package/typescript/tsconfig.node.json +0 -4
  85. package/typescript/tsconfig.node18.json +0 -10
  86. package/typescript/tsconfig.node20.json +0 -11
  87. package/typescript/tsconfig.node22.json +0 -11
  88. package/typescript/tsconfig.node24.json +0 -17
  89. package/typescript/tsconfig.web.json +0 -8
@@ -1,256 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- /**
6
- * @type {Linter.RulesRecord}
7
- */
8
- const commentsRules = {
9
- "@eslint-community/eslint-comments/disable-enable-pair": [
10
- "error",
11
- { allowWholeFile: true }
12
- ]
13
- };
14
-
15
- /**
16
- * @type {Linter.RulesRecord}
17
- */
18
- export const bestPracticeRules = {
19
- ...commentsRules,
20
-
21
- /**
22
- * Require return statements in array methods callbacks.
23
- *
24
- * 🚫 Not fixable -https://eslint.org/docs/rules/array-callback-return
25
- */
26
- "array-callback-return": ["error", { allowImplicit: true }],
27
- /**
28
- * Treat `var` statements as if they were block scoped.
29
- *
30
- * 🚫 Not fixable - https://eslint.org/docs/rules/block-scoped-var
31
- */
32
- "block-scoped-var": "error",
33
- /**
34
- * Require curly braces for multiline blocks.
35
- *
36
- * 🔧 Fixable - https://eslint.org/docs/rules/curly
37
- */
38
- curly: ["warn", "multi-line"],
39
- /**
40
- * Require default clauses in switch statements to be last (if used).
41
- *
42
- * 🚫 Not fixable - https://eslint.org/docs/rules/default-case-last
43
- */
44
- "default-case-last": "error",
45
- /**
46
- * Require triple equals (`===` and `!==`).
47
- *
48
- * 🔧 Fixable - https://eslint.org/docs/rules/eqeqeq
49
- */
50
- eqeqeq: ["error", "always", { null: "ignore" }],
51
- /**
52
- * Require grouped accessor pairs in object literals and classes.
53
- *
54
- * 🚫 Not fixable - https://eslint.org/docs/rules/grouped-accessor-pairs
55
- */
56
- "grouped-accessor-pairs": "error",
57
- /**
58
- * Disallow use of `alert()`.
59
- *
60
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-alert
61
- */
62
- "no-alert": "error",
63
- /**
64
- * Disallow use of `caller`/`callee`.
65
- *
66
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-caller
67
- */
68
- "no-caller": "error",
69
- /**
70
- * Disallow returning value in constructor.
71
- *
72
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-constructor-return
73
- */
74
- "no-constructor-return": "error",
75
- /**
76
- * Disallow using an `else` if the `if` block contains a return.
77
- *
78
- * 🔧 Fixable - https://eslint.org/docs/rules/no-else-return
79
- */
80
- "no-else-return": "warn",
81
- /**
82
- * Disallow `eval()`.
83
- *
84
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-eval
85
- */
86
- "no-eval": "error",
87
- /**
88
- * Disallow extending native objects.
89
- *
90
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-extend-native
91
- */
92
- "no-extend-native": "error",
93
- /**
94
- * Disallow unnecessary function binding.
95
- *
96
- * 🔧 Fixable - https://eslint.org/docs/rules/no-extra-bind
97
- */
98
- "no-extra-bind": "error",
99
- /**
100
- * Disallow unnecessary labels.
101
- *
102
- * 🔧 Fixable - https://eslint.org/docs/rules/no-extra-label
103
- */
104
- "no-extra-label": "error",
105
- /**
106
- * Disallow floating decimals.
107
- *
108
- * 🔧 Fixable - https://eslint.org/docs/rules/no-floating-decimal
109
- */
110
- "no-floating-decimal": "error",
111
- /**
112
- * Require converting types explicitly, e.g., `Boolean(foo)` instead of `!!foo`.
113
- *
114
- * 🔧 Partially fixable - https://eslint.org/docs/rules/no-implicit-coercion
115
- */
116
- "no-implicit-coercion": "error",
117
- /**
118
- * Disallow use of `eval()`-like methods.
119
- *
120
- * https://eslint.org/docs/rules/no-implied-eval
121
- */
122
- "no-implied-eval": "error",
123
- /**
124
- * Disallow usage of `__iterator__` property.
125
- *
126
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-iterator
127
- */
128
- "no-iterator": "error",
129
- /**
130
- * Disallow use of labels.
131
- *
132
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-labels
133
- */
134
- "no-labels": "error",
135
- /**
136
- * Disallow unnecessary nested blocks.
137
- *
138
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-lone-blocks
139
- */
140
- "no-lone-blocks": "error",
141
- /**
142
- * Disallow `new` for side effects.
143
- *
144
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-new
145
- */
146
- "no-new": "error",
147
- /**
148
- * Disallow function constructors.
149
- *
150
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-new-func
151
- */
152
- "no-new-func": "error",
153
- /**
154
- * Disallow primitive wrapper instances, such as `new String('foo')`.
155
- *
156
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-new-wrappers
157
- */
158
- "no-new-wrappers": "error",
159
- /**
160
- * Disallow use of octal escape sequences in string literals.
161
- *
162
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-octal-escape
163
- */
164
- "no-octal-escape": "error",
165
- /**
166
- * Disallow reassignment of function parameters.
167
- *
168
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-param-reassign
169
- */
170
- "no-param-reassign": "error",
171
- /**
172
- * Disallow usage of the deprecated `__proto__` property.
173
- *
174
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-proto
175
- */
176
- "no-proto": "error",
177
- /**
178
- * Disallow assignment in `return` statement.
179
- *
180
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-return-assign
181
- */
182
- "no-return-assign": "error",
183
- /**
184
- * Disallow unnecessary `return await`.
185
- *
186
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-return-await
187
- */
188
- "no-return-await": "error",
189
- /**
190
- * Disallow use of `javascript:` urls.
191
- *
192
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-script-url
193
- */
194
- "no-script-url": "error",
195
- /**
196
- * Disallow comparisons where both sides are exactly the same.
197
- *
198
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-self-compare
199
- */
200
- "no-self-compare": "error",
201
- /**
202
- * Disallow use of comma operator.
203
- *
204
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-sequences
205
- */
206
- "no-sequences": "error",
207
- /**
208
- * Disallow unnecessary `.call()` and `.apply()`.
209
- *
210
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-useless-call
211
- */
212
- "no-useless-call": "error",
213
- /**
214
- * Disallow unnecessary concatenation of strings.
215
- *
216
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-useless-concat
217
- */
218
- "no-useless-concat": "error",
219
- /**
220
- * Disallow redundant return statements.
221
- *
222
- * 🔧 Fixable - https://eslint.org/docs/rules/no-useless-return
223
- */
224
- "no-useless-return": "warn",
225
- /**
226
- * Require using named capture groups in regular expressions.
227
- *
228
- * 🚫 Not fixable - https://eslint.org/docs/rules/prefer-named-capture-group
229
- */
230
- "prefer-named-capture-group": "error",
231
- /**
232
- * Require using Error objects as Promise rejection reasons.
233
- *
234
- * 🚫 Not fixable - https://eslint.org/docs/rules/prefer-promise-reject-errors
235
- */
236
- "prefer-promise-reject-errors": ["error", { allowEmptyReject: true }],
237
- /**
238
- * Disallow use of the RegExp constructor in favor of regular expression
239
- * literals.
240
- *
241
- * 🚫 Not fixable - https://eslint.org/docs/rules/prefer-regex-literals
242
- */
243
- "prefer-regex-literals": "error",
244
- /**
245
- * Disallow the `"use strict"` directive (we assume ESM by default).
246
- *
247
- * 🔧 Fixable - https://eslint.org/docs/latest/rules/strict
248
- */
249
- strict: ["error", "never"],
250
- /**
251
- * Disallow "Yoda conditions".
252
- *
253
- * 🔧 Fixable - https://eslint.org/docs/rules/yoda
254
- */
255
- yoda: "error"
256
- };
@@ -1,94 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- /**
6
- * @type {Linter.RulesRecord}
7
- */
8
- const disabledRules = {
9
- /**
10
- * Enforce a module import order convention.
11
- * This is disabled as it is covered by `eslint-plugin-simple-import-sort`.
12
- *
13
- * 🔧 Fixable - https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/order.md
14
- */
15
- "import-x/order": "off"
16
- };
17
-
18
- /**
19
- * @type {Linter.RulesRecord}
20
- */
21
- export const importRules = {
22
- ...disabledRules,
23
- /**
24
- * Disallow non-import statements appearing before import statements.
25
- *
26
- * 🚫 Not fixable - https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/first.md
27
- */
28
- "import-x/first": "error",
29
- /**
30
- * Require a newline after the last import-x/require.
31
- *
32
- * 🔧 Fixable - https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/newline-after-import.md
33
- */
34
- "import-x/newline-after-import": "warn",
35
- /**
36
- * Disallow import of modules using absolute paths.
37
- *
38
- * 🚫 Not fixable - https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-absolute-path.md
39
- */
40
- "import-x/no-absolute-path": "error",
41
- /**
42
- * Disallow cyclical dependencies between modules.
43
- *
44
- * 🚫 Not fixable - https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-cycle.md
45
- */
46
- "import-x/no-cycle": "error",
47
- /**
48
- * Disallow default exports.
49
- *
50
- * 🚫 Not fixable - https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-default-export.md
51
- */
52
- "import-x/no-default-export": "error",
53
- /**
54
- * Combine separate imports of resolved paths.
55
- *
56
- * 🔧 Fixable - https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-duplicates.md
57
- */
58
- "import-x/no-duplicates": [
59
- "error",
60
- {
61
- considerQueryString: true
62
- }
63
- ],
64
- /**
65
- * Disallow the use of extraneous packages.
66
- *
67
- * 🚫 Not fixable - https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-extraneous-dependencies.md
68
- */
69
- "import-x/no-extraneous-dependencies": ["error", { includeTypes: true }],
70
- /**
71
- * Disallow mutable exports.
72
- *
73
- * 🚫 Not fixable - https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-mutable-exports.md
74
- */
75
- "import-x/no-mutable-exports": "error",
76
- /**
77
- * Disallow importing packages through relative paths.
78
- *
79
- * 🚫 Not fixable - https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-relative-packages.md
80
- */
81
- "import-x/no-relative-packages": "warn",
82
- /**
83
- * Disallow a module from importing itself.
84
- *
85
- * 🚫 Not fixable - https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-self-import.md
86
- */
87
- "import-x/no-self-import": "error",
88
- /**
89
- * Ensures that there are no useless path segments.
90
- *
91
- * 🚫 Not fixable - https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-useless-path-segments.md
92
- */
93
- "import-x/no-useless-path-segments": ["error"]
94
- };
@@ -1,21 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- /**
6
- * These are enabled by `jsx-a11y/recommended`, but we've made the decision to
7
- * disable them.
8
- *
9
- * @type {Linter.RulesRecord}
10
- */
11
- const disabledRules = {
12
- // This rule has been deprecated, but not yet removed.
13
- "jsx-a11y/no-onchange": "off"
14
- };
15
-
16
- /**
17
- * @type {Linter.RulesRecord}
18
- */
19
- export const jsxA11yRules = {
20
- ...disabledRules
21
- };
@@ -1,27 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- /**
6
- * @type {Linter.RulesRecord}
7
- */
8
- export const playwrightTestRules = {
9
- /**
10
- * Require lowercase test names.
11
- *
12
- * 🔧 Fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
13
- */
14
- "playwright/prefer-lowercase-title": "warn",
15
- /**
16
- * Require using `toHaveLength` over explicitly checking lengths.
17
- *
18
- * 🔧 Fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
19
- */
20
- "playwright/prefer-to-have-length": "warn",
21
- /**
22
- * Require test cases and hooks to be inside a `test.describe` block.
23
- *
24
- * 🚫 Not fixable - https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-lowercase-title.md
25
- */
26
- "playwright/require-top-level-describe": "error"
27
- };
@@ -1,40 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- /**
6
- * @type {Linter.RulesRecord}
7
- */
8
- export const possibleErrorsRules = {
9
- /**
10
- * Disallow the use of console.
11
- *
12
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-console
13
- */
14
- "no-console": "error",
15
- /**
16
- * Disallow expressions where the operation doesn't affect the value.
17
- *
18
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-console
19
- */
20
- "no-constant-binary-expression": "error",
21
- /**
22
- * Disallow returning values from Promise executor functions.
23
- *
24
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-promise-executor-return
25
- */
26
- "no-promise-executor-return": "error",
27
- /**
28
- * Disallow template literal placeholder syntax in regular strings, as
29
- * these are likely errors.
30
- *
31
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-template-curly-in-string
32
- */
33
- "no-template-curly-in-string": "error",
34
- /**
35
- * Disallow loops with a body that allows only one iteration.
36
- *
37
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-unreachable-loop
38
- */
39
- "no-unreachable-loop": "error"
40
- };
@@ -1,78 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- /**
6
- * Rules we've decided to disable from the preset config.
7
- *
8
- * @type {Linter.RulesRecord}
9
- */
10
- const disabledRules = {
11
- /**
12
- * Enforces that function components props are read-only.
13
- *
14
- * We have other checks that already disallow changing function parameters.
15
- *
16
- * 🚫 Not fixable - https://eslint-react.xyz/docs/rules/prefer-read-only-props
17
- */
18
- "@eslint-react/prefer-read-only-props": "off"
19
- };
20
-
21
- /**
22
- * Additional rules to enable on top of the preset config from
23
- * `@eslint-react/eslint-plugin`
24
- *
25
- * @type {Linter.RulesRecord}
26
- */
27
- export const reactXRules = {
28
- ...disabledRules,
29
-
30
- /**
31
- * Prevents using useless `fragment` components or `<>` syntax.
32
- *
33
- * 🚫 Not fixable - https://eslint-react.xyz/docs/rules/no-useless-fragment
34
- */
35
- "@eslint-react/no-useless-fragment": "error",
36
-
37
- /**
38
- * Enforces using shorthand syntax for boolean attributes.
39
- *
40
- * 🔧 Fixable - https://eslint-react.xyz/docs/rules/prefer-shorthand-boolean
41
- */
42
- "@eslint-react/prefer-shorthand-boolean": "error",
43
-
44
- /**
45
- * Enforces using shorthand syntax for fragments.
46
- *
47
- * 🚫 Not fixable - https://eslint-react.xyz/docs/rules/prefer-shorthand-fragment
48
- */
49
- "@eslint-react/prefer-shorthand-fragment": "error",
50
-
51
- /**
52
- * Warns function calls made inside `useState` calls.
53
- *
54
- * 🚫 Not fixable - https://eslint-react.xyz/docs/rules/hooks-extra-prefer-use-state-lazy-initialization
55
- */
56
- "@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "error",
57
-
58
- /**
59
- * Enforces naming conventions for components.
60
- *
61
- * 🚫 Not fixable - https://eslint-react.xyz/docs/rules/naming-convention-component-name
62
- */
63
- "@eslint-react/naming-convention/component-name": "warn",
64
-
65
- /**
66
- * Enforces consistent use of the JSX file extension.
67
- *
68
- * 🚫 Not fixable - https://eslint-react.xyz/docs/rules/naming-convention-filename-extension
69
- */
70
- "@eslint-react/naming-convention/filename-extension": "warn",
71
-
72
- /**
73
- * Enforces destructuring and symmetric naming of useState hook value and setter variables.
74
- *
75
- * 🚫 Not fixable - https://eslint-react.xyz/docs/rules/naming-convention-use-state
76
- */
77
- "@eslint-react/naming-convention/use-state": "warn"
78
- };
@@ -1,24 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- /**
6
- * We primarily use `@eslint-react/eslint-plugin`, but it's not quite complete
7
- * compared to the official plugin. We enable missing rules selectively here.
8
- *
9
- * @type {Linter.RulesRecord}
10
- */
11
- export const reactRules = {
12
- /**
13
- * Require consistent function type for function components.
14
- *
15
- * 🔧 Fixable - https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/function-component-definition.md
16
- */
17
- "react/function-component-definition": [
18
- "error",
19
- {
20
- namedComponents: "arrow-function",
21
- unnamedComponents: "arrow-function"
22
- }
23
- ]
24
- };
@@ -1,17 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- /**
6
- * @type {Linter.RulesRecord}
7
- */
8
- export const stylisticJsxRules = {
9
- /**
10
- * Disallow extra closing tags for components without children.
11
- *
12
- * Components without children can be self-closed to avoid unnecessary extra closing tag.
13
- *
14
- * 🔧 Fixable - https://eslint.style/rules/jsx/jsx-self-closing-comp
15
- */
16
- "@stylistic/jsx/jsx-self-closing-comp": "error"
17
- };
@@ -1,85 +0,0 @@
1
- /**
2
- * @import { Linter } from "eslint"
3
- */
4
-
5
- /**
6
- * @type {Linter.RulesRecord}
7
- */
8
- export const stylisticRules = {
9
- /**
10
- * Require camel case names.
11
- *
12
- * 🚫 Not fixable - https://eslint.org/docs/rules/camelcase
13
- */
14
- camelcase: [
15
- "error",
16
- { allow: ["^UNSAFE_"], ignoreDestructuring: false, properties: "never" }
17
- ],
18
- /**
19
- * Require function expressions to have a name.
20
- *
21
- * 🚫 Not fixable - https://eslint.org/docs/rules/func-names
22
- */
23
- "func-names": ["error", "as-needed"],
24
- /**
25
- * Require a capital letter for constructors.
26
- *
27
- * 🚫 Not fixable - https://eslint.org/docs/rules/new-cap
28
- */
29
- "new-cap": ["error", { capIsNew: false }],
30
- /**
31
- * Disallow the omission of parentheses when invoking a constructor with
32
- * no arguments.
33
- *
34
- * 🔧 Fixable - https://eslint.org/docs/rules/new-parens
35
- */
36
- "new-parens": "warn",
37
- /**
38
- * Disallow use of the Array constructor.
39
- *
40
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-array-constructor
41
- */
42
- "no-array-constructor": "error",
43
- /**
44
- * Disallow use of bitwise operators.
45
- *
46
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-bitwise
47
- */
48
- "no-bitwise": "error",
49
- /**
50
- * Disallow if as the only statement in an else block.
51
- *
52
- * 🔧 Fixable - https://eslint.org/docs/rules/no-lonely-if
53
- */
54
- "no-lonely-if": "warn",
55
- /**
56
- * Disallow use of chained assignment expressions.
57
- *
58
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-multi-assign
59
- */
60
- "no-multi-assign": ["error"],
61
- /**
62
- * Disallow nested ternary expressions.
63
- *
64
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-nested-ternary
65
- */
66
- "no-nested-ternary": "error",
67
- /**
68
- * Disallow ternary operators when simpler alternatives exist.
69
- *
70
- * 🚫 Not fixable - https://eslint.org/docs/rules/no-unneeded-ternary
71
- */
72
- "no-unneeded-ternary": "error",
73
- /**
74
- * Require using arrow functions for callbacks.
75
- *
76
- * 🔧 Fixable - https://eslint.org/docs/rules/prefer-arrow-callback
77
- */
78
- "prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
79
- /**
80
- * Require use of an object spread over Object.assign.
81
- *
82
- * 🔧 Fixable - https://eslint.org/docs/rules/prefer-object-spread
83
- */
84
- "prefer-object-spread": "warn"
85
- };