@apst/oxlint 0.0.0-dev.20260324.f9d48c4e → 0.0.0-dev.20260624.019efa3b

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 (61) hide show
  1. package/README.md +7 -0
  2. package/dist/presets/common/index.d.ts +3 -4
  3. package/dist/presets/common/index.js +1 -3
  4. package/dist/presets/common/index.mjs +3 -4
  5. package/dist/presets/common/plugin/index.d.ts +1 -2
  6. package/dist/presets/common/plugin/index.js +0 -2
  7. package/dist/presets/common/plugin/index.js.map +1 -1
  8. package/dist/presets/common/plugin/index.mjs +1 -2
  9. package/dist/presets/common/plugin/index.mjs.map +1 -1
  10. package/dist/presets/common/preset/index.js +1 -4
  11. package/dist/presets/common/preset/index.js.map +1 -1
  12. package/dist/presets/common/preset/index.mjs +2 -5
  13. package/dist/presets/common/preset/index.mjs.map +1 -1
  14. package/dist/presets/common/rules/eslint.d.ts +8 -4
  15. package/dist/presets/common/rules/eslint.js +4 -4
  16. package/dist/presets/common/rules/eslint.js.map +1 -1
  17. package/dist/presets/common/rules/eslint.mjs +4 -4
  18. package/dist/presets/common/rules/eslint.mjs.map +1 -1
  19. package/dist/presets/common/rules/import.d.ts +10 -0
  20. package/dist/presets/common/rules/import.js +5 -0
  21. package/dist/presets/common/rules/import.js.map +1 -1
  22. package/dist/presets/common/rules/import.mjs +5 -0
  23. package/dist/presets/common/rules/import.mjs.map +1 -1
  24. package/dist/presets/common/rules/typescript.d.ts +58 -44
  25. package/dist/presets/common/rules/typescript.js +20 -15
  26. package/dist/presets/common/rules/typescript.js.map +1 -1
  27. package/dist/presets/common/rules/typescript.mjs +20 -15
  28. package/dist/presets/common/rules/typescript.mjs.map +1 -1
  29. package/dist/presets/common/rules/unicorn.d.ts +13 -9
  30. package/dist/presets/common/rules/unicorn.js +7 -4
  31. package/dist/presets/common/rules/unicorn.js.map +1 -1
  32. package/dist/presets/common/rules/unicorn.mjs +7 -5
  33. package/dist/presets/common/rules/unicorn.mjs.map +1 -1
  34. package/dist/presets/jsx/rules/jsx-a11y.d.ts +16 -0
  35. package/dist/presets/jsx/rules/jsx-a11y.js +15 -0
  36. package/dist/presets/jsx/rules/jsx-a11y.js.map +1 -1
  37. package/dist/presets/jsx/rules/jsx-a11y.mjs +15 -0
  38. package/dist/presets/jsx/rules/jsx-a11y.mjs.map +1 -1
  39. package/dist/presets/next/rules/nextjs.js +1 -0
  40. package/dist/presets/next/rules/nextjs.js.map +1 -1
  41. package/dist/presets/next/rules/nextjs.mjs +1 -0
  42. package/dist/presets/next/rules/nextjs.mjs.map +1 -1
  43. package/dist/presets/react/index.d.ts +2 -2
  44. package/dist/presets/react/index.js +1 -0
  45. package/dist/presets/react/index.mjs +2 -2
  46. package/dist/presets/react/rules/react.d.ts +32 -1
  47. package/dist/presets/react/rules/react.js +15 -2
  48. package/dist/presets/react/rules/react.js.map +1 -1
  49. package/dist/presets/react/rules/react.mjs +15 -3
  50. package/dist/presets/react/rules/react.mjs.map +1 -1
  51. package/dist/presets/vitest/rules/vitest.d.ts +4 -0
  52. package/dist/presets/vitest/rules/vitest.js +3 -1
  53. package/dist/presets/vitest/rules/vitest.js.map +1 -1
  54. package/dist/presets/vitest/rules/vitest.mjs +3 -1
  55. package/dist/presets/vitest/rules/vitest.mjs.map +1 -1
  56. package/package.json +12 -44
  57. package/dist/presets/common/rules/stylistic.d.ts +0 -14
  58. package/dist/presets/common/rules/stylistic.js +0 -14
  59. package/dist/presets/common/rules/stylistic.js.map +0 -1
  60. package/dist/presets/common/rules/stylistic.mjs +0 -13
  61. package/dist/presets/common/rules/stylistic.mjs.map +0 -1
