@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.
Files changed (53) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +192 -183
  3. package/dist/configs/base.mjs +13 -9
  4. package/dist/configs/css.mjs +2 -2
  5. package/dist/configs/cypress.mjs +2 -2
  6. package/dist/configs/html.mjs +2 -2
  7. package/dist/configs/importX.mjs +2 -2
  8. package/dist/configs/oxlintOverrides.mjs +16 -11
  9. package/dist/configs/perfectionist.mjs +2 -2
  10. package/dist/configs/playwright.mjs +2 -2
  11. package/dist/configs/restrictedExports.mjs +1 -1
  12. package/dist/configs/storybook.mjs +2 -2
  13. package/dist/configs/stylistic.mjs +2 -2
  14. package/dist/configs/tailwind.mjs +4 -4
  15. package/dist/configs/typescript.mjs +2 -2
  16. package/dist/configs/vitest.mjs +2 -2
  17. package/dist/configs/vue.mjs +2 -2
  18. package/dist/configs/vueComponentNames.mjs +1 -1
  19. package/dist/configs/vueServerComponents.mjs +1 -1
  20. package/dist/configs/zod.mjs +21 -0
  21. package/dist/{utils → helpers}/globs.mjs +1 -1
  22. package/dist/{utils → helpers}/ignores/defaultIgnorePatterns.mjs +1 -1
  23. package/dist/{utils → helpers}/ignores/getIgnorePatterns.mjs +1 -1
  24. package/dist/{utils → helpers}/ignores/resolveGitignorePatterns.mjs +1 -1
  25. package/dist/{utils → helpers}/isPackageDetected.mjs +5 -3
  26. package/dist/{utils → helpers}/options/defaultOptions.mjs +14 -7
  27. package/dist/{utils → helpers}/options/enableDetectedConfigs.mjs +2 -3
  28. package/dist/{utils → helpers}/options/mergeWithDefaults.mjs +4 -5
  29. package/dist/{utils → helpers}/vue/getRestrictedVueElements.mjs +1 -1
  30. package/dist/{utils → helpers}/vue/getRestrictedVueInputs.mjs +1 -1
  31. package/dist/index.mjs +6 -4
  32. package/dist/oxlint.config.jsonc +209 -201
  33. package/dist/prettier.config.mjs +1 -1
  34. package/dist/rules/css.mjs +1 -1
  35. package/dist/rules/html.mjs +3 -3
  36. package/dist/rules/importX.mjs +1 -1
  37. package/dist/rules/javascript.mjs +1 -2
  38. package/dist/rules/perfectionist.mjs +2 -2
  39. package/dist/rules/stylistic.mjs +22 -10
  40. package/dist/rules/tailwind.mjs +4 -4
  41. package/dist/rules/typescript.mjs +6 -3
  42. package/dist/rules/vitest.mjs +4 -0
  43. package/dist/rules/vue.mjs +6 -6
  44. package/dist/rules/vueAccessibility.mjs +1 -1
  45. package/dist/rules/zod.mjs +20 -0
  46. package/dist/types/configOptions/base.d.mts +8 -8
  47. package/dist/types/configOptions/nuxt.d.mts +3 -3
  48. package/dist/types/configOptions/stylistic.d.mts +0 -15
  49. package/dist/types/configOptions/test.d.mts +4 -4
  50. package/dist/types/configOptions/vue.d.mts +1 -1
  51. package/dist/types/eslint-schema.d.mts +769 -270
  52. package/dist/types/index.d.mts +43 -19
  53. package/package.json +139 -123
