@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
package/dist/rules/vue.js
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import { isEnabled } from "../utils/isEnabled.js";
|
|
2
|
-
import { defaultOptions } from "../utils/options/defaultOptions.js";
|
|
3
|
-
import { getRestrictedVueInputs } from "../utils/vue/getRestrictedVueInputs.js";
|
|
4
|
-
import { getRestrictedVueElements } from "../utils/vue/getRestrictedVueElements.js";
|
|
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 nuxtImage = isEnabled(nuxt) ? nuxt.image : void 0;
|
|
12
|
-
const nuxtUI = isEnabled(nuxt) ? nuxt.ui : void 0;
|
|
13
|
-
const nuxtUIPrefix = isEnabled(nuxt) && isEnabled(nuxt.ui) ? nuxt.ui.prefix : defaultOptions.configs.nuxt.ui.prefix;
|
|
14
|
-
const nuxtIcon = isEnabled(nuxt) ? nuxt.icon : void 0;
|
|
15
|
-
const nuxtIconComponent = isEnabled(nuxt) && isEnabled(nuxt.icon) ? nuxt.icon.component : defaultOptions.configs.nuxt.icon.component;
|
|
16
|
-
const isScriptLangTS = blockLang.script === "ts";
|
|
17
|
-
const isStyleLangImplicit = blockLang.style === "implicit";
|
|
18
|
-
return {
|
|
19
|
-
"no-undef": "off",
|
|
20
|
-
"no-useless-assignment": "off",
|
|
21
|
-
"import-x/default": "off",
|
|
22
|
-
"import-x/no-unresolved": "off",
|
|
23
|
-
"vue/no-multiple-template-root": "off",
|
|
24
|
-
"vue/comment-directive": ["error", { reportUnusedDisableDirectives: true }],
|
|
25
|
-
"vue/no-async-in-computed-properties": ["error", { ignoredObjectNames: ["z"] }],
|
|
26
|
-
"vue/require-default-prop": "off",
|
|
27
|
-
"vue/html-closing-bracket-newline": "warn",
|
|
28
|
-
"vue/singleline-html-element-content-newline": "off",
|
|
29
|
-
"vue/html-indent": ["warn", useTabs ? "tab" : indent],
|
|
30
|
-
"vue/v-slot-style": ["warn", { atComponent: "shorthand" }],
|
|
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
|
-
],
|
|
42
|
-
"vue/html-self-closing": ["error", { html: {
|
|
43
|
-
normal: "never",
|
|
44
|
-
void: selfCloseVoidHTMLElements
|
|
45
|
-
} }],
|
|
46
|
-
"vue/max-attributes-per-line": ["warn", { singleline: { max: maxAttributesPerLine } }],
|
|
47
|
-
"vue/attributes-order": ["warn", { order: attributesOrder }],
|
|
48
|
-
"vue/camelcase": "warn",
|
|
49
|
-
"vue/no-root-v-if": "warn",
|
|
50
|
-
"vue/require-expose": "error",
|
|
51
|
-
"vue/no-unused-refs": "error",
|
|
52
|
-
"vue/prop-name-casing": "warn",
|
|
53
|
-
"vue/slot-name-casing": "warn",
|
|
54
|
-
"vue/no-useless-v-bind": "error",
|
|
55
|
-
"vue/component-api-style": "error",
|
|
56
|
-
"vue/html-button-has-type": "error",
|
|
57
|
-
"vue/valid-define-options": "error",
|
|
58
|
-
"vue/prefer-define-options": "warn",
|
|
59
|
-
"vue/require-emit-validator": "error",
|
|
60
|
-
"vue/require-default-export": "error",
|
|
61
|
-
"vue/custom-event-name-casing": "warn",
|
|
62
|
-
"vue/no-use-v-else-with-v-for": "error",
|
|
63
|
-
"vue/no-empty-component-block": "error",
|
|
64
|
-
"vue/no-negated-v-if-condition": "warn",
|
|
65
|
-
"vue/no-import-compiler-macros": "error",
|
|
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",
|
|
81
|
-
"vue/block-order": ["warn", { order: blocksOrder }],
|
|
82
|
-
"vue/v-for-delimiter-style": ["warn", vForDelimiterStyle],
|
|
83
|
-
"vue/require-typed-ref": isScriptLangTS ? "error" : "off",
|
|
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 }],
|
|
87
|
-
"vue/no-required-prop-with-default": ["error", { autofix: true }],
|
|
88
|
-
"vue/prefer-true-attribute-shorthand": ["warn", preferVBindTrueShorthand],
|
|
89
|
-
"vue/no-deprecated-model-definition": ["error", { allowVue3Compat: true }],
|
|
90
|
-
"vue/enforce-style-attribute": ["error", { allow: allowedStyleAttributes }],
|
|
91
|
-
"vue/define-props-destructuring": ["warn", { destructure: destructureProps }],
|
|
92
|
-
"vue/define-emits-declaration": ["warn", isScriptLangTS ? "type-based" : "runtime"],
|
|
93
|
-
"vue/define-props-declaration": ["error", isScriptLangTS ? "type-based" : "runtime"],
|
|
94
|
-
"vue/max-len": [tailwind ? "off" : "warn", {
|
|
95
|
-
tabWidth: indent,
|
|
96
|
-
code: maxLineLength,
|
|
97
|
-
template: Infinity,
|
|
98
|
-
ignoreUrls: true,
|
|
99
|
-
ignoreStrings: true,
|
|
100
|
-
ignoreComments: true,
|
|
101
|
-
ignoreRegExpLiterals: true,
|
|
102
|
-
ignoreTrailingComments: true,
|
|
103
|
-
ignoreTemplateLiterals: true,
|
|
104
|
-
ignoreHTMLTextContents: true,
|
|
105
|
-
ignoreHTMLAttributeValues: true
|
|
106
|
-
}],
|
|
107
|
-
"vue/block-lang": ["error", {
|
|
108
|
-
script: { lang: blockLang.script },
|
|
109
|
-
style: {
|
|
110
|
-
lang: isStyleLangImplicit ? void 0 : blockLang.style,
|
|
111
|
-
allowNoLang: isStyleLangImplicit
|
|
112
|
-
}
|
|
113
|
-
}],
|
|
114
|
-
"vue/block-tag-newline": ["warn", {
|
|
115
|
-
singleline: "always",
|
|
116
|
-
maxEmptyLines: maxConsecutiveEmptyLines ? maxConsecutiveEmptyLines - 1 : 0
|
|
117
|
-
}],
|
|
118
|
-
"vue/no-restricted-html-elements": [
|
|
119
|
-
"error",
|
|
120
|
-
{
|
|
121
|
-
element: nuxt ? "time" : "",
|
|
122
|
-
message: "Use `<NuxtTime>`."
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
element: nuxtImage ? "img" : "",
|
|
126
|
-
message: "Use `<NuxtImg>`."
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
element: nuxtUI ? [
|
|
130
|
-
"a",
|
|
131
|
-
"RouterLink",
|
|
132
|
-
"NuxtLink"
|
|
133
|
-
] : "",
|
|
134
|
-
message: nuxtUI ? `Use \`<${nuxtUIPrefix}Link>\`.` : void 0
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
element: ["a", nuxt ? "RouterLink" : ""],
|
|
138
|
-
message: `Use \`<${nuxt ? "NuxtLink" : "RouterLink"}>\`.`
|
|
139
|
-
},
|
|
140
|
-
...nuxtUI ? getRestrictedVueElements(nuxtUIPrefix) : [],
|
|
141
|
-
...userRestrictedElements
|
|
142
|
-
],
|
|
143
|
-
"vue/no-restricted-static-attribute": [
|
|
144
|
-
"error",
|
|
145
|
-
...nuxtUI ? getRestrictedVueInputs(nuxtUIPrefix) : [],
|
|
146
|
-
nuxtUI ? {
|
|
147
|
-
key: "href",
|
|
148
|
-
element: `${nuxtUIPrefix}Link`,
|
|
149
|
-
message: "Use `v-bind:to=\"\"`."
|
|
150
|
-
} : { key: "" },
|
|
151
|
-
nuxtUI ? {
|
|
152
|
-
key: "href",
|
|
153
|
-
element: `${nuxtUIPrefix}Button`,
|
|
154
|
-
message: "Use `v-bind:to=\"\"`."
|
|
155
|
-
} : { key: " " },
|
|
156
|
-
...userRestrictedStaticAttributes
|
|
157
|
-
],
|
|
158
|
-
"vue/no-undef-components": ["error", { ignorePatterns: [
|
|
159
|
-
nuxt ? "^Nuxt" : void 0,
|
|
160
|
-
nuxt ? "^(Html|Head|Title|Base|Meta|Link|Style|Body|NoScript|ClientOnly|DevOnly)$" : void 0,
|
|
161
|
-
nuxtIcon ? `^${nuxtIconComponent}$` : void 0,
|
|
162
|
-
nuxtUI ? `^${nuxtUIPrefix}` : void 0,
|
|
163
|
-
...userIgnoredUndefinedComponents
|
|
164
|
-
].filter(Boolean) }],
|
|
165
|
-
"vue/match-component-file-name": ["error", {
|
|
166
|
-
shouldMatchCase: true,
|
|
167
|
-
extensions: [
|
|
168
|
-
"vue",
|
|
169
|
-
"js",
|
|
170
|
-
"jsx",
|
|
171
|
-
...typescript ? ["ts", "tsx"] : []
|
|
172
|
-
]
|
|
173
|
-
}],
|
|
174
|
-
"vue/component-name-in-template-casing": [
|
|
175
|
-
"warn",
|
|
176
|
-
componentNameCaseInTemplate,
|
|
177
|
-
{
|
|
178
|
-
ignores: ["/^\\w+(\\.\\w+)+$/"],
|
|
179
|
-
registeredComponentsOnly: false
|
|
180
|
-
}
|
|
181
|
-
]
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
//#endregion
|
|
186
|
-
export { getVueRules };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|