oxlint 1.76.0 → 1.78.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/configuration_schema.json +286 -21
- package/dist/bindings.js +391 -326
- package/dist/index.d.ts +105 -9
- package/dist/lint.js +1013 -818
- package/dist/plugins-dev.d.ts +1 -1
- package/dist/plugins-dev.js +15 -15
- package/dist/plugins.js +1 -1
- package/dist/workspace2.js +2 -1
- package/package.json +20 -20
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";
|
|
@@ -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;
|
|
@@ -1153,7 +1164,7 @@ interface DummyRuleMap {
|
|
|
1153
1164
|
"no-useless-return"?: RuleNoConfig;
|
|
1154
1165
|
"no-var"?: RuleNoConfig;
|
|
1155
1166
|
"no-void"?: RuleNoConfig | [AllowWarnDeny, NoVoid];
|
|
1156
|
-
"no-warning-comments"?: RuleNoConfig | [AllowWarnDeny,
|
|
1167
|
+
"no-warning-comments"?: RuleNoConfig | [AllowWarnDeny, NoWarningCommentsConfig];
|
|
1157
1168
|
"no-with"?: RuleNoConfig;
|
|
1158
1169
|
"node/callback-return"?: RuleNoConfig | [AllowWarnDeny, CallbackReturn];
|
|
1159
1170
|
"node/exports-style"?: RuleNoConfig | [AllowWarnDeny, ExportsStyleMode] | [AllowWarnDeny, ExportsStyleMode, ExportsStyleOptions];
|
|
@@ -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;
|
|
@@ -2463,6 +2475,12 @@ interface EmptyTagsConfig {
|
|
|
2463
2475
|
*/
|
|
2464
2476
|
tags?: string[];
|
|
2465
2477
|
}
|
|
2478
|
+
interface NoBlankBlocks {
|
|
2479
|
+
/**
|
|
2480
|
+
* Whether to automatically remove blank JSDoc blocks.
|
|
2481
|
+
*/
|
|
2482
|
+
enableFixer?: boolean;
|
|
2483
|
+
}
|
|
2466
2484
|
interface NoDefaultsConfig {
|
|
2467
2485
|
/**
|
|
2468
2486
|
* If true, report the presence of optional param names (square brackets) on `@param` tags.
|
|
@@ -2605,6 +2623,12 @@ interface AnchorAmbiguousTextConfig {
|
|
|
2605
2623
|
*/
|
|
2606
2624
|
words?: string[];
|
|
2607
2625
|
}
|
|
2626
|
+
interface AnchorHasContentConfig {
|
|
2627
|
+
/**
|
|
2628
|
+
* Additional custom component names to treat as anchor elements.
|
|
2629
|
+
*/
|
|
2630
|
+
components?: string[];
|
|
2631
|
+
}
|
|
2608
2632
|
interface AnchorIsValidConfig {
|
|
2609
2633
|
/**
|
|
2610
2634
|
* Sub-rule aspects to run.
|
|
@@ -4062,9 +4086,20 @@ interface NoVoid {
|
|
|
4062
4086
|
*/
|
|
4063
4087
|
allowAsStatement?: boolean;
|
|
4064
4088
|
}
|
|
4065
|
-
interface
|
|
4089
|
+
interface NoWarningCommentsConfig {
|
|
4090
|
+
/**
|
|
4091
|
+
* An array of characters to ignore at the start of comments when `location` is `"start"`.
|
|
4092
|
+
*
|
|
4093
|
+
* Useful for ignoring common comment decorations like `*` in JSDoc-style comments.
|
|
4094
|
+
*/
|
|
4066
4095
|
decoration?: string[];
|
|
4096
|
+
/**
|
|
4097
|
+
* Where to check for the terms.
|
|
4098
|
+
*/
|
|
4067
4099
|
location?: Location;
|
|
4100
|
+
/**
|
|
4101
|
+
* An array of terms to match. The matching is case-insensitive.
|
|
4102
|
+
*/
|
|
4068
4103
|
terms?: string[];
|
|
4069
4104
|
}
|
|
4070
4105
|
interface ExportsStyleOptions {
|
|
@@ -4107,6 +4142,46 @@ interface ObjectShorthandOptions {
|
|
|
4107
4142
|
ignoreConstructors?: boolean;
|
|
4108
4143
|
methodsIgnorePattern?: string;
|
|
4109
4144
|
}
|
|
4145
|
+
/**
|
|
4146
|
+
* Options for configuring declaration grouping by kind or initialization state.
|
|
4147
|
+
*
|
|
4148
|
+
* `initialized` and `uninitialized` take precedence over the per-kind option for the
|
|
4149
|
+
* corresponding declarators.
|
|
4150
|
+
*/
|
|
4151
|
+
interface OneVarOptions {
|
|
4152
|
+
/**
|
|
4153
|
+
* Controls grouping for `await using` declarations.
|
|
4154
|
+
*/
|
|
4155
|
+
awaitUsing?: OneVarMode;
|
|
4156
|
+
/**
|
|
4157
|
+
* Controls grouping for `const` declarations.
|
|
4158
|
+
*/
|
|
4159
|
+
const?: OneVarMode;
|
|
4160
|
+
/**
|
|
4161
|
+
* Controls grouping for initialized declarators, overriding per-kind options.
|
|
4162
|
+
*/
|
|
4163
|
+
initialized?: OneVarMode;
|
|
4164
|
+
/**
|
|
4165
|
+
* Controls grouping for `let` declarations.
|
|
4166
|
+
*/
|
|
4167
|
+
let?: OneVarMode;
|
|
4168
|
+
/**
|
|
4169
|
+
* Keeps direct `require(...)` initializers separate from other initialized declarations.
|
|
4170
|
+
*/
|
|
4171
|
+
separateRequires?: boolean;
|
|
4172
|
+
/**
|
|
4173
|
+
* Controls grouping for uninitialized declarators, overriding per-kind options.
|
|
4174
|
+
*/
|
|
4175
|
+
uninitialized?: OneVarMode;
|
|
4176
|
+
/**
|
|
4177
|
+
* Controls grouping for `using` declarations.
|
|
4178
|
+
*/
|
|
4179
|
+
using?: OneVarMode;
|
|
4180
|
+
/**
|
|
4181
|
+
* Controls grouping for `var` declarations.
|
|
4182
|
+
*/
|
|
4183
|
+
var?: OneVarMode;
|
|
4184
|
+
}
|
|
4110
4185
|
interface NoAsyncEndpointHandlersConfig {
|
|
4111
4186
|
/**
|
|
4112
4187
|
* An array of names that are allowed to be async.
|
|
@@ -5103,6 +5178,9 @@ interface BanTsCommentConfig {
|
|
|
5103
5178
|
*/
|
|
5104
5179
|
"ts-nocheck"?: DirectiveConfigSchema;
|
|
5105
5180
|
}
|
|
5181
|
+
interface DescriptionFormatConfig {
|
|
5182
|
+
descriptionFormat?: string;
|
|
5183
|
+
}
|
|
5106
5184
|
interface ConsistentReturnConfig {
|
|
5107
5185
|
/**
|
|
5108
5186
|
* Treat explicit `return undefined` as equivalent to an unspecified return.
|
|
@@ -5655,12 +5733,30 @@ interface NoUnnecessaryBooleanLiteralCompareConfig {
|
|
|
5655
5733
|
}
|
|
5656
5734
|
interface NoUnnecessaryConditionConfig {
|
|
5657
5735
|
/**
|
|
5658
|
-
*
|
|
5659
|
-
*
|
|
5736
|
+
* Controls which constant conditions are allowed in `while`, `do...while`, and `for` loops.
|
|
5737
|
+
*
|
|
5738
|
+
* - `"never"` (or `false`) reports all constant loop conditions.
|
|
5739
|
+
* - `"always"` (or `true`) allows conditions whose type is the literal type `true`, such as
|
|
5740
|
+
* `while (true)` or `while (variable)` when `variable` has type `true`.
|
|
5741
|
+
* - `"only-allowed-literals"` allows only the literal expressions `true`, `false`, `0`, and
|
|
5742
|
+
* `1`. Variables whose types are those literal types are still reported.
|
|
5660
5743
|
*/
|
|
5661
5744
|
allowConstantLoopConditions?: AllowConstantLoopConditions;
|
|
5662
5745
|
/**
|
|
5663
|
-
* Whether to check type predicate functions.
|
|
5746
|
+
* Whether to check arguments passed to type predicate and assertion functions.
|
|
5747
|
+
*
|
|
5748
|
+
* When enabled, the rule reports a call if the argument already satisfies the predicate or
|
|
5749
|
+
* if an assertion function receives an argument that is always truthy or always falsy.
|
|
5750
|
+
*
|
|
5751
|
+
* For example, `narrow(value)` is unnecessary because `value` already has type `true`:
|
|
5752
|
+
*
|
|
5753
|
+
* ```ts
|
|
5754
|
+
* declare const narrow: (value: unknown) => value is true;
|
|
5755
|
+
* const value = true;
|
|
5756
|
+
* if (narrow(value)) {
|
|
5757
|
+
* // ...
|
|
5758
|
+
* }
|
|
5759
|
+
* ```
|
|
5664
5760
|
*/
|
|
5665
5761
|
checkTypePredicates?: boolean;
|
|
5666
5762
|
}
|