oxlint 1.77.0 → 1.79.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.d.ts CHANGED
@@ -156,6 +156,18 @@ type ExportsStyleMode = "module.exports" | "exports";
156
156
  type HandleCallbackErrConfig = string;
157
157
  type NoMixedRequiresConfig = boolean | NoMixedRequiresOptions;
158
158
  type ShorthandType = "always" | "methods" | "properties" | "consistent" | "consistent-as-needed" | "never";
159
+ /**
160
+ * Enforces consistent grouping of variable declarations.
161
+ */
162
+ type OneVar = OneVarConfig;
163
+ /**
164
+ * Configuration accepted by the `one-var` rule.
165
+ */
166
+ type OneVarConfig = OneVarMode | OneVarOptions;
167
+ /**
168
+ * Controls how variable declarators are grouped into declarations.
169
+ */
170
+ type OneVarMode = "always" | "never" | "consecutive";
159
171
  type Destructuring = "any" | "all";
160
172
  type PreferDestructuringOption = PreferDestructuringTargetOption | PreferDestructuringAssignmentConfig;
161
173
  type TerminationMethod = string | string[];
@@ -203,9 +215,7 @@ type ImportKind = "none" | "all" | "multiple" | "single";
203
215
  type SortOrder = "desc" | "asc";
204
216
  type ArrayOption = "array" | "array-simple" | "generic";
205
217
  type ReadonlyArrayOption = "array" | "array-simple" | "generic";
206
- type DirectiveConfigSchema = boolean | RequireDescription | {
207
- descriptionFormat?: string;
208
- };
218
+ type DirectiveConfigSchema = boolean | RequireDescription | DescriptionFormatConfig;
209
219
  type RequireDescription = "allow-with-description";
210
220
  type ClassLiteralPropertyStyleOption = "fields" | "getters";
211
221
  type PreferGenericType = "constructor" | "type-annotation";
