@shayanthenerd/eslint-config 0.11.1 → 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 +43 -0
- package/dist/configs/{css.js → css.mjs} +6 -6
- package/dist/configs/{cypress.js → cypress.mjs} +6 -5
- package/dist/configs/{html.js → html.mjs} +7 -5
- package/dist/configs/importX.mjs +26 -0
- package/dist/configs/{oxlintOverrides.js → oxlintOverrides.mjs} +14 -14
- package/dist/configs/{perfectionist.js → perfectionist.mjs} +5 -5
- package/dist/configs/{playwright.js → playwright.mjs} +6 -5
- package/dist/configs/{restrictedExports.js → restrictedExports.mjs} +1 -1
- package/dist/configs/{storybook.js → storybook.mjs} +5 -6
- package/dist/configs/{stylistic.js → stylistic.mjs} +7 -7
- package/dist/configs/{tailwind.js → tailwind.mjs} +19 -16
- package/dist/configs/typescript.mjs +34 -0
- package/dist/configs/{vitest.js → vitest.mjs} +5 -5
- package/dist/configs/vue.mjs +45 -0
- package/dist/configs/{vueComponentNames.js → vueComponentNames.mjs} +1 -1
- package/dist/configs/{vueServerComponents.js → vueServerComponents.mjs} +1 -1
- package/dist/{index.d.ts → index.d.mts} +3 -3
- package/dist/index.mjs +75 -0
- package/dist/oxlint.config.jsonc +1 -0
- package/dist/rules/{css.js → css.mjs} +14 -5
- package/dist/rules/cypress.mjs +18 -0
- package/dist/rules/{html.js → html.mjs} +47 -25
- package/dist/rules/{importX.js → importX.mjs} +25 -23
- package/dist/rules/{javascript.js → javascript.mjs} +167 -115
- package/dist/rules/{perfectionist.js → perfectionist.mjs} +2 -2
- package/dist/rules/playwright.mjs +54 -0
- package/dist/rules/storybook.mjs +25 -0
- package/dist/rules/{stylistic.js → stylistic.mjs} +106 -57
- package/dist/rules/{tailwind.js → tailwind.mjs} +15 -14
- package/dist/rules/typescript.mjs +173 -0
- package/dist/rules/{vitest.js → vitest.mjs} +57 -28
- package/dist/rules/vue.mjs +361 -0
- package/dist/rules/{vueAccessibility.js → vueAccessibility.mjs} +23 -9
- package/dist/types/configOptions/{base.d.ts → base.d.mts} +2 -2
- package/dist/types/configOptions/{css.d.ts → css.d.mts} +2 -2
- package/dist/types/configOptions/{html.d.ts → html.d.mts} +2 -2
- package/dist/types/configOptions/{importX.d.ts → importX.d.mts} +1 -1
- package/dist/types/configOptions/{perfectionist.d.ts → perfectionist.d.mts} +2 -2
- package/dist/types/configOptions/{stylistic.d.ts → stylistic.d.mts} +2 -2
- package/dist/types/configOptions/{tailwind.d.ts → tailwind.d.mts} +2 -2
- package/dist/types/configOptions/{test.d.ts → test.d.mts} +2 -2
- package/dist/types/configOptions/{typescript.d.ts → typescript.d.mts} +2 -2
- package/dist/types/configOptions/{vue.d.ts → vue.d.mts} +3 -3
- package/dist/types/configOptions/{vueAccessibility.d.ts → vueAccessibility.d.mts} +1 -1
- package/dist/types/{eslint-schema.d.ts → eslint-schema.d.mts} +24 -33
- package/dist/types/{eslintRules.d.ts → eslintRules.d.mts} +2 -2
- package/dist/types/{index.d.ts → index.d.mts} +12 -12
- package/dist/utils/ignores/{getIgnorePatterns.js → getIgnorePatterns.mjs} +2 -2
- package/dist/utils/{isPackageDetected.js → isPackageDetected.mjs} +1 -1
- package/dist/utils/options/{enableDetectedConfigs.js → enableDetectedConfigs.mjs} +2 -2
- package/dist/utils/options/{mergeWithDefaults.js → mergeWithDefaults.mjs} +3 -3
- package/package.json +30 -31
- package/dist/configs/base.js +0 -44
- package/dist/configs/importX.js +0 -23
- package/dist/configs/typescript.js +0 -31
- package/dist/configs/vue.js +0 -33
- package/dist/index.js +0 -74
- package/dist/rules/cypress.js +0 -14
- package/dist/rules/playwright.js +0 -26
- package/dist/rules/storybook.js +0 -14
- package/dist/rules/typescript.js +0 -63
- package/dist/rules/vue.js +0 -186
- /package/dist/{prettier.config.d.ts → prettier.config.d.mts} +0 -0
- /package/dist/{prettier.config.js → prettier.config.mjs} +0 -0
- /package/dist/types/configOptions/{nuxt.d.ts → nuxt.d.mts} +0 -0
- /package/dist/types/{helpers.d.ts → helpers.d.mts} +0 -0
- /package/dist/utils/{globs.js → globs.mjs} +0 -0
- /package/dist/utils/ignores/{defaultIgnorePatterns.js → defaultIgnorePatterns.mjs} +0 -0
- /package/dist/utils/ignores/{resolveGitignorePatterns.js → resolveGitignorePatterns.mjs} +0 -0
- /package/dist/utils/{isEmptyString.js → isEmptyString.mjs} +0 -0
- /package/dist/utils/{isEnabled.js → isEnabled.mjs} +0 -0
- /package/dist/utils/options/{defaultOptions.js → defaultOptions.mjs} +0 -0
- /package/dist/utils/vue/{getRestrictedVueElements.js → getRestrictedVueElements.mjs} +0 -0
- /package/dist/utils/vue/{getRestrictedVueInputs.js → getRestrictedVueInputs.mjs} +0 -0
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
2
|
+
import { defaultOptions } from "../utils/options/defaultOptions.mjs";
|
|
3
|
+
import { getRestrictedVueInputs } from "../utils/vue/getRestrictedVueInputs.mjs";
|
|
4
|
+
import { getRestrictedVueElements } from "../utils/vue/getRestrictedVueElements.mjs";
|
|
5
|
+
|
|
6
|
+
//#region src/rules/vue.ts
|
|
7
|
+
function getVueRules(options) {
|
|
8
|
+
const { typescript, stylistic, tailwind, vue, nuxt } = options.configs;
|
|
9
|
+
const { indent, useTabs, trailingComma, maxLineLength, maxAttributesPerLine, maxConsecutiveEmptyLines, selfCloseVoidHTMLElements } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
|
|
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 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) : [];
|
|
19
|
+
const isScriptLangTS = blockLang.script === "ts";
|
|
20
|
+
const isStyleLangImplicit = blockLang.style === "implicit";
|
|
21
|
+
return {
|
|
22
|
+
"no-undef": "off",
|
|
23
|
+
"no-useless-assignment": "off",
|
|
24
|
+
"import-x/default": "off",
|
|
25
|
+
"import-x/no-unresolved": "off",
|
|
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",
|
|
30
|
+
"vue/no-async-in-computed-properties": ["error", { ignoredObjectNames: ["z"] }],
|
|
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",
|
|
115
|
+
"vue/html-closing-bracket-newline": "warn",
|
|
116
|
+
"vue/html-closing-bracket-spacing": "warn",
|
|
117
|
+
"vue/html-end-tags": "warn",
|
|
118
|
+
"vue/html-indent": ["warn", useTabs ? "tab" : indent],
|
|
119
|
+
"vue/html-quotes": "warn",
|
|
120
|
+
"vue/html-self-closing": ["error", { html: {
|
|
121
|
+
normal: "never",
|
|
122
|
+
void: selfCloseVoidHTMLElements
|
|
123
|
+
} }],
|
|
124
|
+
"vue/max-attributes-per-line": ["warn", { singleline: { max: maxAttributesPerLine } }],
|
|
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",
|
|
131
|
+
"vue/prop-name-casing": "warn",
|
|
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 }],
|
|
145
|
+
"vue/block-order": ["warn", { order: blocksOrder }],
|
|
146
|
+
"vue/no-lone-template": "error",
|
|
147
|
+
"vue/no-multiple-slot-args": "error",
|
|
148
|
+
"vue/no-required-prop-with-default": ["error", { autofix: true }],
|
|
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",
|
|
174
|
+
"vue/max-len": [tailwind ? "off" : "warn", {
|
|
175
|
+
tabWidth: indent,
|
|
176
|
+
code: maxLineLength,
|
|
177
|
+
template: Infinity,
|
|
178
|
+
ignoreUrls: true,
|
|
179
|
+
ignoreStrings: true,
|
|
180
|
+
ignoreComments: true,
|
|
181
|
+
ignoreRegExpLiterals: true,
|
|
182
|
+
ignoreTrailingComments: true,
|
|
183
|
+
ignoreTemplateLiterals: true,
|
|
184
|
+
ignoreHTMLTextContents: true,
|
|
185
|
+
ignoreHTMLAttributeValues: true
|
|
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",
|
|
232
|
+
"vue/block-lang": ["error", {
|
|
233
|
+
script: { lang: blockLang.script },
|
|
234
|
+
style: {
|
|
235
|
+
lang: isStyleLangImplicit ? void 0 : blockLang.style,
|
|
236
|
+
allowNoLang: isStyleLangImplicit
|
|
237
|
+
}
|
|
238
|
+
}],
|
|
239
|
+
"vue/block-tag-newline": ["warn", {
|
|
240
|
+
singleline: "always",
|
|
241
|
+
maxEmptyLines: maxConsecutiveEmptyLines ? maxConsecutiveEmptyLines - 1 : 0
|
|
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",
|
|
286
|
+
"vue/no-restricted-html-elements": [
|
|
287
|
+
"error",
|
|
288
|
+
{
|
|
289
|
+
element: isNuxtEnabled ? "time" : "",
|
|
290
|
+
message: "Use `<NuxtTime>`."
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
element: isNuxtImageEnabled ? "img" : "",
|
|
294
|
+
message: "Use `<NuxtImg>`."
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
element: isNuxtUIEnabled ? [
|
|
298
|
+
"a",
|
|
299
|
+
"RouterLink",
|
|
300
|
+
"NuxtLink"
|
|
301
|
+
] : "",
|
|
302
|
+
message: isNuxtUIEnabled ? `Use \`<${nuxtUIPrefix}Link>\`.` : void 0
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
element: ["a", isNuxtEnabled ? "RouterLink" : ""],
|
|
306
|
+
message: `Use \`<${isNuxtEnabled ? "NuxtLink" : "RouterLink"}>\`.`
|
|
307
|
+
},
|
|
308
|
+
...restrictedVueElements,
|
|
309
|
+
...userRestrictedElements
|
|
310
|
+
],
|
|
311
|
+
"vue/no-restricted-static-attribute": [
|
|
312
|
+
"error",
|
|
313
|
+
...restrictedVueInputs,
|
|
314
|
+
isNuxtUIEnabled ? {
|
|
315
|
+
key: "href",
|
|
316
|
+
element: `${nuxtUIPrefix}Link`,
|
|
317
|
+
message: "Use `v-bind:to=\"\"`."
|
|
318
|
+
} : { key: "" },
|
|
319
|
+
isNuxtUIEnabled ? {
|
|
320
|
+
key: "href",
|
|
321
|
+
element: `${nuxtUIPrefix}Button`,
|
|
322
|
+
message: "Use `v-bind:to=\"\"`."
|
|
323
|
+
} : { key: " " },
|
|
324
|
+
...userRestrictedStaticAttributes
|
|
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",
|
|
330
|
+
"vue/no-undef-components": ["error", { ignorePatterns: [
|
|
331
|
+
isNuxtEnabled && "^Nuxt",
|
|
332
|
+
isNuxtEnabled && "^(Html|Head|Title|Base|Meta|Link|Style|Body|NoScript|ClientOnly|DevOnly)$",
|
|
333
|
+
isNuxtIconEnabled && `^${nuxtIconComponent}$`,
|
|
334
|
+
isNuxtUIEnabled && `^${nuxtUIPrefix}`,
|
|
335
|
+
...userIgnoredUndefinedComponents
|
|
336
|
+
].filter(Boolean) }],
|
|
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]
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
//#endregion
|
|
361
|
+
export { getVueRules };
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { isEnabled } from "../utils/isEnabled.
|
|
2
|
-
import { defaultOptions } from "../utils/options/defaultOptions.
|
|
1
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
2
|
+
import { defaultOptions } from "../utils/options/defaultOptions.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/rules/vueAccessibility.ts
|
|
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
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RuleOptions } from "../eslintRules.
|
|
2
|
-
import { ConfigWithOverrides } from "../index.
|
|
1
|
+
import { RuleOptions } from "../eslintRules.mjs";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/types/configOptions/base.d.ts
|
|
5
5
|
type MaxDepthOptions = RuleOptions<'max-depth'>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RuleOptions } from "../eslintRules.
|
|
2
|
-
import { ConfigWithOverrides } from "../index.
|
|
1
|
+
import { RuleOptions } from "../eslintRules.mjs";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/types/configOptions/css.d.ts
|
|
5
5
|
interface CSSOptions extends ConfigWithOverrides {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RuleOptions } from "../eslintRules.
|
|
2
|
-
import { ConfigWithOverrides } from "../index.
|
|
1
|
+
import { RuleOptions } from "../eslintRules.mjs";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/types/configOptions/html.d.ts
|
|
5
5
|
interface HTMLOptions extends ConfigWithOverrides {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RuleOptions } from "../eslintRules.
|
|
2
|
-
import { ConfigWithOverrides } from "../index.
|
|
1
|
+
import { RuleOptions } from "../eslintRules.mjs";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/types/configOptions/perfectionist.d.ts
|
|
5
5
|
interface PerfectionistOptions extends ConfigWithOverrides {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RuleOptions } from "../eslintRules.
|
|
2
|
-
import { ConfigWithOverrides } from "../index.
|
|
1
|
+
import { RuleOptions } from "../eslintRules.mjs";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/types/configOptions/stylistic.d.ts
|
|
5
5
|
interface StylisticOptions extends ConfigWithOverrides {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RuleOptions } from "../eslintRules.
|
|
2
|
-
import { ConfigWithOverrides } from "../index.
|
|
1
|
+
import { RuleOptions } from "../eslintRules.mjs";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/types/configOptions/tailwind.d.ts
|
|
5
5
|
interface BaseTailwindOptions extends ConfigWithOverrides {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RuleOptions } from "../eslintRules.
|
|
2
|
-
import { ConfigWithOverrides } from "../index.
|
|
1
|
+
import { RuleOptions } from "../eslintRules.mjs";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/types/configOptions/test.d.ts
|
|
5
5
|
interface TestOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RuleOptions } from "../eslintRules.
|
|
2
|
-
import { ConfigWithOverrides } from "../index.
|
|
1
|
+
import { RuleOptions } from "../eslintRules.mjs";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/types/configOptions/typescript.d.ts
|
|
5
5
|
interface TypeScriptOptions extends ConfigWithOverrides {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RuleOptions } from "../eslintRules.
|
|
2
|
-
import { VueAccessibilityOptions } from "./vueAccessibility.
|
|
3
|
-
import { ConfigWithOverrides } from "../index.
|
|
1
|
+
import { RuleOptions } from "../eslintRules.mjs";
|
|
2
|
+
import { VueAccessibilityOptions } from "./vueAccessibility.mjs";
|
|
3
|
+
import { ConfigWithOverrides } from "../index.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/types/configOptions/vue.d.ts
|
|
6
6
|
interface BlockLang {
|
|
@@ -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 = [] | [{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DeepNonNullable, Tail } from "./helpers.
|
|
2
|
-
import { ESLintSchema } from "./eslint-schema.
|
|
1
|
+
import { DeepNonNullable, Tail } from "./helpers.mjs";
|
|
2
|
+
import { ESLintSchema } from "./eslint-schema.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/types/eslintRules.d.ts
|
|
5
5
|
/*** CoreRules & PluginRules ***/
|