@@ -1,19 +1,8 @@
1
1
  declare const RULES_TYPESCRIPT_NURSERY: {
2
- readonly "typescript/consistent-return": ["error", {
3
- readonly treatUndefinedAsUnspecified: false;
4
- }];
5
- readonly "typescript/consistent-type-exports": ["error", {
6
- readonly fixMixedExportsWithInlineTypeSpecifier: false;
7
- }];
8
- readonly "typescript/dot-notation": ["error", {
9
- readonly allowIndexSignaturePropertyAccess: false;
10
- readonly allowKeywords: true;
11
- readonly allowPrivateClassPropertyAccess: false;
12
- readonly allowProtectedClassPropertyAccess: false;
2
+ readonly "typescript/no-unnecessary-condition": ["error", {
3
+ readonly allowConstantLoopConditions: true;
4
+ readonly checkTypePredicates: true;
13
5
  }];
14
- readonly "typescript/no-unnecessary-type-conversion": "error";
15
- readonly "typescript/no-unnecessary-type-parameters": "error";
16
- readonly "typescript/no-useless-default-assignment": "error";
17
6
  readonly "typescript/prefer-optional-chain": ["error", {
18
7
  readonly allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false;
19
8
  readonly checkAny: true;
@@ -24,13 +13,6 @@ declare const RULES_TYPESCRIPT_NURSERY: {
24
13
  readonly checkUnknown: true;
25
14
  readonly requireNullish: false;
26
15
  }];
27
- readonly "typescript/prefer-readonly": ["error", {
28
- readonly onlyInlineLambdas: false;
29
- }];
30
- readonly "typescript/prefer-regexp-exec": "error";
31
- readonly "typescript/strict-void-return": ["error", {
32
- readonly allowReturnAny: false;
33
- }];
34
16
  };
35
17
  declare const RULES_TYPESCRIPT_PEDANTIC: {
36
18
  readonly "typescript/no-misused-promises": ["error", {
@@ -92,6 +74,9 @@ declare const RULES_TYPESCRIPT_PEDANTIC: {
92
74
  readonly allowNumber: true;
93
75
  readonly allowString: true;
94
76
  }];
77
+ readonly "typescript/strict-void-return": ["error", {
78
+ readonly allowReturnAny: false;
79
+ }];
95
80
  readonly "typescript/switch-exhaustiveness-check": ["error", {
96
81
  readonly allowDefaultCaseForExhaustiveSwitch: true;
97
82
  readonly considerDefaultExhaustiveForUnions: true;
@@ -99,6 +84,9 @@ declare const RULES_TYPESCRIPT_PEDANTIC: {
99
84
  }];
100
85
  };
101
86
  declare const RULES_TYPESCRIPT_RESTRICTION: {
87
+ readonly "typescript/explicit-member-accessibility": ["error", {
88
+ readonly accessibility: "explicit";
89
+ }];
102
90
  readonly "typescript/no-empty-object-type": ["error", {
103
91
  readonly allowInterfaces: "with-single-extends";
104
92
  readonly allowObjectTypes: "never";
@@ -124,11 +112,21 @@ declare const RULES_TYPESCRIPT_STYLE: {
124
112
  readonly assertionStyle: "as";
125
113
  }];
126
114
  readonly "typescript/consistent-type-definitions": ["error", "type"];
115
+ readonly "typescript/consistent-type-exports": ["error", {
116
+ readonly fixMixedExportsWithInlineTypeSpecifier: false;
117
+ }];
127
118
  readonly "typescript/consistent-type-imports": ["error", {
128
- readonly disallowTypeImports: true;
119
+ readonly disallowTypeAnnotations: true;
129
120
  readonly fixStyle: "separate-type-imports";
130
121
  readonly prefer: "type-imports";
131
122
  }];
123
+ readonly "typescript/dot-notation": ["error", {
124
+ readonly allowIndexSignaturePropertyAccess: false;
125
+ readonly allowKeywords: true;
126
+ readonly allowPrivateClassPropertyAccess: false;
127
+ readonly allowProtectedClassPropertyAccess: false;
128
+ }];
129
+ readonly "typescript/method-signature-style": ["error", "property"];
132
130
  readonly "typescript/no-empty-interface": ["error", {
133
131
  readonly allowSingleExtends: true;
134
132
  }];
@@ -137,28 +135,52 @@ declare const RULES_TYPESCRIPT_STYLE: {
137
135
  }];
138
136
  readonly "typescript/prefer-function-type": "error";
139
137
  readonly "typescript/prefer-reduce-type-parameter": "error";
138
+ readonly "typescript/prefer-readonly": ["error", {
139
+ readonly onlyInlineLambdas: false;
140
+ }];
141
+ readonly "typescript/prefer-regexp-exec": "error";
140
142
  readonly "typescript/prefer-return-this-type": "error";
141
143
  };
142
144
  declare const RULES_TYPESCRIPT_SUSPICIOUS: {
145
+ readonly "typescript/consistent-return": ["error", {
146
+ readonly treatUndefinedAsUnspecified: false;
147
+ }];
143
148
  readonly "typescript/no-confusing-non-null-assertion": "error";
144
149
  readonly "typescript/no-unnecessary-template-expression": "error";
145
150
  readonly "typescript/no-unnecessary-type-constraint": "error";
151
+ readonly "typescript/no-unnecessary-type-conversion": "error";
152
+ readonly "typescript/no-unnecessary-type-parameters": "error";
146
153
  readonly "typescript/no-unsafe-enum-comparison": "error";
147
154
  };
148
155
  declare const RULES_TYPESCRIPT: {
156
+ readonly "typescript/consistent-return": ["error", {
157
+ readonly treatUndefinedAsUnspecified: false;
158
+ }];
149
159
  readonly "typescript/no-confusing-non-null-assertion": "error";
150
160
  readonly "typescript/no-unnecessary-template-expression": "error";
151
161
  readonly "typescript/no-unnecessary-type-constraint": "error";
162
+ readonly "typescript/no-unnecessary-type-conversion": "error";
163
+ readonly "typescript/no-unnecessary-type-parameters": "error";
152
164
  readonly "typescript/no-unsafe-enum-comparison": "error";
153
165
  readonly "typescript/consistent-type-assertions": ["error", {
154
166
  readonly assertionStyle: "as";
155
167
  }];
156
168
  readonly "typescript/consistent-type-definitions": ["error", "type"];
169
+ readonly "typescript/consistent-type-exports": ["error", {
170
+ readonly fixMixedExportsWithInlineTypeSpecifier: false;
171
+ }];
157
172
  readonly "typescript/consistent-type-imports": ["error", {
158
- readonly disallowTypeImports: true;
173
+ readonly disallowTypeAnnotations: true;
159
174
  readonly fixStyle: "separate-type-imports";
160
175
  readonly prefer: "type-imports";
161
176
  }];
177
+ readonly "typescript/dot-notation": ["error", {
178
+ readonly allowIndexSignaturePropertyAccess: false;
179
+ readonly allowKeywords: true;
180
+ readonly allowPrivateClassPropertyAccess: false;
181
+ readonly allowProtectedClassPropertyAccess: false;
182
+ }];
183
+ readonly "typescript/method-signature-style": ["error", "property"];
162
184
  readonly "typescript/no-empty-interface": ["error", {
163
185
  readonly allowSingleExtends: true;
164
186
  }];
@@ -167,7 +189,14 @@ declare const RULES_TYPESCRIPT: {
167
189
  }];
168
190
  readonly "typescript/prefer-function-type": "error";
169
191
  readonly "typescript/prefer-reduce-type-parameter": "error";
192
+ readonly "typescript/prefer-readonly": ["error", {
193
+ readonly onlyInlineLambdas: false;
194
+ }];
195
+ readonly "typescript/prefer-regexp-exec": "error";
170
196
  readonly "typescript/prefer-return-this-type": "error";
197
+ readonly "typescript/explicit-member-accessibility": ["error", {
198
+ readonly accessibility: "explicit";
199
+ }];
171
200
  readonly "typescript/no-empty-object-type": ["error", {
172
201
  readonly allowInterfaces: "with-single-extends";
173
202
  readonly allowObjectTypes: "never";
@@ -246,26 +275,18 @@ declare const RULES_TYPESCRIPT: {
246
275
  readonly allowNumber: true;
247
276
  readonly allowString: true;
248
277
  }];
278
+ readonly "typescript/strict-void-return": ["error", {
279
+ readonly allowReturnAny: false;
280
+ }];
249
281
  readonly "typescript/switch-exhaustiveness-check": ["error", {
250
282
  readonly allowDefaultCaseForExhaustiveSwitch: true;
251
283
  readonly considerDefaultExhaustiveForUnions: true;
252
284
  readonly requireDefaultForNonUnion: false;
253
285
  }];
254
- readonly "typescript/consistent-return": ["error", {
255
- readonly treatUndefinedAsUnspecified: false;
256
- }];
257
- readonly "typescript/consistent-type-exports": ["error", {
258
- readonly fixMixedExportsWithInlineTypeSpecifier: false;
286
+ readonly "typescript/no-unnecessary-condition": ["error", {
287
+ readonly allowConstantLoopConditions: true;
288
+ readonly checkTypePredicates: true;
259
289
  }];
260
- readonly "typescript/dot-notation": ["error", {
261
- readonly allowIndexSignaturePropertyAccess: false;
262
- readonly allowKeywords: true;
263
- readonly allowPrivateClassPropertyAccess: false;
264
- readonly allowProtectedClassPropertyAccess: false;
265
- }];
266
- readonly "typescript/no-unnecessary-type-conversion": "error";
267
- readonly "typescript/no-unnecessary-type-parameters": "error";
268
- readonly "typescript/no-useless-default-assignment": "error";
269
290
  readonly "typescript/prefer-optional-chain": ["error", {
270
291
  readonly allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false;
271
292
  readonly checkAny: true;
@@ -276,13 +297,6 @@ declare const RULES_TYPESCRIPT: {
276
297
  readonly checkUnknown: true;
277
298
  readonly requireNullish: false;
278
299
  }];
279
- readonly "typescript/prefer-readonly": ["error", {
280
- readonly onlyInlineLambdas: false;
281
- }];
282
- readonly "typescript/prefer-regexp-exec": "error";
283
- readonly "typescript/strict-void-return": ["error", {
284
- readonly allowReturnAny: false;
285
- }];
286
300
  };
287
301
  export { RULES_TYPESCRIPT, RULES_TYPESCRIPT_NURSERY, RULES_TYPESCRIPT_PEDANTIC, RULES_TYPESCRIPT_RESTRICTION, RULES_TYPESCRIPT_STYLE, RULES_TYPESCRIPT_SUSPICIOUS };
288
302
  //# sourceMappingURL=typescript.d.ts.map
@@ -1,16 +1,9 @@
1
1
 
2
2
  const RULES_TYPESCRIPT_NURSERY = {
3
- "typescript/consistent-return": ["error", { treatUndefinedAsUnspecified: false }],
4
- "typescript/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: false }],
5
- "typescript/dot-notation": ["error", {
6
- allowIndexSignaturePropertyAccess: false,
7
- allowKeywords: true,
8
- allowPrivateClassPropertyAccess: false,
9
- allowProtectedClassPropertyAccess: false
3
+ "typescript/no-unnecessary-condition": ["error", {
4
+ allowConstantLoopConditions: true,
5
+ checkTypePredicates: true
10
6
  }],
11
- "typescript/no-unnecessary-type-conversion": "error",
12
- "typescript/no-unnecessary-type-parameters": "error",
13
- "typescript/no-useless-default-assignment": "error",
14
7
  "typescript/prefer-optional-chain": ["error", {
15
8
  allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false,
16
9
  checkAny: true,
@@ -20,10 +13,7 @@ const RULES_TYPESCRIPT_NURSERY = {
20
13
  checkString: true,
21
14
  checkUnknown: true,
22
15
  requireNullish: false
23
- }],
24
- "typescript/prefer-readonly": ["error", { onlyInlineLambdas: false }],
25
- "typescript/prefer-regexp-exec": "error",
26
- "typescript/strict-void-return": ["error", { allowReturnAny: false }]
16
+ }]
27
17
  };
28
18
  const RULES_TYPESCRIPT_PEDANTIC = {
29
19
  "typescript/no-misused-promises": ["error", {
@@ -85,6 +75,7 @@ const RULES_TYPESCRIPT_PEDANTIC = {
85
75
  allowNumber: true,
86
76
  allowString: true
87
77
  }],
78
+ "typescript/strict-void-return": ["error", { allowReturnAny: false }],
88
79
  "typescript/switch-exhaustiveness-check": ["error", {
89
80
  allowDefaultCaseForExhaustiveSwitch: true,
90
81
  considerDefaultExhaustiveForUnions: true,
@@ -92,6 +83,7 @@ const RULES_TYPESCRIPT_PEDANTIC = {
92
83
  }]
93
84
  };
94
85
  const RULES_TYPESCRIPT_RESTRICTION = {
86
+ "typescript/explicit-member-accessibility": ["error", { accessibility: "explicit" }],
95
87
  "typescript/no-empty-object-type": ["error", {
96
88
  allowInterfaces: "with-single-extends",
97
89
  allowObjectTypes: "never"
@@ -115,21 +107,34 @@ const RULES_TYPESCRIPT_RESTRICTION = {
115
107
  const RULES_TYPESCRIPT_STYLE = {
116
108
  "typescript/consistent-type-assertions": ["error", { assertionStyle: "as" }],
117
109
  "typescript/consistent-type-definitions": ["error", "type"],
110
+ "typescript/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: false }],
118
111
  "typescript/consistent-type-imports": ["error", {
119
- disallowTypeImports: true,
112
+ disallowTypeAnnotations: true,
120
113
  fixStyle: "separate-type-imports",
121
114
  prefer: "type-imports"
122
115
  }],
116
+ "typescript/dot-notation": ["error", {
117
+ allowIndexSignaturePropertyAccess: false,
118
+ allowKeywords: true,
119
+ allowPrivateClassPropertyAccess: false,
120
+ allowProtectedClassPropertyAccess: false
121
+ }],
122
+ "typescript/method-signature-style": ["error", "property"],
123
123
  "typescript/no-empty-interface": ["error", { allowSingleExtends: true }],
124
124
  "typescript/parameter-properties": ["error", { prefer: "class-property" }],
125
125
  "typescript/prefer-function-type": "error",
126
126
  "typescript/prefer-reduce-type-parameter": "error",
127
+ "typescript/prefer-readonly": ["error", { onlyInlineLambdas: false }],
128
+ "typescript/prefer-regexp-exec": "error",
127
129
  "typescript/prefer-return-this-type": "error"
128
130
  };
129
131
  const RULES_TYPESCRIPT_SUSPICIOUS = {
132
+ "typescript/consistent-return": ["error", { treatUndefinedAsUnspecified: false }],
130
133
  "typescript/no-confusing-non-null-assertion": "error",
131
134
  "typescript/no-unnecessary-template-expression": "error",
132
135
  "typescript/no-unnecessary-type-constraint": "error",
136
+ "typescript/no-unnecessary-type-conversion": "error",
137
+ "typescript/no-unnecessary-type-parameters": "error",
133
138
  "typescript/no-unsafe-enum-comparison": "error"
134
139
  };
135
140
  const RULES_TYPESCRIPT = {
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.js","names":[],"sources":["../../../../src/presets/common/rules/typescript.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_TYPESCRIPT_NURSERY = {\n \"typescript/consistent-return\": [\n \"error\",\n {\n treatUndefinedAsUnspecified: false,\n },\n ],\n \"typescript/consistent-type-exports\": [\n \"error\",\n {\n fixMixedExportsWithInlineTypeSpecifier: false,\n },\n ],\n \"typescript/dot-notation\": [\n \"error\",\n {\n allowIndexSignaturePropertyAccess: false,\n allowKeywords: true,\n allowPrivateClassPropertyAccess: false,\n allowProtectedClassPropertyAccess: false,\n },\n ],\n \"typescript/no-unnecessary-type-conversion\": \"error\",\n \"typescript/no-unnecessary-type-parameters\": \"error\",\n \"typescript/no-useless-default-assignment\": \"error\",\n \"typescript/prefer-optional-chain\": [\n \"error\",\n {\n allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false,\n checkAny: true,\n checkBigInt: true,\n checkBoolean: true,\n checkNumber: true,\n checkString: true,\n checkUnknown: true,\n requireNullish: false,\n },\n ],\n \"typescript/prefer-readonly\": [\n \"error\",\n {\n onlyInlineLambdas: false,\n },\n ],\n \"typescript/prefer-regexp-exec\": \"error\",\n \"typescript/strict-void-return\": [\n \"error\",\n {\n allowReturnAny: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_PEDANTIC = {\n \"typescript/no-misused-promises\": [\n \"error\",\n {\n checksConditionals: true,\n checksSpreads: true,\n checksVoidReturn: {\n arguments: true,\n attributes: true,\n inheritedMethods: true,\n properties: true,\n returns: true,\n variables: true,\n },\n },\n ],\n \"typescript/no-mixed-enums\": \"error\",\n \"typescript/no-unsafe-argument\": \"error\",\n \"typescript/no-unsafe-assignment\": \"error\",\n \"typescript/no-unsafe-call\": \"error\",\n \"typescript/no-unsafe-function-type\": \"error\",\n \"typescript/no-unsafe-member-access\": \"error\",\n \"typescript/no-unsafe-return\": \"error\",\n \"typescript/only-throw-error\": \"error\",\n \"typescript/prefer-includes\": \"error\",\n \"typescript/prefer-nullish-coalescing\": [\n \"error\",\n {\n ignoreBooleanCoercion: false,\n ignoreConditionalTests: false,\n ignoreIfStatements: false,\n ignoreMixedLogicalExpressions: false,\n ignorePrimitives: {\n bigint: false,\n boolean: false,\n number: false,\n string: false,\n },\n ignoreTernaryTests: false,\n },\n ],\n \"typescript/prefer-promise-reject-errors\": [\n \"error\",\n {\n allowEmptyReject: false,\n allowThrowingAny: false,\n allowThrowingUnknown: false,\n },\n ],\n \"typescript/prefer-ts-expect-error\": \"error\",\n \"typescript/restrict-plus-operands\": [\n \"error\",\n {\n allowAny: true,\n allowBoolean: true,\n allowNullish: true,\n allowNumberAndString: true,\n allowRegExp: true,\n skipCompoundAssignments: false,\n },\n ],\n \"typescript/return-await\": [\n \"error\",\n \"always\",\n ],\n \"typescript/strict-boolean-expressions\": [\n \"error\",\n {\n allowAny: true,\n allowNullableBoolean: false,\n allowNullableEnum: false,\n allowNullableNumber: false,\n allowNullableObject: true,\n allowNullableString: false,\n allowNumber: true,\n allowString: true,\n },\n ],\n \"typescript/switch-exhaustiveness-check\": [\n \"error\",\n {\n allowDefaultCaseForExhaustiveSwitch: true,\n considerDefaultExhaustiveForUnions: true,\n requireDefaultForNonUnion: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_RESTRICTION = {\n \"typescript/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\",\n },\n ],\n \"typescript/no-import-type-side-effects\": \"error\",\n \"typescript/no-namespace\": [\n \"error\",\n {\n allowDeclarations: false,\n allowDefinitionFiles: true,\n },\n ],\n \"typescript/no-non-null-asserted-nullish-coalescing\": \"error\",\n \"typescript/no-non-null-assertion\": \"error\",\n \"typescript/promise-function-async\": [\n \"error\",\n {\n allowAny: true,\n checkArrowFunctions: true,\n checkFunctionDeclarations: true,\n checkFunctionExpressions: true,\n checkMethodDeclarations: true,\n },\n ],\n \"typescript/use-unknown-in-catch-callback-variable\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_STYLE = {\n \"typescript/consistent-type-assertions\": [\n \"error\",\n {\n assertionStyle: \"as\",\n },\n ],\n \"typescript/consistent-type-definitions\": [\n \"error\",\n \"type\",\n ],\n \"typescript/consistent-type-imports\": [\n \"error\",\n {\n disallowTypeImports: true,\n fixStyle: \"separate-type-imports\",\n prefer: \"type-imports\",\n },\n ],\n \"typescript/no-empty-interface\": [\n \"error\",\n {\n allowSingleExtends: true,\n },\n ],\n \"typescript/parameter-properties\": [\n \"error\",\n {\n prefer: \"class-property\",\n },\n ],\n \"typescript/prefer-function-type\": \"error\",\n \"typescript/prefer-reduce-type-parameter\": \"error\",\n \"typescript/prefer-return-this-type\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_SUSPICIOUS = {\n \"typescript/no-confusing-non-null-assertion\": \"error\",\n \"typescript/no-unnecessary-template-expression\": \"error\",\n \"typescript/no-unnecessary-type-constraint\": \"error\",\n \"typescript/no-unsafe-enum-comparison\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT = {\n ...RULES_TYPESCRIPT_NURSERY,\n ...RULES_TYPESCRIPT_PEDANTIC,\n ...RULES_TYPESCRIPT_RESTRICTION,\n ...RULES_TYPESCRIPT_STYLE,\n ...RULES_TYPESCRIPT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_TYPESCRIPT,\n RULES_TYPESCRIPT_NURSERY,\n RULES_TYPESCRIPT_PEDANTIC,\n RULES_TYPESCRIPT_RESTRICTION,\n RULES_TYPESCRIPT_STYLE,\n RULES_TYPESCRIPT_SUSPICIOUS,\n};\n"],"mappings":";AAEA,MAAM,2BA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ACA;EACI,UAAU;EACV,sBAAsB;EACtB,mBAAmB;EACnB,qBAAqB;EACrB,qBAAqB;EACrB,qBAAqB;EACrB,aAAa;EACb,aAAa;CACjB,CACJ;CACA,0CAA0C,CACtC,SACA;EACI,qCAAqC;EACrC,oCAAoC;EACpC,2BAA2B;CAC/B,CACJ;AACJ;AAEA,MAAM,+BAA+B;CACjC,mCAAmC,CAC/B,SACA;EACI,iBAAiB;EACjB,kBAAkB;CACtB,CACJ;CACA,0CAA0C;CAC1C,2BAA2B,CACvB,SACA;EACI,mBAAmB;EACnB,sBAAsB;CAC1B,CACJ;CACA,sDAAsD;CACtD,oCAAoC;CACpC,qCAAqC,CACjC,SACA;EACI,UAAU;EACV,qBAAqB;EACrB,2BAA2B;EAC3B,0BAA0B;EAC1B,yBAAyB;CAC7B,CACJ;CACA,qDAAqD;AACzD;AAEA,MAAM,yBAAyB;CAC3B,yCAAyC,CACrC,SACA,EACI,gBAAgB,KACpB,CACJ;CACA,0CAA0C,CACtC,SACA,MACJ;CACA,sCAAsC,CAClC,SACA;EACI,qBAAqB;EACrB,UAAU;EACV,QAAQ;CACZ,CACJ;CACA,iCAAiC,CAC7B,SACA,EACI,oBAAoB,KACxB,CACJ;CACA,mCAAmC,CAC/B,SACA,EACI,QAAQ,iBACZ,CACJ;CACA,mCAAmC;CACnC,2CAA2C;CAC3C,sCAAsC;AAC1C;AAEA,MAAM,8BAA8B;CAChC,8CAA8C;CAC9C,iDAAiD;CACjD,6CAA6C;CAC7C,wCAAwC;AAC5C;AAEA,MAAM,mBAAmB;CACrB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
1
+ {"version":3,"file":"typescript.js","names":[],"sources":["../../../../src/presets/common/rules/typescript.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_TYPESCRIPT_NURSERY = {\n \"typescript/no-unnecessary-condition\": [\n \"error\",\n {\n allowConstantLoopConditions: true,\n checkTypePredicates: true,\n },\n ],\n \"typescript/prefer-optional-chain\": [\n \"error\",\n {\n allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false,\n checkAny: true,\n checkBigInt: true,\n checkBoolean: true,\n checkNumber: true,\n checkString: true,\n checkUnknown: true,\n requireNullish: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_PEDANTIC = {\n \"typescript/no-misused-promises\": [\n \"error\",\n {\n checksConditionals: true,\n checksSpreads: true,\n checksVoidReturn: {\n arguments: true,\n attributes: true,\n inheritedMethods: true,\n properties: true,\n returns: true,\n variables: true,\n },\n },\n ],\n \"typescript/no-mixed-enums\": \"error\",\n \"typescript/no-unsafe-argument\": \"error\",\n \"typescript/no-unsafe-assignment\": \"error\",\n \"typescript/no-unsafe-call\": \"error\",\n \"typescript/no-unsafe-function-type\": \"error\",\n \"typescript/no-unsafe-member-access\": \"error\",\n \"typescript/no-unsafe-return\": \"error\",\n \"typescript/only-throw-error\": \"error\",\n \"typescript/prefer-includes\": \"error\",\n \"typescript/prefer-nullish-coalescing\": [\n \"error\",\n {\n ignoreBooleanCoercion: false,\n ignoreConditionalTests: false,\n ignoreIfStatements: false,\n ignoreMixedLogicalExpressions: false,\n ignorePrimitives: {\n bigint: false,\n boolean: false,\n number: false,\n string: false,\n },\n ignoreTernaryTests: false,\n },\n ],\n \"typescript/prefer-promise-reject-errors\": [\n \"error\",\n {\n allowEmptyReject: false,\n allowThrowingAny: false,\n allowThrowingUnknown: false,\n },\n ],\n \"typescript/prefer-ts-expect-error\": \"error\",\n \"typescript/restrict-plus-operands\": [\n \"error\",\n {\n allowAny: true,\n allowBoolean: true,\n allowNullish: true,\n allowNumberAndString: true,\n allowRegExp: true,\n skipCompoundAssignments: false,\n },\n ],\n \"typescript/return-await\": [\n \"error\",\n \"always\",\n ],\n \"typescript/strict-boolean-expressions\": [\n \"error\",\n {\n allowAny: true,\n allowNullableBoolean: false,\n allowNullableEnum: false,\n allowNullableNumber: false,\n allowNullableObject: true,\n allowNullableString: false,\n allowNumber: true,\n allowString: true,\n },\n ],\n \"typescript/strict-void-return\": [\n \"error\",\n {\n allowReturnAny: false,\n },\n ],\n \"typescript/switch-exhaustiveness-check\": [\n \"error\",\n {\n allowDefaultCaseForExhaustiveSwitch: true,\n considerDefaultExhaustiveForUnions: true,\n requireDefaultForNonUnion: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_RESTRICTION = {\n \"typescript/explicit-member-accessibility\": [\n \"error\",\n {\n accessibility: \"explicit\",\n },\n ],\n \"typescript/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\",\n },\n ],\n \"typescript/no-import-type-side-effects\": \"error\",\n \"typescript/no-namespace\": [\n \"error\",\n {\n allowDeclarations: false,\n allowDefinitionFiles: true,\n },\n ],\n \"typescript/no-non-null-asserted-nullish-coalescing\": \"error\",\n \"typescript/no-non-null-assertion\": \"error\",\n \"typescript/promise-function-async\": [\n \"error\",\n {\n allowAny: true,\n checkArrowFunctions: true,\n checkFunctionDeclarations: true,\n checkFunctionExpressions: true,\n checkMethodDeclarations: true,\n },\n ],\n \"typescript/use-unknown-in-catch-callback-variable\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_STYLE = {\n \"typescript/consistent-type-assertions\": [\n \"error\",\n {\n assertionStyle: \"as\",\n },\n ],\n \"typescript/consistent-type-definitions\": [\n \"error\",\n \"type\",\n ],\n \"typescript/consistent-type-exports\": [\n \"error\",\n {\n fixMixedExportsWithInlineTypeSpecifier: false,\n },\n ],\n \"typescript/consistent-type-imports\": [\n \"error\",\n {\n disallowTypeAnnotations: true,\n fixStyle: \"separate-type-imports\",\n prefer: \"type-imports\",\n },\n ],\n \"typescript/dot-notation\": [\n \"error\",\n {\n allowIndexSignaturePropertyAccess: false,\n allowKeywords: true,\n allowPrivateClassPropertyAccess: false,\n allowProtectedClassPropertyAccess: false,\n },\n ],\n \"typescript/method-signature-style\": [\n \"error\",\n \"property\",\n ],\n \"typescript/no-empty-interface\": [\n \"error\",\n {\n allowSingleExtends: true,\n },\n ],\n \"typescript/parameter-properties\": [\n \"error\",\n {\n prefer: \"class-property\",\n },\n ],\n \"typescript/prefer-function-type\": \"error\",\n \"typescript/prefer-reduce-type-parameter\": \"error\",\n \"typescript/prefer-readonly\": [\n \"error\",\n {\n onlyInlineLambdas: false,\n },\n ],\n \"typescript/prefer-regexp-exec\": \"error\",\n \"typescript/prefer-return-this-type\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_SUSPICIOUS = {\n \"typescript/consistent-return\": [\n \"error\",\n {\n treatUndefinedAsUnspecified: false,\n },\n ],\n \"typescript/no-confusing-non-null-assertion\": \"error\",\n \"typescript/no-unnecessary-template-expression\": \"error\",\n \"typescript/no-unnecessary-type-constraint\": \"error\",\n \"typescript/no-unnecessary-type-conversion\": \"error\",\n \"typescript/no-unnecessary-type-parameters\": \"error\",\n \"typescript/no-unsafe-enum-comparison\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT = {\n ...RULES_TYPESCRIPT_NURSERY,\n ...RULES_TYPESCRIPT_PEDANTIC,\n ...RULES_TYPESCRIPT_RESTRICTION,\n ...RULES_TYPESCRIPT_STYLE,\n ...RULES_TYPESCRIPT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_TYPESCRIPT,\n RULES_TYPESCRIPT_NURSERY,\n RULES_TYPESCRIPT_PEDANTIC,\n RULES_TYPESCRIPT_RESTRICTION,\n RULES_TYPESCRIPT_STYLE,\n RULES_TYPESCRIPT_SUSPICIOUS,\n};\n"],"mappings":";AAEA,MAAM,2BAA2B;CAC7B,uCAAuC,CACnC,SACA;EACI,6BAA6B;EAC7B,qBAAqB;CACzB,CACJ;CACA,oCAAoC,CAChC,SACA;EACI,oEAAoE;EACpE,UAAU;EACV,aAAa;EACb,cAAc;EACd,aAAa;EACb,aAAa;EACb,cAAc;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,CACJ;CACA,sDAAsD;CACtD,oCAAoC;CACpC,qCAAqC,CACjC,SACA;EACI,UAAU;EACV,qBAAqB;EACrB,2BAA2B;EAC3B,0BAA0B;EAC1B,yBAAyB;CAC7B,CACJ;CACA,qDAAqD;AACzD;AAEA,MAAM,yBAAyB;CAC3B,yCAAyC,CACrC,SACA,EACI,gBAAgB,KACpB,CACJ;CACA,0CAA0C,CACtC,SACA,MACJ;CACA,sCAAsC,CAClC,SACA,EACI,wCAAwC,MAC5C,CACJ;CACA,sCAAsC,CAClC,SACA;EACI,yBAAyB;EACzB,UAAU;EACV,QAAQ;CACZ,CACJ;CACA,2BAA2B,CACvB,SACA;EACI,mCAAmC;EACnC,eAAe;EACf,iCAAiC;EACjC,mCAAmC;CACvC,CACJ;CACA,qCAAqC,CACjC,SACA,UACJ;CACA,iCAAiC,CAC7B,SACA,EACI,oBAAoB,KACxB,CACJ;CACA,mCAAmC,CAC/B,SACA,EACI,QAAQ,iBACZ,CACJ;CACA,mCAAmC;CACnC,2CAA2C;CAC3C,8BAA8B,CAC1B,SACA,EACI,mBAAmB,MACvB,CACJ;CACA,iCAAiC;CACjC,sCAAsC;AAC1C;AAEA,MAAM,8BAA8B;CAChC,gCAAgC,CAC5B,SACA,EACI,6BAA6B,MACjC,CACJ;CACA,8CAA8C;CAC9C,iDAAiD;CACjD,6CAA6C;CAC7C,6CAA6C;CAC7C,6CAA6C;CAC7C,wCAAwC;AAC5C;AAEA,MAAM,mBAAmB;CACrB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
@@ -1,15 +1,8 @@
1
1
  const RULES_TYPESCRIPT_NURSERY = {
2
- "typescript/consistent-return": ["error", { treatUndefinedAsUnspecified: false }],
3
- "typescript/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: false }],
4
- "typescript/dot-notation": ["error", {
5
- allowIndexSignaturePropertyAccess: false,
6
- allowKeywords: true,
7
- allowPrivateClassPropertyAccess: false,
8
- allowProtectedClassPropertyAccess: false
2
+ "typescript/no-unnecessary-condition": ["error", {
3
+ allowConstantLoopConditions: true,
4
+ checkTypePredicates: true
9
5
  }],
10
- "typescript/no-unnecessary-type-conversion": "error",
11
- "typescript/no-unnecessary-type-parameters": "error",
12
- "typescript/no-useless-default-assignment": "error",
13
6
  "typescript/prefer-optional-chain": ["error", {
14
7
  allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false,
15
8
  checkAny: true,
@@ -19,10 +12,7 @@ const RULES_TYPESCRIPT_NURSERY = {
19
12
  checkString: true,
20
13
  checkUnknown: true,
21
14
  requireNullish: false
22
- }],
23
- "typescript/prefer-readonly": ["error", { onlyInlineLambdas: false }],
24
- "typescript/prefer-regexp-exec": "error",
25
- "typescript/strict-void-return": ["error", { allowReturnAny: false }]
15
+ }]
26
16
  };
27
17
  const RULES_TYPESCRIPT_PEDANTIC = {
28
18
  "typescript/no-misused-promises": ["error", {
@@ -84,6 +74,7 @@ const RULES_TYPESCRIPT_PEDANTIC = {
84
74
  allowNumber: true,
85
75
  allowString: true
86
76
  }],
77
+ "typescript/strict-void-return": ["error", { allowReturnAny: false }],
87
78
  "typescript/switch-exhaustiveness-check": ["error", {
88
79
  allowDefaultCaseForExhaustiveSwitch: true,
89
80
  considerDefaultExhaustiveForUnions: true,
@@ -91,6 +82,7 @@ const RULES_TYPESCRIPT_PEDANTIC = {
91
82
  }]
92
83
  };
93
84
  const RULES_TYPESCRIPT_RESTRICTION = {
85
+ "typescript/explicit-member-accessibility": ["error", { accessibility: "explicit" }],
94
86
  "typescript/no-empty-object-type": ["error", {
95
87
  allowInterfaces: "with-single-extends",
96
88
  allowObjectTypes: "never"
@@ -114,21 +106,34 @@ const RULES_TYPESCRIPT_RESTRICTION = {
114
106
  const RULES_TYPESCRIPT_STYLE = {
115
107
  "typescript/consistent-type-assertions": ["error", { assertionStyle: "as" }],
116
108
  "typescript/consistent-type-definitions": ["error", "type"],
109
+ "typescript/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: false }],
117
110
  "typescript/consistent-type-imports": ["error", {
118
- disallowTypeImports: true,
111
+ disallowTypeAnnotations: true,
119
112
  fixStyle: "separate-type-imports",
120
113
  prefer: "type-imports"
121
114
  }],
115
+ "typescript/dot-notation": ["error", {
116
+ allowIndexSignaturePropertyAccess: false,
117
+ allowKeywords: true,
118
+ allowPrivateClassPropertyAccess: false,
119
+ allowProtectedClassPropertyAccess: false
120
+ }],
121
+ "typescript/method-signature-style": ["error", "property"],
122
122
  "typescript/no-empty-interface": ["error", { allowSingleExtends: true }],
123
123
  "typescript/parameter-properties": ["error", { prefer: "class-property" }],
124
124
  "typescript/prefer-function-type": "error",
125
125
  "typescript/prefer-reduce-type-parameter": "error",
126
+ "typescript/prefer-readonly": ["error", { onlyInlineLambdas: false }],
127
+ "typescript/prefer-regexp-exec": "error",
126
128
  "typescript/prefer-return-this-type": "error"
127
129
  };
128
130
  const RULES_TYPESCRIPT_SUSPICIOUS = {
131
+ "typescript/consistent-return": ["error", { treatUndefinedAsUnspecified: false }],
129
132
  "typescript/no-confusing-non-null-assertion": "error",
130
133
  "typescript/no-unnecessary-template-expression": "error",
131
134
  "typescript/no-unnecessary-type-constraint": "error",
135
+ "typescript/no-unnecessary-type-conversion": "error",
136
+ "typescript/no-unnecessary-type-parameters": "error",
132
137
  "typescript/no-unsafe-enum-comparison": "error"
133
138
  };
134
139
  const RULES_TYPESCRIPT = {
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.mjs","names":[],"sources":["../../../../src/presets/common/rules/typescript.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_TYPESCRIPT_NURSERY = {\n \"typescript/consistent-return\": [\n \"error\",\n {\n treatUndefinedAsUnspecified: false,\n },\n ],\n \"typescript/consistent-type-exports\": [\n \"error\",\n {\n fixMixedExportsWithInlineTypeSpecifier: false,\n },\n ],\n \"typescript/dot-notation\": [\n \"error\",\n {\n allowIndexSignaturePropertyAccess: false,\n allowKeywords: true,\n allowPrivateClassPropertyAccess: false,\n allowProtectedClassPropertyAccess: false,\n },\n ],\n \"typescript/no-unnecessary-type-conversion\": \"error\",\n \"typescript/no-unnecessary-type-parameters\": \"error\",\n \"typescript/no-useless-default-assignment\": \"error\",\n \"typescript/prefer-optional-chain\": [\n \"error\",\n {\n allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false,\n checkAny: true,\n checkBigInt: true,\n checkBoolean: true,\n checkNumber: true,\n checkString: true,\n checkUnknown: true,\n requireNullish: false,\n },\n ],\n \"typescript/prefer-readonly\": [\n \"error\",\n {\n onlyInlineLambdas: false,\n },\n ],\n \"typescript/prefer-regexp-exec\": \"error\",\n \"typescript/strict-void-return\": [\n \"error\",\n {\n allowReturnAny: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_PEDANTIC = {\n \"typescript/no-misused-promises\": [\n \"error\",\n {\n checksConditionals: true,\n checksSpreads: true,\n checksVoidReturn: {\n arguments: true,\n attributes: true,\n inheritedMethods: true,\n properties: true,\n returns: true,\n variables: true,\n },\n },\n ],\n \"typescript/no-mixed-enums\": \"error\",\n \"typescript/no-unsafe-argument\": \"error\",\n \"typescript/no-unsafe-assignment\": \"error\",\n \"typescript/no-unsafe-call\": \"error\",\n \"typescript/no-unsafe-function-type\": \"error\",\n \"typescript/no-unsafe-member-access\": \"error\",\n \"typescript/no-unsafe-return\": \"error\",\n \"typescript/only-throw-error\": \"error\",\n \"typescript/prefer-includes\": \"error\",\n \"typescript/prefer-nullish-coalescing\": [\n \"error\",\n {\n ignoreBooleanCoercion: false,\n ignoreConditionalTests: false,\n ignoreIfStatements: false,\n ignoreMixedLogicalExpressions: false,\n ignorePrimitives: {\n bigint: false,\n boolean: false,\n number: false,\n string: false,\n },\n ignoreTernaryTests: false,\n },\n ],\n \"typescript/prefer-promise-reject-errors\": [\n \"error\",\n {\n allowEmptyReject: false,\n allowThrowingAny: false,\n allowThrowingUnknown: false,\n },\n ],\n \"typescript/prefer-ts-expect-error\": \"error\",\n \"typescript/restrict-plus-operands\": [\n \"error\",\n {\n allowAny: true,\n allowBoolean: true,\n allowNullish: true,\n allowNumberAndString: true,\n allowRegExp: true,\n skipCompoundAssignments: false,\n },\n ],\n \"typescript/return-await\": [\n \"error\",\n \"always\",\n ],\n \"typescript/strict-boolean-expressions\": [\n \"error\",\n {\n allowAny: true,\n allowNullableBoolean: false,\n allowNullableEnum: false,\n allowNullableNumber: false,\n allowNullableObject: true,\n allowNullableString: false,\n allowNumber: true,\n allowString: true,\n },\n ],\n \"typescript/switch-exhaustiveness-check\": [\n \"error\",\n {\n allowDefaultCaseForExhaustiveSwitch: true,\n considerDefaultExhaustiveForUnions: true,\n requireDefaultForNonUnion: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_RESTRICTION = {\n \"typescript/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\",\n },\n ],\n \"typescript/no-import-type-side-effects\": \"error\",\n \"typescript/no-namespace\": [\n \"error\",\n {\n allowDeclarations: false,\n allowDefinitionFiles: true,\n },\n ],\n \"typescript/no-non-null-asserted-nullish-coalescing\": \"error\",\n \"typescript/no-non-null-assertion\": \"error\",\n \"typescript/promise-function-async\": [\n \"error\",\n {\n allowAny: true,\n checkArrowFunctions: true,\n checkFunctionDeclarations: true,\n checkFunctionExpressions: true,\n checkMethodDeclarations: true,\n },\n ],\n \"typescript/use-unknown-in-catch-callback-variable\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_STYLE = {\n \"typescript/consistent-type-assertions\": [\n \"error\",\n {\n assertionStyle: \"as\",\n },\n ],\n \"typescript/consistent-type-definitions\": [\n \"error\",\n \"type\",\n ],\n \"typescript/consistent-type-imports\": [\n \"error\",\n {\n disallowTypeImports: true,\n fixStyle: \"separate-type-imports\",\n prefer: \"type-imports\",\n },\n ],\n \"typescript/no-empty-interface\": [\n \"error\",\n {\n allowSingleExtends: true,\n },\n ],\n \"typescript/parameter-properties\": [\n \"error\",\n {\n prefer: \"class-property\",\n },\n ],\n \"typescript/prefer-function-type\": \"error\",\n \"typescript/prefer-reduce-type-parameter\": \"error\",\n \"typescript/prefer-return-this-type\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_SUSPICIOUS = {\n \"typescript/no-confusing-non-null-assertion\": \"error\",\n \"typescript/no-unnecessary-template-expression\": \"error\",\n \"typescript/no-unnecessary-type-constraint\": \"error\",\n \"typescript/no-unsafe-enum-comparison\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT = {\n ...RULES_TYPESCRIPT_NURSERY,\n ...RULES_TYPESCRIPT_PEDANTIC,\n ...RULES_TYPESCRIPT_RESTRICTION,\n ...RULES_TYPESCRIPT_STYLE,\n ...RULES_TYPESCRIPT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_TYPESCRIPT,\n RULES_TYPESCRIPT_NURSERY,\n RULES_TYPESCRIPT_PEDANTIC,\n RULES_TYPESCRIPT_RESTRICTION,\n RULES_TYPESCRIPT_STYLE,\n RULES_TYPESCRIPT_SUSPICIOUS,\n};\n"],"mappings":"AAEA,MAAM,2BAA2B;CAC7B,gCAAgC,CAC5B,SACA,EACI,6BAA6B,MACjC,CACJ;CACA,sCAAsC,CAClC,SACA,EACI,wCAAwC,MAC5C,CACJ;CACA,2BAA2B,CACvB,SACA;EACI,mCAAmC;EACnC,eAAe;EACf,iCAAiC;EACjC,mCAAmC;CACvC,CACJ;CACA,6CAA6C;CAC7C,6CAA6C;CAC7C,4CAA4C;CAC5C,oCAAoC,CAChC,SACA;EACI,oEAAoE;EACpE,UAAU;EACV,aAAa;EACb,cAAc;EACd,aAAa;EACb,aAAa;EACb,cAAc;EACd,gBAAgB;CACpB,CACJ;CACA,8BAA8B,CAC1B,SACA,EACI,mBAAmB,MACvB,CACJ;CACA,iCAAiC;CACjC,iC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AqB;EACrB,2BAA2B;EAC3B,0BAA0B;EAC1B,yBAAyB;CAC7B,CACJ;CACA,qDAAqD;AACzD;AAEA,MAAM,yBAAyB;CAC3B,yCAAyC,CACrC,SACA,EACI,gBAAgB,KACpB,CACJ;CACA,0CAA0C,CACtC,SACA,MACJ;CACA,sCAAsC,CAClC,SACA;EACI,qBAAqB;EACrB,UAAU;EACV,QAAQ;CACZ,CACJ;CACA,iCAAiC,CAC7B,SACA,EACI,oBAAoB,KACxB,CACJ;CACA,mCAAmC,CAC/B,SACA,EACI,QAAQ,iBACZ,CACJ;CACA,mCAAmC;CACnC,2CAA2C;CAC3C,sCAAsC;AAC1C;AAEA,MAAM,8BAA8B;CAChC,8CAA8C;CAC9C,iDAAiD;CACjD,6CAA6C;CAC7C,wCAAwC;AAC5C;AAEA,MAAM,mBAAmB;CACrB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
1
+ {"version":3,"file":"typescript.mjs","names":[],"sources":["../../../../src/presets/common/rules/typescript.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_TYPESCRIPT_NURSERY = {\n \"typescript/no-unnecessary-condition\": [\n \"error\",\n {\n allowConstantLoopConditions: true,\n checkTypePredicates: true,\n },\n ],\n \"typescript/prefer-optional-chain\": [\n \"error\",\n {\n allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false,\n checkAny: true,\n checkBigInt: true,\n checkBoolean: true,\n checkNumber: true,\n checkString: true,\n checkUnknown: true,\n requireNullish: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_PEDANTIC = {\n \"typescript/no-misused-promises\": [\n \"error\",\n {\n checksConditionals: true,\n checksSpreads: true,\n checksVoidReturn: {\n arguments: true,\n attributes: true,\n inheritedMethods: true,\n properties: true,\n returns: true,\n variables: true,\n },\n },\n ],\n \"typescript/no-mixed-enums\": \"error\",\n \"typescript/no-unsafe-argument\": \"error\",\n \"typescript/no-unsafe-assignment\": \"error\",\n \"typescript/no-unsafe-call\": \"error\",\n \"typescript/no-unsafe-function-type\": \"error\",\n \"typescript/no-unsafe-member-access\": \"error\",\n \"typescript/no-unsafe-return\": \"error\",\n \"typescript/only-throw-error\": \"error\",\n \"typescript/prefer-includes\": \"error\",\n \"typescript/prefer-nullish-coalescing\": [\n \"error\",\n {\n ignoreBooleanCoercion: false,\n ignoreConditionalTests: false,\n ignoreIfStatements: false,\n ignoreMixedLogicalExpressions: false,\n ignorePrimitives: {\n bigint: false,\n boolean: false,\n number: false,\n string: false,\n },\n ignoreTernaryTests: false,\n },\n ],\n \"typescript/prefer-promise-reject-errors\": [\n \"error\",\n {\n allowEmptyReject: false,\n allowThrowingAny: false,\n allowThrowingUnknown: false,\n },\n ],\n \"typescript/prefer-ts-expect-error\": \"error\",\n \"typescript/restrict-plus-operands\": [\n \"error\",\n {\n allowAny: true,\n allowBoolean: true,\n allowNullish: true,\n allowNumberAndString: true,\n allowRegExp: true,\n skipCompoundAssignments: false,\n },\n ],\n \"typescript/return-await\": [\n \"error\",\n \"always\",\n ],\n \"typescript/strict-boolean-expressions\": [\n \"error\",\n {\n allowAny: true,\n allowNullableBoolean: false,\n allowNullableEnum: false,\n allowNullableNumber: false,\n allowNullableObject: true,\n allowNullableString: false,\n allowNumber: true,\n allowString: true,\n },\n ],\n \"typescript/strict-void-return\": [\n \"error\",\n {\n allowReturnAny: false,\n },\n ],\n \"typescript/switch-exhaustiveness-check\": [\n \"error\",\n {\n allowDefaultCaseForExhaustiveSwitch: true,\n considerDefaultExhaustiveForUnions: true,\n requireDefaultForNonUnion: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_RESTRICTION = {\n \"typescript/explicit-member-accessibility\": [\n \"error\",\n {\n accessibility: \"explicit\",\n },\n ],\n \"typescript/no-empty-object-type\": [\n \"error\",\n {\n allowInterfaces: \"with-single-extends\",\n allowObjectTypes: \"never\",\n },\n ],\n \"typescript/no-import-type-side-effects\": \"error\",\n \"typescript/no-namespace\": [\n \"error\",\n {\n allowDeclarations: false,\n allowDefinitionFiles: true,\n },\n ],\n \"typescript/no-non-null-asserted-nullish-coalescing\": \"error\",\n \"typescript/no-non-null-assertion\": \"error\",\n \"typescript/promise-function-async\": [\n \"error\",\n {\n allowAny: true,\n checkArrowFunctions: true,\n checkFunctionDeclarations: true,\n checkFunctionExpressions: true,\n checkMethodDeclarations: true,\n },\n ],\n \"typescript/use-unknown-in-catch-callback-variable\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_STYLE = {\n \"typescript/consistent-type-assertions\": [\n \"error\",\n {\n assertionStyle: \"as\",\n },\n ],\n \"typescript/consistent-type-definitions\": [\n \"error\",\n \"type\",\n ],\n \"typescript/consistent-type-exports\": [\n \"error\",\n {\n fixMixedExportsWithInlineTypeSpecifier: false,\n },\n ],\n \"typescript/consistent-type-imports\": [\n \"error\",\n {\n disallowTypeAnnotations: true,\n fixStyle: \"separate-type-imports\",\n prefer: \"type-imports\",\n },\n ],\n \"typescript/dot-notation\": [\n \"error\",\n {\n allowIndexSignaturePropertyAccess: false,\n allowKeywords: true,\n allowPrivateClassPropertyAccess: false,\n allowProtectedClassPropertyAccess: false,\n },\n ],\n \"typescript/method-signature-style\": [\n \"error\",\n \"property\",\n ],\n \"typescript/no-empty-interface\": [\n \"error\",\n {\n allowSingleExtends: true,\n },\n ],\n \"typescript/parameter-properties\": [\n \"error\",\n {\n prefer: \"class-property\",\n },\n ],\n \"typescript/prefer-function-type\": \"error\",\n \"typescript/prefer-reduce-type-parameter\": \"error\",\n \"typescript/prefer-readonly\": [\n \"error\",\n {\n onlyInlineLambdas: false,\n },\n ],\n \"typescript/prefer-regexp-exec\": \"error\",\n \"typescript/prefer-return-this-type\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT_SUSPICIOUS = {\n \"typescript/consistent-return\": [\n \"error\",\n {\n treatUndefinedAsUnspecified: false,\n },\n ],\n \"typescript/no-confusing-non-null-assertion\": \"error\",\n \"typescript/no-unnecessary-template-expression\": \"error\",\n \"typescript/no-unnecessary-type-constraint\": \"error\",\n \"typescript/no-unnecessary-type-conversion\": \"error\",\n \"typescript/no-unnecessary-type-parameters\": \"error\",\n \"typescript/no-unsafe-enum-comparison\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_TYPESCRIPT = {\n ...RULES_TYPESCRIPT_NURSERY,\n ...RULES_TYPESCRIPT_PEDANTIC,\n ...RULES_TYPESCRIPT_RESTRICTION,\n ...RULES_TYPESCRIPT_STYLE,\n ...RULES_TYPESCRIPT_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_TYPESCRIPT,\n RULES_TYPESCRIPT_NURSERY,\n RULES_TYPESCRIPT_PEDANTIC,\n RULES_TYPESCRIPT_RESTRICTION,\n RULES_TYPESCRIPT_STYLE,\n RULES_TYPESCRIPT_SUSPICIOUS,\n};\n"],"mappings":"AAEA,MAAM,2BAA2B;CAC7B,uCAAuC,CACnC,SACA;EACI,6BAA6B;EAC7B,qBAAqB;CACzB,CACJ;CACA,oCAAoC,CAChC,SACA;EACI,oEAAoE;EACpE,UAAU;EACV,aAAa;EACb,cAAc;EACd,aAAa;EACb,aAAa;EACb,cAAc;EACd,gBAAgB;CACpB,CACJ;AACJ;AAEA,MAAM,4BAA4B;CAC9B,kCAAkC,CAC9B,SACA;EACI,oBAAoB;EACpB,eAAe;EACf,kBAAkB;GACd,WAAW;GACX,YAAY;GACZ,kBAAkB;GAClB,YAAY;GACZ,SAAS;GACT,WAAW;EACf;CACJ,CACJ;CACA,6BAA6B;CAC7B,iCAAiC;CACjC,mCAAmC;CACnC,6BAA6B;CAC7B,sCAAsC;CACtC,sCAAsC;CACtC,+BAA+B;CAC/B,+BAA+B;CAC/B,8BAA8B;CAC9B,wCAAwC,CACpC,SACA;EACI,uBAAuB;EACvB,wBAAwB;EACxB,oBAAoB;EACpB,+BAA+B;EAC/B,kBAAkB;GACd,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iCAAiC;EACjC,mCAAmC;CACvC,CACJ;CACA,qCAAqC,CACjC,SACA,UACJ;CACA,iCAAiC,CAC7B,SACA,EACI,oBAAoB,KACxB,CACJ;CACA,mCAAmC,CAC/B,SACA,EACI,QAAQ,iBACZ,CACJ;CACA,mCAAmC;CACnC,2CAA2C;CAC3C,8BAA8B,CAC1B,SACA,EACI,mBAAmB,MACvB,CACJ;CACA,iCAAiC;CACjC,sCAAsC;AAC1C;AAEA,MAAM,8BAA8B;CAChC,gCAAgC,CAC5B,SACA,EACI,6BAA6B,MACjC,CACJ;CACA,8CAA8C;CAC9C,iDAAiD;CACjD,6CAA6C;CAC7C,6CAA6C;CAC7C,6CAA6C;CAC7C,wCAAwC;AAC5C;AAEA,MAAM,mBAAmB;CACrB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
@@ -1,3 +1,6 @@
1
+ declare const RULES_UNICORN_NURSERY: {
2
+ readonly "unicorn/no-useless-iterator-to-array": "error";
3
+ };
1
4
  declare const RULES_UNICORN_PEDANTIC: {
2
5
  readonly "unicorn/consistent-empty-array-spread": "error";
3
6
  readonly "unicorn/explicit-length-check": ["error", {
@@ -28,6 +31,8 @@ declare const RULES_UNICORN_RESTRICTION: {
28
31
  declare const RULES_UNICORN_STYLE: {
29
32
  readonly "unicorn/consistent-date-clone": "error";
30
33
  readonly "unicorn/consistent-existence-index-check": "error";
34
+ readonly "unicorn/consistent-template-literal-escape": "error";
35
+ readonly "unicorn/custom-error-definition": "error";
31
36
  readonly "unicorn/empty-brace-spaces": "error";
32
37
  readonly "unicorn/error-message": "error";
33
38
  readonly "unicorn/no-array-method-this-argument": "error";
@@ -64,6 +69,7 @@ declare const RULES_UNICORN_STYLE: {
64
69
  readonly "unicorn/relative-url-style": ["error", "always"];
65
70
  readonly "unicorn/require-module-attributes": "error";
66
71
  readonly "unicorn/switch-case-braces": "error";
72
+ readonly "unicorn/switch-case-break-position": "error";
67
73
  readonly "unicorn/text-encoding-identifier-case": ["error", {
68
74
  readonly withDash: true;
69
75
  }];
@@ -76,10 +82,7 @@ declare const RULES_UNICORN_SUSPICIOUS: {
76
82
  readonly "unicorn/no-array-sort": ["error", {
77
83
  readonly allowExpressionStatement: true;
78
84
  }];
79
- readonly "unicorn/no-instanceof-builtins": ["error", {
80
- readonly strategy: "strict";
81
- readonly useErrorIsError: false;
82
- }];
85
+ readonly "unicorn/no-instanceof-builtins": ["allow"];
83
86
  };
84
87
  declare const RULES_UNICORN: {
85
88
  readonly "unicorn/consistent-function-scoping": "error";
@@ -88,12 +91,11 @@ declare const RULES_UNICORN: {
88
91
  readonly "unicorn/no-array-sort": ["error", {
89
92
  readonly allowExpressionStatement: true;
90
93
  }];
91
- readonly "unicorn/no-instanceof-builtins": ["error", {
92
- readonly strategy: "strict";
93
- readonly useErrorIsError: false;
94
- }];
94
+ readonly "unicorn/no-instanceof-builtins": ["allow"];
95
95
  readonly "unicorn/consistent-date-clone": "error";
96
96
  readonly "unicorn/consistent-existence-index-check": "error";
97
+ readonly "unicorn/consistent-template-literal-escape": "error";
98
+ readonly "unicorn/custom-error-definition": "error";
97
99
  readonly "unicorn/empty-brace-spaces": "error";
98
100
  readonly "unicorn/error-message": "error";
99
101
  readonly "unicorn/no-array-method-this-argument": "error";
@@ -130,6 +132,7 @@ declare const RULES_UNICORN: {
130
132
  readonly "unicorn/relative-url-style": ["error", "always"];
131
133
  readonly "unicorn/require-module-attributes": "error";
132
134
  readonly "unicorn/switch-case-braces": "error";
135
+ readonly "unicorn/switch-case-break-position": "error";
133
136
  readonly "unicorn/text-encoding-identifier-case": ["error", {
134
137
  readonly withDash: true;
135
138
  }];
@@ -157,6 +160,7 @@ declare const RULES_UNICORN: {
157
160
  readonly "unicorn/prefer-math-min-max": "error";
158
161
  readonly "unicorn/prefer-type-error": "error";
159
162
  readonly "unicorn/require-number-to-fixed-digits-argument": "error";
163
+ readonly "unicorn/no-useless-iterator-to-array": "error";
160
164
  };
161
- export { RULES_UNICORN, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS };
165
+ export { RULES_UNICORN, RULES_UNICORN_NURSERY, RULES_UNICORN_PEDANTIC, RULES_UNICORN_RESTRICTION, RULES_UNICORN_STYLE, RULES_UNICORN_SUSPICIOUS };
162
166
  //# sourceMappingURL=unicorn.d.ts.map
@@ -1,4 +1,5 @@
1
1
 
2
+ const RULES_UNICORN_NURSERY = { "unicorn/no-useless-iterator-to-array": "error" };
2
3
  const RULES_UNICORN_PEDANTIC = {
3
4
  "unicorn/consistent-empty-array-spread": "error",
4
5
  "unicorn/explicit-length-check": ["error", { "non-zero": "greater-than" }],
@@ -25,6 +26,8 @@ const RULES_UNICORN_RESTRICTION = {
25
26
  const RULES_UNICORN_STYLE = {
26
27
  "unicorn/consistent-date-clone": "error",
27
28
  "unicorn/consistent-existence-index-check": "error",
29
+ "unicorn/consistent-template-literal-escape": "error",
30
+ "unicorn/custom-error-definition": "error",
28
31
  "unicorn/empty-brace-spaces": "error",
29
32
  "unicorn/error-message": "error",
30
33
  "unicorn/no-array-method-this-argument": "error",
@@ -61,6 +64,7 @@ const RULES_UNICORN_STYLE = {
61
64
  "unicorn/relative-url-style": ["error", "always"],
62
65
  "unicorn/require-module-attributes": "error",
63
66
  "unicorn/switch-case-braces": "error",
67
+ "unicorn/switch-case-break-position": "error",
64
68
  "unicorn/text-encoding-identifier-case": ["error", { withDash: true }],
65
69
  "unicorn/throw-new-error": "error"
66
70
  };
@@ -69,12 +73,10 @@ const RULES_UNICORN_SUSPICIOUS = {
69
73
  "unicorn/no-accessor-recursion": "error",
70
74
  "unicorn/no-array-reverse": "error",
71
75
  "unicorn/no-array-sort": ["error", { allowExpressionStatement: true }],
72
- "unicorn/no-instanceof-builtins": ["error", {
73
- strategy: "strict",
74
- useErrorIsError: false
75
- }]
76
+ "unicorn/no-instanceof-builtins": ["allow"]
76
77
  };
77
78
  const RULES_UNICORN = {
79
+ ...RULES_UNICORN_NURSERY,
78
80
  ...RULES_UNICORN_PEDANTIC,
79
81
  ...RULES_UNICORN_RESTRICTION,
80
82
  ...RULES_UNICORN_STYLE,
@@ -82,6 +84,7 @@ const RULES_UNICORN = {
82
84
  };
83
85
 
84
86
  exports.RULES_UNICORN = RULES_UNICORN;
87
+ exports.RULES_UNICORN_NURSERY = RULES_UNICORN_NURSERY;
85
88
  exports.RULES_UNICORN_PEDANTIC = RULES_UNICORN_PEDANTIC;
86
89
  exports.RULES_UNICORN_RESTRICTION = RULES_UNICORN_RESTRICTION;
87
90
  exports.RULES_UNICORN_STYLE = RULES_UNICORN_STYLE;
@@ -1 +1 @@
1
- {"version":3,"file":"unicorn.js","names":[],"sources":["../../../../src/presets/common/rules/unicorn.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_UNICORN_PEDANTIC = {\n \"unicorn/consistent-empty-array-spread\": \"error\",\n \"unicorn/explicit-length-check\": [\n \"error\",\n {\n \"non-zero\": \"greater-than\",\n },\n ],\n \"unicorn/new-for-builtins\": \"error\",\n \"unicorn/no-instanceof-array\": \"error\",\n \"unicorn/no-new-buffer\": \"error\",\n \"unicorn/no-unnecessary-array-flat-depth\": \"error\",\n \"unicorn/no-unnecessary-array-splice-count\": \"error\",\n \"unicorn/no-unnecessary-slice-end\": \"error\",\n \"unicorn/no-useless-promise-resolve-reject\": [\n \"error\",\n {\n allowReject: false,\n },\n ],\n \"unicorn/prefer-date-now\": \"error\",\n \"unicorn/prefer-math-min-max\": \"error\",\n \"unicorn/prefer-type-error\": \"error\",\n \"unicorn/require-number-to-fixed-digits-argument\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_UNICORN_RESTRICTION = {\n \"unicorn/no-length-as-slice-end\": \"error\",\n \"unicorn/prefer-node-protocol\": \"error\",\n \"unicorn/prefer-number-properties\": [\n \"error\",\n {\n checkInfinity: true,\n checkNaN: true,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_UNICORN_STYLE = {\n \"unicorn/consistent-date-clone\": \"error\",\n \"unicorn/consistent-existence-index-check\": \"error\",\n \"unicorn/empty-brace-spaces\": \"error\",\n \"unicorn/error-message\": \"error\",\n \"unicorn/no-array-method-this-argument\": \"error\",\n \"unicorn/no-unreadable-array-destructuring\": \"error\",\n \"unicorn/no-useless-collection-argument\": \"error\",\n \"unicorn/numeric-separators-style\": [\n \"error\",\n {\n binary: {\n groupLength: 3,\n minimumDigits: 5,\n },\n hexadecimal: {\n groupLength: 3,\n minimumDigits: 5,\n },\n number: {\n groupLength: 3,\n minimumDigits: 5,\n },\n octal: {\n groupLength: 3,\n minimumDigits: 5,\n },\n onlyIfContainsSeparator: false,\n },\n ],\n \"unicorn/prefer-classlist-toggle\": \"error\",\n \"unicorn/prefer-dom-node-text-content\": \"error\",\n \"unicorn/prefer-global-this\": \"error\",\n \"unicorn/prefer-includes\": \"error\",\n \"unicorn/prefer-keyboard-event-key\": \"error\",\n \"unicorn/prefer-modern-dom-apis\": \"error\",\n \"unicorn/prefer-object-from-entries\": \"error\",\n \"unicorn/prefer-response-static-json\": \"error\",\n \"unicorn/prefer-string-trim-start-end\": \"error\",\n \"unicorn/relative-url-style\": [\n \"error\",\n \"always\",\n ],\n \"unicorn/require-module-attributes\": \"error\",\n \"unicorn/switch-case-braces\": \"error\",\n \"unicorn/text-encoding-identifier-case\": [\n \"error\",\n {\n withDash: true,\n },\n ],\n \"unicorn/throw-new-error\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_UNICORN_SUSPICIOUS = {\n \"unicorn/consistent-function-scoping\": \"error\",\n \"unicorn/no-accessor-recursion\": \"error\",\n \"unicorn/no-array-reverse\": \"error\",\n \"unicorn/no-array-sort\": [\n \"error\",\n {\n allowExpressionStatement: true,\n },\n ],\n \"unicorn/no-instanceof-builtins\": [\n \"error\",\n {\n strategy: \"strict\",\n useErrorIsError: false,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_UNICORN = {\n ...RULES_UNICORN_PEDANTIC,\n ...RULES_UNICORN_RESTRICTION,\n ...RULES_UNICORN_STYLE,\n ...RULES_UNICORN_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_UNICORN,\n RULES_UNICORN_PEDANTIC,\n RULES_UNICORN_RESTRICTION,\n RULES_UNICORN_STYLE,\n RULES_UNICORN_SUSPICIOUS,\n};\n"],"mappings":";AAEA,MAAM,yBAAyB;CAC3B,yCAAyC;CACzC,iCAAiC,CAC7B,SACA,EACI,YAAY,eAChB,CACJ;CACA,4BAA4B;CAC5B,+BAA+B;CAC/B,yBAAyB;CACzB,2CAA2C;CAC3C,6CAA6C;CAC7C,oCAAoC;CACpC,6CAA6C,CACzC,SACA,EACI,aAAa,MACjB,CACJ;CACA,2BAA2B;CAC3B,+BAA+B;CAC/B,6BAA6B;CAC7B,mDAAmD;AACvD;AAEA,MAAM,4BAA4B;CAC9B,kCAAkC;CAClC,gCAAgC;CAChC,oCAAoC,CAChC,SACA;EACI,eAAe;EACf,UAAU;CACd,CACJ;AACJ;AAEA,MAAM,sBAAsB;CACxB,iCAAiC;CACjC,4CAA4C;CAC5C,8BAA8B;CAC9B,yBAAyB;CACzB,yCAAyC;CACzC,6CAA6C;CAC7C,0CAA0C;CAC1C,oCAAoC,CAChC,SACA;EACI,QAAQ;GACJ,aAAa;GACb,eAAe;EACnB;EACA,aAAa;GACT,aAAa;GACb,eAAe;EACnB;EACA,QAAQ;GACJ,aAAa;GACb,eAAe;EACnB;EACA,OAAO;GACH,aAAa;GACb,eAAe;EACnB;EACA,yBAAyB;CAC7B,CACJ;CACA,mCAAmC;CACnC,wCAAwC;CACxC,8BAA8B;CAC9B,2BAA2B;CAC3B,qCAAqC;CACrC,kCAAkC;CAClC,sCAAsC;CACtC,uCAAuC;CACvC,wCAAwC;CACxC,8BAA8B,CAC1B,SACA,QACJ;CACA,qCAAqC;CACrC,8BAA8B;CAC9B,yCAAyC,CACrC,SACA,EACI,UAAU,KACd,CACJ;CACA,2BAA2B;AAC/B;AAEA,MAAM,2BAA2B;CAC7B,uCAAuC;CACvC,iCAAiC;CACjC,4BAA4B;CAC5B,yBAAyB,CACrB,SACA,EACI,0BAA0B,KAC9B,CACJ;CACA,kCAAkC,CAC9B,SACA;EACI,UAAU;EACV,iBAAiB;CACrB,CACJ;AACJ;AAEA,MAAM,gBAAgB;CAClB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACP"}
1
+ {"version":3,"file":"unicorn.js","names":[],"sources":["../../../../src/presets/common/rules/unicorn.ts"],"sourcesContent":["import type { LintRules } from \"#/@types/oxlint\";\n\nconst RULES_UNICORN_NURSERY = {\n \"unicorn/no-useless-iterator-to-array\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_UNICORN_PEDANTIC = {\n \"unicorn/consistent-empty-array-spread\": \"error\",\n \"unicorn/explicit-length-check\": [\n \"error\",\n {\n \"non-zero\": \"greater-than\",\n },\n ],\n \"unicorn/new-for-builtins\": \"error\",\n \"unicorn/no-instanceof-array\": \"error\",\n \"unicorn/no-new-buffer\": \"error\",\n \"unicorn/no-unnecessary-array-flat-depth\": \"error\",\n \"unicorn/no-unnecessary-array-splice-count\": \"error\",\n \"unicorn/no-unnecessary-slice-end\": \"error\",\n \"unicorn/no-useless-promise-resolve-reject\": [\n \"error\",\n {\n allowReject: false,\n },\n ],\n \"unicorn/prefer-date-now\": \"error\",\n \"unicorn/prefer-math-min-max\": \"error\",\n \"unicorn/prefer-type-error\": \"error\",\n \"unicorn/require-number-to-fixed-digits-argument\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_UNICORN_RESTRICTION = {\n \"unicorn/no-length-as-slice-end\": \"error\",\n \"unicorn/prefer-node-protocol\": \"error\",\n \"unicorn/prefer-number-properties\": [\n \"error\",\n {\n checkInfinity: true,\n checkNaN: true,\n },\n ],\n} as const satisfies LintRules;\n\nconst RULES_UNICORN_STYLE = {\n \"unicorn/consistent-date-clone\": \"error\",\n \"unicorn/consistent-existence-index-check\": \"error\",\n \"unicorn/consistent-template-literal-escape\": \"error\",\n \"unicorn/custom-error-definition\": \"error\",\n \"unicorn/empty-brace-spaces\": \"error\",\n \"unicorn/error-message\": \"error\",\n \"unicorn/no-array-method-this-argument\": \"error\",\n \"unicorn/no-unreadable-array-destructuring\": \"error\",\n \"unicorn/no-useless-collection-argument\": \"error\",\n \"unicorn/numeric-separators-style\": [\n \"error\",\n {\n binary: {\n groupLength: 3,\n minimumDigits: 5,\n },\n hexadecimal: {\n groupLength: 3,\n minimumDigits: 5,\n },\n number: {\n groupLength: 3,\n minimumDigits: 5,\n },\n octal: {\n groupLength: 3,\n minimumDigits: 5,\n },\n onlyIfContainsSeparator: false,\n },\n ],\n \"unicorn/prefer-classlist-toggle\": \"error\",\n \"unicorn/prefer-dom-node-text-content\": \"error\",\n \"unicorn/prefer-global-this\": \"error\",\n \"unicorn/prefer-includes\": \"error\",\n \"unicorn/prefer-keyboard-event-key\": \"error\",\n \"unicorn/prefer-modern-dom-apis\": \"error\",\n \"unicorn/prefer-object-from-entries\": \"error\",\n \"unicorn/prefer-response-static-json\": \"error\",\n \"unicorn/prefer-string-trim-start-end\": \"error\",\n \"unicorn/relative-url-style\": [\n \"error\",\n \"always\",\n ],\n \"unicorn/require-module-attributes\": \"error\",\n \"unicorn/switch-case-braces\": \"error\",\n \"unicorn/switch-case-break-position\": \"error\",\n \"unicorn/text-encoding-identifier-case\": [\n \"error\",\n {\n withDash: true,\n },\n ],\n \"unicorn/throw-new-error\": \"error\",\n} as const satisfies LintRules;\n\nconst RULES_UNICORN_SUSPICIOUS = {\n \"unicorn/consistent-function-scoping\": \"error\",\n \"unicorn/no-accessor-recursion\": \"error\",\n \"unicorn/no-array-reverse\": \"error\",\n \"unicorn/no-array-sort\": [\n \"error\",\n {\n allowExpressionStatement: true,\n },\n ],\n \"unicorn/no-instanceof-builtins\": [\n \"allow\",\n ],\n} as const satisfies LintRules;\n\nconst RULES_UNICORN = {\n ...RULES_UNICORN_NURSERY,\n ...RULES_UNICORN_PEDANTIC,\n ...RULES_UNICORN_RESTRICTION,\n ...RULES_UNICORN_STYLE,\n ...RULES_UNICORN_SUSPICIOUS,\n} as const satisfies LintRules;\n\nexport {\n RULES_UNICORN,\n RULES_UNICORN_NURSERY,\n RULES_UNICORN_PEDANTIC,\n RULES_UNICORN_RESTRICTION,\n RULES_UNICORN_STYLE,\n RULES_UNICORN_SUSPICIOUS,\n};\n"],"mappings":";AAEA,MAAM,wBAAwB,EAC1B,wCAAwC,QAC5C;AAEA,MAAM,yBAAyB;CAC3B,yCAAyC;CACzC,iCAAiC,CAC7B,SACA,EACI,YAAY,eAChB,CACJ;CACA,4BAA4B;CAC5B,+BAA+B;CAC/B,yBAAyB;CACzB,2CAA2C;CAC3C,6CAA6C;CAC7C,oCAAoC;CACpC,6CAA6C,CACzC,SACA,EACI,aAAa,MACjB,CACJ;CACA,2BAA2B;CAC3B,+BAA+B;CAC/B,6BAA6B;CAC7B,mDAAmD;AACvD;AAEA,MAAM,4BAA4B;CAC9B,kCAAkC;CAClC,gCAAgC;CAChC,oCAAoC,CAChC,SACA;EACI,eAAe;EACf,UAAU;CACd,CACJ;AACJ;AAEA,MAAM,sBAAsB;CACxB,iCAAiC;CACjC,4CAA4C;CAC5C,8CAA8C;CAC9C,mCAAmC;CACnC,8BAA8B;CAC9B,yBAAyB;CACzB,yCAAyC;CACzC,6CAA6C;CAC7C,0CAA0C;CAC1C,oCAAoC,CAChC,SACA;EACI,QAAQ;GACJ,aAAa;GACb,eAAe;EACnB;EACA,aAAa;GACT,aAAa;GACb,eAAe;EACnB;EACA,QAAQ;GACJ,aAAa;GACb,eAAe;EACnB;EACA,OAAO;GACH,aAAa;GACb,eAAe;EACnB;EACA,yBAAyB;CAC7B,CACJ;CACA,mCAAmC;CACnC,wCAAwC;CACxC,8BAA8B;CAC9B,2BAA2B;CAC3B,qCAAqC;CACrC,kCAAkC;CAClC,sCAAsC;CACtC,uCAAuC;CACvC,wCAAwC;CACxC,8BAA8B,CAC1B,SAC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