@zhangyu1818/oxlint-config 2.1.0 → 2.2.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/dist/index.js CHANGED
@@ -1,1030 +1,867 @@
1
- // src/oxlint/index.ts
2
- import { isPackageExists as isPackageExists2 } from "local-pkg";
3
-
4
- // src/shared/ignore-patterns.ts
5
- var defaultIgnorePatterns = [
6
- "**/node_modules",
7
- "**/dist",
8
- "**/package-lock.json",
9
- "**/yarn.lock",
10
- "**/pnpm-lock.yaml",
11
- "**/bun.lockb",
12
- "**/output",
13
- "**/coverage",
14
- "**/temp",
15
- "**/.temp",
16
- "**/tmp",
17
- "**/.tmp",
18
- "**/.history",
19
- "**/.vitepress/cache",
20
- "**/.nuxt",
21
- "**/.next",
22
- "**/.vercel",
23
- "**/.changeset",
24
- "**/.idea",
25
- "**/.cache",
26
- "**/.output",
27
- "**/.vite-inspect",
28
- "**/.yarn",
29
- "**/CHANGELOG*.md",
30
- "**/*.min.*",
31
- "**/LICENSE*",
32
- "**/__snapshots__",
33
- "**/auto-import.d.ts",
34
- "**/auto-imports.d.ts",
35
- "**/components.d.ts",
36
- "tests/fixtures/**"
1
+ import { isPackageExists } from "local-pkg";
2
+ import { existsSync } from "node:fs";
3
+ import { fileURLToPath } from "node:url";
4
+ //#region src/shared/ignore-patterns.ts
5
+ const defaultIgnorePatterns = [
6
+ "**/node_modules",
7
+ "**/dist",
8
+ "**/package-lock.json",
9
+ "**/yarn.lock",
10
+ "**/pnpm-lock.yaml",
11
+ "**/bun.lockb",
12
+ "**/output",
13
+ "**/coverage",
14
+ "**/temp",
15
+ "**/.temp",
16
+ "**/tmp",
17
+ "**/.tmp",
18
+ ".tmp-*",
19
+ "**/.history",
20
+ "**/.vitepress/cache",
21
+ "**/.nuxt",
22
+ "**/.next",
23
+ "**/.vercel",
24
+ "**/.changeset",
25
+ "**/.idea",
26
+ "**/.cache",
27
+ "**/.output",
28
+ "**/.vite-inspect",
29
+ "**/.yarn",
30
+ "**/CHANGELOG*.md",
31
+ "**/*.min.*",
32
+ "**/LICENSE*",
33
+ "**/__snapshots__",
34
+ "**/auto-import.d.ts",
35
+ "**/auto-imports.d.ts",
36
+ "**/components.d.ts",
37
+ "tests/fixtures/**"
37
38
  ];
38
-
39
- // src/oxlint/presets/imports.ts
40
- var importRules = {
41
- "import/first": "error",
42
- "import/no-duplicates": ["error", { "prefer-inline": true }],
43
- "import/no-mutable-exports": "error",
44
- "import/no-named-default": "error",
45
- "import/no-self-import": "error",
46
- "import/no-webpack-loader-syntax": "error"
39
+ //#endregion
40
+ //#region src/oxlint/presets/imports.ts
41
+ const importRules = {
42
+ "import/first": "error",
43
+ "import/no-duplicates": ["error", { "prefer-inline": true }],
44
+ "import/no-mutable-exports": "error",
45
+ "import/no-named-default": "error",
46
+ "import/no-self-import": "error",
47
+ "import/no-webpack-loader-syntax": "error"
47
48
  };
48
-
49
- // src/oxlint/presets/javascript.ts
50
- var javascriptRules = {
51
- "accessor-pairs": [
52
- "error",
53
- {
54
- enforceForClassMembers: true,
55
- setWithoutGet: true
56
- }
57
- ],
58
- "array-callback-return": "error",
59
- "block-scoped-var": "error",
60
- "constructor-super": "error",
61
- "default-case-last": "error",
62
- eqeqeq: ["error", "smart"],
63
- "new-cap": [
64
- "error",
65
- {
66
- capIsNew: false,
67
- newIsCap: true,
68
- properties: true
69
- }
70
- ],
71
- "no-alert": "error",
72
- "no-array-constructor": "error",
73
- "no-async-promise-executor": "error",
74
- "no-caller": "error",
75
- "no-case-declarations": "error",
76
- "no-class-assign": "error",
77
- "no-compare-neg-zero": "error",
78
- "no-cond-assign": ["error", "always"],
79
- "no-console": [
80
- "error",
81
- {
82
- allow: ["warn", "error"]
83
- }
84
- ],
85
- "no-const-assign": "error",
86
- "no-control-regex": "error",
87
- "no-debugger": "error",
88
- "no-delete-var": "error",
89
- "no-dupe-class-members": "error",
90
- "no-dupe-keys": "error",
91
- "no-duplicate-case": "error",
92
- "no-empty": ["error", { allowEmptyCatch: true }],
93
- "no-empty-character-class": "error",
94
- "no-empty-pattern": "error",
95
- "no-eval": "error",
96
- "no-ex-assign": "error",
97
- "no-extend-native": "error",
98
- "no-extra-bind": "error",
99
- "no-extra-boolean-cast": "error",
100
- "no-fallthrough": "error",
101
- "no-func-assign": "error",
102
- "no-global-assign": "error",
103
- "no-import-assign": "error",
104
- "no-invalid-regexp": "error",
105
- "no-irregular-whitespace": "error",
106
- "no-iterator": "error",
107
- "no-labels": ["error", { allowLoop: false, allowSwitch: false }],
108
- "no-lone-blocks": "error",
109
- "no-loss-of-precision": "error",
110
- "no-misleading-character-class": "error",
111
- "no-multi-str": "error",
112
- "no-new": "error",
113
- "no-new-func": "error",
114
- "no-new-native-nonconstructor": "error",
115
- "no-new-wrappers": "error",
116
- "no-obj-calls": "error",
117
- "no-proto": "error",
118
- "no-prototype-builtins": "error",
119
- "no-redeclare": ["error", { builtinGlobals: false }],
120
- "no-regex-spaces": "error",
121
- "no-restricted-globals": [
122
- "error",
123
- {
124
- message: "Use `globalThis` instead.",
125
- name: "global"
126
- },
127
- {
128
- message: "Use `globalThis` instead.",
129
- name: "self"
130
- }
131
- ],
132
- "no-self-assign": ["error", { props: true }],
133
- "no-self-compare": "error",
134
- "no-sequences": "error",
135
- "no-shadow-restricted-names": "error",
136
- "no-sparse-arrays": "error",
137
- "no-template-curly-in-string": "error",
138
- "no-this-before-super": "error",
139
- "no-throw-literal": "error",
140
- "no-undef": "error",
141
- "no-unmodified-loop-condition": "error",
142
- "no-unneeded-ternary": ["error", { defaultAssignment: false }],
143
- "no-unreachable": "error",
144
- "no-unsafe-finally": "error",
145
- "no-unsafe-negation": "error",
146
- "no-unused-expressions": [
147
- "error",
148
- {
149
- allowTaggedTemplates: true,
150
- allowTernary: true
151
- }
152
- ],
153
- "no-unused-vars": [
154
- "error",
155
- {
156
- args: "none",
157
- caughtErrors: "none",
158
- vars: "all"
159
- }
160
- ],
161
- "no-use-before-define": [
162
- "error",
163
- {
164
- classes: false,
165
- functions: false,
166
- variables: true
167
- }
168
- ],
169
- "no-useless-backreference": "error",
170
- "no-useless-call": "error",
171
- "no-useless-catch": "error",
172
- "no-useless-computed-key": "error",
173
- "no-useless-constructor": "error",
174
- "no-useless-rename": "error",
175
- "no-useless-return": "error",
176
- "no-var": "error",
177
- "no-with": "error",
178
- "object-shorthand": [
179
- "error",
180
- "always",
181
- {
182
- avoidExplicitReturnArrows: true,
183
- avoidQuotes: true
184
- }
185
- ],
186
- "prefer-const": ["error", { destructuring: "all" }],
187
- "prefer-exponentiation-operator": "error",
188
- "prefer-promise-reject-errors": "error",
189
- "prefer-rest-params": "error",
190
- "prefer-spread": "error",
191
- "prefer-template": "error",
192
- "symbol-description": "error",
193
- "unicode-bom": ["error", "never"],
194
- "use-isnan": [
195
- "error",
196
- {
197
- enforceForIndexOf: true,
198
- enforceForSwitchCase: true
199
- }
200
- ],
201
- "valid-typeof": ["error", { requireStringLiterals: true }],
202
- "vars-on-top": "error",
203
- yoda: ["error", "never"]
49
+ //#endregion
50
+ //#region src/oxlint/presets/javascript.ts
51
+ const javascriptRules = {
52
+ "accessor-pairs": ["error", {
53
+ enforceForClassMembers: true,
54
+ setWithoutGet: true
55
+ }],
56
+ "array-callback-return": "error",
57
+ "block-scoped-var": "error",
58
+ "constructor-super": "error",
59
+ "default-case-last": "error",
60
+ eqeqeq: ["error", "smart"],
61
+ "new-cap": ["error", {
62
+ capIsNew: false,
63
+ newIsCap: true,
64
+ properties: true
65
+ }],
66
+ "no-alert": "error",
67
+ "no-array-constructor": "error",
68
+ "no-async-promise-executor": "error",
69
+ "no-caller": "error",
70
+ "no-case-declarations": "error",
71
+ "no-class-assign": "error",
72
+ "no-compare-neg-zero": "error",
73
+ "no-cond-assign": ["error", "always"],
74
+ "no-console": ["error", { allow: ["warn", "error"] }],
75
+ "no-const-assign": "error",
76
+ "no-control-regex": "error",
77
+ "no-debugger": "error",
78
+ "no-delete-var": "error",
79
+ "no-dupe-class-members": "error",
80
+ "no-dupe-keys": "error",
81
+ "no-duplicate-case": "error",
82
+ "no-empty": ["error", { allowEmptyCatch: true }],
83
+ "no-empty-character-class": "error",
84
+ "no-empty-pattern": "error",
85
+ "no-eval": "error",
86
+ "no-ex-assign": "error",
87
+ "no-extend-native": "error",
88
+ "no-extra-bind": "error",
89
+ "no-extra-boolean-cast": "error",
90
+ "no-fallthrough": "error",
91
+ "no-func-assign": "error",
92
+ "no-global-assign": "error",
93
+ "no-import-assign": "error",
94
+ "no-invalid-regexp": "error",
95
+ "no-irregular-whitespace": "error",
96
+ "no-iterator": "error",
97
+ "no-labels": ["error", {
98
+ allowLoop: false,
99
+ allowSwitch: false
100
+ }],
101
+ "no-lone-blocks": "error",
102
+ "no-loss-of-precision": "error",
103
+ "no-misleading-character-class": "error",
104
+ "no-multi-str": "error",
105
+ "no-new": "error",
106
+ "no-new-func": "error",
107
+ "no-new-native-nonconstructor": "error",
108
+ "no-new-wrappers": "error",
109
+ "no-obj-calls": "error",
110
+ "no-proto": "error",
111
+ "no-prototype-builtins": "error",
112
+ "no-redeclare": ["error", { builtinGlobals: false }],
113
+ "no-regex-spaces": "error",
114
+ "no-restricted-globals": [
115
+ "error",
116
+ {
117
+ message: "Use `globalThis` instead.",
118
+ name: "global"
119
+ },
120
+ {
121
+ message: "Use `globalThis` instead.",
122
+ name: "self"
123
+ }
124
+ ],
125
+ "no-self-assign": ["error", { props: true }],
126
+ "no-self-compare": "error",
127
+ "no-sequences": "error",
128
+ "no-shadow-restricted-names": "error",
129
+ "no-sparse-arrays": "error",
130
+ "no-template-curly-in-string": "error",
131
+ "no-this-before-super": "error",
132
+ "no-throw-literal": "error",
133
+ "no-undef": "error",
134
+ "no-unmodified-loop-condition": "error",
135
+ "no-unneeded-ternary": ["error", { defaultAssignment: false }],
136
+ "no-unreachable": "error",
137
+ "no-unsafe-finally": "error",
138
+ "no-unsafe-negation": "error",
139
+ "no-unused-expressions": ["error", {
140
+ allowTaggedTemplates: true,
141
+ allowTernary: true
142
+ }],
143
+ "no-unused-vars": ["error", {
144
+ args: "none",
145
+ caughtErrors: "none",
146
+ vars: "all"
147
+ }],
148
+ "no-use-before-define": ["error", {
149
+ classes: false,
150
+ functions: false,
151
+ variables: true
152
+ }],
153
+ "no-useless-backreference": "error",
154
+ "no-useless-call": "error",
155
+ "no-useless-catch": "error",
156
+ "no-useless-computed-key": "error",
157
+ "no-useless-constructor": "error",
158
+ "no-useless-rename": "error",
159
+ "no-useless-return": "error",
160
+ "no-var": "error",
161
+ "no-with": "error",
162
+ "object-shorthand": [
163
+ "error",
164
+ "always",
165
+ {
166
+ avoidExplicitReturnArrows: true,
167
+ avoidQuotes: true
168
+ }
169
+ ],
170
+ "prefer-const": ["error", { destructuring: "all" }],
171
+ "prefer-exponentiation-operator": "error",
172
+ "prefer-promise-reject-errors": "error",
173
+ "prefer-rest-params": "error",
174
+ "prefer-spread": "error",
175
+ "prefer-template": "error",
176
+ "symbol-description": "error",
177
+ "unicode-bom": ["error", "never"],
178
+ "use-isnan": ["error", {
179
+ enforceForIndexOf: true,
180
+ enforceForSwitchCase: true
181
+ }],
182
+ "valid-typeof": ["error", { requireStringLiterals: true }],
183
+ "vars-on-top": "error",
184
+ yoda: ["error", "never"]
204
185
  };
205
-
206
- // src/oxlint/presets/next.ts
207
- var nextjsRules = {
208
- "nextjs/google-font-display": "warn",
209
- "nextjs/google-font-preconnect": "warn",
210
- "nextjs/inline-script-id": "error",
211
- "nextjs/next-script-for-ga": "warn",
212
- "nextjs/no-assign-module-variable": "error",
213
- "nextjs/no-async-client-component": "warn",
214
- "nextjs/no-before-interactive-script-outside-document": "warn",
215
- "nextjs/no-css-tags": "warn",
216
- "nextjs/no-document-import-in-page": "error",
217
- "nextjs/no-duplicate-head": "error",
218
- "nextjs/no-head-element": "warn",
219
- "nextjs/no-head-import-in-document": "error",
220
- "nextjs/no-html-link-for-pages": "off",
221
- "nextjs/no-img-element": "warn",
222
- "nextjs/no-page-custom-font": "warn",
223
- "nextjs/no-script-component-in-head": "error",
224
- "nextjs/no-styled-jsx-in-document": "warn",
225
- "nextjs/no-sync-scripts": "error",
226
- "nextjs/no-title-in-document-head": "warn",
227
- "nextjs/no-typos": "warn",
228
- "nextjs/no-unwanted-polyfillio": "warn"
186
+ //#endregion
187
+ //#region src/oxlint/presets/next.ts
188
+ const nextjsRules = {
189
+ "nextjs/google-font-display": "warn",
190
+ "nextjs/google-font-preconnect": "warn",
191
+ "nextjs/inline-script-id": "error",
192
+ "nextjs/next-script-for-ga": "warn",
193
+ "nextjs/no-assign-module-variable": "error",
194
+ "nextjs/no-async-client-component": "warn",
195
+ "nextjs/no-before-interactive-script-outside-document": "warn",
196
+ "nextjs/no-css-tags": "warn",
197
+ "nextjs/no-document-import-in-page": "error",
198
+ "nextjs/no-duplicate-head": "error",
199
+ "nextjs/no-head-element": "warn",
200
+ "nextjs/no-head-import-in-document": "error",
201
+ "nextjs/no-html-link-for-pages": "off",
202
+ "nextjs/no-img-element": "warn",
203
+ "nextjs/no-page-custom-font": "warn",
204
+ "nextjs/no-script-component-in-head": "error",
205
+ "nextjs/no-styled-jsx-in-document": "warn",
206
+ "nextjs/no-sync-scripts": "error",
207
+ "nextjs/no-title-in-document-head": "warn",
208
+ "nextjs/no-typos": "warn",
209
+ "nextjs/no-unwanted-polyfillio": "warn"
229
210
  };
230
-
231
- // src/oxlint/presets/node.ts
232
- var nodeRules = {
233
- "node/handle-callback-err": ["error", "^(err|error)$"],
234
- "node/no-exports-assign": "error",
235
- "node/no-new-require": "error",
236
- "node/no-path-concat": "error"
211
+ //#endregion
212
+ //#region src/oxlint/presets/node.ts
213
+ const nodeRules = {
214
+ "node/handle-callback-err": ["error", "^(err|error)$"],
215
+ "node/no-exports-assign": "error",
216
+ "node/no-new-require": "error",
217
+ "node/no-path-concat": "error"
237
218
  };
238
-
239
- // src/oxlint/presets/react-agent-rules.ts
240
- import { existsSync } from "fs";
241
- import { fileURLToPath } from "url";
219
+ //#endregion
220
+ //#region src/oxlint/presets/react-agent-rules.ts
242
221
  function resolveReactAgentRulesPluginPath() {
243
- const sourcePluginPath = fileURLToPath(
244
- new URL("../../react-agent-rules.ts", import.meta.url)
245
- );
246
- if (existsSync(sourcePluginPath)) {
247
- return sourcePluginPath;
248
- }
249
- return fileURLToPath(new URL("./react-agent-rules.js", import.meta.url));
222
+ const sourcePluginPath = fileURLToPath(new URL("../../react-agent-rules.ts", import.meta.url));
223
+ if (existsSync(sourcePluginPath)) return sourcePluginPath;
224
+ return fileURLToPath(new URL("./react-agent-rules.js", import.meta.url));
250
225
  }
251
- var reactAgentRulesPlugin = resolveReactAgentRulesPluginPath();
252
- var reactAgentRules = {
253
- "react-agent-rules/effect-empty-deps-only": "error",
254
- "react-agent-rules/no-forward-ref": "error",
255
- "react-agent-rules/no-manual-memoization": "error",
256
- "react-agent-rules/no-use-context": "error"
226
+ const reactAgentRulesPlugin = resolveReactAgentRulesPluginPath();
227
+ const reactAgentRules = {
228
+ "react-agent-rules/effect-empty-deps-only": "error",
229
+ "react-agent-rules/no-forward-ref": "error",
230
+ "react-agent-rules/no-manual-memoization": "error",
231
+ "react-agent-rules/no-use-context": "error"
257
232
  };
258
-
259
- // src/oxlint/presets/react.ts
260
- import { isPackageExists } from "local-pkg";
261
- var jsxA11yRules = {
262
- "jsx-a11y/alt-text": "error",
263
- "jsx-a11y/anchor-ambiguous-text": "off",
264
- "jsx-a11y/anchor-has-content": "error",
265
- "jsx-a11y/anchor-is-valid": "error",
266
- "jsx-a11y/aria-activedescendant-has-tabindex": "error",
267
- "jsx-a11y/aria-props": "error",
268
- "jsx-a11y/aria-proptypes": "error",
269
- "jsx-a11y/aria-role": "error",
270
- "jsx-a11y/aria-unsupported-elements": "error",
271
- "jsx-a11y/autocomplete-valid": "error",
272
- "jsx-a11y/click-events-have-key-events": "error",
273
- "jsx-a11y/heading-has-content": "error",
274
- "jsx-a11y/html-has-lang": "error",
275
- "jsx-a11y/iframe-has-title": "error",
276
- "jsx-a11y/img-redundant-alt": "error",
277
- "jsx-a11y/label-has-associated-control": "error",
278
- "jsx-a11y/media-has-caption": "error",
279
- "jsx-a11y/mouse-events-have-key-events": "error",
280
- "jsx-a11y/no-access-key": "error",
281
- "jsx-a11y/no-autofocus": "error",
282
- "jsx-a11y/no-distracting-elements": "error",
283
- "jsx-a11y/no-noninteractive-tabindex": [
284
- "error",
285
- {
286
- allowExpressionValues: true,
287
- roles: ["tabpanel"],
288
- tags: []
289
- }
290
- ],
291
- "jsx-a11y/no-redundant-roles": "error",
292
- "jsx-a11y/no-static-element-interactions": [
293
- "error",
294
- {
295
- allowExpressionValues: true,
296
- handlers: [
297
- "onClick",
298
- "onMouseDown",
299
- "onMouseUp",
300
- "onKeyPress",
301
- "onKeyDown",
302
- "onKeyUp"
303
- ]
304
- }
305
- ],
306
- "jsx-a11y/role-has-required-aria-props": "error",
307
- "jsx-a11y/role-supports-aria-props": "error",
308
- "jsx-a11y/scope": "error",
309
- "jsx-a11y/tabindex-no-positive": "error"
233
+ //#endregion
234
+ //#region src/oxlint/presets/react.ts
235
+ const jsxA11yRules = {
236
+ "jsx-a11y/alt-text": "error",
237
+ "jsx-a11y/anchor-ambiguous-text": "off",
238
+ "jsx-a11y/anchor-has-content": "error",
239
+ "jsx-a11y/anchor-is-valid": "error",
240
+ "jsx-a11y/aria-activedescendant-has-tabindex": "error",
241
+ "jsx-a11y/aria-props": "error",
242
+ "jsx-a11y/aria-proptypes": "error",
243
+ "jsx-a11y/aria-role": "error",
244
+ "jsx-a11y/aria-unsupported-elements": "error",
245
+ "jsx-a11y/autocomplete-valid": "error",
246
+ "jsx-a11y/click-events-have-key-events": "error",
247
+ "jsx-a11y/heading-has-content": "error",
248
+ "jsx-a11y/html-has-lang": "error",
249
+ "jsx-a11y/iframe-has-title": "error",
250
+ "jsx-a11y/img-redundant-alt": "error",
251
+ "jsx-a11y/interactive-supports-focus": "error",
252
+ "jsx-a11y/label-has-associated-control": "error",
253
+ "jsx-a11y/media-has-caption": "error",
254
+ "jsx-a11y/mouse-events-have-key-events": "error",
255
+ "jsx-a11y/no-access-key": "error",
256
+ "jsx-a11y/no-autofocus": "error",
257
+ "jsx-a11y/no-distracting-elements": "error",
258
+ "jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
259
+ "jsx-a11y/no-noninteractive-element-interactions": "error",
260
+ "jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
261
+ "jsx-a11y/no-noninteractive-tabindex": ["error", {
262
+ allowExpressionValues: true,
263
+ roles: ["tabpanel"],
264
+ tags: []
265
+ }],
266
+ "jsx-a11y/no-redundant-roles": "error",
267
+ "jsx-a11y/no-static-element-interactions": ["error", {
268
+ allowExpressionValues: true,
269
+ handlers: [
270
+ "onClick",
271
+ "onMouseDown",
272
+ "onMouseUp",
273
+ "onKeyPress",
274
+ "onKeyDown",
275
+ "onKeyUp"
276
+ ]
277
+ }],
278
+ "jsx-a11y/role-has-required-aria-props": "error",
279
+ "jsx-a11y/role-supports-aria-props": "error",
280
+ "jsx-a11y/scope": "error",
281
+ "jsx-a11y/tabindex-no-positive": "error"
310
282
  };
311
- var baseReactRules = {
312
- "react/exhaustive-deps": "warn",
313
- "react/jsx-boolean-value": "error",
314
- "react/jsx-curly-brace-presence": [
315
- "error",
316
- {
317
- children: "never",
318
- propElementValues: "always",
319
- props: "never"
320
- }
321
- ],
322
- "react/jsx-key": "error",
323
- "react/jsx-no-comment-textnodes": "error",
324
- "react/jsx-no-duplicate-props": "error",
325
- "react/jsx-no-target-blank": "error",
326
- "react/jsx-no-undef": "error",
327
- "react/jsx-no-useless-fragment": "error",
328
- "react/no-array-index-key": "warn",
329
- "react/no-children-prop": "error",
330
- "react/no-danger-with-children": "error",
331
- "react/no-direct-mutation-state": "error",
332
- "react/no-find-dom-node": "error",
333
- "react/no-is-mounted": "error",
334
- "react/no-render-return-value": "error",
335
- "react/no-string-refs": "error",
336
- "react/no-unknown-property": "error",
337
- "react/no-unescaped-entities": "error",
338
- "react/react-in-jsx-scope": "off",
339
- "react/require-render-return": "error",
340
- "react/rules-of-hooks": "error",
341
- "react/self-closing-comp": [
342
- "error",
343
- {
344
- component: true,
345
- html: true
346
- }
347
- ],
348
- "react/void-dom-elements-no-children": "error"
283
+ const baseReactRules = {
284
+ "react/exhaustive-deps": "warn",
285
+ "react/jsx-boolean-value": "error",
286
+ "react/jsx-curly-brace-presence": ["error", {
287
+ children: "never",
288
+ propElementValues: "always",
289
+ props: "never"
290
+ }],
291
+ "react/jsx-key": "error",
292
+ "react/jsx-no-comment-textnodes": "error",
293
+ "react/jsx-no-duplicate-props": "error",
294
+ "react/jsx-no-target-blank": "error",
295
+ "react/jsx-no-undef": "error",
296
+ "react/jsx-no-useless-fragment": "error",
297
+ "react/no-array-index-key": "warn",
298
+ "react/no-children-prop": "error",
299
+ "react/no-danger-with-children": "error",
300
+ "react/no-direct-mutation-state": "error",
301
+ "react/no-find-dom-node": "error",
302
+ "react/no-is-mounted": "error",
303
+ "react/no-render-return-value": "error",
304
+ "react/no-string-refs": "error",
305
+ "react/no-unknown-property": "error",
306
+ "react/no-unescaped-entities": "error",
307
+ "react/react-in-jsx-scope": "off",
308
+ "react/require-render-return": "error",
309
+ "react/rules-of-hooks": "error",
310
+ "react/self-closing-comp": ["error", {
311
+ component: true,
312
+ html: true
313
+ }],
314
+ "react/void-dom-elements-no-children": "error"
349
315
  };
350
316
  function createReactRules(options, nextEnabled) {
351
- const framework = options.framework ?? {};
352
- const next = framework.next ?? nextEnabled;
353
- const vite = framework.vite ?? isPackageExists("vite");
354
- return {
355
- ...baseReactRules,
356
- "react/only-export-components": [
357
- "warn",
358
- {
359
- allowConstantExport: vite,
360
- allowExportNames: next ? [
361
- "dynamic",
362
- "dynamicParams",
363
- "revalidate",
364
- "fetchCache",
365
- "runtime",
366
- "preferredRegion",
367
- "maxDuration",
368
- "generateStaticParams",
369
- "metadata",
370
- "generateMetadata",
371
- "viewport",
372
- "generateViewport"
373
- ] : []
374
- }
375
- ]
376
- };
317
+ const framework = options.framework ?? {};
318
+ const next = framework.next ?? nextEnabled;
319
+ const vite = framework.vite ?? isPackageExists("vite");
320
+ return {
321
+ ...baseReactRules,
322
+ "react/only-export-components": ["warn", {
323
+ allowConstantExport: vite,
324
+ allowExportNames: next ? [
325
+ "dynamic",
326
+ "dynamicParams",
327
+ "revalidate",
328
+ "fetchCache",
329
+ "runtime",
330
+ "preferredRegion",
331
+ "maxDuration",
332
+ "generateStaticParams",
333
+ "metadata",
334
+ "generateMetadata",
335
+ "viewport",
336
+ "generateViewport"
337
+ ] : []
338
+ }]
339
+ };
377
340
  }
378
-
379
- // src/oxlint/presets/test.ts
380
- var vitestRules = {
381
- "no-unused-expressions": "off",
382
- "vitest/expect-expect": "error",
383
- "vitest/no-commented-out-tests": "error",
384
- "vitest/no-conditional-expect": "error",
385
- "vitest/no-disabled-tests": "warn",
386
- "vitest/no-focused-tests": "error",
387
- "vitest/no-identical-title": "error",
388
- "vitest/no-import-node-test": "error",
389
- "vitest/no-interpolation-in-snapshots": "error",
390
- "vitest/no-mocks-import": "error",
391
- "vitest/no-standalone-expect": "error",
392
- "vitest/no-unneeded-async-expect-function": "error",
393
- "vitest/prefer-called-exactly-once-with": "error",
394
- "vitest/require-local-test-context-for-concurrent-snapshots": "error",
395
- "vitest/valid-describe-callback": "error",
396
- "vitest/valid-expect": "error",
397
- "vitest/valid-expect-in-promise": "error",
398
- "vitest/valid-title": "error"
341
+ //#endregion
342
+ //#region src/oxlint/presets/test.ts
343
+ const vitestRules = {
344
+ "no-unused-expressions": "off",
345
+ "vitest/expect-expect": "error",
346
+ "vitest/no-commented-out-tests": "error",
347
+ "vitest/no-conditional-expect": "error",
348
+ "vitest/no-disabled-tests": "warn",
349
+ "vitest/no-focused-tests": "error",
350
+ "vitest/no-identical-title": "error",
351
+ "vitest/no-import-node-test": "error",
352
+ "vitest/no-interpolation-in-snapshots": "error",
353
+ "vitest/no-mocks-import": "error",
354
+ "vitest/no-standalone-expect": "error",
355
+ "vitest/no-unneeded-async-expect-function": "error",
356
+ "vitest/prefer-called-exactly-once-with": "error",
357
+ "vitest/require-local-test-context-for-concurrent-snapshots": "error",
358
+ "vitest/valid-describe-callback": "error",
359
+ "vitest/valid-expect": "error",
360
+ "vitest/valid-expect-in-promise": "error",
361
+ "vitest/valid-title": "error"
399
362
  };
400
-
401
- // src/oxlint/presets/typescript.ts
402
- var typeScriptRules = {
403
- "no-throw-literal": "off",
404
- "no-undef": "off",
405
- "no-unused-vars": "error",
406
- "typescript/adjacent-overload-signatures": "off",
407
- "typescript/array-type": "error",
408
- "typescript/await-thenable": "warn",
409
- "typescript/ban-ts-comment": [
410
- "error",
411
- {
412
- minimumDescriptionLength: 3,
413
- "ts-check": false,
414
- "ts-expect-error": "allow-with-description",
415
- "ts-ignore": true,
416
- "ts-nocheck": true
417
- }
418
- ],
419
- "typescript/consistent-generic-constructors": "error",
420
- "typescript/consistent-indexed-object-style": "error",
421
- "typescript/consistent-type-definitions": "warn",
422
- "typescript/consistent-type-exports": [
423
- "error",
424
- {
425
- fixMixedExportsWithInlineTypeSpecifier: true
426
- }
427
- ],
428
- "typescript/consistent-type-imports": [
429
- "error",
430
- {
431
- disallowTypeAnnotations: false,
432
- fixStyle: "separate-type-imports",
433
- prefer: "type-imports"
434
- }
435
- ],
436
- "typescript/dot-notation": ["error", { allowKeywords: true }],
437
- "typescript/no-implied-eval": "error",
438
- "typescript/no-array-delete": "error",
439
- "typescript/no-base-to-string": "error",
440
- "typescript/no-duplicate-enum-values": "error",
441
- "typescript/no-duplicate-type-constituents": "error",
442
- "typescript/no-dynamic-delete": "error",
443
- "typescript/no-empty-interface": "error",
444
- "typescript/no-empty-object-type": "error",
445
- "typescript/no-explicit-any": "warn",
446
- "typescript/no-extra-non-null-assertion": "error",
447
- "typescript/no-extraneous-class": "error",
448
- "typescript/no-for-in-array": "error",
449
- "typescript/no-import-type-side-effects": "error",
450
- "typescript/no-invalid-void-type": "error",
451
- "typescript/no-meaningless-void-operator": "error",
452
- "typescript/no-misused-new": "error",
453
- "typescript/no-misused-promises": "error",
454
- "typescript/no-mixed-enums": "error",
455
- "typescript/no-namespace": "error",
456
- "typescript/no-non-null-asserted-nullish-coalescing": "error",
457
- "typescript/no-non-null-asserted-optional-chain": "error",
458
- "typescript/no-non-null-assertion": "off",
459
- "typescript/no-redundant-type-constituents": "error",
460
- "typescript/no-this-alias": "error",
461
- "typescript/no-unnecessary-boolean-literal-compare": "error",
462
- "typescript/no-unnecessary-condition": "error",
463
- "typescript/no-unnecessary-template-expression": "error",
464
- "typescript/no-unnecessary-type-arguments": "error",
465
- "typescript/no-unnecessary-type-assertion": "error",
466
- "typescript/no-unnecessary-type-constraint": "error",
467
- "typescript/no-unsafe-declaration-merging": "error",
468
- "typescript/no-unsafe-function-type": "error",
469
- "typescript/no-useless-empty-export": "error",
470
- "typescript/no-var-requires": "error",
471
- "typescript/no-wrapper-object-types": "error",
472
- "typescript/non-nullable-type-assertion-style": "error",
473
- "typescript/only-throw-error": "error",
474
- "typescript/prefer-as-const": "error",
475
- "typescript/prefer-literal-enum-member": "error",
476
- "typescript/prefer-optional-chain": "error",
477
- "typescript/triple-slash-reference": "warn",
478
- "typescript/unified-signatures": "error"
363
+ //#endregion
364
+ //#region src/oxlint/presets/typescript.ts
365
+ const typeScriptRules = {
366
+ "no-throw-literal": "off",
367
+ "no-undef": "off",
368
+ "no-unused-vars": "error",
369
+ "typescript/adjacent-overload-signatures": "off",
370
+ "typescript/array-type": "error",
371
+ "typescript/await-thenable": "warn",
372
+ "typescript/ban-ts-comment": ["error", {
373
+ minimumDescriptionLength: 3,
374
+ "ts-check": false,
375
+ "ts-expect-error": "allow-with-description",
376
+ "ts-ignore": true,
377
+ "ts-nocheck": true
378
+ }],
379
+ "typescript/consistent-generic-constructors": "error",
380
+ "typescript/consistent-indexed-object-style": "error",
381
+ "typescript/consistent-type-definitions": "warn",
382
+ "typescript/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: true }],
383
+ "typescript/consistent-type-imports": ["error", {
384
+ disallowTypeAnnotations: false,
385
+ fixStyle: "separate-type-imports",
386
+ prefer: "type-imports"
387
+ }],
388
+ "typescript/dot-notation": ["error", { allowKeywords: true }],
389
+ "typescript/no-implied-eval": "error",
390
+ "typescript/no-array-delete": "error",
391
+ "typescript/no-base-to-string": "error",
392
+ "typescript/no-duplicate-enum-values": "error",
393
+ "typescript/no-duplicate-type-constituents": "error",
394
+ "typescript/no-dynamic-delete": "error",
395
+ "typescript/no-empty-interface": "error",
396
+ "typescript/no-empty-object-type": "error",
397
+ "typescript/no-explicit-any": "warn",
398
+ "typescript/no-extra-non-null-assertion": "error",
399
+ "typescript/no-extraneous-class": "error",
400
+ "typescript/no-for-in-array": "error",
401
+ "typescript/no-import-type-side-effects": "error",
402
+ "typescript/no-invalid-void-type": "error",
403
+ "typescript/no-meaningless-void-operator": "error",
404
+ "typescript/no-misused-new": "error",
405
+ "typescript/no-misused-promises": "error",
406
+ "typescript/no-mixed-enums": "error",
407
+ "typescript/no-namespace": "error",
408
+ "typescript/no-non-null-asserted-nullish-coalescing": "error",
409
+ "typescript/no-non-null-asserted-optional-chain": "error",
410
+ "typescript/no-non-null-assertion": "off",
411
+ "typescript/no-redundant-type-constituents": "error",
412
+ "typescript/no-this-alias": "error",
413
+ "typescript/no-unnecessary-boolean-literal-compare": "error",
414
+ "typescript/no-unnecessary-condition": "error",
415
+ "typescript/no-unnecessary-template-expression": "error",
416
+ "typescript/no-unnecessary-type-arguments": "error",
417
+ "typescript/no-unnecessary-type-assertion": "error",
418
+ "typescript/no-unnecessary-type-constraint": "error",
419
+ "typescript/no-unsafe-declaration-merging": "error",
420
+ "typescript/no-unsafe-function-type": "error",
421
+ "typescript/no-useless-empty-export": "error",
422
+ "typescript/no-var-requires": "error",
423
+ "typescript/no-wrapper-object-types": "error",
424
+ "typescript/non-nullable-type-assertion-style": "error",
425
+ "typescript/only-throw-error": "error",
426
+ "typescript/prefer-as-const": "error",
427
+ "typescript/prefer-literal-enum-member": "error",
428
+ "typescript/prefer-optional-chain": "error",
429
+ "typescript/triple-slash-reference": "warn",
430
+ "typescript/unified-signatures": "error"
479
431
  };
480
-
481
- // src/oxlint/presets/unicorn.ts
482
- var unicornRules = {
483
- "unicorn/consistent-empty-array-spread": "error",
484
- "unicorn/consistent-function-scoping": "error",
485
- "unicorn/error-message": "error",
486
- "unicorn/escape-case": "error",
487
- "unicorn/explicit-length-check": ["error", { "non-zero": "not-equal" }],
488
- "unicorn/new-for-builtins": "error",
489
- "unicorn/no-anonymous-default-export": "error",
490
- "unicorn/no-await-expression-member": "error",
491
- "unicorn/no-await-in-promise-methods": "error",
492
- "unicorn/no-instanceof-builtins": "error",
493
- "unicorn/no-new-array": "error",
494
- "unicorn/no-new-buffer": "error",
495
- "unicorn/no-useless-length-check": "error",
496
- "unicorn/no-useless-spread": "error",
497
- "unicorn/prefer-dom-node-text-content": "error",
498
- "unicorn/prefer-includes": "error",
499
- "unicorn/prefer-modern-dom-apis": "error",
500
- "unicorn/prefer-node-protocol": "error",
501
- "unicorn/prefer-number-properties": "error",
502
- "unicorn/prefer-query-selector": "error",
503
- "unicorn/prefer-string-raw": "error",
504
- "unicorn/prefer-string-starts-ends-with": "error",
505
- "unicorn/prefer-type-error": "error",
506
- "unicorn/throw-new-error": "error"
432
+ //#endregion
433
+ //#region src/oxlint/presets/unicorn.ts
434
+ const unicornRules = {
435
+ "unicorn/consistent-empty-array-spread": "error",
436
+ "unicorn/consistent-function-scoping": "error",
437
+ "unicorn/error-message": "error",
438
+ "unicorn/escape-case": "error",
439
+ "unicorn/explicit-length-check": ["error", { "non-zero": "not-equal" }],
440
+ "unicorn/new-for-builtins": "error",
441
+ "unicorn/no-anonymous-default-export": "error",
442
+ "unicorn/no-await-expression-member": "error",
443
+ "unicorn/no-await-in-promise-methods": "error",
444
+ "unicorn/no-instanceof-builtins": "error",
445
+ "unicorn/no-new-array": "error",
446
+ "unicorn/no-new-buffer": "error",
447
+ "unicorn/no-useless-length-check": "error",
448
+ "unicorn/no-useless-spread": "error",
449
+ "unicorn/prefer-dom-node-text-content": "error",
450
+ "unicorn/prefer-includes": "error",
451
+ "unicorn/prefer-modern-dom-apis": "error",
452
+ "unicorn/prefer-node-protocol": "error",
453
+ "unicorn/prefer-number-properties": "error",
454
+ "unicorn/prefer-query-selector": "error",
455
+ "unicorn/prefer-string-raw": "error",
456
+ "unicorn/prefer-type-error": "error",
457
+ "unicorn/throw-new-error": "error"
507
458
  };
508
-
509
- // src/shared/utils.ts
459
+ //#endregion
460
+ //#region src/shared/utils.ts
510
461
  function resolvePreset(preset, defaultEnabled) {
511
- if (typeof preset === "boolean" || preset == null) {
512
- return {
513
- enabled: preset ?? defaultEnabled,
514
- options: void 0
515
- };
516
- }
517
- return {
518
- enabled: preset.enabled ?? true,
519
- options: preset.options
520
- };
462
+ if (typeof preset === "boolean" || preset == null) return {
463
+ enabled: preset ?? defaultEnabled,
464
+ options: void 0
465
+ };
466
+ return {
467
+ enabled: preset.enabled ?? true,
468
+ options: preset.options
469
+ };
521
470
  }
522
471
  function dedupe(values) {
523
- return [...new Set(values)];
472
+ return [...new Set(values)];
524
473
  }
525
-
526
- // src/oxlint/shared.ts
527
- var scriptFiles = [
528
- "scripts/**/*.js",
529
- "scripts/**/*.mjs",
530
- "scripts/**/*.cjs",
531
- "scripts/**/*.jsx",
532
- "scripts/**/*.ts",
533
- "scripts/**/*.mts",
534
- "scripts/**/*.cts",
535
- "scripts/**/*.tsx",
536
- "cli.js",
537
- "cli.mjs",
538
- "cli.cjs",
539
- "cli.jsx",
540
- "cli.ts",
541
- "cli.mts",
542
- "cli.cts",
543
- "cli.tsx"
474
+ //#endregion
475
+ //#region src/oxlint/shared.ts
476
+ const scriptFiles = [
477
+ "scripts/**/*.js",
478
+ "scripts/**/*.mjs",
479
+ "scripts/**/*.cjs",
480
+ "scripts/**/*.jsx",
481
+ "scripts/**/*.ts",
482
+ "scripts/**/*.mts",
483
+ "scripts/**/*.cts",
484
+ "scripts/**/*.tsx",
485
+ "cli.js",
486
+ "cli.mjs",
487
+ "cli.cjs",
488
+ "cli.jsx",
489
+ "cli.ts",
490
+ "cli.mts",
491
+ "cli.cts",
492
+ "cli.tsx"
493
+ ];
494
+ const tsFiles = [
495
+ "**/*.ts",
496
+ "**/*.mts",
497
+ "**/*.cts",
498
+ "**/*.tsx",
499
+ "**/*.mtsx",
500
+ "**/*.ctsx"
501
+ ];
502
+ const sourceFiles = [
503
+ "**/*.js",
504
+ "**/*.mjs",
505
+ "**/*.cjs",
506
+ "**/*.jsx",
507
+ "**/*.ts",
508
+ "**/*.mts",
509
+ "**/*.cts",
510
+ "**/*.tsx",
511
+ "**/*.mtsx",
512
+ "**/*.ctsx"
544
513
  ];
545
- var tsFiles = [
546
- "**/*.ts",
547
- "**/*.mts",
548
- "**/*.cts",
549
- "**/*.tsx",
550
- "**/*.mtsx",
551
- "**/*.ctsx"
514
+ const componentFiles = [
515
+ "**/*.jsx",
516
+ "**/*.tsx",
517
+ "**/*.mtsx",
518
+ "**/*.ctsx"
552
519
  ];
553
- var sourceFiles = [
554
- "**/*.js",
555
- "**/*.mjs",
556
- "**/*.cjs",
557
- "**/*.jsx",
558
- "**/*.ts",
559
- "**/*.mts",
560
- "**/*.cts",
561
- "**/*.tsx",
562
- "**/*.mtsx",
563
- "**/*.ctsx"
520
+ const dtsFiles = [
521
+ "**/*.d.ts",
522
+ "**/*.d.mts",
523
+ "**/*.d.cts"
564
524
  ];
565
- var componentFiles = ["**/*.jsx", "**/*.tsx", "**/*.mtsx", "**/*.ctsx"];
566
- var dtsFiles = ["**/*.d.ts", "**/*.d.mts", "**/*.d.cts"];
567
- var jsRequireFiles = ["**/*.js", "**/*.cjs"];
568
- var testFiles = [
569
- "**/__tests__/**/*.js",
570
- "**/__tests__/**/*.mjs",
571
- "**/__tests__/**/*.cjs",
572
- "**/__tests__/**/*.jsx",
573
- "**/__tests__/**/*.ts",
574
- "**/__tests__/**/*.mts",
575
- "**/__tests__/**/*.cts",
576
- "**/__tests__/**/*.tsx",
577
- "**/__tests__/**/*.mtsx",
578
- "**/__tests__/**/*.ctsx",
579
- "**/*.spec.js",
580
- "**/*.spec.mjs",
581
- "**/*.spec.cjs",
582
- "**/*.spec.jsx",
583
- "**/*.spec.ts",
584
- "**/*.spec.mts",
585
- "**/*.spec.cts",
586
- "**/*.spec.tsx",
587
- "**/*.spec.mtsx",
588
- "**/*.spec.ctsx",
589
- "**/*.test.js",
590
- "**/*.test.mjs",
591
- "**/*.test.cjs",
592
- "**/*.test.jsx",
593
- "**/*.test.ts",
594
- "**/*.test.mts",
595
- "**/*.test.cts",
596
- "**/*.test.tsx",
597
- "**/*.test.mtsx",
598
- "**/*.test.ctsx",
599
- "**/*.bench.js",
600
- "**/*.bench.mjs",
601
- "**/*.bench.cjs",
602
- "**/*.bench.jsx",
603
- "**/*.bench.ts",
604
- "**/*.bench.mts",
605
- "**/*.bench.cts",
606
- "**/*.bench.tsx",
607
- "**/*.bench.mtsx",
608
- "**/*.bench.ctsx",
609
- "**/*.benchmark.js",
610
- "**/*.benchmark.mjs",
611
- "**/*.benchmark.cjs",
612
- "**/*.benchmark.jsx",
613
- "**/*.benchmark.ts",
614
- "**/*.benchmark.mts",
615
- "**/*.benchmark.cts",
616
- "**/*.benchmark.tsx",
617
- "**/*.benchmark.mtsx",
618
- "**/*.benchmark.ctsx"
525
+ const jsRequireFiles = ["**/*.js", "**/*.cjs"];
526
+ const testFiles = [
527
+ "**/__tests__/**/*.js",
528
+ "**/__tests__/**/*.mjs",
529
+ "**/__tests__/**/*.cjs",
530
+ "**/__tests__/**/*.jsx",
531
+ "**/__tests__/**/*.ts",
532
+ "**/__tests__/**/*.mts",
533
+ "**/__tests__/**/*.cts",
534
+ "**/__tests__/**/*.tsx",
535
+ "**/__tests__/**/*.mtsx",
536
+ "**/__tests__/**/*.ctsx",
537
+ "**/*.spec.js",
538
+ "**/*.spec.mjs",
539
+ "**/*.spec.cjs",
540
+ "**/*.spec.jsx",
541
+ "**/*.spec.ts",
542
+ "**/*.spec.mts",
543
+ "**/*.spec.cts",
544
+ "**/*.spec.tsx",
545
+ "**/*.spec.mtsx",
546
+ "**/*.spec.ctsx",
547
+ "**/*.test.js",
548
+ "**/*.test.mjs",
549
+ "**/*.test.cjs",
550
+ "**/*.test.jsx",
551
+ "**/*.test.ts",
552
+ "**/*.test.mts",
553
+ "**/*.test.cts",
554
+ "**/*.test.tsx",
555
+ "**/*.test.mtsx",
556
+ "**/*.test.ctsx",
557
+ "**/*.bench.js",
558
+ "**/*.bench.mjs",
559
+ "**/*.bench.cjs",
560
+ "**/*.bench.jsx",
561
+ "**/*.bench.ts",
562
+ "**/*.bench.mts",
563
+ "**/*.bench.cts",
564
+ "**/*.bench.tsx",
565
+ "**/*.bench.mtsx",
566
+ "**/*.bench.ctsx",
567
+ "**/*.benchmark.js",
568
+ "**/*.benchmark.mjs",
569
+ "**/*.benchmark.cjs",
570
+ "**/*.benchmark.jsx",
571
+ "**/*.benchmark.ts",
572
+ "**/*.benchmark.mts",
573
+ "**/*.benchmark.cts",
574
+ "**/*.benchmark.tsx",
575
+ "**/*.benchmark.mtsx",
576
+ "**/*.benchmark.ctsx"
619
577
  ];
620
578
  function resolveRulePreset(preset, defaultEnabled) {
621
- const resolved = resolvePreset(preset, defaultEnabled);
622
- return {
623
- ...resolved,
624
- rules: typeof preset === "boolean" || preset == null ? {} : preset.rules ?? {}
625
- };
579
+ return {
580
+ ...resolvePreset(preset, defaultEnabled),
581
+ rules: typeof preset === "boolean" || preset == null ? {} : preset.rules ?? {}
582
+ };
626
583
  }
627
584
  function resolveIgnorePreset(preset, defaultEnabled) {
628
- if (typeof preset === "boolean" || preset == null) {
629
- return {
630
- enabled: preset ?? defaultEnabled,
631
- patterns: []
632
- };
633
- }
634
- return {
635
- enabled: preset.enabled ?? defaultEnabled,
636
- patterns: preset.patterns ?? []
637
- };
585
+ if (typeof preset === "boolean" || preset == null) return {
586
+ enabled: preset ?? defaultEnabled,
587
+ patterns: []
588
+ };
589
+ return {
590
+ enabled: preset.enabled ?? defaultEnabled,
591
+ patterns: preset.patterns ?? []
592
+ };
638
593
  }
639
594
  function mergeRules(...entries) {
640
- return Object.assign({}, ...entries);
595
+ return Object.assign({}, ...entries);
641
596
  }
642
597
  function pickRules(rules, predicate) {
643
- if (!rules) {
644
- return {};
645
- }
646
- return Object.fromEntries(
647
- Object.entries(rules).filter(([rule]) => predicate(rule))
648
- );
598
+ if (!rules) return {};
599
+ return Object.fromEntries(Object.entries(rules).filter(([rule]) => predicate(rule)));
649
600
  }
650
601
  function appendPlugin(plugins, plugin) {
651
- if (!plugins.includes(plugin)) {
652
- plugins.push(plugin);
653
- }
602
+ if (!plugins.includes(plugin)) plugins.push(plugin);
654
603
  }
655
604
  function pruneOverride(override) {
656
- const result = {
657
- files: override.files
658
- };
659
- if (override.env && Object.keys(override.env).length !== 0) {
660
- result.env = override.env;
661
- }
662
- if (override.excludeFiles && override.excludeFiles.length !== 0) {
663
- result.excludeFiles = override.excludeFiles;
664
- }
665
- if (override.globals && Object.keys(override.globals).length !== 0) {
666
- result.globals = override.globals;
667
- }
668
- if (override.jsPlugins && override.jsPlugins.length !== 0) {
669
- result.jsPlugins = override.jsPlugins;
670
- }
671
- if (override.plugins && override.plugins.length !== 0) {
672
- result.plugins = override.plugins;
673
- }
674
- if (override.rules && Object.keys(override.rules).length !== 0) {
675
- result.rules = override.rules;
676
- }
677
- return result.rules || result.plugins || result.jsPlugins || result.env || result.globals ? result : null;
605
+ const result = { files: override.files };
606
+ if (override.env && Object.keys(override.env).length !== 0) result.env = override.env;
607
+ if (override.excludeFiles && override.excludeFiles.length !== 0) result.excludeFiles = override.excludeFiles;
608
+ if (override.globals && Object.keys(override.globals).length !== 0) result.globals = override.globals;
609
+ if (override.jsPlugins && override.jsPlugins.length !== 0) result.jsPlugins = override.jsPlugins;
610
+ if (override.plugins && override.plugins.length !== 0) result.plugins = override.plugins;
611
+ if (override.rules && Object.keys(override.rules).length !== 0) result.rules = override.rules;
612
+ return result.rules || result.plugins || result.jsPlugins || result.env || result.globals ? result : null;
678
613
  }
679
-
680
- // src/oxlint/index.ts
681
- var defaultOxlintPresets = {
682
- ignores: true,
683
- imports: true,
684
- javascript: true,
685
- next: isPackageExists2("next"),
686
- node: false,
687
- react: isPackageExists2("react"),
688
- reactAgentRules: isPackageExists2("react"),
689
- test: isPackageExists2("vitest"),
690
- typescript: isPackageExists2("typescript"),
691
- unicorn: true
614
+ //#endregion
615
+ //#region src/oxlint/index.ts
616
+ const defaultOxlintPresets = {
617
+ ignores: true,
618
+ imports: true,
619
+ javascript: true,
620
+ next: isPackageExists("next"),
621
+ node: false,
622
+ react: isPackageExists("react"),
623
+ reactAgentRules: isPackageExists("react"),
624
+ test: isPackageExists("vitest"),
625
+ typescript: isPackageExists("typescript"),
626
+ unicorn: true
692
627
  };
693
628
  function defineOxlintConfig(options = {}) {
694
- const presets = {
695
- ...defaultOxlintPresets,
696
- ...options.presets
697
- };
698
- const ignorePreset = resolveIgnorePreset(presets.ignores, true);
699
- const importPreset = resolveRulePreset(presets.imports, true);
700
- const javascriptPreset = resolveRulePreset(presets.javascript, true);
701
- const nextPreset = resolveRulePreset(presets.next, defaultOxlintPresets.next);
702
- const nodePreset = resolveRulePreset(presets.node, false);
703
- const reactPreset = resolveRulePreset(
704
- presets.react,
705
- defaultOxlintPresets.react
706
- );
707
- const reactAgentRulesPreset = resolveRulePreset(
708
- presets.reactAgentRules,
709
- false
710
- );
711
- const testPreset = resolveRulePreset(presets.test, defaultOxlintPresets.test);
712
- const typeScriptPreset = resolveRulePreset(
713
- presets.typescript,
714
- defaultOxlintPresets.typescript
715
- );
716
- const unicornPreset = resolveRulePreset(presets.unicorn, true);
717
- const reactAgentRulesForSourceFiles = reactAgentRulesPreset.enabled ? mergeRules(
718
- reactAgentRules,
719
- reactAgentRulesPreset.rules,
720
- pickRules(
721
- options.rules,
722
- (rule) => rule.startsWith("react-agent-rules/")
723
- )
724
- ) : void 0;
725
- const plugins = [];
726
- const rules = mergeRules(
727
- {
728
- "max-lines": [
729
- "error",
730
- {
731
- max: 300,
732
- skipBlankLines: true,
733
- skipComments: true
734
- }
735
- ]
736
- },
737
- unicornPreset.enabled ? unicornRules : void 0,
738
- unicornPreset.rules,
739
- importPreset.enabled ? importRules : void 0,
740
- importPreset.rules,
741
- javascriptPreset.enabled ? javascriptRules : void 0,
742
- javascriptPreset.rules,
743
- nodePreset.enabled ? nodeRules : void 0,
744
- nodePreset.rules,
745
- reactAgentRulesPreset.enabled ? reactAgentRules : void 0,
746
- reactAgentRulesPreset.rules,
747
- options.rules
748
- );
749
- if (unicornPreset.enabled) {
750
- appendPlugin(plugins, "unicorn");
751
- }
752
- if (importPreset.enabled) {
753
- appendPlugin(plugins, "import");
754
- }
755
- if (typeScriptPreset.enabled) {
756
- appendPlugin(plugins, "typescript");
757
- }
758
- if (nodePreset.enabled) {
759
- appendPlugin(plugins, "node");
760
- }
761
- const overrides = [];
762
- if (reactAgentRulesPreset.enabled && reactAgentRulesForSourceFiles) {
763
- overrides.push({
764
- files: sourceFiles,
765
- jsPlugins: [reactAgentRulesPlugin],
766
- rules: reactAgentRulesForSourceFiles
767
- });
768
- }
769
- if (javascriptPreset.enabled) {
770
- overrides.push({
771
- files: scriptFiles,
772
- rules: {
773
- "no-console": "off"
774
- }
775
- });
776
- }
777
- if (typeScriptPreset.enabled) {
778
- overrides.push({
779
- files: tsFiles,
780
- rules: mergeRules(typeScriptRules, typeScriptPreset.rules)
781
- });
782
- overrides.push({
783
- files: dtsFiles,
784
- rules: {
785
- "import/no-duplicates": "off"
786
- }
787
- });
788
- overrides.push({
789
- files: jsRequireFiles,
790
- rules: {
791
- "typescript/no-require-imports": "off",
792
- "typescript/no-var-requires": "off"
793
- }
794
- });
795
- }
796
- overrides.push({
797
- files: componentFiles,
798
- rules: {
799
- "max-lines": [
800
- "error",
801
- {
802
- max: 200,
803
- skipBlankLines: true,
804
- skipComments: true
805
- }
806
- ]
807
- }
808
- });
809
- if (reactPreset.enabled || nextPreset.enabled) {
810
- const reactOptions = reactPreset.options ?? {};
811
- const a11y = reactOptions.a11y ?? true;
812
- const overridePlugins = [];
813
- const reactRules = reactPreset.enabled ? createReactRules(reactOptions, nextPreset.enabled) : {};
814
- const nextRules = nextPreset.enabled ? nextjsRules : {};
815
- const mergedRules = mergeRules(
816
- reactRules,
817
- a11y && reactPreset.enabled ? jsxA11yRules : void 0,
818
- nextRules,
819
- reactAgentRulesPreset.enabled ? {
820
- "react/exhaustive-deps": "off"
821
- } : void 0,
822
- reactPreset.rules,
823
- nextPreset.rules
824
- );
825
- if (reactPreset.enabled) {
826
- appendPlugin(overridePlugins, "react");
827
- }
828
- if (reactPreset.enabled && a11y) {
829
- appendPlugin(overridePlugins, "jsx-a11y");
830
- }
831
- if (nextPreset.enabled) {
832
- appendPlugin(overridePlugins, "nextjs");
833
- }
834
- const override = pruneOverride({
835
- files: sourceFiles,
836
- plugins: overridePlugins,
837
- rules: mergedRules
838
- });
839
- if (override) {
840
- overrides.push(override);
841
- }
842
- }
843
- overrides.push({
844
- files: testFiles,
845
- plugins: testPreset.enabled ? ["vitest"] : void 0,
846
- rules: mergeRules(
847
- {
848
- "max-lines": [
849
- "error",
850
- {
851
- max: 500,
852
- skipBlankLines: true,
853
- skipComments: true
854
- }
855
- ]
856
- },
857
- testPreset.enabled ? vitestRules : void 0,
858
- testPreset.rules
859
- )
860
- });
861
- const config = {
862
- $schema: "./node_modules/oxlint/configuration_schema.json",
863
- categories: {
864
- correctness: "off",
865
- ...options.categories ?? {}
866
- },
867
- env: {
868
- browser: true,
869
- builtin: true,
870
- es2024: true,
871
- node: true,
872
- ...options.env ?? {}
873
- },
874
- extends: options.extends,
875
- globals: options.globals,
876
- ignorePatterns: ignorePreset.enabled ? dedupe([
877
- ...defaultIgnorePatterns,
878
- ...ignorePreset.patterns,
879
- ...options.ignorePatterns ?? []
880
- ]) : options.ignorePatterns,
881
- jsPlugins: reactAgentRulesPreset.enabled ? [reactAgentRulesPlugin, ...options.jsPlugins ?? []] : options.jsPlugins,
882
- overrides: [...overrides, ...options.overrides ?? []].map(pruneOverride).filter((override) => override !== null),
883
- plugins,
884
- rules,
885
- settings: options.settings
886
- };
887
- if (typeScriptPreset.enabled) {
888
- config.options = {
889
- typeAware: typeScriptPreset.options?.typeAware ?? true
890
- };
891
- }
892
- if (!config.ignorePatterns || config.ignorePatterns.length === 0) {
893
- delete config.ignorePatterns;
894
- }
895
- if (!config.extends || config.extends.length === 0) {
896
- delete config.extends;
897
- }
898
- if (!config.globals || Object.keys(config.globals).length === 0) {
899
- delete config.globals;
900
- }
901
- if (!config.overrides || config.overrides.length === 0) {
902
- delete config.overrides;
903
- }
904
- if (!config.jsPlugins || config.jsPlugins.length === 0) {
905
- delete config.jsPlugins;
906
- }
907
- if (!config.plugins || config.plugins.length === 0) {
908
- delete config.plugins;
909
- }
910
- if (!config.rules || Object.keys(config.rules).length === 0) {
911
- delete config.rules;
912
- }
913
- if (!config.settings || Object.keys(config.settings).length === 0) {
914
- delete config.settings;
915
- }
916
- return config;
629
+ const presets = {
630
+ ...defaultOxlintPresets,
631
+ ...options.presets
632
+ };
633
+ const ignorePreset = resolveIgnorePreset(presets.ignores, true);
634
+ const importPreset = resolveRulePreset(presets.imports, true);
635
+ const javascriptPreset = resolveRulePreset(presets.javascript, true);
636
+ const nextPreset = resolveRulePreset(presets.next, defaultOxlintPresets.next);
637
+ const nodePreset = resolveRulePreset(presets.node, false);
638
+ const reactPreset = resolveRulePreset(presets.react, defaultOxlintPresets.react);
639
+ const reactAgentRulesPreset = resolveRulePreset(options.presets?.reactAgentRules, reactPreset.enabled);
640
+ const testPreset = resolveRulePreset(presets.test, defaultOxlintPresets.test);
641
+ const typeScriptPreset = resolveRulePreset(presets.typescript, defaultOxlintPresets.typescript);
642
+ const unicornPreset = resolveRulePreset(presets.unicorn, true);
643
+ const reactAgentRulesForSourceFiles = reactAgentRulesPreset.enabled ? mergeRules(reactAgentRules, reactAgentRulesPreset.rules, pickRules(options.rules, (rule) => rule.startsWith("react-agent-rules/"))) : void 0;
644
+ const plugins = [];
645
+ const rules = mergeRules({ "max-lines": ["error", {
646
+ max: 300,
647
+ skipBlankLines: true,
648
+ skipComments: true
649
+ }] }, unicornPreset.enabled ? unicornRules : void 0, unicornPreset.rules, importPreset.enabled ? importRules : void 0, importPreset.rules, javascriptPreset.enabled ? javascriptRules : void 0, javascriptPreset.rules, nodePreset.enabled ? nodeRules : void 0, nodePreset.rules, reactAgentRulesPreset.enabled ? reactAgentRules : void 0, reactAgentRulesPreset.rules, options.rules);
650
+ if (unicornPreset.enabled) appendPlugin(plugins, "unicorn");
651
+ if (importPreset.enabled) appendPlugin(plugins, "import");
652
+ if (typeScriptPreset.enabled) appendPlugin(plugins, "typescript");
653
+ if (nodePreset.enabled) appendPlugin(plugins, "node");
654
+ const overrides = [];
655
+ if (reactAgentRulesPreset.enabled && reactAgentRulesForSourceFiles) overrides.push({
656
+ files: sourceFiles,
657
+ jsPlugins: [reactAgentRulesPlugin],
658
+ rules: reactAgentRulesForSourceFiles
659
+ });
660
+ if (javascriptPreset.enabled) overrides.push({
661
+ files: scriptFiles,
662
+ rules: { "no-console": "off" }
663
+ });
664
+ if (typeScriptPreset.enabled) {
665
+ overrides.push({
666
+ files: tsFiles,
667
+ rules: mergeRules(typeScriptRules, typeScriptPreset.rules)
668
+ });
669
+ overrides.push({
670
+ files: dtsFiles,
671
+ rules: { "import/no-duplicates": "off" }
672
+ });
673
+ overrides.push({
674
+ files: jsRequireFiles,
675
+ rules: {
676
+ "typescript/no-require-imports": "off",
677
+ "typescript/no-var-requires": "off"
678
+ }
679
+ });
680
+ }
681
+ overrides.push({
682
+ files: componentFiles,
683
+ rules: { "max-lines": ["error", {
684
+ max: 200,
685
+ skipBlankLines: true,
686
+ skipComments: true
687
+ }] }
688
+ });
689
+ if (reactPreset.enabled || nextPreset.enabled) {
690
+ const reactOptions = reactPreset.options ?? {};
691
+ const a11y = reactOptions.a11y ?? true;
692
+ const overridePlugins = [];
693
+ const reactRules = reactPreset.enabled ? createReactRules(reactOptions, nextPreset.enabled) : {};
694
+ const nextRules = nextPreset.enabled ? nextjsRules : {};
695
+ const mergedRules = mergeRules(reactRules, a11y && reactPreset.enabled ? jsxA11yRules : void 0, nextRules, reactAgentRulesPreset.enabled ? { "react/exhaustive-deps": "off" } : void 0, reactPreset.rules, nextPreset.rules);
696
+ if (reactPreset.enabled) appendPlugin(overridePlugins, "react");
697
+ if (reactPreset.enabled && a11y) appendPlugin(overridePlugins, "jsx-a11y");
698
+ if (nextPreset.enabled) appendPlugin(overridePlugins, "nextjs");
699
+ const override = pruneOverride({
700
+ files: sourceFiles,
701
+ plugins: overridePlugins,
702
+ rules: mergedRules
703
+ });
704
+ if (override) overrides.push(override);
705
+ }
706
+ overrides.push({
707
+ files: testFiles,
708
+ plugins: testPreset.enabled ? ["vitest"] : void 0,
709
+ rules: mergeRules({ "max-lines": ["error", {
710
+ max: 500,
711
+ skipBlankLines: true,
712
+ skipComments: true
713
+ }] }, testPreset.enabled ? vitestRules : void 0, testPreset.rules)
714
+ });
715
+ const config = {
716
+ $schema: "./node_modules/oxlint/configuration_schema.json",
717
+ categories: {
718
+ correctness: "off",
719
+ ...options.categories ?? {}
720
+ },
721
+ env: {
722
+ browser: true,
723
+ builtin: true,
724
+ es2024: true,
725
+ node: true,
726
+ ...options.env ?? {}
727
+ },
728
+ extends: options.extends,
729
+ globals: options.globals,
730
+ ignorePatterns: ignorePreset.enabled ? dedupe([
731
+ ...defaultIgnorePatterns,
732
+ ...ignorePreset.patterns,
733
+ ...options.ignorePatterns ?? []
734
+ ]) : options.ignorePatterns,
735
+ jsPlugins: reactAgentRulesPreset.enabled ? [reactAgentRulesPlugin, ...options.jsPlugins ?? []] : options.jsPlugins,
736
+ overrides: [...overrides, ...options.overrides ?? []].map(pruneOverride).filter((override) => override !== null),
737
+ plugins,
738
+ rules,
739
+ settings: options.settings
740
+ };
741
+ if (typeScriptPreset.enabled) config.options = { typeAware: typeScriptPreset.options?.typeAware ?? true };
742
+ if (!config.ignorePatterns || config.ignorePatterns.length === 0) delete config.ignorePatterns;
743
+ if (!config.extends || config.extends.length === 0) delete config.extends;
744
+ if (!config.globals || Object.keys(config.globals).length === 0) delete config.globals;
745
+ if (!config.overrides || config.overrides.length === 0) delete config.overrides;
746
+ if (!config.jsPlugins || config.jsPlugins.length === 0) delete config.jsPlugins;
747
+ if (!config.plugins || config.plugins.length === 0) delete config.plugins;
748
+ if (!config.rules || Object.keys(config.rules).length === 0) delete config.rules;
749
+ if (!config.settings || Object.keys(config.settings).length === 0) delete config.settings;
750
+ return config;
917
751
  }
918
- var defineConfig = defineOxlintConfig;
919
-
920
- // src/oxfmt/presets/imports.ts
921
- var defaultSortImports = {
922
- customGroups: [
923
- {
924
- elementNamePattern: ["next", "next/**"],
925
- groupName: "next"
926
- },
927
- {
928
- elementNamePattern: ["react", "react-dom", "react-dom/**"],
929
- groupName: "react"
930
- },
931
- {
932
- elementNamePattern: ["three", "three/**"],
933
- groupName: "three"
934
- },
935
- {
936
- elementNamePattern: ["@react-three/**"],
937
- groupName: "reactThree"
938
- }
939
- ],
940
- groups: [
941
- "value-builtin",
942
- "next",
943
- "react",
944
- "three",
945
- "reactThree",
946
- "value-external",
947
- "value-internal",
948
- ["value-index", "value-sibling", "value-parent"],
949
- "type-builtin",
950
- "type-external",
951
- "type-internal",
952
- ["type-index", "type-sibling", "type-parent"],
953
- "style",
954
- "side_effect",
955
- "side_effect_style",
956
- "unknown"
957
- ],
958
- ignoreCase: false,
959
- internalPattern: ["^@/.*", "^~/.*"],
960
- newlinesBetween: true,
961
- order: "asc",
962
- partitionByComment: false,
963
- partitionByNewline: false,
964
- sortSideEffects: true
752
+ const defineConfig = defineOxlintConfig;
753
+ //#endregion
754
+ //#region src/oxfmt/presets/imports.ts
755
+ const defaultSortImports = {
756
+ customGroups: [
757
+ {
758
+ elementNamePattern: ["next", "next/**"],
759
+ groupName: "next"
760
+ },
761
+ {
762
+ elementNamePattern: [
763
+ "react",
764
+ "react-dom",
765
+ "react-dom/**"
766
+ ],
767
+ groupName: "react"
768
+ },
769
+ {
770
+ elementNamePattern: ["three", "three/**"],
771
+ groupName: "three"
772
+ },
773
+ {
774
+ elementNamePattern: ["@react-three/**"],
775
+ groupName: "reactThree"
776
+ }
777
+ ],
778
+ groups: [
779
+ "value-builtin",
780
+ "next",
781
+ "react",
782
+ "three",
783
+ "reactThree",
784
+ "value-external",
785
+ "value-internal",
786
+ [
787
+ "value-index",
788
+ "value-sibling",
789
+ "value-parent"
790
+ ],
791
+ "type-builtin",
792
+ "type-external",
793
+ "type-internal",
794
+ [
795
+ "type-index",
796
+ "type-sibling",
797
+ "type-parent"
798
+ ],
799
+ "style",
800
+ "side_effect",
801
+ "side_effect_style",
802
+ "unknown"
803
+ ],
804
+ ignoreCase: false,
805
+ internalPattern: ["^@/.*", "^~/.*"],
806
+ newlinesBetween: true,
807
+ order: "asc",
808
+ partitionByComment: false,
809
+ partitionByNewline: false,
810
+ sortSideEffects: true
965
811
  };
966
-
967
- // src/oxfmt/presets/package-json.ts
968
- var defaultSortPackageJson = {
969
- sortScripts: false
970
- };
971
-
972
- // src/oxfmt/presets/tailwindcss.ts
973
- var defaultTailwindSort = {
974
- functions: ["clsx", "cn", "cva", "tw"]
975
- };
976
-
977
- // src/oxfmt/index.ts
978
- var defaultOxfmtPresets = {
979
- imports: true,
980
- packageJson: true,
981
- tailwindcss: false
812
+ //#endregion
813
+ //#region src/oxfmt/presets/package-json.ts
814
+ const defaultSortPackageJson = { sortScripts: false };
815
+ //#endregion
816
+ //#region src/oxfmt/presets/tailwindcss.ts
817
+ const defaultTailwindSort = { functions: [
818
+ "clsx",
819
+ "cn",
820
+ "cva",
821
+ "tw"
822
+ ] };
823
+ //#endregion
824
+ //#region src/oxfmt/index.ts
825
+ const defaultOxfmtPresets = {
826
+ imports: true,
827
+ packageJson: true,
828
+ tailwindcss: false
982
829
  };
983
830
  function defineOxfmtConfig(options = {}) {
984
- const presets = {
985
- ...defaultOxfmtPresets,
986
- ...options.presets
987
- };
988
- const importsPreset = resolvePreset(presets.imports, true);
989
- const packageJsonPreset = resolvePreset(presets.packageJson, true);
990
- const tailwindPreset = resolvePreset(presets.tailwindcss, false);
991
- const sortImports = importsPreset.enabled ? {
992
- ...defaultSortImports,
993
- ...importsPreset.options
994
- } : false;
995
- const sortPackageJson = packageJsonPreset.enabled ? {
996
- ...defaultSortPackageJson,
997
- ...packageJsonPreset.options
998
- } : false;
999
- const sortTailwindcss = tailwindPreset.enabled ? {
1000
- ...defaultTailwindSort,
1001
- ...tailwindPreset.options
1002
- } : false;
1003
- return {
1004
- $schema: "./node_modules/oxfmt/configuration_schema.json",
1005
- endOfLine: options.endOfLine ?? "lf",
1006
- ignorePatterns: dedupe([
1007
- ...defaultIgnorePatterns,
1008
- ...options.ignorePatterns ?? []
1009
- ]),
1010
- overrides: options.overrides,
1011
- printWidth: options.printWidth ?? 80,
1012
- semi: options.semi ?? false,
1013
- singleQuote: options.singleQuote ?? true,
1014
- sortImports,
1015
- sortPackageJson,
1016
- sortTailwindcss,
1017
- tabWidth: options.tabWidth ?? 2,
1018
- trailingComma: options.trailingComma ?? "all",
1019
- useTabs: options.useTabs ?? false
1020
- };
831
+ const presets = {
832
+ ...defaultOxfmtPresets,
833
+ ...options.presets
834
+ };
835
+ const importsPreset = resolvePreset(presets.imports, true);
836
+ const packageJsonPreset = resolvePreset(presets.packageJson, true);
837
+ const tailwindPreset = resolvePreset(presets.tailwindcss, false);
838
+ const sortImports = importsPreset.enabled ? {
839
+ ...defaultSortImports,
840
+ ...importsPreset.options
841
+ } : false;
842
+ const sortPackageJson = packageJsonPreset.enabled ? {
843
+ ...defaultSortPackageJson,
844
+ ...packageJsonPreset.options
845
+ } : false;
846
+ const sortTailwindcss = tailwindPreset.enabled ? {
847
+ ...defaultTailwindSort,
848
+ ...tailwindPreset.options
849
+ } : false;
850
+ return {
851
+ $schema: "./node_modules/oxfmt/configuration_schema.json",
852
+ endOfLine: options.endOfLine ?? "lf",
853
+ ignorePatterns: dedupe([...defaultIgnorePatterns, ...options.ignorePatterns ?? []]),
854
+ overrides: options.overrides,
855
+ printWidth: options.printWidth ?? 80,
856
+ semi: options.semi ?? false,
857
+ singleQuote: options.singleQuote ?? true,
858
+ sortImports,
859
+ sortPackageJson,
860
+ sortTailwindcss,
861
+ tabWidth: options.tabWidth ?? 2,
862
+ trailingComma: options.trailingComma ?? "all",
863
+ useTabs: options.useTabs ?? false
864
+ };
1021
865
  }
1022
- export {
1023
- defaultIgnorePatterns,
1024
- defaultOxfmtPresets,
1025
- defaultOxlintPresets,
1026
- defaultSortImports,
1027
- defineConfig,
1028
- defineOxfmtConfig,
1029
- defineOxlintConfig
1030
- };
866
+ //#endregion
867
+ export { defaultIgnorePatterns, defaultOxfmtPresets, defaultOxlintPresets, defaultSortImports, defineConfig, defineOxfmtConfig, defineOxlintConfig };