@@ -1,203 +1,211 @@
1
1
  {
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/yoda": "error",
48
- "eslint/alert": "warn",
49
- "eslint/id-length": "off",
50
- "eslint/sort-vars": "off",
51
- "eslint/sort-keys": "off",
52
- "eslint/no-ternary": "off",
53
- "eslint/no-undefined": "off",
54
- "eslint/sort-imports": "off",
55
- "eslint/no-else-return": "off",
56
- "eslint/no-magic-numbers": "off",
57
- "eslint/arrow-body-style": "off",
58
- "eslint/func-names": ["error", "as-needed"],
59
- "eslint/no-plusplus": ["warn", { "allowForLoopAfterthoughts": true }],
60
- "eslint/no-unused-vars": ["error", { "ignoreUsingDeclarations": true }],
61
- "eslint/no-duplicate-imports": ["error", { "allowSeparateTypeImports": true }],
62
- "eslint/grouped-accessor-pairs": ["warn", "anyOrder", { "enforceForTSTypes": true }],
63
- "eslint/no-console": [
64
- "warn",
65
- {
66
- "allow": ["info", "warn", "error", "table", "group", "groupEnd", "groupCollapsed"]
67
- }
68
- ],
69
-
70
- /*** TypeScript ***/
71
- "typescript/triple-slash-reference": "off",
72
- "typescript/strict-boolean-expressions": "off",
73
- "typescript/explicit-function-return-type": "off",
74
- "typescript/explicit-module-boundary-types": "off",
75
- "typescript/consistent-indexed-object-style": ["warn", "record"],
76
-
77
- /*** Import ***/
78
- "import/extensions": "off",
79
- "import/unambiguous": "off",
80
- "import/no-namespace": "off",
81
- "import/exports-last": "off",
82
- "import/no-named-export": "off",
83
- "import/max-dependencies": "off",
84
- "import/no-default-export": "off",
85
- "import/prefer-default-export": "off",
86
- "import/no-named-as-default-member": "off",
87
- "import/no-anonymous-default-export": "off",
88
-
89
- /*** Unicorn ***/
90
- "unicorn/no-null": "off",
91
- "unicorn/filename-case": "off",
92
- "unicorn/prefer-set-has": "off",
93
- "unicorn/no-array-reduce": "off",
94
- "unicorn/prefer-string-raw": "off",
95
- "unicorn/no-array-for-each": "off",
96
- "unicorn/prefer-global-this": "off",
97
- "unicorn/no-useless-undefined": "off",
98
- "unicorn/prefer-prototype-methods": "off",
99
- "unicorn/no-await-expression-member": "off",
100
-
101
- /*** Jest ***/
102
- "jest/require-hook": "off",
103
- "jest/prefer-lowercase-title": "warn",
104
- "jest/require-top-level-describe": "off",
105
-
106
- /*** JSDoc ***/
107
- "jsdoc/require-param": "off",
108
- "jsdoc/require-returns": "off",
109
- "jsdoc/require-property": "off",
110
-
111
- /*** Vue ***/
112
- "vue/max-props": "off",
113
- "vue/no-required-prop-with-default": "off",
114
-
115
- /*** Customizable Overrides ***/
116
- /* These rules are customizable in the ESLint config, but OXLint doesn't respect them. */
117
- "eslint/max-depth": "off",
118
- "eslint/func-style": "off",
119
- "eslint/max-nested-callbacks": "off",
120
- "typescript/consistent-type-definitions": "off",
121
- "vitest/consistent-test-it": "off",
122
- "jest/max-nested-describe": "off",
123
- "vue/define-props-destructuring": "off"
124
- },
125
-
126
- "overrides": [
127
- {
128
- "files": ["**/{src,app,server}/**/*.{vue,js,mjs,cjs,jsx,ts,mts,cts,tsx}"],
129
- "rules": {
130
- "eslint/no-undef": "off"
131
- }
132
- }
133
- ],
134
-
135
- "ignorePatterns": [
136
- /* Dependencies */
137
- "**/*.min.*",
138
- "**/jspm_packages",
139
- "**/pnpm-lock.yaml",
140
- "**/bower_components",
141
- "**/package-lock.json",
142
-
143
- /* Auto-generated type definitions */
144
- "**/typegen.d.ts",
145
- "**/components.d.ts",
146
- "**/auto-import?(s).d.ts",
147
-
148
- /* Build outputs */
149
- "**/out",
150
- "**/dist",
151
- "**/build",
152
- "**/.data",
153
- "**/output",
154
- "**/.output",
155
- "**/.serverless",
156
- "**/public/build",
157
- "**/public/static",
158
- "**/.eslint-config-inspector",
159
-
160
- /* Cache */
161
- "**/tmp",
162
- "**/.tmp",
163
- "**/.npm",
164
- "**/temp",
165
- "**/.temp",
166
- "**/cache",
167
- "**/.cache",
168
- "**/deno_dir",
169
- "**/.parcel-cache",
170
- "**/*.lerna_backup",
171
- "**/.postcss-cache",
172
- "**/.vitepress/cache",
173
- "**/vite.config.*.timestamp-*",
174
-
175
- /* Frameworks and tools */
176
- "**/.nx",
177
- "**/.vite",
178
- "**/.yarn",
179
- "**/.nuxt",
180
- "**/.next",
181
- "**/.vitest",
182
- "**/.vercel",
183
- "**/.svelte-kit",
184
- "**/.vite-inspect",
185
-
186
- /* Tests */
187
- "**/coverage",
188
- "**/_fixtures",
189
- "**/.nyc_output",
190
- "**/__snapshots__",
191
-
192
- /* Development environment */
193
- "**/.idea",
194
- "**/.fleet",
195
- "**/.history",
196
-
197
- // Documentation
198
- "**/LICENSE*",
199
- "**/CHANGELOG*.md",
200
- "**/CODEOWNERS.md",
201
- "**/CODE_OF_CONDUCT.md"
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
  }