@@ -846,7 +856,7 @@ interface DummyRuleMap {
846
856
  "getter-return"?: RuleNoConfig | [AllowWarnDeny, GetterReturn];
847
857
  "grouped-accessor-pairs"?: RuleNoConfig | [AllowWarnDeny, PairOrder] | [AllowWarnDeny, PairOrder, GroupedAccessorPairsConfig];
848
858
  "guard-for-in"?: RuleNoConfig;
849
- "id-denylist"?: RuleNoConfig | [AllowWarnDeny, string, ...string[]];
859
+ "id-denylist"?: RuleNoConfig | [AllowWarnDeny, ...string[]];
850
860
  "id-length"?: RuleNoConfig | [AllowWarnDeny, IdLengthConfig];
851
861
  "id-match"?: RuleNoConfig | [AllowWarnDeny, string] | [AllowWarnDeny, string, IdMatchOptions];
852
862
  "import/consistent-type-specifier-style"?: RuleNoConfig | [AllowWarnDeny, Mode];
@@ -948,6 +958,7 @@ interface DummyRuleMap {
948
958
  "jsdoc/check-tag-names"?: RuleNoConfig | [AllowWarnDeny, CheckTagNamesConfig];
949
959
  "jsdoc/empty-tags"?: RuleNoConfig | [AllowWarnDeny, EmptyTagsConfig];
950
960
  "jsdoc/implements-on-classes"?: RuleNoConfig;
961
+ "jsdoc/no-blank-blocks"?: RuleNoConfig | [AllowWarnDeny, NoBlankBlocks];
951
962
  "jsdoc/no-defaults"?: RuleNoConfig | [AllowWarnDeny, NoDefaultsConfig];
952
963
  "jsdoc/require-param"?: RuleNoConfig | [AllowWarnDeny, RequireParamConfig];
953
964
  "jsdoc/require-param-description"?: RuleNoConfig | [AllowWarnDeny, RequireParamDescriptionConfig];
@@ -967,7 +978,7 @@ interface DummyRuleMap {
967
978
  "jsdoc/require-yields-type"?: RuleNoConfig;
968
979
  "jsx-a11y/alt-text"?: RuleNoConfig | [AllowWarnDeny, AltTextConfigSchema];
969
980
  "jsx-a11y/anchor-ambiguous-text"?: RuleNoConfig | [AllowWarnDeny, AnchorAmbiguousTextConfig];
970
- "jsx-a11y/anchor-has-content"?: RuleNoConfig;
981
+ "jsx-a11y/anchor-has-content"?: RuleNoConfig | [AllowWarnDeny, AnchorHasContentConfig];
971
982
  "jsx-a11y/anchor-is-valid"?: RuleNoConfig | [AllowWarnDeny, AnchorIsValidConfig];
972
983
  "jsx-a11y/aria-activedescendant-has-tabindex"?: RuleNoConfig;
973
984
  "jsx-a11y/aria-props"?: RuleNoConfig;
@@ -1108,9 +1119,9 @@ interface DummyRuleMap {
1108
1119
  "no-redeclare"?: RuleNoConfig | [AllowWarnDeny, NoRedeclare];
1109
1120
  "no-regex-spaces"?: RuleNoConfig;
1110
1121
  "no-restricted-exports"?: RuleNoConfig | [AllowWarnDeny, NoRestrictedExportsConfig];
1111
- "no-restricted-globals"?: RuleNoConfig | [AllowWarnDeny, NoRestrictedGlobalsConfigEnum, ...NoRestrictedGlobalsConfigEnum[]];
1112
- "no-restricted-imports"?: RuleNoConfig | [AllowWarnDeny, NoRestrictedImportsConfigEnum, ...NoRestrictedImportsConfigEnum[]];
1113
- "no-restricted-properties"?: RuleNoConfig | [AllowWarnDeny, PropertyDetails, ...PropertyDetails[]];
1122
+ "no-restricted-globals"?: RuleNoConfig | [AllowWarnDeny, ...NoRestrictedGlobalsConfigEnum[]];
1123
+ "no-restricted-imports"?: RuleNoConfig | [AllowWarnDeny, ...NoRestrictedImportsConfigEnum[]];
1124
+ "no-restricted-properties"?: RuleNoConfig | [AllowWarnDeny, ...PropertyDetails[]];
1114
1125
  "no-return-assign"?: RuleNoConfig | [AllowWarnDeny, NoReturnAssignMode];
1115
1126
  "no-script-url"?: RuleNoConfig;
1116
1127
  "no-self-assign"?: RuleNoConfig | [AllowWarnDeny, NoSelfAssign];
@@ -1167,6 +1178,7 @@ interface DummyRuleMap {
1167
1178
  "node/no-sync"?: RuleNoConfig | [AllowWarnDeny, NoSyncConfig];
1168
1179
  "node/no-top-level-await"?: RuleNoConfig | [AllowWarnDeny, NoTopLevelAwaitConfig];
1169
1180
  "object-shorthand"?: RuleNoConfig | [AllowWarnDeny, ShorthandType] | [AllowWarnDeny, ShorthandType, ObjectShorthandOptions];
1181
+ "one-var"?: RuleNoConfig | [AllowWarnDeny, OneVar];
1170
1182
  "operator-assignment"?: RuleNoConfig | [AllowWarnDeny, AlwaysNever];
1171
1183
  "oxc/approx-constant"?: RuleNoConfig;
1172
1184
  "oxc/bad-array-method-on-arguments"?: RuleNoConfig;
@@ -1231,16 +1243,24 @@ interface DummyRuleMap {
1231
1243
  "react-perf/jsx-no-new-function-as-prop"?: RuleNoConfig | [AllowWarnDeny, ReactPerfConfig];
1232
1244
  "react-perf/jsx-no-new-object-as-prop"?: RuleNoConfig | [AllowWarnDeny, ReactPerfConfig];
1233
1245
  "react/button-has-type"?: RuleNoConfig | [AllowWarnDeny, ButtonHasType];
1246
+ "react/capitalized-calls"?: RuleNoConfig;
1234
1247
  "react/checked-requires-onchange-or-readonly"?: RuleNoConfig | [AllowWarnDeny, CheckedRequiresOnchangeOrReadonly];
1235
1248
  "react/display-name"?: RuleNoConfig | [AllowWarnDeny, DisplayNameConfig];
1249
+ "react/error-boundaries"?: RuleNoConfig;
1236
1250
  "react/exhaustive-deps"?: RuleNoConfig | [AllowWarnDeny, ExhaustiveDepsConfig];
1251
+ "react/exhaustive-effect-dependencies"?: RuleNoConfig;
1237
1252
  "react/forbid-component-props"?: RuleNoConfig | [AllowWarnDeny, ForbidComponentPropsConfig];
1238
1253
  "react/forbid-dom-props"?: RuleNoConfig | [AllowWarnDeny, ForbidDomPropsConfig];
1239
1254
  "react/forbid-elements"?: RuleNoConfig | [AllowWarnDeny, ForbidElementsConfig];
1240
1255
  "react/forward-ref-uses-ref"?: RuleNoConfig;
1241
1256
  "react/function-component-definition"?: RuleNoConfig | [AllowWarnDeny, FunctionComponentDefinitionConfig];
1257
+ "react/globals"?: RuleNoConfig;
1242
1258
  "react/hook-use-state"?: RuleNoConfig | [AllowWarnDeny, HookUseStateConfig];
1259
+ "react/hooks"?: RuleNoConfig;
1243
1260
  "react/iframe-missing-sandbox"?: RuleNoConfig;
1261
+ "react/immutability"?: RuleNoConfig;
1262
+ "react/incompatible-library"?: RuleNoConfig;
1263
+ "react/invariant"?: RuleNoConfig;
1244
1264
  "react/jsx-boolean-value"?: RuleNoConfig | [AllowWarnDeny, EnforceBooleanAttribute] | [AllowWarnDeny, EnforceBooleanAttribute, JsxBooleanValueOptions];
1245
1265
  "react/jsx-curly-brace-presence"?: RuleNoConfig | [AllowWarnDeny, JsxCurlyBracePresenceConfig];
1246
1266
  "react/jsx-filename-extension"?: RuleNoConfig | [AllowWarnDeny, JsxFilenameExtensionConfig];
@@ -1259,11 +1279,13 @@ interface DummyRuleMap {
1259
1279
  "react/jsx-pascal-case"?: RuleNoConfig | [AllowWarnDeny, JsxPascalCaseConfig];
1260
1280
  "react/jsx-props-no-spread-multi"?: RuleNoConfig;
1261
1281
  "react/jsx-props-no-spreading"?: RuleNoConfig | [AllowWarnDeny, JsxPropsNoSpreadingConfig];
1282
+ "react/memo-dependencies"?: RuleNoConfig;
1262
1283
  "react/no-array-index-key"?: RuleNoConfig;
1263
1284
  "react/no-children-prop"?: RuleNoConfig;
1264
1285
  "react/no-clone-element"?: RuleNoConfig;
1265
1286
  "react/no-danger"?: RuleNoConfig;
1266
1287
  "react/no-danger-with-children"?: RuleNoConfig;
1288
+ "react/no-deriving-state-in-effects"?: RuleNoConfig;
1267
1289
  "react/no-did-mount-set-state"?: RuleNoConfig | [AllowWarnDeny, AllowedOrDisallowInFunc];
1268
1290
  "react/no-did-update-set-state"?: RuleNoConfig | [AllowWarnDeny, AllowedOrDisallowInFunc];
1269
1291
  "react/no-direct-mutation-state"?: RuleNoConfig;
@@ -1286,14 +1308,25 @@ interface DummyRuleMap {
1286
1308
  "react/only-export-components"?: RuleNoConfig | [AllowWarnDeny, OnlyExportComponentsConfig];
1287
1309
  "react/prefer-es6-class"?: RuleNoConfig | [AllowWarnDeny, AlwaysNever];
1288
1310
  "react/prefer-function-component"?: RuleNoConfig | [AllowWarnDeny, PreferFunctionComponent];
1289
- "react/react-compiler"?: RuleNoConfig | [AllowWarnDeny, ReactCompilerConfig];
1311
+ "react/preserve-manual-memoization"?: RuleNoConfig;
1312
+ "react/purity"?: RuleNoConfig;
1290
1313
  "react/react-in-jsx-scope"?: RuleNoConfig;
1314
+ "react/refs"?: RuleNoConfig;
1291
1315
  "react/require-render-return"?: RuleNoConfig;
1316
+ "react/rule-suppression"?: RuleNoConfig;
1292
1317
  "react/rules-of-hooks"?: RuleNoConfig;
1293
1318
  "react/self-closing-comp"?: RuleNoConfig | [AllowWarnDeny, SelfClosingComp];
1319
+ "react/set-state-in-effect"?: RuleNoConfig;
1320
+ "react/set-state-in-render"?: RuleNoConfig;
1294
1321
  "react/state-in-constructor"?: RuleNoConfig | [AllowWarnDeny, AlwaysNever];
1322
+ "react/static-components"?: RuleNoConfig;
1295
1323
  "react/style-prop-object"?: RuleNoConfig | [AllowWarnDeny, StylePropObjectConfig];
1324
+ "react/syntax"?: RuleNoConfig;
1325
+ "react/todo"?: RuleNoConfig;
1326
+ "react/unsupported-syntax"?: RuleNoConfig;
1327
+ "react/use-memo"?: RuleNoConfig;
1296
1328
  "react/void-dom-elements-no-children"?: RuleNoConfig;
1329
+ "react/void-use-memo"?: RuleNoConfig;
1297
1330
  "require-await"?: RuleNoConfig;
1298
1331
  "require-unicode-regexp"?: RuleNoConfig | [AllowWarnDeny, RequireUnicodeRegexpConfig];
1299
1332
  "require-yield"?: RuleNoConfig;
@@ -2271,7 +2304,8 @@ interface NoHooksConfig {
2271
2304
  interface NoLargeSnapshotsConfig {
2272
2305
  /**
2273
2306
  * A map of snapshot file paths to arrays of snapshot names that are allowed to exceed the size limit.
2274
- * Snapshot names can be specified as regular expressions.
2307
+ * Each snapshot name is interpreted as a Rust regular expression. If it is not a valid regular
2308
+ * expression, it is matched as an exact literal string instead.
2275
2309
  */
2276
2310
  allowedSnapshots?: {
2277
2311
  [k: string]: string[] | undefined;
@@ -2463,6 +2497,12 @@ interface EmptyTagsConfig {
2463
2497
  */
2464
2498
  tags?: string[];
2465
2499
  }
2500
+ interface NoBlankBlocks {
2501
+ /**
2502
+ * Whether to automatically remove blank JSDoc blocks.
2503
+ */
2504
+ enableFixer?: boolean;
2505
+ }
2466
2506
  interface NoDefaultsConfig {
2467
2507
  /**
2468
2508
  * If true, report the presence of optional param names (square brackets) on `@param` tags.
@@ -2605,6 +2645,12 @@ interface AnchorAmbiguousTextConfig {
2605
2645
  */
2606
2646
  words?: string[];
2607
2647
  }
2648
+ interface AnchorHasContentConfig {
2649
+ /**
2650
+ * Additional custom component names to treat as anchor elements.
2651
+ */
2652
+ components?: string[];
2653
+ }
2608
2654
  interface AnchorIsValidConfig {
2609
2655
  /**
2610
2656
  * Sub-rule aspects to run.
@@ -3735,10 +3781,10 @@ interface NoUnusedVarsOptions {
3735
3781
  * Specifies exceptions to this rule for unused arguments. Arguments whose
3736
3782
  * names match this pattern will be ignored.
3737
3783
  *
3738
- * By default, this pattern is `^_` unless options are configured with an
3739
- * object. In this case it will default to [`None`]. Note that this
3740
- * behavior deviates from both ESLint and TypeScript-ESLint, which never
3741
- * provide a default pattern.
3784
+ * By default, names starting with `_` are ignored, except for the bare `_`
3785
+ * parameter. If options are configured with an object, this will default
3786
+ * to [`None`]. Note that this behavior deviates from both ESLint and
3787
+ * TypeScript-ESLint, which never provide a default pattern.
3742
3788
  *
3743
3789
  * #### Example
3744
3790
  *
@@ -4118,6 +4164,46 @@ interface ObjectShorthandOptions {
4118
4164
  ignoreConstructors?: boolean;
4119
4165
  methodsIgnorePattern?: string;
4120
4166
  }
4167
+ /**
4168
+ * Options for configuring declaration grouping by kind or initialization state.
4169
+ *
4170
+ * `initialized` and `uninitialized` take precedence over the per-kind option for the
4171
+ * corresponding declarators.
4172
+ */
4173
+ interface OneVarOptions {
4174
+ /**
4175
+ * Controls grouping for `await using` declarations.
4176
+ */
4177
+ awaitUsing?: OneVarMode;
4178
+ /**
4179
+ * Controls grouping for `const` declarations.
4180
+ */
4181
+ const?: OneVarMode;
4182
+ /**
4183
+ * Controls grouping for initialized declarators, overriding per-kind options.
4184
+ */
4185
+ initialized?: OneVarMode;
4186
+ /**
4187
+ * Controls grouping for `let` declarations.
4188
+ */
4189
+ let?: OneVarMode;
4190
+ /**
4191
+ * Keeps direct `require(...)` initializers separate from other initialized declarations.
4192
+ */
4193
+ separateRequires?: boolean;
4194
+ /**
4195
+ * Controls grouping for uninitialized declarators, overriding per-kind options.
4196
+ */
4197
+ uninitialized?: OneVarMode;
4198
+ /**
4199
+ * Controls grouping for `using` declarations.
4200
+ */
4201
+ using?: OneVarMode;
4202
+ /**
4203
+ * Controls grouping for `var` declarations.
4204
+ */
4205
+ var?: OneVarMode;
4206
+ }
4121
4207
  interface NoAsyncEndpointHandlersConfig {
4122
4208
  /**
4123
4209
  * An array of names that are allowed to be async.
@@ -4950,15 +5036,6 @@ interface PreferFunctionComponent {
4950
5036
  */
4951
5037
  allowJsxUtilityClass?: boolean;
4952
5038
  }
4953
- interface ReactCompilerConfig {
4954
- /**
4955
- * Also report compiler bail-outs — places where React Compiler skipped a
4956
- * component or hook (for example because of unsupported syntax) without
4957
- * finding a rule violation. These do not indicate incorrect code, only
4958
- * code that the compiler declined to optimize.
4959
- */
4960
- reportAllBailouts?: boolean;
4961
- }
4962
5039
  interface SelfClosingComp {
4963
5040
  /**
4964
5041
  * Whether to enforce self-closing for custom components.
@@ -5114,6 +5191,9 @@ interface BanTsCommentConfig {
5114
5191
  */
5115
5192
  "ts-nocheck"?: DirectiveConfigSchema;
5116
5193
  }
5194
+ interface DescriptionFormatConfig {
5195
+ descriptionFormat?: string;
5196
+ }
5117
5197
  interface ConsistentReturnConfig {
5118
5198
  /**
5119
5199
  * Treat explicit `return undefined` as equivalent to an unspecified return.