@shayanthenerd/eslint-config 0.1.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/LICENSE +21 -0
- package/README.md +496 -0
- package/dist/_virtual/rolldown_runtime.cjs +30 -0
- package/dist/configs/base.cjs +44 -0
- package/dist/configs/base.js +43 -0
- package/dist/configs/commons.cjs +26 -0
- package/dist/configs/commons.js +25 -0
- package/dist/configs/css.cjs +29 -0
- package/dist/configs/css.js +28 -0
- package/dist/configs/cypress.cjs +23 -0
- package/dist/configs/cypress.js +22 -0
- package/dist/configs/html.cjs +23 -0
- package/dist/configs/html.js +22 -0
- package/dist/configs/importX.cjs +26 -0
- package/dist/configs/importX.js +25 -0
- package/dist/configs/nuxtMultiRootTemplate.cjs +14 -0
- package/dist/configs/nuxtMultiRootTemplate.js +14 -0
- package/dist/configs/oxlintOverrides.cjs +49 -0
- package/dist/configs/oxlintOverrides.js +48 -0
- package/dist/configs/perfectionist.cjs +24 -0
- package/dist/configs/perfectionist.js +23 -0
- package/dist/configs/playwright.cjs +23 -0
- package/dist/configs/playwright.js +22 -0
- package/dist/configs/storybook.cjs +24 -0
- package/dist/configs/storybook.js +23 -0
- package/dist/configs/stylistic.cjs +23 -0
- package/dist/configs/stylistic.js +22 -0
- package/dist/configs/tailwind.cjs +43 -0
- package/dist/configs/tailwind.js +42 -0
- package/dist/configs/typescript.cjs +31 -0
- package/dist/configs/typescript.js +30 -0
- package/dist/configs/vitest.cjs +23 -0
- package/dist/configs/vitest.js +22 -0
- package/dist/configs/vue.cjs +35 -0
- package/dist/configs/vue.js +34 -0
- package/dist/configs/vueComponentNames.cjs +19 -0
- package/dist/configs/vueComponentNames.js +19 -0
- package/dist/index.cjs +55 -0
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +54 -0
- package/dist/oxlint.config.jsonc +192 -0
- package/dist/prettier.config.js +42 -0
- package/dist/rules/css.cjs +65 -0
- package/dist/rules/css.js +65 -0
- package/dist/rules/cypress.cjs +16 -0
- package/dist/rules/cypress.js +15 -0
- package/dist/rules/html.cjs +53 -0
- package/dist/rules/html.js +53 -0
- package/dist/rules/importX.cjs +51 -0
- package/dist/rules/importX.js +50 -0
- package/dist/rules/javascript.cjs +164 -0
- package/dist/rules/javascript.js +163 -0
- package/dist/rules/perfectionist.cjs +73 -0
- package/dist/rules/perfectionist.js +73 -0
- package/dist/rules/playwright.cjs +28 -0
- package/dist/rules/playwright.js +27 -0
- package/dist/rules/storybook.cjs +16 -0
- package/dist/rules/storybook.js +15 -0
- package/dist/rules/stylistic.cjs +160 -0
- package/dist/rules/stylistic.js +160 -0
- package/dist/rules/tailwind.cjs +36 -0
- package/dist/rules/tailwind.js +36 -0
- package/dist/rules/typescript.cjs +62 -0
- package/dist/rules/typescript.js +62 -0
- package/dist/rules/vitest.cjs +47 -0
- package/dist/rules/vitest.js +46 -0
- package/dist/rules/vue.cjs +169 -0
- package/dist/rules/vue.js +169 -0
- package/dist/rules/vueAccessibility.cjs +23 -0
- package/dist/rules/vueAccessibility.js +23 -0
- package/dist/types/configOptions/base.d.cts +47 -0
- package/dist/types/configOptions/base.d.ts +47 -0
- package/dist/types/configOptions/css.d.cts +27 -0
- package/dist/types/configOptions/css.d.ts +27 -0
- package/dist/types/configOptions/html.d.cts +27 -0
- package/dist/types/configOptions/html.d.ts +27 -0
- package/dist/types/configOptions/importX.d.cts +20 -0
- package/dist/types/configOptions/importX.d.ts +20 -0
- package/dist/types/configOptions/nuxt.d.cts +42 -0
- package/dist/types/configOptions/nuxt.d.ts +42 -0
- package/dist/types/configOptions/perfectionist.d.cts +16 -0
- package/dist/types/configOptions/perfectionist.d.ts +16 -0
- package/dist/types/configOptions/stylistic.d.cts +145 -0
- package/dist/types/configOptions/stylistic.d.ts +145 -0
- package/dist/types/configOptions/tailwind.d.cts +46 -0
- package/dist/types/configOptions/tailwind.d.ts +46 -0
- package/dist/types/configOptions/test.d.cts +55 -0
- package/dist/types/configOptions/test.d.ts +55 -0
- package/dist/types/configOptions/typescript.d.cts +36 -0
- package/dist/types/configOptions/typescript.d.ts +36 -0
- package/dist/types/configOptions/vue.d.cts +211 -0
- package/dist/types/configOptions/vue.d.ts +211 -0
- package/dist/types/configOptions/vueAccessibility.d.cts +34 -0
- package/dist/types/configOptions/vueAccessibility.d.ts +34 -0
- package/dist/types/eslint-schema.d.cts +13258 -0
- package/dist/types/eslint-schema.d.ts +13258 -0
- package/dist/types/eslintRules.d.cts +12 -0
- package/dist/types/eslintRules.d.ts +12 -0
- package/dist/types/helpers.d.cts +5 -0
- package/dist/types/helpers.d.ts +5 -0
- package/dist/types/index.d.cts +360 -0
- package/dist/types/index.d.ts +360 -0
- package/dist/utils/globs.cjs +31 -0
- package/dist/utils/globs.js +30 -0
- package/dist/utils/ignores/defaultIgnorePatterns.cjs +58 -0
- package/dist/utils/ignores/defaultIgnorePatterns.js +57 -0
- package/dist/utils/ignores/getIgnorePatterns.cjs +16 -0
- package/dist/utils/ignores/getIgnorePatterns.js +16 -0
- package/dist/utils/ignores/resolveGitignorePatterns.cjs +27 -0
- package/dist/utils/ignores/resolveGitignorePatterns.js +26 -0
- package/dist/utils/isEmptyString.cjs +8 -0
- package/dist/utils/isEmptyString.js +7 -0
- package/dist/utils/isEnabled.cjs +8 -0
- package/dist/utils/isEnabled.js +7 -0
- package/dist/utils/isPackageDetected.cjs +22 -0
- package/dist/utils/isPackageDetected.js +20 -0
- package/dist/utils/options/defaultOptions.cjs +168 -0
- package/dist/utils/options/defaultOptions.js +167 -0
- package/dist/utils/options/enableDetectedConfigs.cjs +36 -0
- package/dist/utils/options/enableDetectedConfigs.js +36 -0
- package/dist/utils/options/mergeWithDefaults.cjs +22 -0
- package/dist/utils/options/mergeWithDefaults.js +21 -0
- package/dist/utils/vue/getRestrictedVueElements.cjs +28 -0
- package/dist/utils/vue/getRestrictedVueElements.js +27 -0
- package/dist/utils/vue/getRestrictedVueInputs.cjs +24 -0
- package/dist/utils/vue/getRestrictedVueInputs.js +23 -0
- package/package.json +130 -0
|
@@ -0,0 +1,169 @@
|
|
|
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, 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, vOnHandlerStyle, 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 : void 0;
|
|
14
|
+
const isScriptLangTS = blockLang.script === "ts";
|
|
15
|
+
const vueRules = {
|
|
16
|
+
"no-undef": "off",
|
|
17
|
+
"no-useless-assignment": "off",
|
|
18
|
+
"vue/comment-directive": ["error", { reportUnusedDisableDirectives: true }],
|
|
19
|
+
"vue/html-closing-bracket-newline": "warn",
|
|
20
|
+
"vue/singleline-html-element-content-newline": "off",
|
|
21
|
+
"vue/html-indent": ["warn", useTabs ? "tab" : indent],
|
|
22
|
+
"vue/v-slot-style": ["warn", { atComponent: "shorthand" }],
|
|
23
|
+
"vue/attribute-hyphenation": ["warn", attributeHyphenation],
|
|
24
|
+
"vue/first-attribute-linebreak": ["warn", { singleline: "beside" }],
|
|
25
|
+
"vue/v-on-event-hyphenation": [
|
|
26
|
+
"warn",
|
|
27
|
+
attributeHyphenation,
|
|
28
|
+
{ autofix: true }
|
|
29
|
+
],
|
|
30
|
+
"vue/v-bind-style": [
|
|
31
|
+
"warn",
|
|
32
|
+
"shorthand",
|
|
33
|
+
{ sameNameShorthand: preferVBindSameNameShorthand }
|
|
34
|
+
],
|
|
35
|
+
"vue/html-self-closing": ["error", { html: {
|
|
36
|
+
normal: "never",
|
|
37
|
+
void: selfCloseVoidHTMLElements
|
|
38
|
+
} }],
|
|
39
|
+
"vue/max-attributes-per-line": ["warn", { singleline: { max: maxAttributesPerLine } }],
|
|
40
|
+
"vue/attributes-order": ["warn", { order: attributesOrder }],
|
|
41
|
+
"vue/camelcase": "warn",
|
|
42
|
+
"vue/no-root-v-if": "warn",
|
|
43
|
+
"vue/require-expose": "error",
|
|
44
|
+
"vue/no-unused-refs": "error",
|
|
45
|
+
"vue/prop-name-casing": "warn",
|
|
46
|
+
"vue/slot-name-casing": "warn",
|
|
47
|
+
"vue/no-useless-v-bind": "error",
|
|
48
|
+
"vue/component-api-style": "error",
|
|
49
|
+
"vue/html-button-has-type": "error",
|
|
50
|
+
"vue/valid-define-options": "error",
|
|
51
|
+
"vue/prefer-define-options": "warn",
|
|
52
|
+
"vue/require-emit-validator": "error",
|
|
53
|
+
"vue/require-default-export": "error",
|
|
54
|
+
"vue/custom-event-name-casing": "warn",
|
|
55
|
+
"vue/no-use-v-else-with-v-for": "error",
|
|
56
|
+
"vue/no-empty-component-block": "error",
|
|
57
|
+
"vue/no-import-compiler-macros": "error",
|
|
58
|
+
"vue/require-typed-object-prop": "error",
|
|
59
|
+
"vue/require-macro-variable-name": "warn",
|
|
60
|
+
"vue/padding-line-between-blocks": "warn",
|
|
61
|
+
"vue/match-component-import-name": "error",
|
|
62
|
+
"vue/html-comment-content-newline": "warn",
|
|
63
|
+
"vue/no-multiple-objects-in-class": "warn",
|
|
64
|
+
"vue/prefer-separate-static-class": "warn",
|
|
65
|
+
"vue/html-comment-content-spacing": "warn",
|
|
66
|
+
"vue/comma-dangle": ["warn", trailingComma],
|
|
67
|
+
"vue/component-options-name-casing": "warn",
|
|
68
|
+
"vue/no-ref-object-reactivity-loss": "error",
|
|
69
|
+
"vue/no-duplicate-attr-inheritance": "error",
|
|
70
|
+
"vue/no-this-in-before-route-enter": "error",
|
|
71
|
+
"vue/prefer-prop-type-boolean-first": "warn",
|
|
72
|
+
"vue/no-setup-props-reactivity-loss": "error",
|
|
73
|
+
"vue/block-order": ["warn", { order: blocksOrder }],
|
|
74
|
+
"vue/v-on-handler-style": ["error", vOnHandlerStyle],
|
|
75
|
+
"vue/v-for-delimiter-style": ["warn", vForDelimiterStyle],
|
|
76
|
+
"vue/require-typed-ref": isScriptLangTS ? "error" : "off",
|
|
77
|
+
"vue/define-macros-order": ["warn", { order: macrosOrder }],
|
|
78
|
+
"vue/html-comment-indent": ["warn", useTabs ? "tab" : indent],
|
|
79
|
+
"vue/no-static-inline-styles": ["warn", { allowBinding: true }],
|
|
80
|
+
"vue/no-required-prop-with-default": ["error", { autofix: true }],
|
|
81
|
+
"vue/prefer-true-attribute-shorthand": ["warn", preferVBindTrueShorthand],
|
|
82
|
+
"vue/no-deprecated-model-definition": ["error", { allowVue3Compat: true }],
|
|
83
|
+
"vue/enforce-style-attribute": ["error", { allow: allowedStyleAttributes }],
|
|
84
|
+
"vue/define-props-destructuring": ["warn", { destructure: destructureProps }],
|
|
85
|
+
"vue/define-emits-declaration": ["warn", isScriptLangTS ? "type-based" : "runtime"],
|
|
86
|
+
"vue/define-props-declaration": ["error", isScriptLangTS ? "type-based" : "runtime"],
|
|
87
|
+
"vue/max-len": ["warn", {
|
|
88
|
+
tabWidth: indent,
|
|
89
|
+
code: maxLineLength,
|
|
90
|
+
template: Infinity,
|
|
91
|
+
ignoreUrls: true,
|
|
92
|
+
ignoreStrings: true,
|
|
93
|
+
ignoreComments: true,
|
|
94
|
+
ignoreRegExpLiterals: true,
|
|
95
|
+
ignoreTrailingComments: true,
|
|
96
|
+
ignoreTemplateLiterals: true,
|
|
97
|
+
ignoreHTMLTextContents: true,
|
|
98
|
+
ignoreHTMLAttributeValues: true
|
|
99
|
+
}],
|
|
100
|
+
"vue/block-lang": ["error", {
|
|
101
|
+
script: { lang: blockLang.script },
|
|
102
|
+
style: {
|
|
103
|
+
lang: blockLang.style,
|
|
104
|
+
allowNoLang: blockLang.style === "implicit"
|
|
105
|
+
}
|
|
106
|
+
}],
|
|
107
|
+
"vue/block-tag-newline": ["warn", {
|
|
108
|
+
singleline: "always",
|
|
109
|
+
maxEmptyLines: maxConsecutiveEmptyLines ? maxConsecutiveEmptyLines - 1 : 0
|
|
110
|
+
}],
|
|
111
|
+
"vue/no-restricted-html-elements": [
|
|
112
|
+
"error",
|
|
113
|
+
{
|
|
114
|
+
element: nuxt ? "time" : "",
|
|
115
|
+
message: "Use `<NuxtTime>`."
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
element: nuxtImage ? "img" : "",
|
|
119
|
+
message: "Use `<NuxtImg>`."
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
element: nuxtImage ? "picture" : "",
|
|
123
|
+
message: "Use `<NuxtPicture>`."
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
element: nuxtUI ? [
|
|
127
|
+
"a",
|
|
128
|
+
"RouterLink",
|
|
129
|
+
"NuxtLink"
|
|
130
|
+
] : "",
|
|
131
|
+
message: nuxtUI && nuxtUIPrefix ? `Use <${nuxtUIPrefix}Link>.` : void 0
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
element: ["a", nuxt ? "RouterLink" : ""],
|
|
135
|
+
message: `Use <${nuxt ? "NuxtLink" : "RouterLink"}>.`
|
|
136
|
+
},
|
|
137
|
+
...nuxtUI && nuxtUIPrefix ? getRestrictedVueElements(nuxtUIPrefix) : [],
|
|
138
|
+
...userRestrictedElements
|
|
139
|
+
],
|
|
140
|
+
"vue/no-restricted-static-attribute": [
|
|
141
|
+
"error",
|
|
142
|
+
...nuxtUI && nuxtUIPrefix ? getRestrictedVueInputs(nuxtUIPrefix) : [],
|
|
143
|
+
...userRestrictedStaticAttributes
|
|
144
|
+
],
|
|
145
|
+
"vue/no-undef-components": ["error", { ignorePatterns: [
|
|
146
|
+
"^(Nuxt|U)",
|
|
147
|
+
"^(Icon|Html|Head|Title|Base|Meta|Link|Style|Body|NoScript)$",
|
|
148
|
+
...userIgnoredUndefinedComponents
|
|
149
|
+
] }],
|
|
150
|
+
"vue/match-component-file-name": ["error", {
|
|
151
|
+
shouldMatchCase: true,
|
|
152
|
+
extensions: [
|
|
153
|
+
"vue",
|
|
154
|
+
"js",
|
|
155
|
+
"jsx",
|
|
156
|
+
...typescript ? ["ts", "tsx"] : []
|
|
157
|
+
]
|
|
158
|
+
}],
|
|
159
|
+
"vue/component-name-in-template-casing": [
|
|
160
|
+
"warn",
|
|
161
|
+
componentNameCaseInTemplate,
|
|
162
|
+
{ registeredComponentsOnly: false }
|
|
163
|
+
]
|
|
164
|
+
};
|
|
165
|
+
return vueRules;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
//#endregion
|
|
169
|
+
export { getVueRules };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled = require('../utils/isEnabled.cjs');
|
|
2
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('../utils/options/defaultOptions.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/rules/vueAccessibility.ts
|
|
5
|
+
function getVueAccessibilityRules(options) {
|
|
6
|
+
const { vue } = options.configs;
|
|
7
|
+
const { imageComponents: userImageComponents, anchorComponents: userAnchorComponents, accessibleChildComponents: userAccessibleChildComponents } = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(vue) && require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(vue.accessibility) ? vue.accessibility : require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.vue.accessibility;
|
|
8
|
+
const vueA11yRules = {
|
|
9
|
+
"vuejs-accessibility/click-events-have-key-events": "off",
|
|
10
|
+
"vuejs-accessibility/mouse-events-have-key-events": "off",
|
|
11
|
+
"vuejs-accessibility/no-aria-hidden-on-focusable": "error",
|
|
12
|
+
"vuejs-accessibility/no-role-presentation-on-focusable": "error",
|
|
13
|
+
"vuejs-accessibility/alt-text": ["error", { img: userImageComponents }],
|
|
14
|
+
"vuejs-accessibility/anchor-has-content": ["error", {
|
|
15
|
+
components: userAnchorComponents,
|
|
16
|
+
accessibleChildren: userAccessibleChildComponents
|
|
17
|
+
}]
|
|
18
|
+
};
|
|
19
|
+
return vueA11yRules;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.getVueAccessibilityRules = getVueAccessibilityRules;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isEnabled } from "../utils/isEnabled.js";
|
|
2
|
+
import { defaultOptions } from "../utils/options/defaultOptions.js";
|
|
3
|
+
|
|
4
|
+
//#region src/rules/vueAccessibility.ts
|
|
5
|
+
function getVueAccessibilityRules(options) {
|
|
6
|
+
const { vue } = options.configs;
|
|
7
|
+
const { imageComponents: userImageComponents, anchorComponents: userAnchorComponents, accessibleChildComponents: userAccessibleChildComponents } = isEnabled(vue) && isEnabled(vue.accessibility) ? vue.accessibility : defaultOptions.configs.vue.accessibility;
|
|
8
|
+
const vueA11yRules = {
|
|
9
|
+
"vuejs-accessibility/click-events-have-key-events": "off",
|
|
10
|
+
"vuejs-accessibility/mouse-events-have-key-events": "off",
|
|
11
|
+
"vuejs-accessibility/no-aria-hidden-on-focusable": "error",
|
|
12
|
+
"vuejs-accessibility/no-role-presentation-on-focusable": "error",
|
|
13
|
+
"vuejs-accessibility/alt-text": ["error", { img: userImageComponents }],
|
|
14
|
+
"vuejs-accessibility/anchor-has-content": ["error", {
|
|
15
|
+
components: userAnchorComponents,
|
|
16
|
+
accessibleChildren: userAccessibleChildComponents
|
|
17
|
+
}]
|
|
18
|
+
};
|
|
19
|
+
return vueA11yRules;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { getVueAccessibilityRules };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { RuleOptions } from "../eslintRules.cjs";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/types/configOptions/base.d.ts
|
|
5
|
+
type MaxDepthOptions = RuleOptions<'max-depth'>;
|
|
6
|
+
type MaxNestedCallbacksOptions = RuleOptions<'max-nested-callbacks'>;
|
|
7
|
+
interface BaseOptions extends ConfigWithOverrides {
|
|
8
|
+
/**
|
|
9
|
+
* Enforce the consistent use of either function declarations or function expressions.
|
|
10
|
+
*
|
|
11
|
+
* Even when set to `'declaration'`, function expressions are still allowed, with or without a type annotation.
|
|
12
|
+
*
|
|
13
|
+
* @default 'declaration'
|
|
14
|
+
*
|
|
15
|
+
* @see [func-style](https://eslint.org/docs/latest/rules/func-style)
|
|
16
|
+
*/
|
|
17
|
+
functionStyle?: RuleOptions<'func-style'>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Prefer named exports instead of default exports.
|
|
21
|
+
*
|
|
22
|
+
* @default true
|
|
23
|
+
*
|
|
24
|
+
* @see [no-restricted-exports: `restrictDefaultExports` option](https://eslint.org/docs/latest/rules/no-restricted-exports#options)
|
|
25
|
+
*/
|
|
26
|
+
preferNamedExports?: boolean;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Enforce a maximum depth that blocks can be nested to reduce code complexity.
|
|
30
|
+
*
|
|
31
|
+
* @default 3
|
|
32
|
+
*
|
|
33
|
+
* @see [max-depth](https://eslint.org/docs/latest/rules/max-depth)
|
|
34
|
+
*/
|
|
35
|
+
maxDepth?: Exclude<MaxDepthOptions, Record<string, unknown>>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Enforce a maximum depth that callbacks can be nested to increase code clarity.
|
|
39
|
+
*
|
|
40
|
+
* @default 3
|
|
41
|
+
*
|
|
42
|
+
* @see [max-nested-callbacks](https://eslint.org/docs/latest/rules/max-nested-callbacks)
|
|
43
|
+
*/
|
|
44
|
+
maxNestedCallbacks?: Exclude<MaxNestedCallbacksOptions, Record<string, unknown>>;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { type BaseOptions };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { RuleOptions } from "../eslintRules.js";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/types/configOptions/base.d.ts
|
|
5
|
+
type MaxDepthOptions = RuleOptions<'max-depth'>;
|
|
6
|
+
type MaxNestedCallbacksOptions = RuleOptions<'max-nested-callbacks'>;
|
|
7
|
+
interface BaseOptions extends ConfigWithOverrides {
|
|
8
|
+
/**
|
|
9
|
+
* Enforce the consistent use of either function declarations or function expressions.
|
|
10
|
+
*
|
|
11
|
+
* Even when set to `'declaration'`, function expressions are still allowed, with or without a type annotation.
|
|
12
|
+
*
|
|
13
|
+
* @default 'declaration'
|
|
14
|
+
*
|
|
15
|
+
* @see [func-style](https://eslint.org/docs/latest/rules/func-style)
|
|
16
|
+
*/
|
|
17
|
+
functionStyle?: RuleOptions<'func-style'>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Prefer named exports instead of default exports.
|
|
21
|
+
*
|
|
22
|
+
* @default true
|
|
23
|
+
*
|
|
24
|
+
* @see [no-restricted-exports: `restrictDefaultExports` option](https://eslint.org/docs/latest/rules/no-restricted-exports#options)
|
|
25
|
+
*/
|
|
26
|
+
preferNamedExports?: boolean;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Enforce a maximum depth that blocks can be nested to reduce code complexity.
|
|
30
|
+
*
|
|
31
|
+
* @default 3
|
|
32
|
+
*
|
|
33
|
+
* @see [max-depth](https://eslint.org/docs/latest/rules/max-depth)
|
|
34
|
+
*/
|
|
35
|
+
maxDepth?: Exclude<MaxDepthOptions, Record<string, unknown>>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Enforce a maximum depth that callbacks can be nested to increase code clarity.
|
|
39
|
+
*
|
|
40
|
+
* @default 3
|
|
41
|
+
*
|
|
42
|
+
* @see [max-nested-callbacks](https://eslint.org/docs/latest/rules/max-nested-callbacks)
|
|
43
|
+
*/
|
|
44
|
+
maxNestedCallbacks?: Exclude<MaxNestedCallbacksOptions, Record<string, unknown>>;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { type BaseOptions };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RuleOptions } from "../eslintRules.cjs";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/types/configOptions/css.d.ts
|
|
5
|
+
interface CSSOptions extends ConfigWithOverrides {
|
|
6
|
+
/**
|
|
7
|
+
* Enforce the use of baseline features.
|
|
8
|
+
*
|
|
9
|
+
* Aside from `'widely'` and `'newly'`, it can also be set to a numeric baseline year, such as `2025`, to allow features that became baseline newly available that year or earlier.
|
|
10
|
+
*
|
|
11
|
+
* @default false
|
|
12
|
+
*
|
|
13
|
+
* @see [css/use-baseline](https://github.com/eslint/css/blob/main/docs/rules/use-baseline.md)
|
|
14
|
+
*/
|
|
15
|
+
useBaseline?: false | RuleOptions<'css/use-baseline'>['available'];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* An array of relative font units that are allowed to be used.
|
|
19
|
+
*
|
|
20
|
+
* @default ['rem', 'em']
|
|
21
|
+
*
|
|
22
|
+
* @see [css/relative-font-units: `allowUnits` option](https://github.com/eslint/css/blob/main/docs/rules/relative-font-units.md#options)
|
|
23
|
+
*/
|
|
24
|
+
allowedRelativeFontUnits?: RuleOptions<'css/relative-font-units'>['allowUnits'];
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { type CSSOptions };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RuleOptions } from "../eslintRules.js";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/types/configOptions/css.d.ts
|
|
5
|
+
interface CSSOptions extends ConfigWithOverrides {
|
|
6
|
+
/**
|
|
7
|
+
* Enforce the use of baseline features.
|
|
8
|
+
*
|
|
9
|
+
* Aside from `'widely'` and `'newly'`, it can also be set to a numeric baseline year, such as `2025`, to allow features that became baseline newly available that year or earlier.
|
|
10
|
+
*
|
|
11
|
+
* @default false
|
|
12
|
+
*
|
|
13
|
+
* @see [css/use-baseline](https://github.com/eslint/css/blob/main/docs/rules/use-baseline.md)
|
|
14
|
+
*/
|
|
15
|
+
useBaseline?: false | RuleOptions<'css/use-baseline'>['available'];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* An array of relative font units that are allowed to be used.
|
|
19
|
+
*
|
|
20
|
+
* @default ['rem', 'em']
|
|
21
|
+
*
|
|
22
|
+
* @see [css/relative-font-units: `allowUnits` option](https://github.com/eslint/css/blob/main/docs/rules/relative-font-units.md#options)
|
|
23
|
+
*/
|
|
24
|
+
allowedRelativeFontUnits?: RuleOptions<'css/relative-font-units'>['allowUnits'];
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { type CSSOptions };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RuleOptions } from "../eslintRules.cjs";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/types/configOptions/html.d.ts
|
|
5
|
+
interface HTMLOptions extends ConfigWithOverrides {
|
|
6
|
+
/**
|
|
7
|
+
* Enforce the use of baseline features.
|
|
8
|
+
*
|
|
9
|
+
* Aside from `'widely'` and `'newly'`, it can also be set to a numeric baseline year, such as `2025` (minimum is `2000`), to allow features that became baseline newly available that year or earlier.
|
|
10
|
+
*
|
|
11
|
+
* @default false
|
|
12
|
+
*
|
|
13
|
+
* @see [@html-eslint/use-baseline](https://html-eslint.org/docs/rules/use-baseline)
|
|
14
|
+
*/
|
|
15
|
+
useBaseline?: false | RuleOptions<'@html-eslint/use-baseline'>['available'];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Enforce consistent naming convention for `id` attribute values.
|
|
19
|
+
*
|
|
20
|
+
* @default 'snake_case'
|
|
21
|
+
*
|
|
22
|
+
* @see [@html-eslint/id-naming-convention](https://html-eslint.org/docs/rules/id-naming-convention)
|
|
23
|
+
*/
|
|
24
|
+
idNamingConvention?: Exclude<RuleOptions<'@html-eslint/id-naming-convention'>, 'regex'>;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { type HTMLOptions };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RuleOptions } from "../eslintRules.js";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/types/configOptions/html.d.ts
|
|
5
|
+
interface HTMLOptions extends ConfigWithOverrides {
|
|
6
|
+
/**
|
|
7
|
+
* Enforce the use of baseline features.
|
|
8
|
+
*
|
|
9
|
+
* Aside from `'widely'` and `'newly'`, it can also be set to a numeric baseline year, such as `2025` (minimum is `2000`), to allow features that became baseline newly available that year or earlier.
|
|
10
|
+
*
|
|
11
|
+
* @default false
|
|
12
|
+
*
|
|
13
|
+
* @see [@html-eslint/use-baseline](https://html-eslint.org/docs/rules/use-baseline)
|
|
14
|
+
*/
|
|
15
|
+
useBaseline?: false | RuleOptions<'@html-eslint/use-baseline'>['available'];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Enforce consistent naming convention for `id` attribute values.
|
|
19
|
+
*
|
|
20
|
+
* @default 'snake_case'
|
|
21
|
+
*
|
|
22
|
+
* @see [@html-eslint/id-naming-convention](https://html-eslint.org/docs/rules/id-naming-convention)
|
|
23
|
+
*/
|
|
24
|
+
idNamingConvention?: Exclude<RuleOptions<'@html-eslint/id-naming-convention'>, 'regex'>;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { type HTMLOptions };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RuleOptions } from "../eslintRules.cjs";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/types/configOptions/importX.d.ts
|
|
5
|
+
type RequireFileExtensionOptions = RuleOptions<'import-x/extensions'>;
|
|
6
|
+
type RequireFileExtension = Exclude<RequireFileExtensionOptions, 'ignorePackages' | Record<string, unknown>>;
|
|
7
|
+
interface ImportXOptions extends ConfigWithOverrides {
|
|
8
|
+
/**
|
|
9
|
+
* Enforce consistent use of file extensions within the import path.
|
|
10
|
+
*
|
|
11
|
+
* Imports from third-party packages are ignored.
|
|
12
|
+
*
|
|
13
|
+
* @default 'always'
|
|
14
|
+
*
|
|
15
|
+
* @see [import-x/extensions](https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/extensions.md)
|
|
16
|
+
*/
|
|
17
|
+
requireFileExtension?: RequireFileExtension;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { type ImportXOptions };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RuleOptions } from "../eslintRules.js";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/types/configOptions/importX.d.ts
|
|
5
|
+
type RequireFileExtensionOptions = RuleOptions<'import-x/extensions'>;
|
|
6
|
+
type RequireFileExtension = Exclude<RequireFileExtensionOptions, 'ignorePackages' | Record<string, unknown>>;
|
|
7
|
+
interface ImportXOptions extends ConfigWithOverrides {
|
|
8
|
+
/**
|
|
9
|
+
* Enforce consistent use of file extensions within the import path.
|
|
10
|
+
*
|
|
11
|
+
* Imports from third-party packages are ignored.
|
|
12
|
+
*
|
|
13
|
+
* @default 'always'
|
|
14
|
+
*
|
|
15
|
+
* @see [import-x/extensions](https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/extensions.md)
|
|
16
|
+
*/
|
|
17
|
+
requireFileExtension?: RequireFileExtension;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { type ImportXOptions };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//#region src/types/configOptions/nuxt.d.ts
|
|
2
|
+
interface NuxtOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Whether [NuxtImage](https://image.nuxt.com) is used in the project.
|
|
5
|
+
*
|
|
6
|
+
* Enforce the use of `<NuxtImg>` instead of `<img>`, and `<NuxtPicture>` instead of `<picture>`.
|
|
7
|
+
*
|
|
8
|
+
* @default false // `true` if "@nuxt/image" is detected in the package.json file when `autoDetectDeps` is enabled
|
|
9
|
+
*
|
|
10
|
+
* @see [vue/no-restricted-html-elements](https://eslint.vuejs.org/rules/no-restricted-html-elements)
|
|
11
|
+
*/
|
|
12
|
+
image?: boolean;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Whether [NuxtUI](https://ui.nuxt.com) is used in the project.
|
|
16
|
+
*
|
|
17
|
+
* Enforce the use of NuxtUI components over their standard counterparts. For example, `<ULink>` must be used instead of `<a>`, `<UInput>` instead of `<input>`, etc.
|
|
18
|
+
*
|
|
19
|
+
* @default false // `true` if "@nuxt/ui" is detected in the package.json file when `autoDetectDeps` is enabled
|
|
20
|
+
*
|
|
21
|
+
* @see [vue/no-restricted-html-elements](https://eslint.vuejs.org/rules/no-restricted-html-elements)
|
|
22
|
+
*/
|
|
23
|
+
ui?: boolean | {
|
|
24
|
+
/**
|
|
25
|
+
* The prefix of the components.
|
|
26
|
+
*
|
|
27
|
+
* This is used by
|
|
28
|
+
* [vue/no-restricted-html-elements](https://eslint.vuejs.org/rules/no-restricted-html-elements) and
|
|
29
|
+
* [vue/no-restricted-static-attribute](https://eslint.vuejs.org/rules/no-restricted-static-attribute)
|
|
30
|
+
* to suggest the alternative components with the correct prefix.
|
|
31
|
+
*
|
|
32
|
+
* It will fall back to the default value if set to an empty string (`''`).
|
|
33
|
+
*
|
|
34
|
+
* @default 'U'
|
|
35
|
+
*
|
|
36
|
+
* @see [NuxtUI Options: Prefix](https://ui.nuxt.com/getting-started/installation/nuxt#prefix)
|
|
37
|
+
*/
|
|
38
|
+
prefix?: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { type NuxtOptions };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//#region src/types/configOptions/nuxt.d.ts
|
|
2
|
+
interface NuxtOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Whether [NuxtImage](https://image.nuxt.com) is used in the project.
|
|
5
|
+
*
|
|
6
|
+
* Enforce the use of `<NuxtImg>` instead of `<img>`, and `<NuxtPicture>` instead of `<picture>`.
|
|
7
|
+
*
|
|
8
|
+
* @default false // `true` if "@nuxt/image" is detected in the package.json file when `autoDetectDeps` is enabled
|
|
9
|
+
*
|
|
10
|
+
* @see [vue/no-restricted-html-elements](https://eslint.vuejs.org/rules/no-restricted-html-elements)
|
|
11
|
+
*/
|
|
12
|
+
image?: boolean;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Whether [NuxtUI](https://ui.nuxt.com) is used in the project.
|
|
16
|
+
*
|
|
17
|
+
* Enforce the use of NuxtUI components over their standard counterparts. For example, `<ULink>` must be used instead of `<a>`, `<UInput>` instead of `<input>`, etc.
|
|
18
|
+
*
|
|
19
|
+
* @default false // `true` if "@nuxt/ui" is detected in the package.json file when `autoDetectDeps` is enabled
|
|
20
|
+
*
|
|
21
|
+
* @see [vue/no-restricted-html-elements](https://eslint.vuejs.org/rules/no-restricted-html-elements)
|
|
22
|
+
*/
|
|
23
|
+
ui?: boolean | {
|
|
24
|
+
/**
|
|
25
|
+
* The prefix of the components.
|
|
26
|
+
*
|
|
27
|
+
* This is used by
|
|
28
|
+
* [vue/no-restricted-html-elements](https://eslint.vuejs.org/rules/no-restricted-html-elements) and
|
|
29
|
+
* [vue/no-restricted-static-attribute](https://eslint.vuejs.org/rules/no-restricted-static-attribute)
|
|
30
|
+
* to suggest the alternative components with the correct prefix.
|
|
31
|
+
*
|
|
32
|
+
* It will fall back to the default value if set to an empty string (`''`).
|
|
33
|
+
*
|
|
34
|
+
* @default 'U'
|
|
35
|
+
*
|
|
36
|
+
* @see [NuxtUI Options: Prefix](https://ui.nuxt.com/getting-started/installation/nuxt#prefix)
|
|
37
|
+
*/
|
|
38
|
+
prefix?: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { type NuxtOptions };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RuleOptions } from "../eslintRules.cjs";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/types/configOptions/perfectionist.d.ts
|
|
5
|
+
interface PerfectionistOptions extends ConfigWithOverrides {
|
|
6
|
+
/**
|
|
7
|
+
* The type of sorting.
|
|
8
|
+
*
|
|
9
|
+
* @default 'line-length'
|
|
10
|
+
*
|
|
11
|
+
* @see [Perfectionist Settings: `type` option](https://perfectionist.dev/guide/getting-started#settings)
|
|
12
|
+
*/
|
|
13
|
+
sortType?: RuleOptions<'perfectionist/sort-imports'>['type'];
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { type PerfectionistOptions };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RuleOptions } from "../eslintRules.js";
|
|
2
|
+
import { ConfigWithOverrides } from "../index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/types/configOptions/perfectionist.d.ts
|
|
5
|
+
interface PerfectionistOptions extends ConfigWithOverrides {
|
|
6
|
+
/**
|
|
7
|
+
* The type of sorting.
|
|
8
|
+
*
|
|
9
|
+
* @default 'line-length'
|
|
10
|
+
*
|
|
11
|
+
* @see [Perfectionist Settings: `type` option](https://perfectionist.dev/guide/getting-started#settings)
|
|
12
|
+
*/
|
|
13
|
+
sortType?: RuleOptions<'perfectionist/sort-imports'>['type'];
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { type PerfectionistOptions };
|