@shayanthenerd/eslint-config 0.11.2 → 0.12.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.
- package/dist/configs/base.mjs +13 -14
- package/dist/configs/css.mjs +2 -2
- package/dist/configs/cypress.mjs +2 -1
- package/dist/configs/html.mjs +3 -1
- package/dist/configs/importX.mjs +8 -5
- package/dist/configs/oxlintOverrides.mjs +8 -8
- package/dist/configs/perfectionist.mjs +1 -1
- package/dist/configs/playwright.mjs +2 -1
- package/dist/configs/storybook.mjs +1 -2
- package/dist/configs/stylistic.mjs +3 -3
- package/dist/configs/tailwind.mjs +15 -12
- package/dist/configs/typescript.mjs +13 -10
- package/dist/configs/vitest.mjs +1 -1
- package/dist/configs/vue.mjs +20 -8
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +23 -22
- package/dist/oxlint.config.jsonc +1 -0
- package/dist/rules/css.mjs +12 -3
- package/dist/rules/cypress.mjs +7 -3
- package/dist/rules/html.mjs +45 -23
- package/dist/rules/importX.mjs +23 -21
- package/dist/rules/javascript.mjs +167 -115
- package/dist/rules/playwright.mjs +40 -12
- package/dist/rules/storybook.mjs +13 -2
- package/dist/rules/stylistic.mjs +104 -55
- package/dist/rules/tailwind.mjs +13 -12
- package/dist/rules/typescript.mjs +117 -7
- package/dist/rules/vitest.mjs +57 -28
- package/dist/rules/vue.mjs +271 -96
- package/dist/rules/vueAccessibility.mjs +21 -7
- package/dist/types/eslint-schema.d.mts +24 -33
- package/package.json +23 -24
package/dist/rules/vue.mjs
CHANGED
|
@@ -8,11 +8,14 @@ function getVueRules(options) {
|
|
|
8
8
|
const { typescript, stylistic, tailwind, vue, nuxt } = options.configs;
|
|
9
9
|
const { indent, useTabs, trailingComma, maxLineLength, maxAttributesPerLine, maxConsecutiveEmptyLines, selfCloseVoidHTMLElements } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
|
|
10
10
|
const { blockLang, blocksOrder, macrosOrder, attributesOrder, destructureProps, vForDelimiterStyle, attributeHyphenation, allowedStyleAttributes, preferVBindTrueShorthand, componentNameCaseInTemplate, preferVBindSameNameShorthand, restrictedElements: userRestrictedElements, ignoredUndefinedComponents: userIgnoredUndefinedComponents, restrictedStaticAttributes: userRestrictedStaticAttributes } = isEnabled(vue) ? vue : defaultOptions.configs.vue;
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
11
|
+
const isNuxtEnabled = isEnabled(nuxt);
|
|
12
|
+
const isNuxtImageEnabled = isNuxtEnabled ? nuxt.image : void 0;
|
|
13
|
+
const isNuxtUIEnabled = isNuxtEnabled ? nuxt.ui : void 0;
|
|
14
|
+
const nuxtUIPrefix = isNuxtEnabled && isEnabled(nuxt.ui) ? nuxt.ui.prefix : defaultOptions.configs.nuxt.ui.prefix;
|
|
15
|
+
const isNuxtIconEnabled = isNuxtEnabled ? nuxt.icon : void 0;
|
|
16
|
+
const nuxtIconComponent = isNuxtEnabled && isEnabled(nuxt.icon) ? nuxt.icon.component : defaultOptions.configs.nuxt.icon.component;
|
|
17
|
+
const restrictedVueElements = isNuxtUIEnabled ? getRestrictedVueElements(nuxtUIPrefix) : [];
|
|
18
|
+
const restrictedVueInputs = isNuxtUIEnabled ? getRestrictedVueInputs(nuxtUIPrefix) : [];
|
|
16
19
|
const isScriptLangTS = blockLang.script === "ts";
|
|
17
20
|
const isStyleLangImplicit = blockLang.style === "implicit";
|
|
18
21
|
return {
|
|
@@ -20,77 +23,154 @@ function getVueRules(options) {
|
|
|
20
23
|
"no-useless-assignment": "off",
|
|
21
24
|
"import-x/default": "off",
|
|
22
25
|
"import-x/no-unresolved": "off",
|
|
23
|
-
"vue/
|
|
24
|
-
"vue/comment-directive":
|
|
26
|
+
"vue/jsx-uses-vars": "error",
|
|
27
|
+
"vue/comment-directive": "error",
|
|
28
|
+
"vue/multi-word-component-names": "error",
|
|
29
|
+
"vue/no-arrow-functions-in-watch": "warn",
|
|
25
30
|
"vue/no-async-in-computed-properties": ["error", { ignoredObjectNames: ["z"] }],
|
|
26
|
-
"vue/
|
|
31
|
+
"vue/no-child-content": "error",
|
|
32
|
+
"vue/no-computed-properties-in-data": "error",
|
|
33
|
+
"vue/no-deprecated-data-object-declaration": "error",
|
|
34
|
+
"vue/no-deprecated-delete-set": "error",
|
|
35
|
+
"vue/no-deprecated-destroyed-lifecycle": "error",
|
|
36
|
+
"vue/no-deprecated-dollar-listeners-api": "error",
|
|
37
|
+
"vue/no-deprecated-dollar-scopedslots-api": "error",
|
|
38
|
+
"vue/no-deprecated-events-api": "error",
|
|
39
|
+
"vue/no-deprecated-filter": "error",
|
|
40
|
+
"vue/no-deprecated-functional-template": "error",
|
|
41
|
+
"vue/no-deprecated-html-element-is": "error",
|
|
42
|
+
"vue/no-deprecated-inline-template": "error",
|
|
43
|
+
"vue/no-deprecated-model-definition": ["error", { allowVue3Compat: true }],
|
|
44
|
+
"vue/no-deprecated-props-default-this": "error",
|
|
45
|
+
"vue/no-deprecated-router-link-tag-prop": "error",
|
|
46
|
+
"vue/no-deprecated-scope-attribute": "error",
|
|
47
|
+
"vue/no-deprecated-slot-attribute": "error",
|
|
48
|
+
"vue/no-deprecated-slot-scope-attribute": "error",
|
|
49
|
+
"vue/no-deprecated-v-bind-sync": "error",
|
|
50
|
+
"vue/no-deprecated-v-is": "error",
|
|
51
|
+
"vue/no-deprecated-v-on-native-modifier": "error",
|
|
52
|
+
"vue/no-deprecated-v-on-number-modifiers": "error",
|
|
53
|
+
"vue/no-deprecated-vue-config-keycodes": "error",
|
|
54
|
+
"vue/no-dupe-keys": "error",
|
|
55
|
+
"vue/no-dupe-v-else-if": "error",
|
|
56
|
+
"vue/no-duplicate-attributes": "error",
|
|
57
|
+
"vue/no-export-in-script-setup": "error",
|
|
58
|
+
"vue/no-expose-after-await": "error",
|
|
59
|
+
"vue/no-lifecycle-after-await": "error",
|
|
60
|
+
"vue/no-multiple-template-root": "off",
|
|
61
|
+
"vue/no-mutating-props": "error",
|
|
62
|
+
"vue/no-parsing-error": "error",
|
|
63
|
+
"vue/no-ref-as-operand": "error",
|
|
64
|
+
"vue/no-reserved-component-names": "error",
|
|
65
|
+
"vue/no-reserved-keys": "error",
|
|
66
|
+
"vue/no-reserved-props": "error",
|
|
67
|
+
"vue/no-shared-component-data": "error",
|
|
68
|
+
"vue/no-side-effects-in-computed-properties": "error",
|
|
69
|
+
"vue/no-template-key": "error",
|
|
70
|
+
"vue/no-textarea-mustache": "error",
|
|
71
|
+
"vue/no-unused-components": "error",
|
|
72
|
+
"vue/no-unused-vars": "error",
|
|
73
|
+
"vue/no-use-computed-property-like-method": "error",
|
|
74
|
+
"vue/no-use-v-if-with-v-for": "error",
|
|
75
|
+
"vue/no-useless-template-attributes": "error",
|
|
76
|
+
"vue/no-v-for-template-key-on-child": "error",
|
|
77
|
+
"vue/no-v-text-v-html-on-component": "error",
|
|
78
|
+
"vue/no-watch-after-await": "error",
|
|
79
|
+
"vue/prefer-import-from-vue": "error",
|
|
80
|
+
"vue/require-component-is": "error",
|
|
81
|
+
"vue/require-prop-type-constructor": "error",
|
|
82
|
+
"vue/require-render-return": "error",
|
|
83
|
+
"vue/require-slots-as-functions": "error",
|
|
84
|
+
"vue/require-toggle-inside-transition": "error",
|
|
85
|
+
"vue/require-v-for-key": "error",
|
|
86
|
+
"vue/require-valid-default-prop": "error",
|
|
87
|
+
"vue/return-in-computed-property": "error",
|
|
88
|
+
"vue/return-in-emits-validator": "error",
|
|
89
|
+
"vue/use-v-on-exact": "error",
|
|
90
|
+
"vue/valid-attribute-name": "error",
|
|
91
|
+
"vue/valid-define-emits": "error",
|
|
92
|
+
"vue/valid-define-options": "error",
|
|
93
|
+
"vue/valid-define-props": "error",
|
|
94
|
+
"vue/valid-next-tick": "error",
|
|
95
|
+
"vue/valid-template-root": "error",
|
|
96
|
+
"vue/valid-v-bind": "error",
|
|
97
|
+
"vue/valid-v-cloak": "error",
|
|
98
|
+
"vue/valid-v-else-if": "error",
|
|
99
|
+
"vue/valid-v-else": "error",
|
|
100
|
+
"vue/valid-v-for": "error",
|
|
101
|
+
"vue/valid-v-html": "error",
|
|
102
|
+
"vue/valid-v-if": "error",
|
|
103
|
+
"vue/valid-v-is": "error",
|
|
104
|
+
"vue/valid-v-memo": "error",
|
|
105
|
+
"vue/valid-v-model": "error",
|
|
106
|
+
"vue/valid-v-on": "error",
|
|
107
|
+
"vue/valid-v-once": "error",
|
|
108
|
+
"vue/valid-v-pre": "error",
|
|
109
|
+
"vue/valid-v-show": "error",
|
|
110
|
+
"vue/valid-v-slot": "error",
|
|
111
|
+
"vue/valid-v-text": "error",
|
|
112
|
+
"vue/attribute-hyphenation": ["warn", attributeHyphenation],
|
|
113
|
+
"vue/component-definition-name-casing": "warn",
|
|
114
|
+
"vue/first-attribute-linebreak": "warn",
|
|
27
115
|
"vue/html-closing-bracket-newline": "warn",
|
|
28
|
-
"vue/
|
|
116
|
+
"vue/html-closing-bracket-spacing": "warn",
|
|
117
|
+
"vue/html-end-tags": "warn",
|
|
29
118
|
"vue/html-indent": ["warn", useTabs ? "tab" : indent],
|
|
30
|
-
"vue/
|
|
31
|
-
"vue/attribute-hyphenation": ["warn", attributeHyphenation],
|
|
32
|
-
"vue/v-on-event-hyphenation": [
|
|
33
|
-
"warn",
|
|
34
|
-
attributeHyphenation,
|
|
35
|
-
{ autofix: true }
|
|
36
|
-
],
|
|
37
|
-
"vue/v-bind-style": [
|
|
38
|
-
"warn",
|
|
39
|
-
"shorthand",
|
|
40
|
-
{ sameNameShorthand: preferVBindSameNameShorthand }
|
|
41
|
-
],
|
|
119
|
+
"vue/html-quotes": "warn",
|
|
42
120
|
"vue/html-self-closing": ["error", { html: {
|
|
43
121
|
normal: "never",
|
|
44
122
|
void: selfCloseVoidHTMLElements
|
|
45
123
|
} }],
|
|
46
124
|
"vue/max-attributes-per-line": ["warn", { singleline: { max: maxAttributesPerLine } }],
|
|
47
|
-
"vue/
|
|
48
|
-
"vue/
|
|
49
|
-
"vue/no-
|
|
50
|
-
"vue/
|
|
51
|
-
"vue/no-
|
|
125
|
+
"vue/multiline-html-element-content-newline": "warn",
|
|
126
|
+
"vue/mustache-interpolation-spacing": "warn",
|
|
127
|
+
"vue/no-multi-spaces": "warn",
|
|
128
|
+
"vue/no-spaces-around-equal-signs-in-attribute": "warn",
|
|
129
|
+
"vue/no-template-shadow": "error",
|
|
130
|
+
"vue/one-component-per-file": "error",
|
|
52
131
|
"vue/prop-name-casing": "warn",
|
|
53
|
-
"vue/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"vue/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"vue/
|
|
64
|
-
"vue/
|
|
65
|
-
"vue/
|
|
66
|
-
"vue/require-typed-object-prop": "error",
|
|
67
|
-
"vue/require-macro-variable-name": "warn",
|
|
68
|
-
"vue/padding-line-between-blocks": "warn",
|
|
69
|
-
"vue/match-component-import-name": "error",
|
|
70
|
-
"vue/html-comment-content-newline": "warn",
|
|
71
|
-
"vue/no-multiple-objects-in-class": "warn",
|
|
72
|
-
"vue/prefer-separate-static-class": "warn",
|
|
73
|
-
"vue/html-comment-content-spacing": "warn",
|
|
74
|
-
"vue/comma-dangle": ["warn", trailingComma],
|
|
75
|
-
"vue/component-options-name-casing": "warn",
|
|
76
|
-
"vue/no-ref-object-reactivity-loss": "error",
|
|
77
|
-
"vue/no-duplicate-attr-inheritance": "error",
|
|
78
|
-
"vue/no-this-in-before-route-enter": "error",
|
|
79
|
-
"vue/prefer-prop-type-boolean-first": "warn",
|
|
80
|
-
"vue/no-setup-props-reactivity-loss": "error",
|
|
132
|
+
"vue/v-bind-style": [
|
|
133
|
+
"warn",
|
|
134
|
+
"shorthand",
|
|
135
|
+
{ sameNameShorthand: preferVBindSameNameShorthand }
|
|
136
|
+
],
|
|
137
|
+
"vue/v-on-event-hyphenation": [
|
|
138
|
+
"warn",
|
|
139
|
+
attributeHyphenation,
|
|
140
|
+
{ autofix: true }
|
|
141
|
+
],
|
|
142
|
+
"vue/v-on-style": "warn",
|
|
143
|
+
"vue/v-slot-style": ["warn", { atComponent: "shorthand" }],
|
|
144
|
+
"vue/attributes-order": ["warn", { order: attributesOrder }],
|
|
81
145
|
"vue/block-order": ["warn", { order: blocksOrder }],
|
|
82
|
-
"vue/
|
|
83
|
-
"vue/
|
|
84
|
-
"vue/define-macros-order": ["warn", { order: macrosOrder }],
|
|
85
|
-
"vue/html-comment-indent": ["warn", useTabs ? "tab" : indent],
|
|
86
|
-
"vue/no-static-inline-styles": ["warn", { allowBinding: true }],
|
|
146
|
+
"vue/no-lone-template": "error",
|
|
147
|
+
"vue/no-multiple-slot-args": "error",
|
|
87
148
|
"vue/no-required-prop-with-default": ["error", { autofix: true }],
|
|
88
|
-
"vue/
|
|
89
|
-
"vue/
|
|
90
|
-
"vue/
|
|
91
|
-
"vue/
|
|
92
|
-
"vue/
|
|
93
|
-
"vue/
|
|
149
|
+
"vue/no-v-html": ["warn", { ignorePattern: "^html" }],
|
|
150
|
+
"vue/order-in-components": "warn",
|
|
151
|
+
"vue/this-in-template": "warn",
|
|
152
|
+
"vue/array-bracket-newline": ["warn", "consistent"],
|
|
153
|
+
"vue/array-bracket-spacing": "warn",
|
|
154
|
+
"vue/arrow-spacing": "warn",
|
|
155
|
+
"vue/block-spacing": "warn",
|
|
156
|
+
"vue/brace-style": [
|
|
157
|
+
"warn",
|
|
158
|
+
"1tbs",
|
|
159
|
+
{ allowSingleLine: true }
|
|
160
|
+
],
|
|
161
|
+
"vue/camelcase": ["warn", {
|
|
162
|
+
properties: "never",
|
|
163
|
+
ignoreImports: true,
|
|
164
|
+
ignoreDestructuring: true
|
|
165
|
+
}],
|
|
166
|
+
"vue/comma-dangle": ["warn", trailingComma],
|
|
167
|
+
"vue/comma-spacing": "warn",
|
|
168
|
+
"vue/comma-style": "warn",
|
|
169
|
+
"vue/dot-notation": "warn",
|
|
170
|
+
"vue/eqeqeq": "error",
|
|
171
|
+
"vue/func-call-spacing": "warn",
|
|
172
|
+
"vue/key-spacing": "warn",
|
|
173
|
+
"vue/keyword-spacing": "warn",
|
|
94
174
|
"vue/max-len": [tailwind ? "off" : "warn", {
|
|
95
175
|
tabWidth: indent,
|
|
96
176
|
code: maxLineLength,
|
|
@@ -104,6 +184,51 @@ function getVueRules(options) {
|
|
|
104
184
|
ignoreHTMLTextContents: true,
|
|
105
185
|
ignoreHTMLAttributeValues: true
|
|
106
186
|
}],
|
|
187
|
+
"vue/multiline-ternary": ["warn", "always-multiline"],
|
|
188
|
+
"vue/no-console": ["warn", { allow: [
|
|
189
|
+
"info",
|
|
190
|
+
"warn",
|
|
191
|
+
"error",
|
|
192
|
+
"table",
|
|
193
|
+
"group",
|
|
194
|
+
"groupEnd",
|
|
195
|
+
"groupCollapsed"
|
|
196
|
+
] }],
|
|
197
|
+
"vue/no-constant-condition": "warn",
|
|
198
|
+
"vue/no-empty-pattern": "warn",
|
|
199
|
+
"vue/no-implicit-coercion": "warn",
|
|
200
|
+
"vue/no-irregular-whitespace": "warn",
|
|
201
|
+
"vue/no-loss-of-precision": "error",
|
|
202
|
+
"vue/no-sparse-arrays": "error",
|
|
203
|
+
"vue/no-useless-concat": "error",
|
|
204
|
+
"vue/object-curly-newline": ["warn", {
|
|
205
|
+
multiline: true,
|
|
206
|
+
consistent: true
|
|
207
|
+
}],
|
|
208
|
+
"vue/object-curly-spacing": [
|
|
209
|
+
"warn",
|
|
210
|
+
"always",
|
|
211
|
+
{ emptyObjects: "never" }
|
|
212
|
+
],
|
|
213
|
+
"vue/object-property-newline": ["warn", { allowAllPropertiesOnSameLine: true }],
|
|
214
|
+
"vue/object-shorthand": "warn",
|
|
215
|
+
"vue/operator-linebreak": [
|
|
216
|
+
"error",
|
|
217
|
+
"none",
|
|
218
|
+
{ overrides: {
|
|
219
|
+
"=": "after",
|
|
220
|
+
"?": "before",
|
|
221
|
+
":": "before",
|
|
222
|
+
"|": "before",
|
|
223
|
+
"&": "before"
|
|
224
|
+
} }
|
|
225
|
+
],
|
|
226
|
+
"vue/prefer-template": "warn",
|
|
227
|
+
"vue/quote-props": ["warn", "consistent-as-needed"],
|
|
228
|
+
"vue/space-in-parens": "warn",
|
|
229
|
+
"vue/space-infix-ops": "warn",
|
|
230
|
+
"vue/space-unary-ops": "warn",
|
|
231
|
+
"vue/template-curly-spacing": "warn",
|
|
107
232
|
"vue/block-lang": ["error", {
|
|
108
233
|
script: { lang: blockLang.script },
|
|
109
234
|
style: {
|
|
@@ -115,70 +240,120 @@ function getVueRules(options) {
|
|
|
115
240
|
singleline: "always",
|
|
116
241
|
maxEmptyLines: maxConsecutiveEmptyLines ? maxConsecutiveEmptyLines - 1 : 0
|
|
117
242
|
}],
|
|
243
|
+
"vue/component-api-style": "error",
|
|
244
|
+
"vue/component-name-in-template-casing": [
|
|
245
|
+
"warn",
|
|
246
|
+
componentNameCaseInTemplate,
|
|
247
|
+
{
|
|
248
|
+
ignores: ["/^\\w+(\\.\\w+)+$/"],
|
|
249
|
+
registeredComponentsOnly: false
|
|
250
|
+
}
|
|
251
|
+
],
|
|
252
|
+
"vue/component-options-name-casing": "warn",
|
|
253
|
+
"vue/custom-event-name-casing": "warn",
|
|
254
|
+
"vue/define-emits-declaration": ["warn", isScriptLangTS ? "type-based" : "runtime"],
|
|
255
|
+
"vue/define-macros-order": ["warn", { order: macrosOrder }],
|
|
256
|
+
"vue/define-props-declaration": ["error", isScriptLangTS ? "type-based" : "runtime"],
|
|
257
|
+
"vue/define-props-destructuring": ["warn", { destructure: destructureProps }],
|
|
258
|
+
"vue/enforce-style-attribute": ["error", { allow: allowedStyleAttributes }],
|
|
259
|
+
"vue/html-button-has-type": "error",
|
|
260
|
+
"vue/html-comment-content-newline": "warn",
|
|
261
|
+
"vue/html-comment-content-spacing": "warn",
|
|
262
|
+
"vue/html-comment-indent": ["warn", useTabs ? "tab" : indent],
|
|
263
|
+
"vue/match-component-file-name": ["error", {
|
|
264
|
+
shouldMatchCase: true,
|
|
265
|
+
extensions: isEnabled(typescript) ? [
|
|
266
|
+
"vue",
|
|
267
|
+
"js",
|
|
268
|
+
"jsx",
|
|
269
|
+
"ts",
|
|
270
|
+
"tsx"
|
|
271
|
+
] : [
|
|
272
|
+
"vue",
|
|
273
|
+
"js",
|
|
274
|
+
"jsx"
|
|
275
|
+
]
|
|
276
|
+
}],
|
|
277
|
+
"vue/match-component-import-name": "warn",
|
|
278
|
+
"vue/next-tick-style": "warn",
|
|
279
|
+
"vue/no-duplicate-attr-inheritance": "error",
|
|
280
|
+
"vue/no-duplicate-class-names": "warn",
|
|
281
|
+
"vue/no-empty-component-block": "error",
|
|
282
|
+
"vue/no-import-compiler-macros": "error",
|
|
283
|
+
"vue/no-multiple-objects-in-class": "warn",
|
|
284
|
+
"vue/no-negated-v-if-condition": "warn",
|
|
285
|
+
"vue/no-ref-object-reactivity-loss": "error",
|
|
118
286
|
"vue/no-restricted-html-elements": [
|
|
119
287
|
"error",
|
|
120
288
|
{
|
|
121
|
-
element:
|
|
289
|
+
element: isNuxtEnabled ? "time" : "",
|
|
122
290
|
message: "Use `<NuxtTime>`."
|
|
123
291
|
},
|
|
124
292
|
{
|
|
125
|
-
element:
|
|
293
|
+
element: isNuxtImageEnabled ? "img" : "",
|
|
126
294
|
message: "Use `<NuxtImg>`."
|
|
127
295
|
},
|
|
128
296
|
{
|
|
129
|
-
element:
|
|
297
|
+
element: isNuxtUIEnabled ? [
|
|
130
298
|
"a",
|
|
131
299
|
"RouterLink",
|
|
132
300
|
"NuxtLink"
|
|
133
301
|
] : "",
|
|
134
|
-
message:
|
|
302
|
+
message: isNuxtUIEnabled ? `Use \`<${nuxtUIPrefix}Link>\`.` : void 0
|
|
135
303
|
},
|
|
136
304
|
{
|
|
137
|
-
element: ["a",
|
|
138
|
-
message: `Use \`<${
|
|
305
|
+
element: ["a", isNuxtEnabled ? "RouterLink" : ""],
|
|
306
|
+
message: `Use \`<${isNuxtEnabled ? "NuxtLink" : "RouterLink"}>\`.`
|
|
139
307
|
},
|
|
140
|
-
...
|
|
308
|
+
...restrictedVueElements,
|
|
141
309
|
...userRestrictedElements
|
|
142
310
|
],
|
|
143
311
|
"vue/no-restricted-static-attribute": [
|
|
144
312
|
"error",
|
|
145
|
-
...
|
|
146
|
-
|
|
313
|
+
...restrictedVueInputs,
|
|
314
|
+
isNuxtUIEnabled ? {
|
|
147
315
|
key: "href",
|
|
148
316
|
element: `${nuxtUIPrefix}Link`,
|
|
149
317
|
message: "Use `v-bind:to=\"\"`."
|
|
150
318
|
} : { key: "" },
|
|
151
|
-
|
|
319
|
+
isNuxtUIEnabled ? {
|
|
152
320
|
key: "href",
|
|
153
321
|
element: `${nuxtUIPrefix}Button`,
|
|
154
322
|
message: "Use `v-bind:to=\"\"`."
|
|
155
323
|
} : { key: " " },
|
|
156
324
|
...userRestrictedStaticAttributes
|
|
157
325
|
],
|
|
326
|
+
"vue/no-root-v-if": "warn",
|
|
327
|
+
"vue/no-setup-props-reactivity-loss": "error",
|
|
328
|
+
"vue/no-static-inline-styles": ["warn", { allowBinding: true }],
|
|
329
|
+
"vue/no-this-in-before-route-enter": "error",
|
|
158
330
|
"vue/no-undef-components": ["error", { ignorePatterns: [
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
331
|
+
isNuxtEnabled && "^Nuxt",
|
|
332
|
+
isNuxtEnabled && "^(Html|Head|Title|Base|Meta|Link|Style|Body|NoScript|ClientOnly|DevOnly)$",
|
|
333
|
+
isNuxtIconEnabled && `^${nuxtIconComponent}$`,
|
|
334
|
+
isNuxtUIEnabled && `^${nuxtUIPrefix}`,
|
|
163
335
|
...userIgnoredUndefinedComponents
|
|
164
336
|
].filter(Boolean) }],
|
|
165
|
-
"vue/
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
"vue/
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
337
|
+
"vue/no-unused-refs": "error",
|
|
338
|
+
"vue/no-unused-emit-declarations": "error",
|
|
339
|
+
"vue/no-use-v-else-with-v-for": "error",
|
|
340
|
+
"vue/no-useless-mustaches": "error",
|
|
341
|
+
"vue/no-useless-v-bind": "error",
|
|
342
|
+
"vue/no-v-text": "error",
|
|
343
|
+
"vue/padding-line-between-blocks": "warn",
|
|
344
|
+
"vue/prefer-define-options": "warn",
|
|
345
|
+
"vue/prefer-prop-type-boolean-first": "warn",
|
|
346
|
+
"vue/prefer-separate-static-class": "warn",
|
|
347
|
+
"vue/prefer-true-attribute-shorthand": ["warn", preferVBindTrueShorthand],
|
|
348
|
+
"vue/prefer-use-template-ref": "warn",
|
|
349
|
+
"vue/require-default-export": "error",
|
|
350
|
+
"vue/require-emit-validator": "error",
|
|
351
|
+
"vue/require-expose": "error",
|
|
352
|
+
"vue/require-macro-variable-name": "warn",
|
|
353
|
+
"vue/require-typed-object-prop": isScriptLangTS ? "error" : "off",
|
|
354
|
+
"vue/require-typed-ref": isScriptLangTS ? "error" : "off",
|
|
355
|
+
"vue/slot-name-casing": "warn",
|
|
356
|
+
"vue/v-for-delimiter-style": ["warn", vForDelimiterStyle]
|
|
182
357
|
};
|
|
183
358
|
}
|
|
184
359
|
|
|
@@ -5,19 +5,22 @@ import { defaultOptions } from "../utils/options/defaultOptions.mjs";
|
|
|
5
5
|
function getVueAccessibilityRules(options) {
|
|
6
6
|
const { vue, nuxt } = options.configs;
|
|
7
7
|
const { imageComponents: userImageComponents, anchorComponents: userAnchorComponents, accessibleChildComponents: userAccessibleChildComponents } = isEnabled(vue) && isEnabled(vue.accessibility) ? vue.accessibility : defaultOptions.configs.vue.accessibility;
|
|
8
|
-
const
|
|
8
|
+
const isNuxtUIEnabled = isEnabled(nuxt) ? nuxt.ui : void 0;
|
|
9
9
|
const nuxtUIPrefix = isEnabled(nuxt) && isEnabled(nuxt.ui) ? nuxt.ui.prefix : defaultOptions.configs.nuxt.ui.prefix;
|
|
10
10
|
return {
|
|
11
|
-
"vuejs-accessibility/click-events-have-key-events": "off",
|
|
12
|
-
"vuejs-accessibility/mouse-events-have-key-events": "off",
|
|
13
|
-
"vuejs-accessibility/no-aria-hidden-on-focusable": "error",
|
|
14
|
-
"vuejs-accessibility/no-role-presentation-on-focusable": "error",
|
|
15
11
|
"vuejs-accessibility/alt-text": ["error", { img: userImageComponents }],
|
|
16
12
|
"vuejs-accessibility/anchor-has-content": ["error", {
|
|
17
13
|
components: userAnchorComponents,
|
|
18
14
|
accessibleChildren: userAccessibleChildComponents
|
|
19
15
|
}],
|
|
20
|
-
"vuejs-accessibility/
|
|
16
|
+
"vuejs-accessibility/aria-props": "error",
|
|
17
|
+
"vuejs-accessibility/aria-role": "error",
|
|
18
|
+
"vuejs-accessibility/aria-unsupported-elements": "error",
|
|
19
|
+
"vuejs-accessibility/click-events-have-key-events": "off",
|
|
20
|
+
"vuejs-accessibility/form-control-has-label": ["error", { labelComponents: isNuxtUIEnabled ? [`${nuxtUIPrefix}FormField`] : void 0 }],
|
|
21
|
+
"vuejs-accessibility/heading-has-content": "error",
|
|
22
|
+
"vuejs-accessibility/iframe-has-title": "error",
|
|
23
|
+
"vuejs-accessibility/interactive-supports-focus": "error",
|
|
21
24
|
"vuejs-accessibility/label-has-for": ["error", {
|
|
22
25
|
allowChildren: true,
|
|
23
26
|
required: { some: ["nesting", "id"] },
|
|
@@ -29,7 +32,18 @@ function getVueAccessibilityRules(options) {
|
|
|
29
32
|
"textarea",
|
|
30
33
|
"progress"
|
|
31
34
|
]
|
|
32
|
-
}]
|
|
35
|
+
}],
|
|
36
|
+
"vuejs-accessibility/media-has-caption": "error",
|
|
37
|
+
"vuejs-accessibility/mouse-events-have-key-events": "off",
|
|
38
|
+
"vuejs-accessibility/no-access-key": "warn",
|
|
39
|
+
"vuejs-accessibility/no-aria-hidden-on-focusable": "error",
|
|
40
|
+
"vuejs-accessibility/no-autofocus": "warn",
|
|
41
|
+
"vuejs-accessibility/no-distracting-elements": "warn",
|
|
42
|
+
"vuejs-accessibility/no-redundant-roles": "warn",
|
|
43
|
+
"vuejs-accessibility/no-role-presentation-on-focusable": "error",
|
|
44
|
+
"vuejs-accessibility/no-static-element-interactions": "error",
|
|
45
|
+
"vuejs-accessibility/role-has-required-aria-props": "error",
|
|
46
|
+
"vuejs-accessibility/tabindex-no-positive": "error"
|
|
33
47
|
};
|
|
34
48
|
}
|
|
35
49
|
|
|
@@ -11,51 +11,26 @@ declare module 'eslint' {
|
|
|
11
11
|
// @ts-ignore - In case the package is not installed
|
|
12
12
|
declare module 'eslint-flat-config-utils' {
|
|
13
13
|
interface DefaultConfigNamesMap {
|
|
14
|
-
'shayanthenerd/global'?: true;
|
|
15
14
|
'shayanthenerd/ignores'?: true;
|
|
16
|
-
'shayanthenerd/
|
|
15
|
+
'shayanthenerd/global'?: true;
|
|
17
16
|
'shayanthenerd/base'?: true;
|
|
18
|
-
'shayanthenerd/restricted-exports'?: true;
|
|
19
|
-
'shayanthenerd/import-x > import-x/recommended'?: true;
|
|
20
|
-
'shayanthenerd/import-x > import-x/typescript'?: true;
|
|
21
|
-
'shayanthenerd/import-x'?: true;
|
|
22
|
-
'shayanthenerd/stylistic > ExtendedConfig[0]'?: true;
|
|
23
|
-
'shayanthenerd/stylistic'?: true;
|
|
24
|
-
'shayanthenerd/perfectionist'?: true;
|
|
25
|
-
'shayanthenerd/typescript > typescript-eslint/base'?: true;
|
|
26
|
-
'shayanthenerd/typescript > typescript-eslint/eslint-recommended'?: true;
|
|
27
|
-
'shayanthenerd/typescript > typescript-eslint/strict-type-checked'?: true;
|
|
28
|
-
'shayanthenerd/typescript > typescript-eslint/base'?: true;
|
|
29
|
-
'shayanthenerd/typescript > typescript-eslint/eslint-recommended'?: true;
|
|
30
|
-
'shayanthenerd/typescript > typescript-eslint/stylistic-type-checked'?: true;
|
|
31
17
|
'shayanthenerd/typescript'?: true;
|
|
32
|
-
'shayanthenerd/html > ExtendedConfig[0]'?: true;
|
|
33
18
|
'shayanthenerd/html'?: true;
|
|
34
|
-
'shayanthenerd/css > ExtendedConfig[0]'?: true;
|
|
35
19
|
'shayanthenerd/css'?: true;
|
|
20
|
+
'shayanthenerd/imports'?: true;
|
|
21
|
+
'shayanthenerd/restricted-exports'?: true;
|
|
22
|
+
'shayanthenerd/stylistic'?: true;
|
|
23
|
+
'shayanthenerd/perfectionist'?: true;
|
|
36
24
|
'shayanthenerd/tailwind'?: true;
|
|
37
|
-
'shayanthenerd/vue >
|
|
38
|
-
'shayanthenerd/vue > vue/base/setup-for-vue'?: true;
|
|
39
|
-
'shayanthenerd/vue > vue/essential/rules'?: true;
|
|
40
|
-
'shayanthenerd/vue > vue/strongly-recommended/rules'?: true;
|
|
41
|
-
'shayanthenerd/vue > vue/recommended/rules'?: true;
|
|
42
|
-
'shayanthenerd/vue > vuejs-accessibility:setup:base'?: true;
|
|
43
|
-
'shayanthenerd/vue > vuejs-accessibility:setup:with-files-rules-and-parser'?: true;
|
|
25
|
+
'shayanthenerd/vue > setup'?: true;
|
|
44
26
|
'shayanthenerd/vue'?: true;
|
|
45
27
|
'shayanthenerd/vue/multi-word-component-names'?: true;
|
|
46
28
|
'shayanthenerd/vue/server-components'?: true;
|
|
47
|
-
'shayanthenerd/storybook > storybook:recommended:setup'?: true;
|
|
48
|
-
'shayanthenerd/storybook > storybook:recommended:stories-rules'?: true;
|
|
49
|
-
'shayanthenerd/storybook > storybook:recommended:main-rules'?: true;
|
|
50
29
|
'shayanthenerd/storybook'?: true;
|
|
51
|
-
'shayanthenerd/vitest > vitest/recommended'?: true;
|
|
52
30
|
'shayanthenerd/vitest'?: true;
|
|
53
|
-
'shayanthenerd/playwright > ExtendedConfig[0]'?: true;
|
|
54
|
-
'shayanthenerd/playwright'?: true;
|
|
55
|
-
'shayanthenerd/cypress > cypress/recommended'?: true;
|
|
56
31
|
'shayanthenerd/cypress'?: true;
|
|
32
|
+
'shayanthenerd/playwright'?: true;
|
|
57
33
|
'oxlint/from-oxlint-config'?: true;
|
|
58
|
-
'oxlint/vue-svelte-exceptions'?: true;
|
|
59
34
|
'oxlint/from-oxlint-config-override-0'?: true;
|
|
60
35
|
'shayanthenerd/oxlint/overrides'?: true;
|
|
61
36
|
}
|
|
@@ -1259,6 +1234,11 @@ interface ESLintSchema {
|
|
|
1259
1234
|
* @see https://typescript-eslint.io/rules/no-unused-expressions
|
|
1260
1235
|
*/
|
|
1261
1236
|
'@typescript-eslint/no-unused-expressions'?: Linter.RuleEntry<TypescriptEslintNoUnusedExpressions>;
|
|
1237
|
+
/**
|
|
1238
|
+
* Disallow unused private class members
|
|
1239
|
+
* @see https://typescript-eslint.io/rules/no-unused-private-class-members
|
|
1240
|
+
*/
|
|
1241
|
+
'@typescript-eslint/no-unused-private-class-members'?: Linter.RuleEntry<[]>;
|
|
1262
1242
|
/**
|
|
1263
1243
|
* Disallow unused variables
|
|
1264
1244
|
* @see https://typescript-eslint.io/rules/no-unused-vars
|
|
@@ -4221,6 +4201,11 @@ interface ESLintSchema {
|
|
|
4221
4201
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-vi-mocked.md
|
|
4222
4202
|
*/
|
|
4223
4203
|
'vitest/prefer-vi-mocked'?: Linter.RuleEntry<[]>;
|
|
4204
|
+
/**
|
|
4205
|
+
* ensure that every `expect.poll` call is awaited
|
|
4206
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-awaited-expect-poll.md
|
|
4207
|
+
*/
|
|
4208
|
+
'vitest/require-awaited-expect-poll'?: Linter.RuleEntry<[]>;
|
|
4224
4209
|
/**
|
|
4225
4210
|
* require setup and teardown to be within a hook
|
|
4226
4211
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
|
|
@@ -4726,6 +4711,11 @@ interface ESLintSchema {
|
|
|
4726
4711
|
* @see https://eslint.vuejs.org/rules/no-duplicate-attributes.html
|
|
4727
4712
|
*/
|
|
4728
4713
|
'vue/no-duplicate-attributes'?: Linter.RuleEntry<VueNoDuplicateAttributes>;
|
|
4714
|
+
/**
|
|
4715
|
+
* disallow duplication of class names in class attributes
|
|
4716
|
+
* @see https://eslint.vuejs.org/rules/no-duplicate-class-names.html
|
|
4717
|
+
*/
|
|
4718
|
+
'vue/no-duplicate-class-names'?: Linter.RuleEntry<[]>;
|
|
4729
4719
|
/**
|
|
4730
4720
|
* disallow the `<template>` `<script>` `<style>` block to be empty
|
|
4731
4721
|
* @see https://eslint.vuejs.org/rules/no-empty-component-block.html
|
|
@@ -5649,6 +5639,7 @@ type HtmlEslintIndent = [] | [("tab" | number)] | [("tab" | number), {
|
|
|
5649
5639
|
tagChildrenIndent?: {
|
|
5650
5640
|
[k: string]: number;
|
|
5651
5641
|
};
|
|
5642
|
+
ignoreComment?: boolean;
|
|
5652
5643
|
}];
|
|
5653
5644
|
// ----- @html-eslint/max-element-depth -----
|
|
5654
5645
|
type HtmlEslintMaxElementDepth = [] | [{
|
|
@@ -12398,7 +12389,7 @@ type VitestNoFocusedTests = [] | [{
|
|
|
12398
12389
|
}];
|
|
12399
12390
|
// ----- vitest/no-hooks -----
|
|
12400
12391
|
type VitestNoHooks = [] | [{
|
|
12401
|
-
allow?:
|
|
12392
|
+
allow?: ("beforeAll" | "beforeEach" | "afterAll" | "afterEach")[];
|
|
12402
12393
|
}];
|
|
12403
12394
|
// ----- vitest/no-large-snapshots -----
|
|
12404
12395
|
type VitestNoLargeSnapshots = [] | [{
|