@luxass/eslint-config 4.0.0-beta.4 → 4.0.0-beta.6
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/README.md +2 -2
- package/dist/{chunk-R5QPJQWU.mjs → chunk-35GU2JDJ.mjs} +1 -1
- package/dist/chunk-5AGNJGGB.mjs +277 -0
- package/dist/{chunk-VJYICA7B.mjs → chunk-FL4KSKUX.mjs} +1 -1
- package/dist/{chunk-2XXYFOA7.mjs → chunk-I7Y5QUDD.mjs} +1 -1
- package/dist/{chunk-AOKXEX6L.mjs → chunk-IM2ZXR5O.mjs} +1 -1
- package/dist/{chunk-N6ELMARC.mjs → chunk-K4E5URXS.mjs} +1 -1
- package/dist/{chunk-ETF3RTA4.mjs → chunk-K7EBHXCY.mjs} +1 -1
- package/dist/{chunk-24LIS25A.mjs → chunk-LFP6OJNY.mjs} +1 -1
- package/dist/{chunk-F2BEG6UB.mjs → chunk-LJD7OIVO.mjs} +1 -1
- package/dist/{chunk-DCAOYLG4.mjs → chunk-M5TZN4OC.mjs} +1 -1
- package/dist/{chunk-PMOB43IB.mjs → chunk-NBXA63NM.mjs} +1 -1
- package/dist/{chunk-C22IQSUX.mjs → chunk-S6Q2GXST.mjs} +1 -1
- package/dist/{chunk-YPPGNIVG.mjs → chunk-YCJ7CRFV.mjs} +1 -0
- package/dist/configs/astro.d.cts +1 -1
- package/dist/configs/astro.mjs +2 -2
- package/dist/configs/comments.d.cts +1 -1
- package/dist/configs/ignores.cjs +1 -0
- package/dist/configs/ignores.d.cts +1 -1
- package/dist/configs/ignores.mjs +2 -2
- package/dist/configs/imports.d.cts +1 -1
- package/dist/configs/index.cjs +217 -8
- package/dist/configs/index.d.cts +1 -1
- package/dist/configs/index.mjs +13 -13
- package/dist/configs/javascript.d.cts +1 -1
- package/dist/configs/javascript.mjs +2 -2
- package/dist/configs/jsdoc.d.cts +1 -1
- package/dist/configs/jsonc.d.cts +1 -1
- package/dist/configs/jsonc.mjs +2 -2
- package/dist/configs/markdown.d.cts +1 -1
- package/dist/configs/markdown.mjs +2 -2
- package/dist/configs/nextjs.d.cts +1 -1
- package/dist/configs/nextjs.mjs +2 -2
- package/dist/configs/node.d.cts +1 -1
- package/dist/configs/perfectionist.d.cts +1 -1
- package/dist/configs/react.cjs +216 -8
- package/dist/configs/react.d.cts +1 -1
- package/dist/configs/react.mjs +2 -2
- package/dist/configs/sort.d.cts +1 -1
- package/dist/configs/stylistic.d.cts +1 -1
- package/dist/configs/tailwindcss.d.cts +1 -1
- package/dist/configs/tailwindcss.mjs +2 -2
- package/dist/configs/test.d.cts +1 -1
- package/dist/configs/test.mjs +2 -2
- package/dist/configs/typescript.d.cts +1 -1
- package/dist/configs/typescript.mjs +2 -2
- package/dist/configs/unicorn.d.cts +1 -1
- package/dist/configs/unocss.d.cts +1 -1
- package/dist/configs/vue.d.cts +1 -1
- package/dist/configs/vue.mjs +2 -2
- package/dist/configs/yaml.d.cts +1 -1
- package/dist/configs/yaml.mjs +2 -2
- package/dist/index.cjs +217 -8
- package/dist/index.d.cts +1 -1
- package/dist/index.mjs +13 -13
- package/dist/types-d6wL74Fv.d.cts +235 -0
- package/package.json +45 -19
- package/dist/chunk-2TYG7WFX.mjs +0 -69
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @luxass/eslint-config
|
|
2
2
|
|
|
3
3
|
> [!IMPORTANT]
|
|
4
|
-
> The configuration is not currently finished
|
|
5
|
-
|
|
4
|
+
> The configuration is not currently finished.
|
|
5
|
+
> I could change at any moment.
|
|
6
6
|
|
|
7
7
|
## ✨ Features
|
|
8
8
|
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GLOB_JSX
|
|
3
|
+
} from "./chunk-YCJ7CRFV.mjs";
|
|
4
|
+
import {
|
|
5
|
+
interop
|
|
6
|
+
} from "./chunk-4VUK6ART.mjs";
|
|
7
|
+
|
|
8
|
+
// src/configs/react.ts
|
|
9
|
+
async function react(options) {
|
|
10
|
+
const [
|
|
11
|
+
pluginReact,
|
|
12
|
+
pluginReactHooks,
|
|
13
|
+
pluginReactRefresh,
|
|
14
|
+
pluginA11y
|
|
15
|
+
] = await Promise.all([
|
|
16
|
+
interop(import("eslint-plugin-react")),
|
|
17
|
+
interop(import("eslint-plugin-react-hooks")),
|
|
18
|
+
interop(import("eslint-plugin-react-refresh")),
|
|
19
|
+
...options.a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
|
|
20
|
+
]);
|
|
21
|
+
const {
|
|
22
|
+
a11y = false,
|
|
23
|
+
overrides = {},
|
|
24
|
+
typescript = true
|
|
25
|
+
} = options;
|
|
26
|
+
return [
|
|
27
|
+
{
|
|
28
|
+
name: "luxass:react:setup",
|
|
29
|
+
plugins: {
|
|
30
|
+
"react": pluginReact,
|
|
31
|
+
"react-hooks": pluginReactHooks,
|
|
32
|
+
"react-refresh": pluginReactRefresh,
|
|
33
|
+
...a11y ? { "jsx-a11y": pluginA11y } : {}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
files: [GLOB_JSX],
|
|
38
|
+
languageOptions: {
|
|
39
|
+
parserOptions: {
|
|
40
|
+
ecmaFeatures: {
|
|
41
|
+
jsx: true
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
name: "luxass:react:rules",
|
|
46
|
+
rules: {
|
|
47
|
+
// recommended rules for jsx-a11y
|
|
48
|
+
"jsx-a11y/alt-text": "error",
|
|
49
|
+
"jsx-a11y/anchor-ambiguous-text": "off",
|
|
50
|
+
"jsx-a11y/anchor-has-content": "error",
|
|
51
|
+
"jsx-a11y/anchor-is-valid": "error",
|
|
52
|
+
"jsx-a11y/aria-activedescendant-has-tabindex": "error",
|
|
53
|
+
"jsx-a11y/aria-props": "error",
|
|
54
|
+
"jsx-a11y/aria-proptypes": "error",
|
|
55
|
+
"jsx-a11y/aria-role": "error",
|
|
56
|
+
"jsx-a11y/aria-unsupported-elements": "error",
|
|
57
|
+
"jsx-a11y/autocomplete-valid": "error",
|
|
58
|
+
"jsx-a11y/click-events-have-key-events": "error",
|
|
59
|
+
"jsx-a11y/control-has-associated-label": [
|
|
60
|
+
"off",
|
|
61
|
+
{
|
|
62
|
+
ignoreElements: [
|
|
63
|
+
"audio",
|
|
64
|
+
"canvas",
|
|
65
|
+
"embed",
|
|
66
|
+
"input",
|
|
67
|
+
"textarea",
|
|
68
|
+
"tr",
|
|
69
|
+
"video"
|
|
70
|
+
],
|
|
71
|
+
ignoreRoles: [
|
|
72
|
+
"grid",
|
|
73
|
+
"listbox",
|
|
74
|
+
"menu",
|
|
75
|
+
"menubar",
|
|
76
|
+
"radiogroup",
|
|
77
|
+
"row",
|
|
78
|
+
"tablist",
|
|
79
|
+
"toolbar",
|
|
80
|
+
"tree",
|
|
81
|
+
"treegrid"
|
|
82
|
+
],
|
|
83
|
+
includeRoles: [
|
|
84
|
+
"alert",
|
|
85
|
+
"dialog"
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"jsx-a11y/heading-has-content": "error",
|
|
90
|
+
"jsx-a11y/html-has-lang": "error",
|
|
91
|
+
"jsx-a11y/iframe-has-title": "error",
|
|
92
|
+
"jsx-a11y/img-redundant-alt": "error",
|
|
93
|
+
"jsx-a11y/interactive-supports-focus": [
|
|
94
|
+
"error",
|
|
95
|
+
{
|
|
96
|
+
tabbable: [
|
|
97
|
+
"button",
|
|
98
|
+
"checkbox",
|
|
99
|
+
"link",
|
|
100
|
+
"searchbox",
|
|
101
|
+
"spinbutton",
|
|
102
|
+
"switch",
|
|
103
|
+
"textbox"
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"jsx-a11y/label-has-associated-control": "error",
|
|
108
|
+
"jsx-a11y/label-has-for": "off",
|
|
109
|
+
"jsx-a11y/media-has-caption": "error",
|
|
110
|
+
"jsx-a11y/mouse-events-have-key-events": "error",
|
|
111
|
+
"jsx-a11y/no-access-key": "error",
|
|
112
|
+
"jsx-a11y/no-autofocus": "error",
|
|
113
|
+
"jsx-a11y/no-distracting-elements": "error",
|
|
114
|
+
"jsx-a11y/no-interactive-element-to-noninteractive-role": [
|
|
115
|
+
"error",
|
|
116
|
+
{
|
|
117
|
+
canvas: [
|
|
118
|
+
"img"
|
|
119
|
+
],
|
|
120
|
+
tr: [
|
|
121
|
+
"none",
|
|
122
|
+
"presentation"
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"jsx-a11y/no-noninteractive-element-interactions": [
|
|
127
|
+
"error",
|
|
128
|
+
{
|
|
129
|
+
alert: [
|
|
130
|
+
"onKeyUp",
|
|
131
|
+
"onKeyDown",
|
|
132
|
+
"onKeyPress"
|
|
133
|
+
],
|
|
134
|
+
body: [
|
|
135
|
+
"onError",
|
|
136
|
+
"onLoad"
|
|
137
|
+
],
|
|
138
|
+
dialog: [
|
|
139
|
+
"onKeyUp",
|
|
140
|
+
"onKeyDown",
|
|
141
|
+
"onKeyPress"
|
|
142
|
+
],
|
|
143
|
+
handlers: [
|
|
144
|
+
"onClick",
|
|
145
|
+
"onError",
|
|
146
|
+
"onLoad",
|
|
147
|
+
"onMouseDown",
|
|
148
|
+
"onMouseUp",
|
|
149
|
+
"onKeyPress",
|
|
150
|
+
"onKeyDown",
|
|
151
|
+
"onKeyUp"
|
|
152
|
+
],
|
|
153
|
+
iframe: [
|
|
154
|
+
"onError",
|
|
155
|
+
"onLoad"
|
|
156
|
+
],
|
|
157
|
+
img: [
|
|
158
|
+
"onError",
|
|
159
|
+
"onLoad"
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"jsx-a11y/no-noninteractive-element-to-interactive-role": [
|
|
164
|
+
"error",
|
|
165
|
+
{
|
|
166
|
+
fieldset: [
|
|
167
|
+
"radiogroup",
|
|
168
|
+
"presentation"
|
|
169
|
+
],
|
|
170
|
+
li: [
|
|
171
|
+
"menuitem",
|
|
172
|
+
"option",
|
|
173
|
+
"row",
|
|
174
|
+
"tab",
|
|
175
|
+
"treeitem"
|
|
176
|
+
],
|
|
177
|
+
ol: [
|
|
178
|
+
"listbox",
|
|
179
|
+
"menu",
|
|
180
|
+
"menubar",
|
|
181
|
+
"radiogroup",
|
|
182
|
+
"tablist",
|
|
183
|
+
"tree",
|
|
184
|
+
"treegrid"
|
|
185
|
+
],
|
|
186
|
+
table: [
|
|
187
|
+
"grid"
|
|
188
|
+
],
|
|
189
|
+
td: [
|
|
190
|
+
"gridcell"
|
|
191
|
+
],
|
|
192
|
+
ul: [
|
|
193
|
+
"listbox",
|
|
194
|
+
"menu",
|
|
195
|
+
"menubar",
|
|
196
|
+
"radiogroup",
|
|
197
|
+
"tablist",
|
|
198
|
+
"tree",
|
|
199
|
+
"treegrid"
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"jsx-a11y/no-noninteractive-tabindex": [
|
|
204
|
+
"error",
|
|
205
|
+
{
|
|
206
|
+
allowExpressionValues: true,
|
|
207
|
+
roles: [
|
|
208
|
+
"tabpanel"
|
|
209
|
+
],
|
|
210
|
+
tags: []
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"jsx-a11y/no-redundant-roles": "error",
|
|
214
|
+
"jsx-a11y/no-static-element-interactions": [
|
|
215
|
+
"error",
|
|
216
|
+
{
|
|
217
|
+
allowExpressionValues: true,
|
|
218
|
+
handlers: [
|
|
219
|
+
"onClick",
|
|
220
|
+
"onMouseDown",
|
|
221
|
+
"onMouseUp",
|
|
222
|
+
"onKeyPress",
|
|
223
|
+
"onKeyDown",
|
|
224
|
+
"onKeyUp"
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"jsx-a11y/role-has-required-aria-props": "error",
|
|
229
|
+
"jsx-a11y/role-supports-aria-props": "error",
|
|
230
|
+
"jsx-a11y/scope": "error",
|
|
231
|
+
"jsx-a11y/tabindex-no-positive": "error",
|
|
232
|
+
// recommended rules react-hooks
|
|
233
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
234
|
+
"react-hooks/rules-of-hooks": "error",
|
|
235
|
+
// react refresh
|
|
236
|
+
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
|
|
237
|
+
// recommended rules react
|
|
238
|
+
"react/display-name": "error",
|
|
239
|
+
"react/jsx-key": "error",
|
|
240
|
+
"react/jsx-no-comment-textnodes": "error",
|
|
241
|
+
"react/jsx-no-duplicate-props": "error",
|
|
242
|
+
"react/jsx-no-target-blank": "error",
|
|
243
|
+
"react/jsx-no-undef": "error",
|
|
244
|
+
"react/jsx-uses-react": "error",
|
|
245
|
+
"react/jsx-uses-vars": "error",
|
|
246
|
+
"react/no-children-prop": "error",
|
|
247
|
+
"react/no-danger-with-children": "error",
|
|
248
|
+
"react/no-deprecated": "error",
|
|
249
|
+
"react/no-direct-mutation-state": "error",
|
|
250
|
+
"react/no-find-dom-node": "error",
|
|
251
|
+
"react/no-is-mounted": "error",
|
|
252
|
+
"react/no-render-return-value": "error",
|
|
253
|
+
"react/no-string-refs": "error",
|
|
254
|
+
"react/no-unescaped-entities": "error",
|
|
255
|
+
"react/no-unknown-property": "error",
|
|
256
|
+
"react/no-unsafe": "off",
|
|
257
|
+
"react/prop-types": "error",
|
|
258
|
+
"react/react-in-jsx-scope": "off",
|
|
259
|
+
"react/require-render-return": "error",
|
|
260
|
+
...typescript ? {
|
|
261
|
+
"react/prop-type": "off"
|
|
262
|
+
} : {},
|
|
263
|
+
// overrides
|
|
264
|
+
...overrides
|
|
265
|
+
},
|
|
266
|
+
settings: {
|
|
267
|
+
react: {
|
|
268
|
+
version: "detect"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export {
|
|
276
|
+
react
|
|
277
|
+
};
|
package/dist/configs/astro.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ConfigurationOptions, O as OverrideOptions, R as ReactOptions, F as FlatConfigItem } from '../types-d6wL74Fv.
|
|
1
|
+
import { C as ConfigurationOptions, O as OverrideOptions, R as ReactOptions, F as FlatConfigItem } from '../types-d6wL74Fv.cjs';
|
|
2
2
|
import 'eslint-config-flat-gitignore';
|
|
3
3
|
import '@typescript-eslint/parser';
|
|
4
4
|
import '@antfu/eslint-define-config';
|
package/dist/configs/astro.mjs
CHANGED
package/dist/configs/ignores.cjs
CHANGED
package/dist/configs/ignores.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as StylisticOptions, F as FlatConfigItem } from '../types-d6wL74Fv.
|
|
1
|
+
import { S as StylisticOptions, F as FlatConfigItem } from '../types-d6wL74Fv.cjs';
|
|
2
2
|
import 'eslint-config-flat-gitignore';
|
|
3
3
|
import '@typescript-eslint/parser';
|
|
4
4
|
import '@antfu/eslint-define-config';
|