@@ -1,7 +1,7 @@
1
1
  //#region src/prettier.config.ts
2
2
  const prettierConfig = {
3
3
  semi: true,
4
- useTabs: true,
4
+ useTabs: false,
5
5
  tabWidth: 2,
6
6
  vueIndentScriptAndStyle: false,
7
7
  printWidth: 120,
@@ -1,5 +1,5 @@
1
1
  import { isEnabled } from "../utils/isEnabled.mjs";
2
- import { defaultOptions } from "../utils/options/defaultOptions.mjs";
2
+ import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
3
 
4
4
  //#region src/rules/css.ts
5
5
  const allowedPhysicalUnits = [
@@ -1,11 +1,11 @@
1
1
  import { isEnabled } from "../utils/isEnabled.mjs";
2
- import { defaultOptions } from "../utils/options/defaultOptions.mjs";
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, useTabs, maxAttributesPerLine, maxConsecutiveEmptyLines, selfCloseVoidHTMLElements } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
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", useTabs ? "tab" : indent],
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,
@@ -1,5 +1,5 @@
1
1
  import { isEnabled } from "../utils/isEnabled.mjs";
2
- import { defaultOptions } from "../utils/options/defaultOptions.mjs";
2
+ import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
3
3
  import path from "node:path";
4
4
 
5
5
  //#region src/rules/importX.ts
@@ -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 "../utils/options/defaultOptions.mjs";
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: {
@@ -1,10 +1,10 @@
1
1
  import { isEnabled } from "../utils/isEnabled.mjs";
2
- import { defaultOptions } from "../utils/options/defaultOptions.mjs";
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, useTabs, jsxQuotes, arrowParens, trailingComma, maxLineLength, maxAttributesPerLine, memberDelimiterStyle, maxConsecutiveEmptyLines } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
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
- useTabs ? "tab" : indent,
32
- { tabLength: indent }
31
+ indent,
32
+ {
33
+ tabLength: indent,
34
+ SwitchCase: 1
35
+ }
33
36
  ],
34
- "@stylistic/indent-binary-ops": ["warn", useTabs ? "tab" : indent],
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", useTabs ? "tab" : indent],
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": useTabs ? "off" : "warn",
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
- "const",
176
+ "var",
171
177
  "let",
172
- "var"
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"],
@@ -1,17 +1,17 @@
1
1
  import { isEnabled } from "../utils/isEnabled.mjs";
2
- import { defaultOptions } from "../utils/options/defaultOptions.mjs";
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, useTabs, maxLineLength } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
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 "../utils/options/defaultOptions.mjs";
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",