@shayanthenerd/eslint-config 0.13.1 → 0.15.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 +1 -1
- package/README.md +192 -183
- package/dist/configs/base.mjs +13 -9
- package/dist/configs/css.mjs +2 -2
- package/dist/configs/cypress.mjs +2 -2
- package/dist/configs/html.mjs +2 -2
- package/dist/configs/importX.mjs +2 -2
- package/dist/configs/oxlintOverrides.mjs +16 -11
- package/dist/configs/perfectionist.mjs +2 -2
- package/dist/configs/playwright.mjs +2 -2
- package/dist/configs/restrictedExports.mjs +1 -1
- package/dist/configs/storybook.mjs +2 -2
- package/dist/configs/stylistic.mjs +2 -2
- package/dist/configs/tailwind.mjs +4 -4
- package/dist/configs/typescript.mjs +2 -2
- package/dist/configs/vitest.mjs +2 -2
- package/dist/configs/vue.mjs +2 -2
- package/dist/configs/vueComponentNames.mjs +1 -1
- package/dist/configs/vueServerComponents.mjs +1 -1
- package/dist/configs/zod.mjs +21 -0
- package/dist/{utils → helpers}/globs.mjs +1 -1
- package/dist/{utils → helpers}/ignores/defaultIgnorePatterns.mjs +1 -1
- package/dist/{utils → helpers}/ignores/getIgnorePatterns.mjs +1 -1
- package/dist/{utils → helpers}/ignores/resolveGitignorePatterns.mjs +1 -1
- package/dist/{utils → helpers}/isPackageDetected.mjs +5 -3
- package/dist/{utils → helpers}/options/defaultOptions.mjs +14 -7
- package/dist/{utils → helpers}/options/enableDetectedConfigs.mjs +2 -3
- package/dist/{utils → helpers}/options/mergeWithDefaults.mjs +4 -5
- package/dist/{utils → helpers}/vue/getRestrictedVueElements.mjs +1 -1
- package/dist/{utils → helpers}/vue/getRestrictedVueInputs.mjs +1 -1
- package/dist/index.mjs +6 -4
- package/dist/oxlint.config.jsonc +209 -201
- package/dist/prettier.config.mjs +1 -1
- package/dist/rules/css.mjs +1 -1
- package/dist/rules/html.mjs +3 -3
- package/dist/rules/importX.mjs +1 -1
- package/dist/rules/javascript.mjs +1 -2
- package/dist/rules/perfectionist.mjs +2 -2
- package/dist/rules/stylistic.mjs +22 -10
- package/dist/rules/tailwind.mjs +4 -4
- package/dist/rules/typescript.mjs +6 -3
- package/dist/rules/vitest.mjs +4 -0
- package/dist/rules/vue.mjs +6 -6
- package/dist/rules/vueAccessibility.mjs +1 -1
- package/dist/rules/zod.mjs +20 -0
- package/dist/types/configOptions/base.d.mts +8 -8
- package/dist/types/configOptions/nuxt.d.mts +3 -3
- package/dist/types/configOptions/stylistic.d.mts +0 -15
- package/dist/types/configOptions/test.d.mts +4 -4
- package/dist/types/configOptions/vue.d.mts +1 -1
- package/dist/types/eslint-schema.d.mts +769 -270
- package/dist/types/index.d.mts +43 -19
- package/package.json +139 -123
package/dist/oxlint.config.jsonc
CHANGED
|
@@ -1,203 +1,211 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
2
|
+
"$schema": "../node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
|
|
4
|
+
"env": {
|
|
5
|
+
"builtin": true,
|
|
6
|
+
"es2026": true,
|
|
7
|
+
"commonjs": false,
|
|
8
|
+
"node": true,
|
|
9
|
+
"browser": true,
|
|
10
|
+
"worker": true,
|
|
11
|
+
"serviceworker": false,
|
|
12
|
+
"webextensions": false
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
"categories": {
|
|
16
|
+
"correctness": "error",
|
|
17
|
+
"suspicious": "error",
|
|
18
|
+
"restriction": "error",
|
|
19
|
+
"pedantic": "error",
|
|
20
|
+
"perf": "warn",
|
|
21
|
+
"style": "warn",
|
|
22
|
+
"nursery": "error"
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
"plugins": [
|
|
26
|
+
"oxc",
|
|
27
|
+
"vue",
|
|
28
|
+
"node",
|
|
29
|
+
"jest",
|
|
30
|
+
"jsdoc",
|
|
31
|
+
"eslint",
|
|
32
|
+
"import",
|
|
33
|
+
"vitest",
|
|
34
|
+
"promise",
|
|
35
|
+
"unicorn",
|
|
36
|
+
"jsx-a11y",
|
|
37
|
+
"typescript"
|
|
38
|
+
],
|
|
39
|
+
|
|
40
|
+
"rules": {
|
|
41
|
+
/*** OXC ***/
|
|
42
|
+
"oxc/no-async-await": "off",
|
|
43
|
+
"oxc/no-optional-chaining": "off",
|
|
44
|
+
"oxc/no-rest-spread-properties": "off",
|
|
45
|
+
|
|
46
|
+
/*** ESLint ***/
|
|
47
|
+
"eslint/alert": "warn",
|
|
48
|
+
"eslint/arrow-body-style": "off",
|
|
49
|
+
"eslint/capitalized-comments": "off",
|
|
50
|
+
"eslint/func-names": ["error", "as-needed"],
|
|
51
|
+
"eslint/grouped-accessor-pairs": ["warn", "anyOrder", { "enforceForTSTypes": true }],
|
|
52
|
+
"eslint/id-length": "off",
|
|
53
|
+
"eslint/max-statements": "off",
|
|
54
|
+
"eslint/no-console": [
|
|
55
|
+
"warn",
|
|
56
|
+
{
|
|
57
|
+
"allow": ["info", "warn", "error", "table", "group", "groupEnd", "groupCollapsed"]
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"eslint/no-continue": "off",
|
|
61
|
+
"eslint/no-duplicate-imports": ["error", { "allowSeparateTypeImports": true }],
|
|
62
|
+
"eslint/no-else-return": "off",
|
|
63
|
+
"eslint/no-inline-comments": "off",
|
|
64
|
+
"eslint/no-magic-numbers": "off",
|
|
65
|
+
"eslint/no-plusplus": ["warn", { "allowForLoopAfterthoughts": true }],
|
|
66
|
+
"eslint/no-sequences": ["error", { "allowInParentheses": false }],
|
|
67
|
+
"eslint/no-ternary": "off",
|
|
68
|
+
"eslint/no-undefined": "off",
|
|
69
|
+
"eslint/no-unused-vars": ["error", { "ignoreUsingDeclarations": true }],
|
|
70
|
+
"eslint/prefer-destructuring": ["warn", { "array": false }],
|
|
71
|
+
"eslint/sort-imports": "off",
|
|
72
|
+
"eslint/sort-keys": "off",
|
|
73
|
+
"eslint/sort-vars": "off",
|
|
74
|
+
"eslint/yoda": "error",
|
|
75
|
+
"no-sequences": ["error", { "allowInParentheses": false }],
|
|
76
|
+
|
|
77
|
+
/*** TypeScript ***/
|
|
78
|
+
"typescript/consistent-indexed-object-style": ["warn", "record"],
|
|
79
|
+
"typescript/explicit-function-return-type": "off",
|
|
80
|
+
"typescript/explicit-module-boundary-types": "off",
|
|
81
|
+
"typescript/strict-boolean-expressions": "off",
|
|
82
|
+
"typescript/triple-slash-reference": "off",
|
|
83
|
+
|
|
84
|
+
/*** Import ***/
|
|
85
|
+
"import/extensions": "off",
|
|
86
|
+
"import/exports-last": "off",
|
|
87
|
+
"import/max-dependencies": "off",
|
|
88
|
+
"import/no-anonymous-default-export": "off",
|
|
89
|
+
"import/no-default-export": "off",
|
|
90
|
+
"import/no-named-as-default-member": "off",
|
|
91
|
+
"import/no-named-export": "off",
|
|
92
|
+
"import/no-namespace": "off",
|
|
93
|
+
"import/prefer-default-export": "off",
|
|
94
|
+
"import/unambiguous": "off",
|
|
95
|
+
|
|
96
|
+
/*** Unicorn ***/
|
|
97
|
+
"unicorn/filename-case": "off",
|
|
98
|
+
"unicorn/no-array-for-each": "off",
|
|
99
|
+
"unicorn/no-array-reduce": "off",
|
|
100
|
+
"unicorn/no-await-expression-member": "off",
|
|
101
|
+
"unicorn/no-immediate-mutation": "warn",
|
|
102
|
+
"unicorn/no-null": "off",
|
|
103
|
+
"unicorn/no-useless-undefined": "off",
|
|
104
|
+
"unicorn/prefer-global-this": "off",
|
|
105
|
+
"unicorn/prefer-prototype-methods": "off",
|
|
106
|
+
"unicorn/prefer-set-has": "off",
|
|
107
|
+
"unicorn/prefer-string-raw": "off",
|
|
108
|
+
|
|
109
|
+
/*** Jest ***/
|
|
110
|
+
"jest/prefer-lowercase-title": "warn",
|
|
111
|
+
"jest/require-hook": "off",
|
|
112
|
+
"jest/require-top-level-describe": "off",
|
|
113
|
+
|
|
114
|
+
/*** JSDoc ***/
|
|
115
|
+
"jsdoc/require-param": "off",
|
|
116
|
+
"jsdoc/require-property": "off",
|
|
117
|
+
"jsdoc/require-returns": "off",
|
|
118
|
+
|
|
119
|
+
/*** Vue ***/
|
|
120
|
+
"vue/max-props": "off",
|
|
121
|
+
"vue/no-required-prop-with-default": "off",
|
|
122
|
+
|
|
123
|
+
/*** Customizable Overrides ***/
|
|
124
|
+
/* These rules are customizable in the ESLint config, but the customizations aren't reflected here. */
|
|
125
|
+
"eslint/func-style": "off",
|
|
126
|
+
"eslint/max-depth": "off",
|
|
127
|
+
"eslint/max-nested-callbacks": "off",
|
|
128
|
+
"typescript/consistent-type-definitions": "off",
|
|
129
|
+
"vitest/consistent-test-it": "off",
|
|
130
|
+
"jest/max-nested-describe": "off",
|
|
131
|
+
"vue/define-props-destructuring": "off"
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
"overrides": [
|
|
135
|
+
{
|
|
136
|
+
"files": ["**/{src,app,server}/**/*.{vue,js,mjs,cjs,jsx,ts,mts,cts,tsx}"],
|
|
137
|
+
"rules": {
|
|
138
|
+
"eslint/no-undef": "off"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
|
|
143
|
+
"ignorePatterns": [
|
|
144
|
+
/* Dependencies */
|
|
145
|
+
"**/*.min.*",
|
|
146
|
+
"**/jspm_packages",
|
|
147
|
+
"**/pnpm-lock.yaml",
|
|
148
|
+
"**/bower_components",
|
|
149
|
+
"**/package-lock.json",
|
|
150
|
+
|
|
151
|
+
/* Auto-generated type definitions */
|
|
152
|
+
"**/typegen.d.ts",
|
|
153
|
+
"**/components.d.ts",
|
|
154
|
+
"**/auto-import?(s).d.ts",
|
|
155
|
+
|
|
156
|
+
/* Build outputs */
|
|
157
|
+
"**/out",
|
|
158
|
+
"**/dist",
|
|
159
|
+
"**/build",
|
|
160
|
+
"**/.data",
|
|
161
|
+
"**/output",
|
|
162
|
+
"**/.output",
|
|
163
|
+
"**/.serverless",
|
|
164
|
+
"**/public/build",
|
|
165
|
+
"**/public/static",
|
|
166
|
+
"**/.eslint-config-inspector",
|
|
167
|
+
|
|
168
|
+
/* Cache */
|
|
169
|
+
"**/tmp",
|
|
170
|
+
"**/.tmp",
|
|
171
|
+
"**/.npm",
|
|
172
|
+
"**/temp",
|
|
173
|
+
"**/.temp",
|
|
174
|
+
"**/cache",
|
|
175
|
+
"**/.cache",
|
|
176
|
+
"**/deno_dir",
|
|
177
|
+
"**/.parcel-cache",
|
|
178
|
+
"**/*.lerna_backup",
|
|
179
|
+
"**/.postcss-cache",
|
|
180
|
+
"**/.vitepress/cache",
|
|
181
|
+
"**/vite.config.*.timestamp-*",
|
|
182
|
+
|
|
183
|
+
/* Frameworks and tools */
|
|
184
|
+
"**/.nx",
|
|
185
|
+
"**/.vite",
|
|
186
|
+
"**/.yarn",
|
|
187
|
+
"**/.nuxt",
|
|
188
|
+
"**/.next",
|
|
189
|
+
"**/.vitest",
|
|
190
|
+
"**/.vercel",
|
|
191
|
+
"**/.svelte-kit",
|
|
192
|
+
"**/.vite-inspect",
|
|
193
|
+
|
|
194
|
+
/* Tests */
|
|
195
|
+
"**/coverage",
|
|
196
|
+
"**/_fixtures",
|
|
197
|
+
"**/.nyc_output",
|
|
198
|
+
"**/__snapshots__",
|
|
199
|
+
|
|
200
|
+
/* Development environment */
|
|
201
|
+
"**/.idea",
|
|
202
|
+
"**/.fleet",
|
|
203
|
+
"**/.history",
|
|
204
|
+
|
|
205
|
+
// Documentation
|
|
206
|
+
"**/LICENSE*",
|
|
207
|
+
"**/CHANGELOG*.md",
|
|
208
|
+
"**/CODEOWNERS.md",
|
|
209
|
+
"**/CODE_OF_CONDUCT.md"
|
|
210
|
+
]
|
|
203
211
|
}
|
package/dist/prettier.config.mjs
CHANGED
package/dist/rules/css.mjs
CHANGED
package/dist/rules/html.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
2
|
-
import { defaultOptions } from "../
|
|
2
|
+
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/rules/html.ts
|
|
5
5
|
function getHTMLRules(options) {
|
|
6
6
|
const { html, tailwind, stylistic } = options.configs;
|
|
7
7
|
const { useBaseline, idNamingConvention } = isEnabled(html) ? html : defaultOptions.configs.html;
|
|
8
|
-
const { indent,
|
|
8
|
+
const { indent, maxAttributesPerLine, maxConsecutiveEmptyLines, selfCloseVoidHTMLElements } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
|
|
9
9
|
const htmlRules = {
|
|
10
10
|
"@html-eslint/no-duplicate-attrs": "error",
|
|
11
11
|
"@html-eslint/no-duplicate-class": "warn",
|
|
@@ -51,7 +51,7 @@ function getHTMLRules(options) {
|
|
|
51
51
|
"@html-eslint/attrs-newline": ["warn", { ifAttrsMoreThan: maxAttributesPerLine }],
|
|
52
52
|
"@html-eslint/element-newline": ["warn", { inline: ["$inline"] }],
|
|
53
53
|
"@html-eslint/id-naming-convention": ["warn", idNamingConvention],
|
|
54
|
-
"@html-eslint/indent": ["warn",
|
|
54
|
+
"@html-eslint/indent": ["warn", indent],
|
|
55
55
|
"@html-eslint/lowercase": "warn",
|
|
56
56
|
"@html-eslint/no-extra-spacing-attrs": ["warn", {
|
|
57
57
|
disallowTabs: true,
|
package/dist/rules/importX.mjs
CHANGED
|
@@ -100,7 +100,6 @@ function getJavaScriptRules(options) {
|
|
|
100
100
|
"groupEnd",
|
|
101
101
|
"groupCollapsed"
|
|
102
102
|
] }],
|
|
103
|
-
"no-continue": "warn",
|
|
104
103
|
"no-empty": "warn",
|
|
105
104
|
"no-empty-function": ["error", { allow: [
|
|
106
105
|
"overrideMethods",
|
|
@@ -193,7 +192,7 @@ function getJavaScriptRules(options) {
|
|
|
193
192
|
"operator-assignment": "error",
|
|
194
193
|
"prefer-arrow-callback": ["warn", { allowUnboundThis: true }],
|
|
195
194
|
"prefer-const": "error",
|
|
196
|
-
"prefer-destructuring": "warn",
|
|
195
|
+
"prefer-destructuring": ["warn", { array: false }],
|
|
197
196
|
"prefer-exponentiation-operator": "warn",
|
|
198
197
|
"prefer-named-capture-group": "warn",
|
|
199
198
|
"prefer-numeric-literals": "warn",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
2
|
-
import { defaultOptions } from "../
|
|
2
|
+
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/rules/perfectionist.ts
|
|
5
5
|
function getPerfectionistRules(options) {
|
|
@@ -15,7 +15,7 @@ function getPerfectionistRules(options) {
|
|
|
15
15
|
"perfectionist/sort-named-imports": "warn",
|
|
16
16
|
"perfectionist/sort-named-exports": "warn",
|
|
17
17
|
"perfectionist/sort-imports": ["warn", {
|
|
18
|
-
environment: env,
|
|
18
|
+
environment: env === "bun" ? "bun" : "node",
|
|
19
19
|
tsconfig: tsConfig || void 0,
|
|
20
20
|
sortSideEffects: true,
|
|
21
21
|
fallbackSort: {
|
package/dist/rules/stylistic.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
2
|
-
import { defaultOptions } from "../
|
|
2
|
+
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/rules/stylistic.ts
|
|
5
5
|
function getStylisticRules(options) {
|
|
6
6
|
const { stylistic } = options.configs;
|
|
7
|
-
const { semi, quotes, indent,
|
|
7
|
+
const { semi, quotes, indent, jsxQuotes, arrowParens, trailingComma, maxLineLength, maxAttributesPerLine, memberDelimiterStyle, maxConsecutiveEmptyLines } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
|
|
8
8
|
return {
|
|
9
9
|
"@stylistic/array-bracket-newline": ["warn", "consistent"],
|
|
10
10
|
"@stylistic/array-bracket-spacing": "warn",
|
|
@@ -28,10 +28,13 @@ function getStylisticRules(options) {
|
|
|
28
28
|
"@stylistic/implicit-arrow-linebreak": ["warn", "beside"],
|
|
29
29
|
"@stylistic/indent": [
|
|
30
30
|
"warn",
|
|
31
|
-
|
|
32
|
-
{
|
|
31
|
+
indent,
|
|
32
|
+
{
|
|
33
|
+
tabLength: indent,
|
|
34
|
+
SwitchCase: 1
|
|
35
|
+
}
|
|
33
36
|
],
|
|
34
|
-
"@stylistic/indent-binary-ops": ["warn",
|
|
37
|
+
"@stylistic/indent-binary-ops": ["warn", indent],
|
|
35
38
|
"@stylistic/jsx-closing-bracket-location": "warn",
|
|
36
39
|
"@stylistic/jsx-closing-tag-location": "warn",
|
|
37
40
|
"@stylistic/jsx-curly-brace-presence": "warn",
|
|
@@ -40,7 +43,7 @@ function getStylisticRules(options) {
|
|
|
40
43
|
"@stylistic/jsx-equals-spacing": "warn",
|
|
41
44
|
"@stylistic/jsx-first-prop-new-line": "warn",
|
|
42
45
|
"@stylistic/jsx-function-call-newline": "warn",
|
|
43
|
-
"@stylistic/jsx-indent-props": ["warn",
|
|
46
|
+
"@stylistic/jsx-indent-props": ["warn", indent],
|
|
44
47
|
"@stylistic/jsx-max-props-per-line": ["warn", { maximum: {
|
|
45
48
|
multi: 1,
|
|
46
49
|
single: maxAttributesPerLine
|
|
@@ -60,7 +63,10 @@ function getStylisticRules(options) {
|
|
|
60
63
|
allowArrayStart: true,
|
|
61
64
|
allowModuleStart: true,
|
|
62
65
|
allowObjectStart: true,
|
|
63
|
-
allowInterfaceStart: true
|
|
66
|
+
allowInterfaceStart: true,
|
|
67
|
+
afterHashbangComment: true,
|
|
68
|
+
applyDefaultIgnorePatterns: false,
|
|
69
|
+
ignorePattern: "@ts|eslint|oxlint"
|
|
64
70
|
}],
|
|
65
71
|
"@stylistic/max-len": ["warn", {
|
|
66
72
|
tabWidth: indent,
|
|
@@ -93,7 +99,7 @@ function getStylisticRules(options) {
|
|
|
93
99
|
maxEOF: 0,
|
|
94
100
|
max: maxConsecutiveEmptyLines
|
|
95
101
|
}],
|
|
96
|
-
"@stylistic/no-tabs":
|
|
102
|
+
"@stylistic/no-tabs": "warn",
|
|
97
103
|
"@stylistic/no-trailing-spaces": "warn",
|
|
98
104
|
"@stylistic/no-whitespace-before-property": "warn",
|
|
99
105
|
"@stylistic/nonblock-statement-body-position": "warn",
|
|
@@ -167,9 +173,10 @@ function getStylisticRules(options) {
|
|
|
167
173
|
},
|
|
168
174
|
{
|
|
169
175
|
prev: [
|
|
170
|
-
"
|
|
176
|
+
"var",
|
|
171
177
|
"let",
|
|
172
|
-
"
|
|
178
|
+
"const",
|
|
179
|
+
"using"
|
|
173
180
|
],
|
|
174
181
|
next: "block-like",
|
|
175
182
|
blankLine: "any"
|
|
@@ -178,6 +185,11 @@ function getStylisticRules(options) {
|
|
|
178
185
|
prev: "block-like",
|
|
179
186
|
next: "*",
|
|
180
187
|
blankLine: "always"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
prev: ["case", "default"],
|
|
191
|
+
next: ["case", "default"],
|
|
192
|
+
blankLine: "any"
|
|
181
193
|
}
|
|
182
194
|
],
|
|
183
195
|
"@stylistic/quote-props": ["warn", "consistent-as-needed"],
|
package/dist/rules/tailwind.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
2
|
-
import { defaultOptions } from "../
|
|
2
|
+
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/rules/tailwind.ts
|
|
5
5
|
function getTailwindRules(options) {
|
|
6
6
|
const { tailwind, stylistic } = options.configs;
|
|
7
7
|
const { multilineSort, ignoredUnregisteredClasses: userIgnoredUnregisteredClasses } = isEnabled(tailwind) ? tailwind : defaultOptions.configs.tailwind;
|
|
8
|
-
const { indent,
|
|
8
|
+
const { indent, maxLineLength } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
|
|
9
9
|
const isTailwindV4 = isEnabled(tailwind) && tailwind.entryPoint;
|
|
10
10
|
const tailwindRules = {
|
|
11
11
|
"better-tailwindcss/enforce-consistent-line-wrapping": [multilineSort ? "warn" : "off", {
|
|
12
|
+
indent,
|
|
12
13
|
preferSingleLine: true,
|
|
13
|
-
printWidth: maxLineLength
|
|
14
|
-
indent: useTabs ? "tab" : indent
|
|
14
|
+
printWidth: maxLineLength
|
|
15
15
|
}],
|
|
16
16
|
"better-tailwindcss/enforce-consistent-class-order": "warn",
|
|
17
17
|
"better-tailwindcss/enforce-consistent-variable-syntax": "warn",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
2
|
-
import { defaultOptions } from "../
|
|
2
|
+
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/rules/typescript.ts
|
|
5
5
|
function getTypeScriptRules(options) {
|
|
@@ -126,14 +126,17 @@ function getTypeScriptRules(options) {
|
|
|
126
126
|
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
|
|
127
127
|
"@typescript-eslint/no-loop-func": "error",
|
|
128
128
|
"@typescript-eslint/default-param-last": "warn",
|
|
129
|
-
"@typescript-eslint/prefer-destructuring": "warn",
|
|
129
|
+
"@typescript-eslint/prefer-destructuring": ["warn", { array: false }],
|
|
130
130
|
"@typescript-eslint/promise-function-async": "error",
|
|
131
131
|
"@typescript-eslint/consistent-type-imports": "warn",
|
|
132
132
|
"@typescript-eslint/no-useless-empty-export": "error",
|
|
133
133
|
"@typescript-eslint/no-unsafe-type-assertion": "warn",
|
|
134
134
|
"@typescript-eslint/prefer-enum-initializers": "error",
|
|
135
135
|
"@typescript-eslint/no-unnecessary-qualifier": "warn",
|
|
136
|
-
"@typescript-eslint/switch-exhaustiveness-check": "warn",
|
|
136
|
+
"@typescript-eslint/switch-exhaustiveness-check": ["warn", {
|
|
137
|
+
requireDefaultForNonUnion: true,
|
|
138
|
+
considerDefaultExhaustiveForUnions: true
|
|
139
|
+
}],
|
|
137
140
|
"@typescript-eslint/explicit-module-boundary-types": "warn",
|
|
138
141
|
"@typescript-eslint/no-unused-private-class-members": "error",
|
|
139
142
|
"@typescript-eslint/no-unnecessary-parameter-property-assignment": "warn",
|