@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,163 @@
|
|
|
1
|
+
//#region src/rules/javascript.ts
|
|
2
|
+
function getJavaScriptRules(options) {
|
|
3
|
+
const { maxDepth, functionStyle, maxNestedCallbacks, preferNamedExports } = options.configs.base;
|
|
4
|
+
const javascriptRules = {
|
|
5
|
+
"no-self-compare": "warn",
|
|
6
|
+
"no-await-in-loop": "error",
|
|
7
|
+
"no-unassigned-vars": "error",
|
|
8
|
+
"no-unreachable-loop": "warn",
|
|
9
|
+
"no-inner-declarations": "warn",
|
|
10
|
+
"require-atomic-updates": "warn",
|
|
11
|
+
"array-callback-return": "error",
|
|
12
|
+
"no-useless-assignment": "error",
|
|
13
|
+
"no-constructor-return": "error",
|
|
14
|
+
"no-async-promise-executor": "error",
|
|
15
|
+
"no-promise-executor-return": "error",
|
|
16
|
+
"no-template-curly-in-string": "error",
|
|
17
|
+
"no-unmodified-loop-condition": "error",
|
|
18
|
+
"use-isnan": ["error", { enforceForIndexOf: true }],
|
|
19
|
+
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
|
20
|
+
"no-unsafe-negation": ["error", { enforceForOrderingRelations: true }],
|
|
21
|
+
"no-unsafe-optional-chaining": ["error", { disallowArithmeticOperators: true }],
|
|
22
|
+
"no-use-before-define": ["error", {
|
|
23
|
+
functions: false,
|
|
24
|
+
ignoreTypeReferences: false
|
|
25
|
+
}],
|
|
26
|
+
"no-duplicate-imports": ["error", {
|
|
27
|
+
includeExports: true,
|
|
28
|
+
allowSeparateTypeImports: true
|
|
29
|
+
}],
|
|
30
|
+
"yoda": "warn",
|
|
31
|
+
"strict": "error",
|
|
32
|
+
"no-var": "error",
|
|
33
|
+
"eqeqeq": "error",
|
|
34
|
+
"no-new": "error",
|
|
35
|
+
"new-cap": "warn",
|
|
36
|
+
"no-eval": "error",
|
|
37
|
+
"no-void": "error",
|
|
38
|
+
"no-proto": "warn",
|
|
39
|
+
"no-empty": "warn",
|
|
40
|
+
"camelcase": "warn",
|
|
41
|
+
"no-caller": "error",
|
|
42
|
+
"no-eq-null": "warn",
|
|
43
|
+
"complexity": "warn",
|
|
44
|
+
"sort-imports": "off",
|
|
45
|
+
"no-redeclare": "off",
|
|
46
|
+
"no-iterator": "warn",
|
|
47
|
+
"no-continue": "warn",
|
|
48
|
+
"no-new-func": "error",
|
|
49
|
+
"guard-for-in": "warn",
|
|
50
|
+
"no-loop-func": "warn",
|
|
51
|
+
"default-case": "warn",
|
|
52
|
+
"no-lonely-if": "error",
|
|
53
|
+
"no-label-var": "error",
|
|
54
|
+
"no-multi-str": "error",
|
|
55
|
+
"prefer-const": "error",
|
|
56
|
+
"require-await": "warn",
|
|
57
|
+
"dot-notation": "error",
|
|
58
|
+
"no-script-url": "error",
|
|
59
|
+
"no-undef-init": "error",
|
|
60
|
+
"no-extra-bind": "error",
|
|
61
|
+
"prefer-spread": "error",
|
|
62
|
+
"no-lone-blocks": "error",
|
|
63
|
+
"no-extra-label": "error",
|
|
64
|
+
"accessor-pairs": "error",
|
|
65
|
+
"prefer-template": "warn",
|
|
66
|
+
"no-invalid-this": "error",
|
|
67
|
+
"no-useless-call": "error",
|
|
68
|
+
"no-implied-eval": "error",
|
|
69
|
+
"consistent-this": "error",
|
|
70
|
+
"no-octal-escape": "error",
|
|
71
|
+
"no-new-wrappers": "error",
|
|
72
|
+
"block-scoped-var": "warn",
|
|
73
|
+
"object-shorthand": "warn",
|
|
74
|
+
"no-throw-literal": "error",
|
|
75
|
+
"no-extend-native": "error",
|
|
76
|
+
"default-case-last": "warn",
|
|
77
|
+
"no-nested-ternary": "warn",
|
|
78
|
+
"no-useless-return": "error",
|
|
79
|
+
"init-declarations": "error",
|
|
80
|
+
"consistent-return": "error",
|
|
81
|
+
"no-useless-concat": "error",
|
|
82
|
+
"no-useless-rename": "error",
|
|
83
|
+
"default-param-last": "warn",
|
|
84
|
+
"symbol-description": "warn",
|
|
85
|
+
"func-name-matching": "warn",
|
|
86
|
+
"prefer-rest-params": "error",
|
|
87
|
+
"operator-assignment": "error",
|
|
88
|
+
"no-unneeded-ternary": "error",
|
|
89
|
+
"no-implicit-globals": "error",
|
|
90
|
+
"prefer-destructuring": "warn",
|
|
91
|
+
"no-implicit-coercion": "error",
|
|
92
|
+
"no-array-constructor": "error",
|
|
93
|
+
"no-underscore-dangle": "error",
|
|
94
|
+
"prefer-object-spread": "error",
|
|
95
|
+
"radix": ["error", "as-needed"],
|
|
96
|
+
"curly": ["warn", "multi-line"],
|
|
97
|
+
"max-depth": ["warn", maxDepth],
|
|
98
|
+
"no-object-constructor": "error",
|
|
99
|
+
"prefer-object-has-own": "error",
|
|
100
|
+
"no-useless-constructor": "error",
|
|
101
|
+
"class-methods-use-this": "error",
|
|
102
|
+
"prefer-numeric-literals": "error",
|
|
103
|
+
"no-useless-computed-key": "error",
|
|
104
|
+
"prefer-named-capture-group": "warn",
|
|
105
|
+
"no-return-assign": ["error", "always"],
|
|
106
|
+
"prefer-exponentiation-operator": "error",
|
|
107
|
+
"no-bitwise": ["error", { int32Hint: true }],
|
|
108
|
+
"max-params": ["warn", { countVoidThis: true }],
|
|
109
|
+
"logical-assignment-operators": ["error", "always"],
|
|
110
|
+
"max-nested-callbacks": ["warn", maxNestedCallbacks],
|
|
111
|
+
"no-sequences": ["error", { allowInParentheses: false }],
|
|
112
|
+
"no-multi-assign": ["error", { ignoreNonDeclaration: true }],
|
|
113
|
+
"no-plusplus": ["error", { allowForLoopAfterthoughts: true }],
|
|
114
|
+
"prefer-arrow-callback": ["error", { allowUnboundThis: true }],
|
|
115
|
+
"no-shadow-restricted-names": ["warn", { reportGlobalThis: true }],
|
|
116
|
+
"func-style": [
|
|
117
|
+
"warn",
|
|
118
|
+
functionStyle,
|
|
119
|
+
{ allowTypeAnnotation: true }
|
|
120
|
+
],
|
|
121
|
+
"prefer-promise-reject-errors": ["error", { allowEmptyReject: true }],
|
|
122
|
+
"prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
|
|
123
|
+
"no-extra-boolean-cast": ["error", { enforceForInnerExpressions: true }],
|
|
124
|
+
"no-console": ["warn", { allow: [
|
|
125
|
+
"info",
|
|
126
|
+
"warn",
|
|
127
|
+
"error",
|
|
128
|
+
"table",
|
|
129
|
+
"group",
|
|
130
|
+
"groupEnd",
|
|
131
|
+
"groupCollapsed"
|
|
132
|
+
] }],
|
|
133
|
+
"no-shadow": ["error", {
|
|
134
|
+
hoist: "all",
|
|
135
|
+
allow: ["name"],
|
|
136
|
+
builtinGlobals: true,
|
|
137
|
+
ignoreTypeValueShadow: false,
|
|
138
|
+
ignoreFunctionTypeParameterNameValueShadow: false
|
|
139
|
+
}],
|
|
140
|
+
"no-restricted-exports": [preferNamedExports ? "error" : "off", { restrictDefaultExports: {
|
|
141
|
+
named: true,
|
|
142
|
+
namedFrom: true,
|
|
143
|
+
defaultFrom: true,
|
|
144
|
+
namespaceFrom: true
|
|
145
|
+
} }],
|
|
146
|
+
"no-empty-function": ["error", { allow: [
|
|
147
|
+
"overrideMethods",
|
|
148
|
+
"decoratedFunctions",
|
|
149
|
+
"privateConstructors",
|
|
150
|
+
"protectedConstructors"
|
|
151
|
+
] }],
|
|
152
|
+
"no-unused-expressions": ["error", {
|
|
153
|
+
allowTernary: true,
|
|
154
|
+
enforceForJSX: true,
|
|
155
|
+
allowShortCircuit: true,
|
|
156
|
+
allowTaggedTemplates: true
|
|
157
|
+
}]
|
|
158
|
+
};
|
|
159
|
+
return javascriptRules;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
//#endregion
|
|
163
|
+
export { getJavaScriptRules };
|
|
@@ -0,0 +1,73 @@
|
|
|
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/perfectionist.ts
|
|
5
|
+
function getPerfectionistRules(options) {
|
|
6
|
+
const { env, tsConfig, configs: { stylistic, perfectionist } } = options;
|
|
7
|
+
const { maxLineLength } = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(stylistic) ? stylistic : require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.stylistic;
|
|
8
|
+
const { sortType } = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(perfectionist) ? perfectionist : require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.perfectionist;
|
|
9
|
+
const perfectionistRules = {
|
|
10
|
+
"perfectionist/sort-maps": "warn",
|
|
11
|
+
"perfectionist/sort-exports": "warn",
|
|
12
|
+
"perfectionist/sort-union-types": "warn",
|
|
13
|
+
"perfectionist/sort-array-includes": "warn",
|
|
14
|
+
"perfectionist/sort-intersection-types": "warn",
|
|
15
|
+
"perfectionist/sort-named-imports": ["warn", { groupKind: "types-first" }],
|
|
16
|
+
"perfectionist/sort-named-exports": ["warn", { groupKind: "types-first" }],
|
|
17
|
+
"perfectionist/sort-imports": ["warn", {
|
|
18
|
+
environment: env,
|
|
19
|
+
tsconfig: tsConfig || void 0,
|
|
20
|
+
sortSideEffects: true,
|
|
21
|
+
fallbackSort: {
|
|
22
|
+
order: "asc",
|
|
23
|
+
type: "natural"
|
|
24
|
+
},
|
|
25
|
+
partitionByComment: true,
|
|
26
|
+
specialCharacters: "trim",
|
|
27
|
+
type: sortType,
|
|
28
|
+
maxLineLength,
|
|
29
|
+
customGroups: [{
|
|
30
|
+
groupName: "vue-sfc",
|
|
31
|
+
elementNamePattern: ["\\.(vue|[jt]sx)$"]
|
|
32
|
+
}, {
|
|
33
|
+
groupName: "image",
|
|
34
|
+
elementNamePattern: ["\\.(ico|svg|gif|png|jpe?g|webp|avif|heic)$"]
|
|
35
|
+
}],
|
|
36
|
+
groups: [
|
|
37
|
+
["style", "side-effect-style"],
|
|
38
|
+
{ newlinesBetween: 0 },
|
|
39
|
+
"side-effect",
|
|
40
|
+
"image",
|
|
41
|
+
"vue-sfc",
|
|
42
|
+
"type-external",
|
|
43
|
+
{ newlinesBetween: 0 },
|
|
44
|
+
"type-builtin",
|
|
45
|
+
{ newlinesBetween: 0 },
|
|
46
|
+
["type-tsconfig-path", "type-subpath"],
|
|
47
|
+
{ newlinesBetween: 0 },
|
|
48
|
+
[
|
|
49
|
+
"type-internal",
|
|
50
|
+
"type-index",
|
|
51
|
+
"type-parent",
|
|
52
|
+
"type-sibling"
|
|
53
|
+
],
|
|
54
|
+
"external",
|
|
55
|
+
{ newlinesBetween: 0 },
|
|
56
|
+
"builtin",
|
|
57
|
+
["tsconfig-path", "subpath"],
|
|
58
|
+
{ newlinesBetween: 0 },
|
|
59
|
+
[
|
|
60
|
+
"internal",
|
|
61
|
+
"index",
|
|
62
|
+
"parent",
|
|
63
|
+
"sibling"
|
|
64
|
+
],
|
|
65
|
+
["import", "unknown"]
|
|
66
|
+
]
|
|
67
|
+
}]
|
|
68
|
+
};
|
|
69
|
+
return perfectionistRules;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
exports.getPerfectionistRules = getPerfectionistRules;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { isEnabled } from "../utils/isEnabled.js";
|
|
2
|
+
import { defaultOptions } from "../utils/options/defaultOptions.js";
|
|
3
|
+
|
|
4
|
+
//#region src/rules/perfectionist.ts
|
|
5
|
+
function getPerfectionistRules(options) {
|
|
6
|
+
const { env, tsConfig, configs: { stylistic, perfectionist } } = options;
|
|
7
|
+
const { maxLineLength } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
|
|
8
|
+
const { sortType } = isEnabled(perfectionist) ? perfectionist : defaultOptions.configs.perfectionist;
|
|
9
|
+
const perfectionistRules = {
|
|
10
|
+
"perfectionist/sort-maps": "warn",
|
|
11
|
+
"perfectionist/sort-exports": "warn",
|
|
12
|
+
"perfectionist/sort-union-types": "warn",
|
|
13
|
+
"perfectionist/sort-array-includes": "warn",
|
|
14
|
+
"perfectionist/sort-intersection-types": "warn",
|
|
15
|
+
"perfectionist/sort-named-imports": ["warn", { groupKind: "types-first" }],
|
|
16
|
+
"perfectionist/sort-named-exports": ["warn", { groupKind: "types-first" }],
|
|
17
|
+
"perfectionist/sort-imports": ["warn", {
|
|
18
|
+
environment: env,
|
|
19
|
+
tsconfig: tsConfig || void 0,
|
|
20
|
+
sortSideEffects: true,
|
|
21
|
+
fallbackSort: {
|
|
22
|
+
order: "asc",
|
|
23
|
+
type: "natural"
|
|
24
|
+
},
|
|
25
|
+
partitionByComment: true,
|
|
26
|
+
specialCharacters: "trim",
|
|
27
|
+
type: sortType,
|
|
28
|
+
maxLineLength,
|
|
29
|
+
customGroups: [{
|
|
30
|
+
groupName: "vue-sfc",
|
|
31
|
+
elementNamePattern: ["\\.(vue|[jt]sx)$"]
|
|
32
|
+
}, {
|
|
33
|
+
groupName: "image",
|
|
34
|
+
elementNamePattern: ["\\.(ico|svg|gif|png|jpe?g|webp|avif|heic)$"]
|
|
35
|
+
}],
|
|
36
|
+
groups: [
|
|
37
|
+
["style", "side-effect-style"],
|
|
38
|
+
{ newlinesBetween: 0 },
|
|
39
|
+
"side-effect",
|
|
40
|
+
"image",
|
|
41
|
+
"vue-sfc",
|
|
42
|
+
"type-external",
|
|
43
|
+
{ newlinesBetween: 0 },
|
|
44
|
+
"type-builtin",
|
|
45
|
+
{ newlinesBetween: 0 },
|
|
46
|
+
["type-tsconfig-path", "type-subpath"],
|
|
47
|
+
{ newlinesBetween: 0 },
|
|
48
|
+
[
|
|
49
|
+
"type-internal",
|
|
50
|
+
"type-index",
|
|
51
|
+
"type-parent",
|
|
52
|
+
"type-sibling"
|
|
53
|
+
],
|
|
54
|
+
"external",
|
|
55
|
+
{ newlinesBetween: 0 },
|
|
56
|
+
"builtin",
|
|
57
|
+
["tsconfig-path", "subpath"],
|
|
58
|
+
{ newlinesBetween: 0 },
|
|
59
|
+
[
|
|
60
|
+
"internal",
|
|
61
|
+
"index",
|
|
62
|
+
"parent",
|
|
63
|
+
"sibling"
|
|
64
|
+
],
|
|
65
|
+
["import", "unknown"]
|
|
66
|
+
]
|
|
67
|
+
}]
|
|
68
|
+
};
|
|
69
|
+
return perfectionistRules;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
export { getPerfectionistRules };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/rules/playwright.ts
|
|
3
|
+
function getPlaywrightRules(options) {
|
|
4
|
+
const { maxNestedDescribe } = options.configs.test;
|
|
5
|
+
const playwrightRules = {
|
|
6
|
+
"playwright/max-expects": "off",
|
|
7
|
+
"playwright/prefer-to-be": "warn",
|
|
8
|
+
"playwright/no-get-by-title": "error",
|
|
9
|
+
"playwright/prefer-to-contain": "warn",
|
|
10
|
+
"playwright/no-wait-for-timeout": "off",
|
|
11
|
+
"playwright/no-duplicate-hooks": "error",
|
|
12
|
+
"playwright/prefer-strict-equal": "warn",
|
|
13
|
+
"playwright/prefer-hooks-on-top": "warn",
|
|
14
|
+
"playwright/prefer-to-have-count": "warn",
|
|
15
|
+
"playwright/prefer-hooks-in-order": "warn",
|
|
16
|
+
"playwright/prefer-to-have-length": "warn",
|
|
17
|
+
"playwright/no-commented-out-tests": "error",
|
|
18
|
+
"playwright/prefer-equality-matcher": "warn",
|
|
19
|
+
"playwright/require-to-throw-message": "error",
|
|
20
|
+
"playwright/prefer-comparison-matcher": "warn",
|
|
21
|
+
"playwright/max-nested-describe": ["warn", { max: maxNestedDescribe }],
|
|
22
|
+
"playwright/prefer-lowercase-title": ["warn", { ignoreTopLevelDescribe: true }]
|
|
23
|
+
};
|
|
24
|
+
return playwrightRules;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.getPlaywrightRules = getPlaywrightRules;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/rules/playwright.ts
|
|
2
|
+
function getPlaywrightRules(options) {
|
|
3
|
+
const { maxNestedDescribe } = options.configs.test;
|
|
4
|
+
const playwrightRules = {
|
|
5
|
+
"playwright/max-expects": "off",
|
|
6
|
+
"playwright/prefer-to-be": "warn",
|
|
7
|
+
"playwright/no-get-by-title": "error",
|
|
8
|
+
"playwright/prefer-to-contain": "warn",
|
|
9
|
+
"playwright/no-wait-for-timeout": "off",
|
|
10
|
+
"playwright/no-duplicate-hooks": "error",
|
|
11
|
+
"playwright/prefer-strict-equal": "warn",
|
|
12
|
+
"playwright/prefer-hooks-on-top": "warn",
|
|
13
|
+
"playwright/prefer-to-have-count": "warn",
|
|
14
|
+
"playwright/prefer-hooks-in-order": "warn",
|
|
15
|
+
"playwright/prefer-to-have-length": "warn",
|
|
16
|
+
"playwright/no-commented-out-tests": "error",
|
|
17
|
+
"playwright/prefer-equality-matcher": "warn",
|
|
18
|
+
"playwright/require-to-throw-message": "error",
|
|
19
|
+
"playwright/prefer-comparison-matcher": "warn",
|
|
20
|
+
"playwright/max-nested-describe": ["warn", { max: maxNestedDescribe }],
|
|
21
|
+
"playwright/prefer-lowercase-title": ["warn", { ignoreTopLevelDescribe: true }]
|
|
22
|
+
};
|
|
23
|
+
return playwrightRules;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { getPlaywrightRules };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const node_path = require_rolldown_runtime.__toESM(require("node:path"));
|
|
3
|
+
|
|
4
|
+
//#region src/rules/storybook.ts
|
|
5
|
+
function getStorybookRules(options) {
|
|
6
|
+
const storybookRules = {
|
|
7
|
+
"storybook/csf-component": "error",
|
|
8
|
+
"storybook/no-stories-of": "error",
|
|
9
|
+
"storybook/meta-satisfies-type": "warn",
|
|
10
|
+
"storybook/no-uninstalled-addons": ["error", { packageJsonLocation: node_path.default.resolve(options.packageDir, "package.json") }]
|
|
11
|
+
};
|
|
12
|
+
return storybookRules;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
exports.getStorybookRules = getStorybookRules;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
|
|
3
|
+
//#region src/rules/storybook.ts
|
|
4
|
+
function getStorybookRules(options) {
|
|
5
|
+
const storybookRules = {
|
|
6
|
+
"storybook/csf-component": "error",
|
|
7
|
+
"storybook/no-stories-of": "error",
|
|
8
|
+
"storybook/meta-satisfies-type": "warn",
|
|
9
|
+
"storybook/no-uninstalled-addons": ["error", { packageJsonLocation: path.resolve(options.packageDir, "package.json") }]
|
|
10
|
+
};
|
|
11
|
+
return storybookRules;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { getStorybookRules };
|
|
@@ -0,0 +1,160 @@
|
|
|
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/stylistic.ts
|
|
5
|
+
function getStylisticRules(options) {
|
|
6
|
+
const { stylistic } = options.configs;
|
|
7
|
+
const { semi, quotes, indent, useTabs, jsxQuotes, arrowParens, trailingComma, maxLineLength, memberDelimiterStyle, maxConsecutiveEmptyLines } = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEnabled.isEnabled(stylistic) ? stylistic : require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.stylistic;
|
|
8
|
+
const stylisticRules = {
|
|
9
|
+
"@stylistic/wrap-regex": "warn",
|
|
10
|
+
"@stylistic/semi-style": "warn",
|
|
11
|
+
"@stylistic/semi": ["warn", semi],
|
|
12
|
+
"@stylistic/spaced-comment": "off",
|
|
13
|
+
"@stylistic/no-extra-semi": "warn",
|
|
14
|
+
"@stylistic/linebreak-style": "warn",
|
|
15
|
+
"@stylistic/quotes": ["warn", quotes],
|
|
16
|
+
"@stylistic/no-confusing-arrow": "warn",
|
|
17
|
+
"@stylistic/switch-colon-spacing": "warn",
|
|
18
|
+
"@stylistic/jsx-quotes": ["warn", jsxQuotes],
|
|
19
|
+
"@stylistic/type-annotation-spacing": "warn",
|
|
20
|
+
"@stylistic/no-tabs": useTabs ? "off" : "warn",
|
|
21
|
+
"@stylistic/lines-between-class-members": "off",
|
|
22
|
+
"@stylistic/arrow-parens": ["warn", arrowParens],
|
|
23
|
+
"@stylistic/comma-dangle": ["warn", trailingComma],
|
|
24
|
+
"@stylistic/object-curly-spacing": ["warn", "always"],
|
|
25
|
+
"@stylistic/nonblock-statement-body-position": "error",
|
|
26
|
+
"@stylistic/generator-star-spacing": ["warn", "after"],
|
|
27
|
+
"@stylistic/implicit-arrow-linebreak": ["error", "beside"],
|
|
28
|
+
"@stylistic/array-bracket-newline": ["warn", "consistent"],
|
|
29
|
+
"@stylistic/no-mixed-spaces-and-tabs": ["warn", "smart-tabs"],
|
|
30
|
+
"@stylistic/indent-binary-ops": ["warn", useTabs ? "tab" : indent],
|
|
31
|
+
"@stylistic/function-call-argument-newline": ["warn", "consistent"],
|
|
32
|
+
"@stylistic/brace-style": [
|
|
33
|
+
"warn",
|
|
34
|
+
"1tbs",
|
|
35
|
+
{ allowSingleLine: true }
|
|
36
|
+
],
|
|
37
|
+
"@stylistic/padded-blocks": [
|
|
38
|
+
"error",
|
|
39
|
+
"never",
|
|
40
|
+
{ allowSingleLineBlocks: true }
|
|
41
|
+
],
|
|
42
|
+
"@stylistic/object-property-newline": ["warn", { allowAllPropertiesOnSameLine: true }],
|
|
43
|
+
"@stylistic/indent": [
|
|
44
|
+
"warn",
|
|
45
|
+
useTabs ? "tab" : indent,
|
|
46
|
+
{ tabLength: indent }
|
|
47
|
+
],
|
|
48
|
+
"@stylistic/max-len": ["warn", {
|
|
49
|
+
tabWidth: indent,
|
|
50
|
+
code: maxLineLength,
|
|
51
|
+
ignoreUrls: true,
|
|
52
|
+
ignoreStrings: true,
|
|
53
|
+
ignoreComments: true,
|
|
54
|
+
ignoreRegExpLiterals: true,
|
|
55
|
+
ignoreTrailingComments: true,
|
|
56
|
+
ignoreTemplateLiterals: true
|
|
57
|
+
}],
|
|
58
|
+
"@stylistic/object-curly-newline": ["warn", {
|
|
59
|
+
multiline: true,
|
|
60
|
+
consistent: true
|
|
61
|
+
}],
|
|
62
|
+
"@stylistic/lines-around-comment": ["warn", {
|
|
63
|
+
allowTypeStart: true,
|
|
64
|
+
allowEnumStart: true,
|
|
65
|
+
allowClassStart: true,
|
|
66
|
+
allowBlockStart: true,
|
|
67
|
+
allowArrayStart: true,
|
|
68
|
+
allowModuleStart: true,
|
|
69
|
+
allowObjectStart: true,
|
|
70
|
+
allowInterfaceStart: true
|
|
71
|
+
}],
|
|
72
|
+
"@stylistic/no-multiple-empty-lines": ["warn", {
|
|
73
|
+
maxBOF: 0,
|
|
74
|
+
maxEOF: 0,
|
|
75
|
+
max: maxConsecutiveEmptyLines
|
|
76
|
+
}],
|
|
77
|
+
"@stylistic/member-delimiter-style": ["error", {
|
|
78
|
+
singleline: { delimiter: memberDelimiterStyle },
|
|
79
|
+
multiline: {
|
|
80
|
+
delimiter: memberDelimiterStyle,
|
|
81
|
+
requireLast: trailingComma !== "never"
|
|
82
|
+
}
|
|
83
|
+
}],
|
|
84
|
+
"@stylistic/operator-linebreak": [
|
|
85
|
+
"error",
|
|
86
|
+
"none",
|
|
87
|
+
{ overrides: {
|
|
88
|
+
"=": "after",
|
|
89
|
+
"?": "before",
|
|
90
|
+
":": "before",
|
|
91
|
+
"|": "before",
|
|
92
|
+
"&": "before"
|
|
93
|
+
} }
|
|
94
|
+
],
|
|
95
|
+
"@stylistic/padding-line-between-statements": [
|
|
96
|
+
"warn",
|
|
97
|
+
{
|
|
98
|
+
prev: "*",
|
|
99
|
+
next: [
|
|
100
|
+
"do",
|
|
101
|
+
"try",
|
|
102
|
+
"for",
|
|
103
|
+
"iife",
|
|
104
|
+
"with",
|
|
105
|
+
"class",
|
|
106
|
+
"block",
|
|
107
|
+
"while",
|
|
108
|
+
"throw",
|
|
109
|
+
"return",
|
|
110
|
+
"switch",
|
|
111
|
+
"export",
|
|
112
|
+
"function",
|
|
113
|
+
"directive",
|
|
114
|
+
"block-like",
|
|
115
|
+
"cjs-export",
|
|
116
|
+
"multiline-block-like"
|
|
117
|
+
],
|
|
118
|
+
blankLine: "always"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
prev: "import",
|
|
122
|
+
next: "*",
|
|
123
|
+
blankLine: "always"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
prev: "import",
|
|
127
|
+
next: "import",
|
|
128
|
+
blankLine: "any"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
prev: "export",
|
|
132
|
+
next: "export",
|
|
133
|
+
blankLine: "any"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
prev: "function-overload",
|
|
137
|
+
next: "function",
|
|
138
|
+
blankLine: "never"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
prev: [
|
|
142
|
+
"const",
|
|
143
|
+
"let",
|
|
144
|
+
"var"
|
|
145
|
+
],
|
|
146
|
+
next: "block-like",
|
|
147
|
+
blankLine: "any"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
prev: "block-like",
|
|
151
|
+
next: "*",
|
|
152
|
+
blankLine: "always"
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
};
|
|
156
|
+
return stylisticRules;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
//#endregion
|
|
160
|
+
exports.getStylisticRules = getStylisticRules;
|