@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,22 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('./options/defaultOptions.cjs');
|
|
3
|
+
const node_path = require_rolldown_runtime.__toESM(require("node:path"));
|
|
4
|
+
const node_util = require_rolldown_runtime.__toESM(require("node:util"));
|
|
5
|
+
const local_pkg = require_rolldown_runtime.__toESM(require("local-pkg"));
|
|
6
|
+
|
|
7
|
+
//#region src/utils/isPackageDetected.ts
|
|
8
|
+
const detectedPackages = [];
|
|
9
|
+
function logDetectedPackages() {
|
|
10
|
+
if (detectedPackages.length > 0) console.info((0, node_util.styleText)("green", "✔"), "Automatic dependency detection enabled ESLint configurations for", detectedPackages.map((packageName) => (0, node_util.styleText)("blue", packageName)).join(", "));
|
|
11
|
+
}
|
|
12
|
+
function isPackageDetected(packageName, options = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions) {
|
|
13
|
+
const { packageDir = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.packageDir, autoDetectDeps = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.autoDetectDeps } = options;
|
|
14
|
+
if (!autoDetectDeps) return false;
|
|
15
|
+
const isPackageInstalled = (0, local_pkg.isPackageExists)(packageName, { paths: [node_path.default.resolve(packageDir)] });
|
|
16
|
+
if (isPackageInstalled) detectedPackages.push(packageName);
|
|
17
|
+
return isPackageInstalled;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.isPackageDetected = isPackageDetected;
|
|
22
|
+
exports.logDetectedPackages = logDetectedPackages;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defaultOptions } from "./options/defaultOptions.js";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { styleText } from "node:util";
|
|
4
|
+
import { isPackageExists } from "local-pkg";
|
|
5
|
+
|
|
6
|
+
//#region src/utils/isPackageDetected.ts
|
|
7
|
+
const detectedPackages = [];
|
|
8
|
+
function logDetectedPackages() {
|
|
9
|
+
if (detectedPackages.length > 0) console.info(styleText("green", "✔"), "Automatic dependency detection enabled ESLint configurations for", detectedPackages.map((packageName) => styleText("blue", packageName)).join(", "));
|
|
10
|
+
}
|
|
11
|
+
function isPackageDetected(packageName, options = defaultOptions) {
|
|
12
|
+
const { packageDir = defaultOptions.packageDir, autoDetectDeps = defaultOptions.autoDetectDeps } = options;
|
|
13
|
+
if (!autoDetectDeps) return false;
|
|
14
|
+
const isPackageInstalled = isPackageExists(packageName, { paths: [path.resolve(packageDir)] });
|
|
15
|
+
if (isPackageInstalled) detectedPackages.push(packageName);
|
|
16
|
+
return isPackageInstalled;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { isPackageDetected, logDetectedPackages };
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/utils/options/defaultOptions.ts
|
|
3
|
+
const defaultOptions = {
|
|
4
|
+
autoDetectDeps: true,
|
|
5
|
+
gitignore: ".gitignore",
|
|
6
|
+
env: "node",
|
|
7
|
+
packageDir: ".",
|
|
8
|
+
tsConfig: false,
|
|
9
|
+
global: {
|
|
10
|
+
basePath: ".",
|
|
11
|
+
ignores: [],
|
|
12
|
+
linterOptions: {
|
|
13
|
+
noInlineConfig: false,
|
|
14
|
+
reportUnusedInlineConfigs: "warn",
|
|
15
|
+
reportUnusedDisableDirectives: "warn"
|
|
16
|
+
},
|
|
17
|
+
globals: {
|
|
18
|
+
node: true,
|
|
19
|
+
commonjs: false,
|
|
20
|
+
browser: true,
|
|
21
|
+
worker: true,
|
|
22
|
+
serviceworker: false,
|
|
23
|
+
webextension: false,
|
|
24
|
+
custom: {}
|
|
25
|
+
},
|
|
26
|
+
settings: {},
|
|
27
|
+
rules: {}
|
|
28
|
+
},
|
|
29
|
+
configs: {
|
|
30
|
+
oxlint: "./.oxlintrc.json",
|
|
31
|
+
base: {
|
|
32
|
+
maxDepth: 3,
|
|
33
|
+
maxNestedCallbacks: 3,
|
|
34
|
+
preferNamedExports: true,
|
|
35
|
+
functionStyle: "declaration",
|
|
36
|
+
overrides: {}
|
|
37
|
+
},
|
|
38
|
+
stylistic: {
|
|
39
|
+
semi: "always",
|
|
40
|
+
trailingComma: "always-multiline",
|
|
41
|
+
memberDelimiterStyle: "comma",
|
|
42
|
+
quotes: "single",
|
|
43
|
+
jsxQuotes: "prefer-double",
|
|
44
|
+
arrowParens: "always",
|
|
45
|
+
useTabs: true,
|
|
46
|
+
indent: 2,
|
|
47
|
+
maxConsecutiveEmptyLines: 1,
|
|
48
|
+
maxLineLength: 120,
|
|
49
|
+
maxAttributesPerLine: 3,
|
|
50
|
+
selfCloseVoidHTMLElements: "always",
|
|
51
|
+
overrides: {}
|
|
52
|
+
},
|
|
53
|
+
html: {
|
|
54
|
+
useBaseline: false,
|
|
55
|
+
idNamingConvention: "snake_case",
|
|
56
|
+
overrides: {}
|
|
57
|
+
},
|
|
58
|
+
css: {
|
|
59
|
+
useBaseline: false,
|
|
60
|
+
allowedRelativeFontUnits: ["rem", "em"],
|
|
61
|
+
overrides: {}
|
|
62
|
+
},
|
|
63
|
+
tailwind: {
|
|
64
|
+
multilineSort: true,
|
|
65
|
+
ignoredUnregisteredClasses: [],
|
|
66
|
+
config: "",
|
|
67
|
+
entryPoint: "",
|
|
68
|
+
overrides: {}
|
|
69
|
+
},
|
|
70
|
+
typescript: {
|
|
71
|
+
allowedDefaultProjects: [],
|
|
72
|
+
methodSignatureStyle: "method",
|
|
73
|
+
typeDefinitionStyle: "interface",
|
|
74
|
+
overrides: {}
|
|
75
|
+
},
|
|
76
|
+
importX: {
|
|
77
|
+
requireFileExtension: "always",
|
|
78
|
+
overrides: {}
|
|
79
|
+
},
|
|
80
|
+
perfectionist: {
|
|
81
|
+
sortType: "line-length",
|
|
82
|
+
overrides: {}
|
|
83
|
+
},
|
|
84
|
+
vue: {
|
|
85
|
+
accessibility: {
|
|
86
|
+
imageComponents: ["NuxtImg"],
|
|
87
|
+
anchorComponents: [
|
|
88
|
+
"RouterLink",
|
|
89
|
+
"NuxtLink",
|
|
90
|
+
"ULink"
|
|
91
|
+
],
|
|
92
|
+
accessibleChildComponents: [
|
|
93
|
+
"img",
|
|
94
|
+
"picture",
|
|
95
|
+
"NuxtImg",
|
|
96
|
+
"NuxtPicture"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
blocksOrder: [
|
|
100
|
+
"script:not([setup])",
|
|
101
|
+
"script[setup]",
|
|
102
|
+
"template",
|
|
103
|
+
"i18n[locale=en]",
|
|
104
|
+
"i18n:not([locale=en])",
|
|
105
|
+
"style:not([scoped])",
|
|
106
|
+
"style[scoped]",
|
|
107
|
+
"docs"
|
|
108
|
+
],
|
|
109
|
+
macrosOrder: [
|
|
110
|
+
"definePage",
|
|
111
|
+
"defineOptions",
|
|
112
|
+
"defineModel",
|
|
113
|
+
"defineProps",
|
|
114
|
+
"defineEmits",
|
|
115
|
+
"defineSlots",
|
|
116
|
+
"defineCustom",
|
|
117
|
+
"defineExpose"
|
|
118
|
+
],
|
|
119
|
+
attributesOrder: [
|
|
120
|
+
"DEFINITION",
|
|
121
|
+
"CONDITIONALS",
|
|
122
|
+
"RENDER_MODIFIERS",
|
|
123
|
+
"LIST_RENDERING",
|
|
124
|
+
"UNIQUE",
|
|
125
|
+
"GLOBAL",
|
|
126
|
+
"TWO_WAY_BINDING",
|
|
127
|
+
"SLOT",
|
|
128
|
+
"CONTENT",
|
|
129
|
+
"OTHER_DIRECTIVES",
|
|
130
|
+
"EVENTS",
|
|
131
|
+
"ATTR_SHORTHAND_BOOL",
|
|
132
|
+
"ATTR_DYNAMIC",
|
|
133
|
+
"ATTR_STATIC"
|
|
134
|
+
],
|
|
135
|
+
attributeHyphenation: "never",
|
|
136
|
+
preferVBindSameNameShorthand: "always",
|
|
137
|
+
preferVBindTrueShorthand: "always",
|
|
138
|
+
allowedStyleAttributes: ["scoped", "module"],
|
|
139
|
+
blockLang: {
|
|
140
|
+
script: "js",
|
|
141
|
+
style: "implicit"
|
|
142
|
+
},
|
|
143
|
+
destructureProps: "always",
|
|
144
|
+
componentNameCaseInTemplate: "PascalCase",
|
|
145
|
+
vForDelimiterStyle: "in",
|
|
146
|
+
vOnHandlerStyle: ["method", "inline-function"],
|
|
147
|
+
restrictedElements: [],
|
|
148
|
+
restrictedStaticAttributes: [],
|
|
149
|
+
ignoredUndefinedComponents: [],
|
|
150
|
+
overrides: {}
|
|
151
|
+
},
|
|
152
|
+
nuxt: {
|
|
153
|
+
image: false,
|
|
154
|
+
ui: { prefix: "U" }
|
|
155
|
+
},
|
|
156
|
+
test: {
|
|
157
|
+
storybook: { overrides: {} },
|
|
158
|
+
vitest: { overrides: {} },
|
|
159
|
+
playwright: { overrides: {} },
|
|
160
|
+
cypress: { overrides: {} },
|
|
161
|
+
testFunction: "test",
|
|
162
|
+
maxNestedDescribe: 1
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
//#endregion
|
|
168
|
+
exports.defaultOptions = defaultOptions;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
//#region src/utils/options/defaultOptions.ts
|
|
2
|
+
const defaultOptions = {
|
|
3
|
+
autoDetectDeps: true,
|
|
4
|
+
gitignore: ".gitignore",
|
|
5
|
+
env: "node",
|
|
6
|
+
packageDir: ".",
|
|
7
|
+
tsConfig: false,
|
|
8
|
+
global: {
|
|
9
|
+
basePath: ".",
|
|
10
|
+
ignores: [],
|
|
11
|
+
linterOptions: {
|
|
12
|
+
noInlineConfig: false,
|
|
13
|
+
reportUnusedInlineConfigs: "warn",
|
|
14
|
+
reportUnusedDisableDirectives: "warn"
|
|
15
|
+
},
|
|
16
|
+
globals: {
|
|
17
|
+
node: true,
|
|
18
|
+
commonjs: false,
|
|
19
|
+
browser: true,
|
|
20
|
+
worker: true,
|
|
21
|
+
serviceworker: false,
|
|
22
|
+
webextension: false,
|
|
23
|
+
custom: {}
|
|
24
|
+
},
|
|
25
|
+
settings: {},
|
|
26
|
+
rules: {}
|
|
27
|
+
},
|
|
28
|
+
configs: {
|
|
29
|
+
oxlint: "./.oxlintrc.json",
|
|
30
|
+
base: {
|
|
31
|
+
maxDepth: 3,
|
|
32
|
+
maxNestedCallbacks: 3,
|
|
33
|
+
preferNamedExports: true,
|
|
34
|
+
functionStyle: "declaration",
|
|
35
|
+
overrides: {}
|
|
36
|
+
},
|
|
37
|
+
stylistic: {
|
|
38
|
+
semi: "always",
|
|
39
|
+
trailingComma: "always-multiline",
|
|
40
|
+
memberDelimiterStyle: "comma",
|
|
41
|
+
quotes: "single",
|
|
42
|
+
jsxQuotes: "prefer-double",
|
|
43
|
+
arrowParens: "always",
|
|
44
|
+
useTabs: true,
|
|
45
|
+
indent: 2,
|
|
46
|
+
maxConsecutiveEmptyLines: 1,
|
|
47
|
+
maxLineLength: 120,
|
|
48
|
+
maxAttributesPerLine: 3,
|
|
49
|
+
selfCloseVoidHTMLElements: "always",
|
|
50
|
+
overrides: {}
|
|
51
|
+
},
|
|
52
|
+
html: {
|
|
53
|
+
useBaseline: false,
|
|
54
|
+
idNamingConvention: "snake_case",
|
|
55
|
+
overrides: {}
|
|
56
|
+
},
|
|
57
|
+
css: {
|
|
58
|
+
useBaseline: false,
|
|
59
|
+
allowedRelativeFontUnits: ["rem", "em"],
|
|
60
|
+
overrides: {}
|
|
61
|
+
},
|
|
62
|
+
tailwind: {
|
|
63
|
+
multilineSort: true,
|
|
64
|
+
ignoredUnregisteredClasses: [],
|
|
65
|
+
config: "",
|
|
66
|
+
entryPoint: "",
|
|
67
|
+
overrides: {}
|
|
68
|
+
},
|
|
69
|
+
typescript: {
|
|
70
|
+
allowedDefaultProjects: [],
|
|
71
|
+
methodSignatureStyle: "method",
|
|
72
|
+
typeDefinitionStyle: "interface",
|
|
73
|
+
overrides: {}
|
|
74
|
+
},
|
|
75
|
+
importX: {
|
|
76
|
+
requireFileExtension: "always",
|
|
77
|
+
overrides: {}
|
|
78
|
+
},
|
|
79
|
+
perfectionist: {
|
|
80
|
+
sortType: "line-length",
|
|
81
|
+
overrides: {}
|
|
82
|
+
},
|
|
83
|
+
vue: {
|
|
84
|
+
accessibility: {
|
|
85
|
+
imageComponents: ["NuxtImg"],
|
|
86
|
+
anchorComponents: [
|
|
87
|
+
"RouterLink",
|
|
88
|
+
"NuxtLink",
|
|
89
|
+
"ULink"
|
|
90
|
+
],
|
|
91
|
+
accessibleChildComponents: [
|
|
92
|
+
"img",
|
|
93
|
+
"picture",
|
|
94
|
+
"NuxtImg",
|
|
95
|
+
"NuxtPicture"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
blocksOrder: [
|
|
99
|
+
"script:not([setup])",
|
|
100
|
+
"script[setup]",
|
|
101
|
+
"template",
|
|
102
|
+
"i18n[locale=en]",
|
|
103
|
+
"i18n:not([locale=en])",
|
|
104
|
+
"style:not([scoped])",
|
|
105
|
+
"style[scoped]",
|
|
106
|
+
"docs"
|
|
107
|
+
],
|
|
108
|
+
macrosOrder: [
|
|
109
|
+
"definePage",
|
|
110
|
+
"defineOptions",
|
|
111
|
+
"defineModel",
|
|
112
|
+
"defineProps",
|
|
113
|
+
"defineEmits",
|
|
114
|
+
"defineSlots",
|
|
115
|
+
"defineCustom",
|
|
116
|
+
"defineExpose"
|
|
117
|
+
],
|
|
118
|
+
attributesOrder: [
|
|
119
|
+
"DEFINITION",
|
|
120
|
+
"CONDITIONALS",
|
|
121
|
+
"RENDER_MODIFIERS",
|
|
122
|
+
"LIST_RENDERING",
|
|
123
|
+
"UNIQUE",
|
|
124
|
+
"GLOBAL",
|
|
125
|
+
"TWO_WAY_BINDING",
|
|
126
|
+
"SLOT",
|
|
127
|
+
"CONTENT",
|
|
128
|
+
"OTHER_DIRECTIVES",
|
|
129
|
+
"EVENTS",
|
|
130
|
+
"ATTR_SHORTHAND_BOOL",
|
|
131
|
+
"ATTR_DYNAMIC",
|
|
132
|
+
"ATTR_STATIC"
|
|
133
|
+
],
|
|
134
|
+
attributeHyphenation: "never",
|
|
135
|
+
preferVBindSameNameShorthand: "always",
|
|
136
|
+
preferVBindTrueShorthand: "always",
|
|
137
|
+
allowedStyleAttributes: ["scoped", "module"],
|
|
138
|
+
blockLang: {
|
|
139
|
+
script: "js",
|
|
140
|
+
style: "implicit"
|
|
141
|
+
},
|
|
142
|
+
destructureProps: "always",
|
|
143
|
+
componentNameCaseInTemplate: "PascalCase",
|
|
144
|
+
vForDelimiterStyle: "in",
|
|
145
|
+
vOnHandlerStyle: ["method", "inline-function"],
|
|
146
|
+
restrictedElements: [],
|
|
147
|
+
restrictedStaticAttributes: [],
|
|
148
|
+
ignoredUndefinedComponents: [],
|
|
149
|
+
overrides: {}
|
|
150
|
+
},
|
|
151
|
+
nuxt: {
|
|
152
|
+
image: false,
|
|
153
|
+
ui: { prefix: "U" }
|
|
154
|
+
},
|
|
155
|
+
test: {
|
|
156
|
+
storybook: { overrides: {} },
|
|
157
|
+
vitest: { overrides: {} },
|
|
158
|
+
playwright: { overrides: {} },
|
|
159
|
+
cypress: { overrides: {} },
|
|
160
|
+
testFunction: "test",
|
|
161
|
+
maxNestedDescribe: 1
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
//#endregion
|
|
167
|
+
export { defaultOptions };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('./defaultOptions.cjs');
|
|
2
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected = require('../isPackageDetected.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/utils/options/enableDetectedConfigs.ts
|
|
5
|
+
function enableDetectedConfigs(options) {
|
|
6
|
+
options.configs ??= {};
|
|
7
|
+
options.configs.test ??= {};
|
|
8
|
+
options.tsConfig ??= options.configs.typescript ? {
|
|
9
|
+
rootDir: ".",
|
|
10
|
+
filename: "tsconfig.json"
|
|
11
|
+
} : false;
|
|
12
|
+
options.configs.html ??= false;
|
|
13
|
+
options.configs.css ??= false;
|
|
14
|
+
options.configs.tailwind ??= false;
|
|
15
|
+
options.configs.importX ??= true;
|
|
16
|
+
options.configs.stylistic ??= true;
|
|
17
|
+
options.configs.perfectionist ??= true;
|
|
18
|
+
options.configs.vue ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("vue", options);
|
|
19
|
+
options.configs.nuxt ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("nuxt", options);
|
|
20
|
+
options.configs.typescript ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("typescript", options);
|
|
21
|
+
options.configs.test.vitest ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("vitest", options);
|
|
22
|
+
options.configs.test.cypress ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("cypress", options);
|
|
23
|
+
options.configs.test.storybook ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("storybook", options);
|
|
24
|
+
options.configs.test.playwright ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("@playwright/test", options);
|
|
25
|
+
options.configs.oxlint ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("oxlint", options) ? require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.oxlint : false;
|
|
26
|
+
if (options.configs.nuxt) {
|
|
27
|
+
if (options.configs.nuxt === true) options.configs.nuxt = {};
|
|
28
|
+
options.configs.nuxt.ui ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("@nuxt/ui", options);
|
|
29
|
+
options.configs.nuxt.image ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("@nuxt/image", options);
|
|
30
|
+
}
|
|
31
|
+
if (options.autoDetectDeps === "verbose") require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.logDetectedPackages();
|
|
32
|
+
return options;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
exports.enableDetectedConfigs = enableDetectedConfigs;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defaultOptions } from "./defaultOptions.js";
|
|
2
|
+
import { isPackageDetected, logDetectedPackages } from "../isPackageDetected.js";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/options/enableDetectedConfigs.ts
|
|
5
|
+
function enableDetectedConfigs(options) {
|
|
6
|
+
options.configs ??= {};
|
|
7
|
+
options.configs.test ??= {};
|
|
8
|
+
options.tsConfig ??= options.configs.typescript ? {
|
|
9
|
+
rootDir: ".",
|
|
10
|
+
filename: "tsconfig.json"
|
|
11
|
+
} : false;
|
|
12
|
+
options.configs.html ??= false;
|
|
13
|
+
options.configs.css ??= false;
|
|
14
|
+
options.configs.tailwind ??= false;
|
|
15
|
+
options.configs.importX ??= true;
|
|
16
|
+
options.configs.stylistic ??= true;
|
|
17
|
+
options.configs.perfectionist ??= true;
|
|
18
|
+
options.configs.vue ??= isPackageDetected("vue", options);
|
|
19
|
+
options.configs.nuxt ??= isPackageDetected("nuxt", options);
|
|
20
|
+
options.configs.typescript ??= isPackageDetected("typescript", options);
|
|
21
|
+
options.configs.test.vitest ??= isPackageDetected("vitest", options);
|
|
22
|
+
options.configs.test.cypress ??= isPackageDetected("cypress", options);
|
|
23
|
+
options.configs.test.storybook ??= isPackageDetected("storybook", options);
|
|
24
|
+
options.configs.test.playwright ??= isPackageDetected("@playwright/test", options);
|
|
25
|
+
options.configs.oxlint ??= isPackageDetected("oxlint", options) ? defaultOptions.configs.oxlint : false;
|
|
26
|
+
if (options.configs.nuxt) {
|
|
27
|
+
if (options.configs.nuxt === true) options.configs.nuxt = {};
|
|
28
|
+
options.configs.nuxt.ui ??= isPackageDetected("@nuxt/ui", options);
|
|
29
|
+
options.configs.nuxt.image ??= isPackageDetected("@nuxt/image", options);
|
|
30
|
+
}
|
|
31
|
+
if (options.autoDetectDeps === "verbose") logDetectedPackages();
|
|
32
|
+
return options;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
export { enableDetectedConfigs };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('./defaultOptions.cjs');
|
|
3
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEmptyString = require('../isEmptyString.cjs');
|
|
4
|
+
const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_enableDetectedConfigs = require('./enableDetectedConfigs.cjs');
|
|
5
|
+
const defu = require_rolldown_runtime.__toESM(require("defu"));
|
|
6
|
+
|
|
7
|
+
//#region src/utils/options/mergeWithDefaults.ts
|
|
8
|
+
const mergeOptions = (0, defu.createDefu)((object, key, value) => {
|
|
9
|
+
const isValueTrue = value === true;
|
|
10
|
+
const isDefaultValueFalse = object[key] === false;
|
|
11
|
+
const isValueEmptyString = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEmptyString.isEmptyString(value);
|
|
12
|
+
const fallBackToDefault = isValueEmptyString || isValueTrue && !isDefaultValueFalse;
|
|
13
|
+
return fallBackToDefault;
|
|
14
|
+
});
|
|
15
|
+
function mergeWithDefaults(options) {
|
|
16
|
+
const optionsWithDetectedConfigs = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_enableDetectedConfigs.enableDetectedConfigs(options);
|
|
17
|
+
const mergedOptions = mergeOptions(optionsWithDetectedConfigs, require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions);
|
|
18
|
+
return mergedOptions;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
exports.mergeWithDefaults = mergeWithDefaults;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defaultOptions } from "./defaultOptions.js";
|
|
2
|
+
import { isEmptyString } from "../isEmptyString.js";
|
|
3
|
+
import { enableDetectedConfigs } from "./enableDetectedConfigs.js";
|
|
4
|
+
import { createDefu } from "defu";
|
|
5
|
+
|
|
6
|
+
//#region src/utils/options/mergeWithDefaults.ts
|
|
7
|
+
const mergeOptions = createDefu((object, key, value) => {
|
|
8
|
+
const isValueTrue = value === true;
|
|
9
|
+
const isDefaultValueFalse = object[key] === false;
|
|
10
|
+
const isValueEmptyString = isEmptyString(value);
|
|
11
|
+
const fallBackToDefault = isValueEmptyString || isValueTrue && !isDefaultValueFalse;
|
|
12
|
+
return fallBackToDefault;
|
|
13
|
+
});
|
|
14
|
+
function mergeWithDefaults(options) {
|
|
15
|
+
const optionsWithDetectedConfigs = enableDetectedConfigs(options);
|
|
16
|
+
const mergedOptions = mergeOptions(optionsWithDetectedConfigs, defaultOptions);
|
|
17
|
+
return mergedOptions;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { mergeWithDefaults };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/utils/vue/getRestrictedVueElements.ts
|
|
3
|
+
const alternativeComponents = {
|
|
4
|
+
kbd: "Kbd",
|
|
5
|
+
form: "Form",
|
|
6
|
+
input: "Input",
|
|
7
|
+
table: "Table",
|
|
8
|
+
dialog: "Modal",
|
|
9
|
+
hr: "Separator",
|
|
10
|
+
button: "Button",
|
|
11
|
+
select: "Select",
|
|
12
|
+
progress: "Progress",
|
|
13
|
+
textarea: "Textarea",
|
|
14
|
+
details: "Accordion",
|
|
15
|
+
datalist: "InputMenu"
|
|
16
|
+
};
|
|
17
|
+
const alternativeComponentPairs = Object.entries(alternativeComponents);
|
|
18
|
+
function getRestrictedVueElements(prefix) {
|
|
19
|
+
const restrictedElements = [];
|
|
20
|
+
for (const [element, component] of alternativeComponentPairs) restrictedElements.push({
|
|
21
|
+
element,
|
|
22
|
+
message: `Use <${prefix}${component}>.`
|
|
23
|
+
});
|
|
24
|
+
return restrictedElements;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.getRestrictedVueElements = getRestrictedVueElements;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/utils/vue/getRestrictedVueElements.ts
|
|
2
|
+
const alternativeComponents = {
|
|
3
|
+
kbd: "Kbd",
|
|
4
|
+
form: "Form",
|
|
5
|
+
input: "Input",
|
|
6
|
+
table: "Table",
|
|
7
|
+
dialog: "Modal",
|
|
8
|
+
hr: "Separator",
|
|
9
|
+
button: "Button",
|
|
10
|
+
select: "Select",
|
|
11
|
+
progress: "Progress",
|
|
12
|
+
textarea: "Textarea",
|
|
13
|
+
details: "Accordion",
|
|
14
|
+
datalist: "InputMenu"
|
|
15
|
+
};
|
|
16
|
+
const alternativeComponentPairs = Object.entries(alternativeComponents);
|
|
17
|
+
function getRestrictedVueElements(prefix) {
|
|
18
|
+
const restrictedElements = [];
|
|
19
|
+
for (const [element, component] of alternativeComponentPairs) restrictedElements.push({
|
|
20
|
+
element,
|
|
21
|
+
message: `Use <${prefix}${component}>.`
|
|
22
|
+
});
|
|
23
|
+
return restrictedElements;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { getRestrictedVueElements };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/utils/vue/getRestrictedVueInputs.ts
|
|
3
|
+
const alternativeComponents = {
|
|
4
|
+
range: "Slider",
|
|
5
|
+
date: "Calendar",
|
|
6
|
+
radio: "RadioGroup",
|
|
7
|
+
checkbox: "Checkbox",
|
|
8
|
+
color: "ColorPicker",
|
|
9
|
+
number: "InputNumber"
|
|
10
|
+
};
|
|
11
|
+
const alternativeComponentPairs = Object.entries(alternativeComponents);
|
|
12
|
+
function getRestrictedVueInputs(prefix) {
|
|
13
|
+
const restrictedInputs = [];
|
|
14
|
+
for (const [input, component] of alternativeComponentPairs) restrictedInputs.push({
|
|
15
|
+
element: "input",
|
|
16
|
+
key: "type",
|
|
17
|
+
value: input,
|
|
18
|
+
message: `Use <${prefix}${component}>.`
|
|
19
|
+
});
|
|
20
|
+
return restrictedInputs;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.getRestrictedVueInputs = getRestrictedVueInputs;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/utils/vue/getRestrictedVueInputs.ts
|
|
2
|
+
const alternativeComponents = {
|
|
3
|
+
range: "Slider",
|
|
4
|
+
date: "Calendar",
|
|
5
|
+
radio: "RadioGroup",
|
|
6
|
+
checkbox: "Checkbox",
|
|
7
|
+
color: "ColorPicker",
|
|
8
|
+
number: "InputNumber"
|
|
9
|
+
};
|
|
10
|
+
const alternativeComponentPairs = Object.entries(alternativeComponents);
|
|
11
|
+
function getRestrictedVueInputs(prefix) {
|
|
12
|
+
const restrictedInputs = [];
|
|
13
|
+
for (const [input, component] of alternativeComponentPairs) restrictedInputs.push({
|
|
14
|
+
element: "input",
|
|
15
|
+
key: "type",
|
|
16
|
+
value: input,
|
|
17
|
+
message: `Use <${prefix}${component}>.`
|
|
18
|
+
});
|
|
19
|
+
return restrictedInputs;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { getRestrictedVueInputs };
|