` elements.
* - If `custom` is set to `enforce`, an exception for `Foo` will ignore the rule on `
` components.
*
* This allows you to override the general setting for individual components.
*/
exceptions?: string[];
/**
* `explicitSpread` set to `ignore` will ignore spread operators that are explicitly listing all object properties within that spread. Default is set to `enforce`.
*/
explicitSpread?: IgnoreEnforceOption;
/**
* `html` set to `ignore` will ignore all html jsx tags like `div`, `img` etc. Default is set to `enforce`.
*/
html?: IgnoreEnforceOption;
}
interface NoMultiCompConfig {
/**
* When `true`, the rule will ignore stateless components and will allow you to have multiple
* stateless components in the same file. Or one stateful component and one-or-more stateless
* components in the same file.
*
* Stateless basically just means function components, including those created via
* `memo` and `forwardRef`.
*/
ignoreStateless?: boolean;
}
interface NoStringRefs {
/**
* Disallow template literals in addition to string literals.
*/
noTemplateLiterals?: boolean;
}
interface NoUnknownPropertyConfig {
/**
* List of properties to ignore.
*/
ignore?: string[];
/**
* Require `data-*` attributes to be lowercase, e.g. `data-foobar` instead of `data-fooBar`.
*/
requireDataLowercase?: boolean;
}
interface NoUnsafeConfig {
/**
* Whether to check for the non-prefixed lifecycle methods.
* If `true`, this means `componentWillMount`, `componentWillReceiveProps`,
* and `componentWillUpdate` will also be flagged, rather than just the
* UNSAFE_ versions. It is recommended to set this to `true` to fully
* avoid unsafe lifecycle methods.
*/
checkAliases?: boolean;
}
interface NoUnstableNestedComponentsConfig {
/**
* Allow component definitions in props.
*/
allowAsProps?: boolean;
/**
* Optional custom propTypes validators accepted for eslint-plugin-react compatibility.
*/
customValidators?: string[];
/**
* Glob pattern for render-prop names that may receive inline component definitions.
*/
propNamePattern?: string;
}
interface OnlyExportComponentsConfig {
/**
* Allow exporting primitive constants (string/number/boolean/template literal)
* alongside component exports without triggering a violation. Recommended when your
* bundler’s Fast Refresh integration supports this (enabled by the plugin’s `vite`
* preset).
*
* ```jsx
* // Allowed when allowConstantExport: true
* export const VERSION = "3";
* export const Foo = () => null;
* ```
*/
allowConstantExport?: boolean;
/**
* Treat specific named exports as HMR-safe (useful for frameworks that hot-replace
* certain exports). For example, in Remix:
* `{ "allowExportNames": ["meta", "links", "headers", "loader", "action"] }`
*/
allowExportNames?: string[];
/**
* Check `.js` files that contain JSX (in addition to `.tsx`/`.jsx`). To reduce
* false positives, only files that import React are checked when this is enabled.
*/
checkJS?: boolean;
/**
* If you export components wrapped in custom higher-order components, list their
* identifiers here to avoid false positives.
*/
customHOCs?: string[];
}
interface PreferFunctionComponent {
/**
* If `true`, error boundary classes (those implementing `componentDidCatch`
* or `static getDerivedStateFromError`) are allowed as class components.
*
* This is because these classes are not easily converted to function components,
* and so they are exempted from this rule by default.
*/
allowErrorBoundary?: boolean;
/**
* If `true`, classes that contain JSX but do not extend `Component` or
* `PureComponent` are allowed.
*/
allowJsxUtilityClass?: boolean;
}
interface SelfClosingComp {
/**
* Whether to enforce self-closing for custom components.
*/
component?: boolean;
/**
* Whether to enforce self-closing for native HTML elements.
*/
html?: boolean;
}
interface StylePropObjectConfig {
/**
* List of component names on which to allow `style` prop values of any type.
*/
allow?: string[];
}
interface RequireUnicodeRegexpConfig {
/**
* The `u` flag may be preferred in environments that do not support the `v` flag.
*
* Examples of **incorrect** code for this rule with the `{ "requireFlag": "u" }` option:
* ```js
* const fooEmpty = /foo/;
* const fooEmptyRegexp = new RegExp('foo');
* const foo = /foo/v;
* const fooRegexp = new RegExp('foo', 'v');
* ```
*
* Examples of **correct** code for this rule with the `{ "requireFlag": "u" }` option:
* ```js
* const foo = /foo/u;
* const fooRegexp = new RegExp('foo', 'u');
* ```
*
* The `v` flag may be a better choice when it is supported because it has more features than the `u` flag (e.g., the ability to test Unicode properties of strings).
* It does have a stricter syntax, however (e.g., the need to escape certain characters within character classes).
*
* Examples of **incorrect** code for this rule with the `{ "requireFlag": "v" }` option:
* ```js
* const fooEmpty = /foo/;
* const fooEmptyRegexp = new RegExp('foo');
* const foo = /foo/u;
* const fooRegexp = new RegExp('foo', 'u');
* ```
*
* Examples of **correct** code for this rule with the `{ "requireFlag": "v" }` option:
* ```js
* const foo = /foo/v;
* const fooRegexp = new RegExp('foo', 'v');
* ```
*/
requireFlag?: RequireFlag;
}
interface SortImportsOptions {
/**
* When `true`, the rule allows import groups separated by blank lines to be treated independently.
*/
allowSeparatedGroups?: boolean;
/**
* When `true`, the rule ignores case-sensitivity when sorting import names.
*/
ignoreCase?: boolean;
/**
* When `true`, the rule ignores the sorting of import declarations (the order of `import` statements).
*/
ignoreDeclarationSort?: boolean;
/**
* When `true`, the rule ignores the sorting of import members within a single import declaration.
*/
ignoreMemberSort?: boolean;
/**
* Specifies the sort order of different import syntaxes.
* Must include all 4 kinds!
*/
memberSyntaxSortOrder?: ImportKind[];
}
interface SortKeysOptions {
/**
* When true, groups of properties separated by a blank line are sorted independently.
*/
allowLineSeparatedGroups?: boolean;
/**
* Whether the sort comparison is case-sensitive (A < a when true).
*/
caseSensitive?: boolean;
/**
* Minimum number of properties required in an object before sorting is enforced.
*/
minKeys?: number;
/**
* Use natural sort order so that, for example, "a2" comes before "a10".
*/
natural?: boolean;
}
interface SortVars {
/**
* When `true`, the rule ignores case-sensitivity when sorting variables.
*/
ignoreCase?: boolean;
}
interface ArrayTypeConfig {
/**
* The array type expected for mutable cases.
*/
default?: ArrayOption;
/**
* The array type expected for readonly cases. If omitted, the value for `default` will be used.
*/
readonly?: ReadonlyArrayOption;
}
/**
* This rule allows you to specify how different TypeScript directive comments
* should be handled.
*
* For each directive (`@ts-expect-error`, `@ts-ignore`, `@ts-nocheck`, `@ts-check`), you can choose one of the following options:
* - `true`: Disallow the directive entirely, preventing its use in the entire codebase.
* - `false`: Allow the directive without any restrictions.
* - `"allow-with-description"`: Allow the directive only if it is followed by a description explaining its use. The description must meet the minimum length specified by `minimumDescriptionLength`.
* - `{ "descriptionFormat": "" }`: Allow the directive only if the description matches the specified regex pattern.
*
* For example:
* ```json
* {
* "ts-expect-error": "allow-with-description",
* "ts-ignore": true,
* "ts-nocheck": {
* "descriptionFormat": "^: TS\\d+ because .+$"
* },
* "ts-check": false,
* "minimumDescriptionLength": 3
* }
* ```
*/
interface BanTsCommentConfig {
/**
* Minimum description length required when using directives with `allow-with-description`.
*/
minimumDescriptionLength?: number;
/**
* How to handle the `@ts-check` directive.
*/
"ts-check"?: DirectiveConfigSchema;
/**
* How to handle the `@ts-expect-error` directive.
*/
"ts-expect-error"?: DirectiveConfigSchema;
/**
* How to handle the `@ts-ignore` directive.
*/
"ts-ignore"?: DirectiveConfigSchema;
/**
* How to handle the `@ts-nocheck` directive.
*/
"ts-nocheck"?: DirectiveConfigSchema;
}
interface DescriptionFormatConfig {
descriptionFormat?: string;
}
interface ConsistentReturnConfig {
/**
* Treat explicit `return undefined` as equivalent to an unspecified return.
*/
treatUndefinedAsUnspecified?: boolean;
}
interface ConsistentTypeAssertionsConfig {
/**
* Whether array literal type assertions are allowed, allowed only as parameters, or disallowed.
*/
arrayLiteralTypeAssertions?: ArrayLiteralTypeAssertions;
/**
* Which assertion syntax is enforced.
*/
assertionStyle?: AssertionStyle;
/**
* Whether object literal type assertions are allowed, allowed only as parameters, or disallowed.
*/
objectLiteralTypeAssertions?: ObjectLiteralTypeAssertions;
}
interface ConsistentTypeExportsConfig {
/**
* Enables an autofix strategy that rewrites mixed exports using inline `type` specifiers.
*/
fixMixedExportsWithInlineTypeSpecifier?: boolean;
}
interface ConsistentTypeImportsConfig {
/**
* Disallow using `import()` in type annotations, like `type T = import('foo')`
*/
disallowTypeAnnotations?: boolean;
/**
* Control how type imports are added when auto-fixing.
*/
fixStyle?: FixStyle;
/**
* Control whether to enforce type imports or value imports.
*/
prefer?: Prefer;
}
interface DotNotationConfig {
/**
* Allow bracket notation for properties covered by an index signature.
*/
allowIndexSignaturePropertyAccess?: boolean;
/**
* Allow bracket notation for ES3 keyword property names (for example `obj["class"]`).
*/
allowKeywords?: boolean;
/**
* Regex pattern for property names that are allowed to use bracket notation.
*/
allowPattern?: string;
/**
* Allow bracket notation for private class members.
*/
allowPrivateClassPropertyAccess?: boolean;
/**
* Allow bracket notation for protected class members.
*/
allowProtectedClassPropertyAccess?: boolean;
}
interface ExplicitFunctionReturnTypeConfig {
/**
* Whether to allow concise arrow functions that start with the `void` keyword.
*/
allowConciseArrowFunctionExpressionsStartingWithVoid?: boolean;
/**
* Whether to allow arrow functions that use `as const` assertion on their return value.
*/
allowDirectConstAssertionInArrowFunctions?: boolean;
/**
* Whether to allow expressions as function return types. When `true`, allows functions that immediately return an expression without a return type annotation.
*/
allowExpressions?: boolean;
/**
* Whether to allow functions that do not have generic type parameters.
*/
allowFunctionsWithoutTypeParameters?: boolean;
/**
* Whether to allow higher-order functions (functions that return another function) without return type annotations.
*/
allowHigherOrderFunctions?: boolean;
/**
* Whether to allow immediately invoked function expressions (IIFEs) without return type annotations.
*/
allowIIFEs?: boolean;
/**
* Whether to allow typed function expressions. When `true`, allows function expressions that are assigned to a typed variable or parameter.
*/
allowTypedFunctionExpressions?: boolean;
/**
* Array of function names that are exempt from requiring return type annotations.
*/
allowedNames?: string[];
}
interface ExplicitMemberAccessibilityConfig {
/**
* Which accessibility modifier is required to exist or not exist.
*/
accessibility?: AccessibilityLevel;
/**
* Specific method names that may be ignored.
*/
ignoredMethodNames?: string[];
/**
* Changes to required accessibility modifiers for specific kinds of class members.
*/
overrides?: AccessibilityOverrides;
}
interface AccessibilityOverrides {
/**
* Which member accessibility modifier requirements to apply for accessors (getters/setters).
*/
accessors?: AccessibilityLevel;
/**
* Which member accessibility modifier requirements to apply for constructors.
*/
constructors?: AccessibilityLevel;
/**
* Which member accessibility modifier requirements to apply for methods.
*/
methods?: AccessibilityLevel;
/**
* Which member accessibility modifier requirements to apply for parameter properties.
*/
parameterProperties?: AccessibilityLevel;
/**
* Which member accessibility modifier requirements to apply for properties.
*/
properties?: AccessibilityLevel;
}
interface ExplicitModuleBoundaryTypesConfig {
/**
* Whether to ignore arguments that are explicitly typed as `any`.
*/
allowArgumentsExplicitlyTypedAsAny?: boolean;
/**
* Whether to ignore return type annotations on body-less arrow functions
* that return an `as const` type assertion. You must still type the
* parameters of the function.
*/
allowDirectConstAssertionInArrowFunctions?: boolean;
/**
* Whether to ignore return type annotations on functions immediately
* returning another function expression. You must still type the
* parameters of the function.
*/
allowHigherOrderFunctions?: boolean;
/**
* Whether to ignore return type annotations on functions with overload
* signatures.
*/
allowOverloadFunctions?: boolean;
/**
* Whether to ignore type annotations on the variable of a function
* expression.
*/
allowTypedFunctionExpressions?: boolean;
/**
* An array of function/method names that will not have their arguments or
* return values checked.
*/
allowedNames?: string[];
}
interface NoBaseToStringConfig {
/**
* Whether to also check values of type `unknown`.
* When `true`, calling toString on `unknown` values will be flagged.
* Default is `false`.
*/
checkUnknown?: boolean;
/**
* A list of type names to ignore when checking for unsafe toString usage.
* These types are considered safe to call toString on even if they don't
* provide a custom implementation.
*/
ignoredTypeNames?: string[];
}
interface NoConfusingVoidExpressionConfig {
/**
* Whether to ignore arrow function shorthand that returns void.
* When true, allows expressions like `() => someVoidFunction()`.
*/
ignoreArrowShorthand?: boolean;
/**
* Whether to ignore expressions using the void operator.
* When true, allows `void someExpression`.
*/
ignoreVoidOperator?: boolean;
/**
* Whether to ignore calling functions that are declared to return void.
* When true, allows expressions like `x = voidReturningFunction()`.
*/
ignoreVoidReturningFunctions?: boolean;
}
interface NoDeprecatedConfig {
/**
* An array of type or value specifiers that are allowed to be used even if deprecated.
* Use this to allow specific deprecated APIs that you intentionally want to continue using.
*/
allow?: TypeOrValueSpecifier[];
}
/**
* Describes specific types or values declared in local files.
*/
interface FileSpecifier {
/**
* Must be "file"
*/
from: FileFrom;
/**
* The name(s) of the type or value to match
*/
name: NameSpecifier;
/**
* Optional file path to specify where the types or values must be declared.
* If omitted, all files will be matched.
*/
path?: string;
}
/**
* Describes specific types or values declared in TypeScript's built-in lib.*.d.ts types.
*/
interface LibSpecifier {
/**
* Must be "lib"
*/
from: LibFrom;
/**
* The name(s) of the lib type or value to match
*/
name: NameSpecifier;
}
/**
* Describes specific types or values imported from packages.
*/
interface PackageSpecifier {
/**
* Must be "package"
*/
from: PackageFrom;
/**
* The name(s) of the type or value to match
*/
name: NameSpecifier;
/**
* The package name to match
*/
package: string;
}
interface NoDuplicateTypeConstituentsConfig {
/**
* Whether to ignore duplicate types in intersection types.
* When true, allows `type T = A & A`.
*/
ignoreIntersections?: boolean;
/**
* Whether to ignore duplicate types in union types.
* When true, allows `type T = A | A`.
*/
ignoreUnions?: boolean;
}
interface NoEmptyInterface {
/**
* When set to `true`, allows empty interfaces that extend a single interface.
*/
allowSingleExtends?: boolean;
}
interface NoEmptyObjectTypeConfig {
/**
* Whether to allow empty interfaces.
*/
allowInterfaces?: AllowInterfaces;
/**
* Whether to allow empty object type literals.
*/
allowObjectTypes?: AllowObjectTypes;
/**
* A stringified regular expression to allow interfaces and object type aliases with the configured name.
*
* This can be useful if your existing code style includes a pattern of declaring empty types with `{}` instead of `object`.
*
* Example of **incorrect** code for this rule with `{ allowWithName: 'Props$' }`:
* ```ts
* interface InterfaceValue {}
* type TypeValue = {};
* ```
*
* Example of **correct** code for this rule with `{ allowWithName: 'Props$' }`:
* ```ts
* interface InterfaceProps {}
* type TypeProps = {};
* ```
*/
allowWithName?: string;
}
interface NoExplicitAny {
/**
* Whether to enable auto-fixing in which the `any` type is converted to the `unknown` type.
*/
fixToUnknown?: boolean;
/**
* Whether to ignore rest parameter arrays.
*/
ignoreRestArgs?: boolean;
}
interface NoExtraneousClass {
/**
* Allow classes that only have a constructor.
*/
allowConstructorOnly?: boolean;
/**
* Allow empty classes.
*/
allowEmpty?: boolean;
/**
* Allow classes with only static members.
*/
allowStaticOnly?: boolean;
/**
* Allow classes with decorators.
*/
allowWithDecorator?: boolean;
}
interface NoFloatingPromisesConfig {
/**
* Allows specific calls to be ignored, specified as type or value specifiers.
*/
allowForKnownSafeCalls?: TypeOrValueSpecifier[];
/**
* Allows specific Promise types to be ignored, specified as type or value specifiers.
*/
allowForKnownSafePromises?: TypeOrValueSpecifier[];
/**
* Check for thenable objects that are not necessarily Promises.
*/
checkThenables?: boolean;
/**
* Ignore immediately invoked function expressions (IIFEs).
*/
ignoreIIFE?: boolean;
/**
* Ignore Promises that are void expressions.
*/
ignoreVoid?: boolean;
}
interface NoInferrableTypes {
/**
* When set to `true`, ignores type annotations on function parameters.
*/
ignoreParameters?: boolean;
/**
* When set to `true`, ignores type annotations on class properties.
*/
ignoreProperties?: boolean;
}
interface NoInvalidVoidTypeConfig {
/**
* Whether a `this` parameter of a function may be `void`.
*/
allowAsThisParameter?: boolean;
/**
* Whether `void` can be used as generic type arguments.
* Can be `true` / `false`, or an allowlist of generic type names.
*/
allowInGenericTypeArguments?: AllowInGenericTypeArguments;
}
interface NoMeaninglessVoidOperatorConfig {
/**
* Whether to check `void` applied to expressions of type `never`.
*/
checkNever?: boolean;
}
interface NoMisusedPromisesConfig {
/**
* Whether to check if Promises are used in conditionals.
* When true, disallows using Promises in conditions where a boolean is expected.
*/
checksConditionals?: boolean;
/**
* Whether to check if Promises are used in spread syntax.
* When true, disallows spreading Promise values.
*/
checksSpreads?: boolean;
/**
* Configuration for checking if Promises are returned in contexts expecting void.
* Can be a boolean to enable/disable all checks, or an object for granular control.
*/
checksVoidReturn?: ChecksVoidReturn;
}
interface ChecksVoidReturnOptions {
/**
* Whether to check Promise-returning functions passed as arguments to void-returning functions.
*/
arguments?: boolean;
/**
* Whether to check Promise-returning functions in JSX attributes expecting void.
*/
attributes?: boolean;
/**
* Whether to check Promise-returning methods that override void-returning inherited methods.
*/
inheritedMethods?: boolean;
/**
* Whether to check Promise-returning functions assigned to object properties expecting void.
*/
properties?: boolean;
/**
* Whether to check Promise values returned from void-returning functions.
*/
returns?: boolean;
/**
* Whether to check Promise-returning functions assigned to variables typed as void-returning.
*/
variables?: boolean;
}
interface NoMisusedSpreadConfig {
/**
* An array of type or value specifiers that are allowed to be spread
* even if they would normally be flagged as misused.
*/
allow?: TypeOrValueSpecifier[];
}
interface NoNamespace {
/**
* Whether to allow declare with custom TypeScript namespaces.
*
* Examples of **incorrect** code for this rule when `{ "allowDeclarations": true }`
* ```typescript
* module foo {}
* namespace foo {}
* ```
*
* Examples of **correct** code for this rule when `{ "allowDeclarations": true }`
* ```typescript
* declare module 'foo' {}
* declare module foo {}
* declare namespace foo {}
*
* declare global {
* namespace foo {}
* }
*
* declare module foo {
* namespace foo {}
* }
* ```
*
* Examples of **incorrect** code for this rule when `{ "allowDeclarations": false }`
* ```typescript
* module foo {}
* namespace foo {}
* declare module foo {}
* declare namespace foo {}
* ```
*
* Examples of **correct** code for this rule when `{ "allowDeclarations": false }`
* ```typescript
* declare module 'foo' {}
* ```
*/
allowDeclarations?: boolean;
/**
* Examples of **incorrect** code for this rule when `{ "allowDefinitionFiles": true }`
* ```typescript
* // if outside a d.ts file
* module foo {}
* namespace foo {}
*
* // if outside a d.ts file
* module foo {}
* namespace foo {}
* declare module foo {}
* declare namespace foo {}
* ```
*
* Examples of **correct** code for this rule when `{ "allowDefinitionFiles": true }`
* ```typescript
* declare module 'foo' {}
* // anything inside a d.ts file
* ```
*/
allowDefinitionFiles?: boolean;
}
interface NoRequireImportsConfig {
/**
* These strings will be compiled into regular expressions with the u flag and be used to test against the imported path.
* A common use case is to allow importing `package.json`. This is because `package.json` commonly lives outside of the TS root directory,
* so statically importing it would lead to root directory conflicts, especially with `resolveJsonModule` enabled.
* You can also use it to allow importing any JSON if your environment doesn't support JSON modules, or use it for other cases where `import` statements cannot work.
*
* With `{ allow: ['/package\\.json$'] }`:
*
* Examples of **correct** code for this rule:
* ```ts
* console.log(require('../package.json').version);
* ```
*/
allow?: string[];
/**
* When set to `true`, `import ... = require(...)` declarations won't be reported.
* This is useful if you use certain module options that require strict CommonJS interop semantics.
*
* When set to `true`:
*
* Examples of **incorrect** code for this rule:
* ```ts
* var foo = require('foo');
* const foo = require('foo');
* let foo = require('foo');
* ```
* Examples of **correct** code for this rule:
* ```ts
* import foo = require('foo');
* import foo from 'foo';
* ```
*/
allowAsImport?: boolean;
}
interface NoRestrictedTypesConfig {
/**
* A mapping of type names to ban configurations.
*/
types?: {
[k: string]: BanConfigValue | undefined;
};
}
interface NoThisAliasConfig {
/**
* Whether to allow destructuring of `this` to local variables.
*/
allowDestructuring?: boolean;
/**
* An array of variable names that are allowed to alias `this`.
*/
allowedNames?: string[];
}
interface NoUnnecessaryBooleanLiteralCompareConfig {
/**
* Whether to allow comparing nullable boolean expressions to `false`.
* When false, `x === false` where x is `boolean | null` will be flagged.
*/
allowComparingNullableBooleansToFalse?: boolean;
/**
* Whether to allow comparing nullable boolean expressions to `true`.
* When false, `x === true` where x is `boolean | null` will be flagged.
*/
allowComparingNullableBooleansToTrue?: boolean;
}
interface NoUnnecessaryConditionConfig {
/**
* Controls which constant conditions are allowed in `while`, `do...while`, and `for` loops.
*
* - `"never"` (or `false`) reports all constant loop conditions.
* - `"always"` (or `true`) allows conditions whose type is the literal type `true`, such as
* `while (true)` or `while (variable)` when `variable` has type `true`.
* - `"only-allowed-literals"` allows only the literal expressions `true`, `false`, `0`, and
* `1`. Variables whose types are those literal types are still reported.
*/
allowConstantLoopConditions?: AllowConstantLoopConditions;
/**
* Whether to check arguments passed to type predicate and assertion functions.
*
* When enabled, the rule reports a call if the argument already satisfies the predicate or
* if an assertion function receives an argument that is always truthy or always falsy.
*
* For example, `narrow(value)` is unnecessary because `value` already has type `true`:
*
* ```ts
* declare const narrow: (value: unknown) => value is true;
* const value = true;
* if (narrow(value)) {
* // ...
* }
* ```
*/
checkTypePredicates?: boolean;
}
interface NoUnnecessaryTypeAssertionConfig {
/**
* Whether to check literal const assertions like `'foo' as const`.
* When `false` (default), const assertions on literal types are not flagged.
* When `true`, these will be reported as unnecessary since the type is already a literal.
*/
checkLiteralConstAssertions?: boolean;
/**
* A list of type names to ignore when checking for unnecessary assertions.
* Type assertions to these types will not be flagged even if they appear unnecessary.
* Example: `["Foo", "Bar"]` to allow `x as Foo` or `x as Bar`.
*/
typesToIgnore?: string[];
}
interface NoUnsafeMemberAccessConfig {
/**
* Whether to allow `?.` optional chains on `any` values.
* When `true`, optional chaining on `any` values will not be flagged.
* Default is `false`.
*/
allowOptionalChaining?: boolean;
}
interface OnlyThrowErrorConfig {
/**
* An array of type or value specifiers for additional types that are allowed to be thrown.
* Use this to allow throwing custom error types.
*/
allow?: TypeOrValueSpecifier[];
/**
* Whether to allow rethrowing caught values that are not Error objects.
*/
allowRethrowing?: boolean;
/**
* Whether to allow throwing values typed as `any`.
*/
allowThrowingAny?: boolean;
/**
* Whether to allow throwing values typed as `unknown`.
*/
allowThrowingUnknown?: boolean;
}
interface ParameterPropertiesConfig {
/**
* Modifiers that are allowed to be used with parameter properties or class properties, depending on the `prefer` option.
*/
allow?: Modifier[];
/**
* Whether to prefer parameter properties or class properties.
*/
prefer?: Prefer2;
}
interface PreferLiteralEnumMember {
/**
* When set to `true`, allows bitwise expressions in enum member initializers.
* This includes bitwise NOT (`~`), AND (`&`), OR (`|`), XOR (`^`), and shift operators (`<<`, `>>`, `>>>`).
*/
allowBitwiseExpressions?: boolean;
}
interface PreferNullishCoalescingConfig {
/**
* Whether to ignore arguments to the `Boolean` constructor.
*/
ignoreBooleanCoercion?: boolean;
/**
* Whether to ignore cases that are located within a conditional test.
*/
ignoreConditionalTests?: boolean;
/**
* Whether to ignore any if statements that could be simplified by using
* the nullish coalescing operator.
*/
ignoreIfStatements?: boolean;
/**
* Whether to ignore any logical or expressions that are part of a mixed
* logical expression (with `&&`).
*/
ignoreMixedLogicalExpressions?: boolean;
/**
* Whether to ignore all (`true`) or some (an object with properties) primitive types.
*/
ignorePrimitives?: IgnorePrimitives;
/**
* Whether to ignore any ternary expressions that could be simplified by
* using the nullish coalescing operator.
*/
ignoreTernaryTests?: boolean;
}
/**
* Options for ignoring specific primitive types.
*/
interface IgnorePrimitivesOptions {
/**
* Ignore bigint primitive types.
*/
bigint?: boolean;
/**
* Ignore boolean primitive types.
*/
boolean?: boolean;
/**
* Ignore number primitive types.
*/
number?: boolean;
/**
* Ignore string primitive types.
*/
string?: boolean;
}
interface PreferOptionalChainConfig {
/**
* Allow autofixers that will change the return type of the expression.
* This option is considered unsafe as it may break the build.
*/
allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing?: boolean;
/**
* Check operands that are typed as `any` when inspecting "loose boolean" operands.
*/
checkAny?: boolean;
/**
* Check operands that are typed as `bigint` when inspecting "loose boolean" operands.
*/
checkBigInt?: boolean;
/**
* Check operands that are typed as `boolean` when inspecting "loose boolean" operands.
*/
checkBoolean?: boolean;
/**
* Check operands that are typed as `number` when inspecting "loose boolean" operands.
*/
checkNumber?: boolean;
/**
* Check operands that are typed as `string` when inspecting "loose boolean" operands.
*/
checkString?: boolean;
/**
* Check operands that are typed as `unknown` when inspecting "loose boolean" operands.
*/
checkUnknown?: boolean;
/**
* Skip operands that are not typed with `null` and/or `undefined` when inspecting
* "loose boolean" operands.
*/
requireNullish?: boolean;
}
interface PreferPromiseRejectErrorsConfig {
/**
* An array of type or value specifiers for additional types that are allowed
* as Promise rejection reasons.
*/
allow?: TypeOrValueSpecifier[];
/**
* Whether to allow calling `Promise.reject()` with no arguments.
*/
allowEmptyReject?: boolean;
/**
* Whether to allow rejecting Promises with values typed as `any`.
*/
allowThrowingAny?: boolean;
/**
* Whether to allow rejecting Promises with values typed as `unknown`.
*/
allowThrowingUnknown?: boolean;
}
interface PreferReadonlyConfig {
/**
* Restrict checks to members immediately initialized with inline lambda values.
*/
onlyInlineLambdas?: boolean;
}
interface PreferReadonlyParameterTypesConfig {
/**
* Type/value specifiers that should be exempt from this rule.
*/
allow?: TypeOrValueSpecifier[];
/**
* Whether to check constructor parameter properties.
*/
checkParameterProperties?: boolean;
/**
* Whether to ignore parameters without explicit type annotations.
*/
ignoreInferredTypes?: boolean;
/**
* Whether mutable methods should be treated as readonly members.
*/
treatMethodsAsReadonly?: boolean;
}
interface PreferStringStartsEndsWithConfig {
/**
* Whether equality checks against the first/last character are allowed.
*/
allowSingleElementEquality?: AllowSingleElementEquality;
}
interface PromiseFunctionAsyncConfig {
/**
* Whether to allow functions returning `any` type without requiring `async`.
*/
allowAny?: boolean;
/**
* A list of Promise type names that are allowed without requiring `async`.
* Example: `["SpecialPromise"]` to allow functions returning `SpecialPromise` without `async`.
*/
allowedPromiseNames?: string[];
/**
* Whether to check arrow functions for missing `async` keyword.
*/
checkArrowFunctions?: boolean;
/**
* Whether to check function declarations for missing `async` keyword.
*/
checkFunctionDeclarations?: boolean;
/**
* Whether to check function expressions for missing `async` keyword.
*/
checkFunctionExpressions?: boolean;
/**
* Whether to check method declarations for missing `async` keyword.
*/
checkMethodDeclarations?: boolean;
}
interface RequireArraySortCompareConfig {
/**
* Whether to ignore arrays in which all elements are strings.
*/
ignoreStringArrays?: boolean;
}
interface RestrictPlusOperandsConfig {
/**
* Whether to allow `any` type in plus operations.
*/
allowAny?: boolean;
/**
* Whether to allow `boolean` types in plus operations.
*/
allowBoolean?: boolean;
/**
* Whether to allow nullish types (`null` or `undefined`) in plus operations.
*/
allowNullish?: boolean;
/**
* Whether to allow mixed number and string operands in plus operations.
*/
allowNumberAndString?: boolean;
/**
* Whether to allow `RegExp` types in plus operations.
*/
allowRegExp?: boolean;
/**
* Whether to skip compound assignments (e.g., `a += b`).
*/
skipCompoundAssignments?: boolean;
}
interface RestrictTemplateExpressionsConfig {
/**
* An array of type or value specifiers for additional types that are allowed in template expressions.
* Defaults include Error, URL, and URLSearchParams from lib.
*/
allow?: TypeOrValueSpecifier[];
/**
* Whether to allow `any` typed values in template expressions.
*/
allowAny?: boolean;
/**
* Whether to allow array types in template expressions.
*/
allowArray?: boolean;
/**
* Whether to allow boolean types in template expressions.
*/
allowBoolean?: boolean;
/**
* Whether to allow `never` type in template expressions.
*/
allowNever?: boolean;
/**
* Whether to allow nullish types (`null` or `undefined`) in template expressions.
*/
allowNullish?: boolean;
/**
* Whether to allow number and bigint types in template expressions.
*/
allowNumber?: boolean;
/**
* Whether to allow RegExp values in template expressions.
*/
allowRegExp?: boolean;
}
interface StrictBooleanExpressionsConfig {
/**
* Whether to allow `any` type in boolean contexts.
*/
allowAny?: boolean;
/**
* Whether to allow nullable boolean types (e.g., `boolean | null`) in boolean contexts.
*/
allowNullableBoolean?: boolean;
/**
* Whether to allow nullable enum types in boolean contexts.
*/
allowNullableEnum?: boolean;
/**
* Whether to allow nullable number types (e.g., `number | null`) in boolean contexts.
*/
allowNullableNumber?: boolean;
/**
* Whether to allow nullable object types in boolean contexts.
*/
allowNullableObject?: boolean;
/**
* Whether to allow nullable string types (e.g., `string | null`) in boolean contexts.
*/
allowNullableString?: boolean;
/**
* Whether to allow number types in boolean contexts (checks for non-zero numbers).
*/
allowNumber?: boolean;
/**
* Whether to allow string types in boolean contexts (checks for non-empty strings).
*/
allowString?: boolean;
}
interface StrictVoidReturnConfig {
/**
* Allow callbacks that return `any` in places that expect a `void` callback.
*/
allowReturnAny?: boolean;
}
interface SwitchExhaustivenessCheckConfig {
/**
* Whether to allow default cases on switches that are not exhaustive.
* When false, requires exhaustive switch statements without default cases.
*/
allowDefaultCaseForExhaustiveSwitch?: boolean;
/**
* Whether to consider `default` cases exhaustive for union types.
* When true, a switch statement with a `default` case is considered exhaustive
* even if not all union members are handled explicitly.
*/
considerDefaultExhaustiveForUnions?: boolean;
/**
* Regular expression pattern for a comment that acts as an omitted `default` case.
* The comment must appear after the final case and the switch must not have a `default` case.
* For union types, it suppresses the exhaustiveness check only when
* `considerDefaultExhaustiveForUnions` is enabled.
* Example: `"^skip default$"` to allow a switch ending in `// skip default`.
*/
defaultCaseCommentPattern?: string;
/**
* Whether to require default cases on switches over union types that are not exhaustive.
* When true, switches with non-exhaustive union types must have a default case.
*/
requireDefaultForNonUnion?: boolean;
}
interface TripleSlashReferenceConfig {
/**
* What to enforce for `/// ` references.
*/
lib?: AlwaysNever;
/**
* What to enforce for `/// ` references.
*/
path?: PathOption;
/**
* What to enforce for `/// ` references.
*/
types?: TypesOption;
}
interface UnboundMethodConfig {
/**
* Whether to ignore unbound methods that are static.
* When true, static methods can be referenced without binding.
*/
ignoreStatic?: boolean;
}
interface UnifiedSignaturesOptions {
/**
* Whether to ignore parameter name differences when comparing signatures. If `false`, signatures
* will not be considered unifiable if they have parameters in the same position with different
* names, even if the parameter types are the same.
*/
ignoreDifferentlyNamedParameters?: boolean;
/**
* Whether to ignore JSDoc differences when comparing signatures. If `false`, signatures will not
* be considered unifiable if the closest leading block comments for the signatures are different,
* even if the signatures themselves are identical.
*/
ignoreOverloadsWithDifferentJSDoc?: boolean;
}
interface CatchErrorNameConfig {
/**
* A list of patterns to ignore when checking `catch` variable names. The pattern
* can be a string or regular expression.
*/
ignore?: string[];
/**
* The name to use for error variables in `catch` blocks. You can customize it
* to something other than `'error'` (e.g., `'exception'`).
*/
name?: string;
}
interface ConsistentFunctionScoping {
/**
* Whether to check scoping with arrow functions.
*/
checkArrowFunctions?: boolean;
}
interface ExplicitLengthCheck {
/**
* Configuration option to specify how non-zero length checks should be enforced.
*/
"non-zero"?: NonZero;
}
interface ImportStyleConfig {
/**
* Whether dynamic import expressions are checked.
*
* Set this to `false` to skip calls such as `await import("module")`.
*
* With the default configuration, examples of **incorrect** code:
* ```js
* async () => {
* const {red} = await import("chalk");
* };
* ```
*
* Examples of **correct** code:
* ```js
* async () => {
* const {default: chalk} = await import("chalk");
* };
* ```
*/
checkDynamicImport?: boolean;
/**
* Whether export-from declarations are checked.
*
* This is disabled by default. Set this to `true` to check declarations like
* `export ... from "module"`.
*
* With `{ "checkExportFrom": true }`, examples of **incorrect** code:
* ```js
* export * from "node:util";
* ```
*
* Examples of **correct** code:
* ```js
* export {promisify} from "node:util";
* ```
*/
checkExportFrom?: boolean;
/**
* Whether static import declarations are checked.
*
* Set this to `false` to skip `import ... from "module"` and side-effect imports like
* `import "module"`.
*
* With the default configuration, examples of **incorrect** code:
* ```js
* import {red} from "chalk";
* ```
*
* Examples of **correct** code:
* ```js
* import chalk from "chalk";
* ```
*/
checkImport?: boolean;
/**
* Whether CommonJS `require()` calls are checked.
*
* Set this to `false` to skip `require("module")` calls completely.
*
* With the default configuration, examples of **incorrect** code:
* ```js
* const util = require("node:util");
* ```
*
* Examples of **correct** code:
* ```js
* const {promisify} = require("node:util");
* ```
*/
checkRequire?: boolean;
/**
* Whether `styles` extends or replaces the built-in module preferences.
*
* When this is `true`, entries in `styles` are merged with the default preferences. For
* example, `{ "styles": { "path": { "named": true } } }` allows named imports from
* `path` while leaving its default import style allowed. When this is `false`, only modules
* configured in `styles` are checked.
*
* With `{ "extendDefaultStyles": false, "styles": {} }`, examples of **correct** code:
* ```js
* import {red} from "chalk";
* ```
*/
extendDefaultStyles?: boolean;
/**
* Per-module import style preferences.
*
* Each key is a module specifier. Set the value to `false` to disable checking for the
* module, or to an object that allows one or more import styles. The available styles are
* `unassigned`, `default`, `namespace`, and `named`. When `extendDefaultStyles` is `true`,
* these entries extend the built-in defaults instead of replacing them.
*
* The default module preferences are default imports for `chalk`, `path`, and `node:path`,
* and named imports for `util` and `node:util`.
*
* With `{ "styles": { "node:util": { "named": true, "default": false } } }`,
* examples of **incorrect** code:
* ```js
* import util from "node:util";
* ```
*
* Examples of **correct** code:
* ```js
* import {promisify} from "node:util";
* ```
*/
styles?: {
[k: string]: ModuleStylesOverride | undefined;
};
}
interface MaxNestedCalls {
/**
* The maximum allowed nested call depth.
*/
max?: number;
}
interface NoArrayReduce {
/**
* When set to `true`, allows simple operations (like summing numbers) in `reduce` and `reduceRight` calls.
*/
allowSimpleOperations?: boolean;
}
interface NoArrayReverse {
/**
* This rule allows `array.reverse()` as an expression statement by default.
* Set to `false` to forbid `Array#reverse()` even if it's an expression statement.
*
* Examples of **incorrect** code for this rule with this option set to `false`:
* ```js
* array.reverse();
* ```
*/
allowExpressionStatement?: boolean;
}
interface NoArraySort {
/**
* When set to `true`, allows sorting a fresh array created by a spread, e.g. `[...iterable].sort()`.
* This avoids the double allocation of `toSorted()` when sorting an iterable such as a `Set`.
*
* Example of **correct** code for this rule with `allowAfterSpread` set to `true`:
* ```js
* const sorted = [...mySet].sort();
* ```
*/
allowAfterSpread?: boolean;
/**
* When set to `true` (default), allows `array.sort()` as an expression statement.
* Set to `false` to forbid `Array#sort()` even if it's an expression statement.
*
* Example of **incorrect** code for this rule with `allowExpressionStatement` set to `false`:
* ```js
* array.sort();
* ```
*/
allowExpressionStatement?: boolean;
}
interface NoInstanceofBuiltinsConfig {
/**
* Constructor names to exclude from checking.
*/
exclude?: string[];
/**
* Additional constructor names to check beyond the default set.
* Use this to extend the rule with additional constructors.
*/
include?: string[];
/**
* Controls which built-in constructors are checked.
*/
strategy?: NoInstanceofBuiltinsStrategy;
/**
* When `true`, checks `instanceof Error` and suggests using `Error.isError()` instead.
* Requires [the `Error.isError()` function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/isError)
* to be available.
*/
useErrorIsError?: boolean;
}
interface NoNull {
/**
* When set to `true`, disallow the use of `null` as a direct function call or constructor argument.
*/
checkArguments?: boolean;
/**
* When set to `true`, the rule will also check strict equality/inequality comparisons (`===` and `!==`) against `null`.
*/
checkStrictEquality?: boolean;
}
interface NoTypeofUndefined {
/**
* If set to `true`, also report `typeof x === "undefined"` when `x` may be a global
* variable that is not declared (commonly checked via `typeof foo === "undefined"`).
*/
checkGlobalVariables?: boolean;
}
interface NoUselessPromiseResolveRejectOptions {
/**
* If set to `true`, allows the use of `Promise.reject` in async functions and promise callbacks.
*/
allowReject?: boolean;
}
interface NoUselessUndefined {
/**
* Whether to check for useless `undefined` in function call arguments.
*/
checkArguments?: boolean;
/**
* Whether to check for useless `undefined` in arrow function bodies.
*/
checkArrowFunctionBody?: boolean;
}
interface NumericSeparatorsStyleConfig {
/**
* Configuration for binary literals (e.g. `0b1010_0001` and bigint variants).
* Controls how digits are grouped and when separators are applied.
*/
binary?: {
/**
* The number of digits per group when inserting numeric separators.
* For example, a `groupLength` of 3 formats `1234567` as `1_234_567`.
*/
groupLength?: number;
/**
* The minimum number of digits required before grouping is applied.
* Values with fewer digits than this threshold will not be grouped.
*/
minimumDigits?: number;
/**
* Only enforce the rule when the numeric literal already contains a separator (`_`).
*
* When `true`, numbers without separators are left as-is; when `false` (default),
* grouping will be enforced for eligible numbers even if they don't include separators yet.
*/
onlyIfContainsSeparator?: boolean;
};
/**
* Configuration for hexadecimal literals (e.g. `0xAB_CD`, `0Xab_cd`, and bigint variants).
* Controls how digits are grouped and when separators are applied.
*/
hexadecimal?: {
/**
* The number of digits per group when inserting numeric separators.
* For example, a `groupLength` of 3 formats `1234567` as `1_234_567`.
*/
groupLength?: number;
/**
* The minimum number of digits required before grouping is applied.
* Values with fewer digits than this threshold will not be grouped.
*/
minimumDigits?: number;
/**
* Only enforce the rule when the numeric literal already contains a separator (`_`).
*
* When `true`, numbers without separators are left as-is; when `false` (default),
* grouping will be enforced for eligible numbers even if they don't include separators yet.
*/
onlyIfContainsSeparator?: boolean;
};
/**
* Configuration for decimal numbers (integers, fraction parts, and exponents).
* Controls how digits are grouped and when separators are applied.
*/
number?: NumericNumberConfig;
/**
* Configuration for octal literals (e.g. `0o1234_5670` and bigint variants).
* Controls how digits are grouped and when separators are applied.
*/
octal?: {
/**
* The number of digits per group when inserting numeric separators.
* For example, a `groupLength` of 3 formats `1234567` as `1_234_567`.
*/
groupLength?: number;
/**
* The minimum number of digits required before grouping is applied.
* Values with fewer digits than this threshold will not be grouped.
*/
minimumDigits?: number;
/**
* Only enforce the rule when the numeric literal already contains a separator (`_`).
*
* When `true`, numbers without separators are left as-is; when `false` (default),
* grouping will be enforced for eligible numbers even if they don't include separators yet.
*/
onlyIfContainsSeparator?: boolean;
};
/**
* Only enforce the rule when the numeric literal already contains a separator (`_`).
*
* When `true`, numbers without separators are left as-is; when `false` (default),
* grouping will be enforced for eligible numbers even if they don't include separators yet.
*/
onlyIfContainsSeparator?: boolean;
}
interface NumericNumberConfig {
/**
* The size a group of digits in the fractional part (after the decimal point) should be.
*/
fractionGroupLength?: number;
/**
* The number of digits per group when inserting numeric separators.
* For example, a `groupLength` of 3 formats `1234567` as `1_234_567`.
*/
groupLength?: number;
/**
* The minimum number of digits required before grouping is applied.
* Values with fewer digits than this threshold will not be grouped.
*/
minimumDigits?: number;
/**
* Only enforce the rule when the numeric literal already contains a separator (`_`).
*
* When `true`, numbers without separators are left as-is; when `false` (default),
* grouping will be enforced for eligible numbers even if they don't include separators yet.
*/
onlyIfContainsSeparator?: boolean;
}
interface PreferAtConfig {
/**
* Check all index access, not just special patterns like `array.length - 1`.
* When enabled, `array[0]`, `array[1]`, etc. will also be flagged.
*/
checkAllIndexAccess?: boolean;
/**
* List of function names to treat as "get last element" functions.
* These functions will be checked for `.at(-1)` usage.
*/
getLastElementFunctions?: string[];
}
interface PreferExportFrom {
/**
* When false, if any import binding is used somewhere other than a re-export, all variables in the import declaration are ignored.
*/
checkUsedVariables?: boolean;
}
interface PreferNumberPropertiesConfig {
/**
* If set to `true`, checks for usage of `Infinity` and `-Infinity` as global variables.
*/
checkInfinity?: boolean;
/**
* If set to `true`, checks for usage of `NaN` as a global variable.
*/
checkNaN?: boolean;
}
interface PreferObjectFromEntriesConfig {
/**
* Additional functions to treat as equivalents to `Object.fromEntries`.
*/
functions?: string[];
}
interface PreferSingleCallConfig {
/**
* Methods to ignore.
*/
ignore?: string[];
}
interface PreferStructuredCloneConfig {
/**
* List of functions that are allowed to be used for deep cloning instead of structuredClone.
*/
functions?: string[];
}
interface TextEncodingIdentifierCase {
/**
* If `true`, prefer `utf-8` over `utf8`.
*/
withDash?: boolean;
}
interface UseIsnan {
/**
* Whether to disallow NaN as arguments of `indexOf` and `lastIndexOf`
*/
enforceForIndexOf?: boolean;
/**
* Whether to disallow NaN in switch cases and discriminants
*/
enforceForSwitchCase?: boolean;
}
interface ValidTypeof {
/**
* The `requireStringLiterals` option when set to `true`, allows the comparison of `typeof`
* expressions with only string literals or other `typeof` expressions, and disallows
* comparisons to any other value. Default is `false`.
*
* With `requireStringLiterals` set to `true`, the following are examples of **incorrect** code:
* ```js
* typeof foo === undefined
* typeof bar == Object
* typeof baz === "strnig"
* typeof qux === "some invalid type"
* typeof baz === anotherVariable
* typeof foo == 5
* ```
*
* With `requireStringLiterals` set to `true`, the following are examples of **correct** code:
* ```js
* typeof foo === "undefined"
* typeof bar == "object"
* typeof baz === "string"
* typeof bar === typeof qux
* ```
*/
requireStringLiterals?: boolean;
}
interface ConsistentEachForJson {
/**
* Preferred method to create parameterized tests for `describe` blocks.
*/
describe?: MemberNames;
/**
* Preferred method to create parameterized tests for `it` blocks.
*/
it?: MemberNames;
/**
* Preferred method to create parameterized tests for `suite` blocks.
*/
suite?: MemberNames;
/**
* Preferred method to create parameterized tests for `test` blocks.
*/
test?: MemberNames;
}
interface ConsistentTestFilenameConfig {
/**
* Regex pattern to ensure we are linting only test filenames.
* Decides whether a file is a testing file.
*/
allTestPattern?: string;
/**
* Required regex to check if a test filename have a valid formart.
* Pattern doesn't have a default value, you must provide one.
*/
pattern?: string;
}
interface ConsistentVitestConfig {
/**
* Decides whether to prefer vitest function accessor
*/
fn?: VitestFnName;
}
interface PreferImportInMockConfig {
/**
* Whether the rule should generate fixes or not.
*/
fixable: boolean;
}
interface RequireMockTypeParametersConfig {
/**
* Also require type parameters for `importActual` and `importMock`.
*/
checkImportFunctions?: boolean;
}
interface DefinePropsDestructuring {
/**
* Require or prohibit destructuring.
*/
destructure?: Destructure;
}
interface MaxProps {
/**
* The maximum number of props allowed in a Vue SFC.
*/
maxProps?: number;
}
interface NoAsyncInComputedPropertiesConfig {
/**
* Names of identifiers whose member-call chains (`.then` / `.catch` / `.finally`)
* should be ignored. Useful for libraries like Zod where `.catch(default)` is
* a builder API, not a Promise method.
*/
ignoredObjectNames?: string[];
}
interface NoDeprecatedModelDefinitionConfig {
/**
* Allow `model: { prop: 'modelValue', event: 'update:modelValue' }` (or
* the kebab-case `model-value` variant) which is forwards-compatible with
* Vue 3's `v-model`.
*/
allowVue3Compat?: boolean;
}
interface NoDupeKeysConfig {
/**
* Additional group names to search for duplicate keys in, on top of the
* built-in `props`, `computed`, `data`, `methods` and `setup` groups.
*/
groups?: string[];
}
interface NoReservedComponentNames {
/**
* Disallow Vue 3 built-in component names (e.g. `Teleport`, `Suspense`).
* Note: this also catches Vue 2 built-ins because Vue 3's set includes them.
*/
disallowVue3BuiltInComponents?: boolean;
/**
* Disallow Vue 2 built-in component names (e.g. `Transition`, `KeepAlive`).
*/
disallowVueBuiltInComponents?: boolean;
/**
* Match HTML / SVG element names case-sensitively. When `false` (default),
* the capitalized form of an HTML element (e.g. `Div`) is also reported.
*/
htmlElementCaseSensitive?: boolean;
}
interface NoReservedKeysConfig {
/**
* Extra component option groups to inspect, on top of the built-in
* `props` / `computed` / `data` / `asyncData` / `methods` / `setup`.
*/
groups?: string[];
/**
* Extra reserved key names to disallow, on top of the built-in list.
*/
reserved?: string[];
}
interface NoReservedPropsConfig {
/**
* Vue major version whose reserved attribute set is applied. Vue 2 reserves
* more names (`is`, `slot`, `class`, `style`, ...) than Vue 3.
*/
vueVersion?: number;
}
interface Options {
/**
* Prop names to ignore, as regular expression patterns.
*/
ignoreProps?: string[];
}
interface RequireDirectExport {
/**
* When set `true`, disallow functional component functions.
*/
disallowFunctionalComponentFunction?: boolean;
}
interface ReturnInComputedPropertyConfig {
/**
* When `true` (default), `return;` (without a value) is treated as a missing return.
* Set to `false` to allow bare `return;` as if it returned a value.
*/
treatUndefinedAsUnspecified?: boolean;
}
interface YodaOptions {
/**
* If the `"exceptRange"` property is `true`, the rule *allows* yoda conditions
* in range comparisons which are wrapped directly in parentheses, including the
* parentheses of an `if` or `while` condition.
* A *range* comparison tests whether a variable is inside or outside the range
* between two literal values.
*/
exceptRange?: boolean;
/**
* If the `"onlyEquality"` property is `true`, the rule reports yoda
* conditions *only* for the equality operators `==` and `===`. The `onlyEquality`
* option allows a superset of the exceptions which `exceptRange` allows, thus
* both options are not useful together.
*/
onlyEquality?: boolean;
}
/**
* Configure the behavior of linter plugins.
*
* Here's an example if you're using Next.js in a monorepo:
*
* ```json
* {
* "settings": {
* "next": {
* "rootDir": "apps/dashboard/"
* },
* "react": {
* "linkComponents": [
* {
* "name": "Link",
* "linkAttribute": "to"
* }
* ]
* },
* "jsx-a11y": {
* "components": {
* "Link": "a",
* "Button": "button"
* }
* }
* }
* }
* ```
*/
interface OxlintPluginSettings {
jest?: JestPluginSettings;
jsdoc?: JSDocPluginSettings;
"jsx-a11y"?: JSXA11YPluginSettings;
next?: NextPluginSettings;
react?: ReactPluginSettings;
vitest?: VitestPluginSettings;
[k: string]: unknown | undefined;
}
/**
* Configure Jest plugin rules.
*
* See [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest)'s
* configuration for a full reference.
*/
interface JestPluginSettings {
/**
* Jest version — accepts a number (`29`) or a semver string (`"29.1.0"` or `"v29.1.0"`),
* storing only the major version.
* ::: warning
* Using this config will override the `no-deprecated-functions` config set.
* :::
*/
version?: JestVersionSchema;
[k: string]: unknown | undefined;
}
interface JSDocPluginSettings {
/**
* Only for `require-(yields|returns|description|example|param|throws)` rule
*/
augmentsExtendsReplacesDocs?: boolean;
/**
* Only for `require-param-type` and `require-param-description` rule
*/
exemptDestructuredRootsFromChecks?: boolean;
/**
* For all rules but NOT apply to `empty-tags` rule
*/
ignoreInternal?: boolean;
/**
* For all rules but NOT apply to `check-access` and `empty-tags` rule
*/
ignorePrivate?: boolean;
/**
* Only for `require-(yields|returns|description|example|param|throws)` rule
*/
ignoreReplacesDocs?: boolean;
/**
* Only for `require-(yields|returns|description|example|param|throws)` rule
*/
implementsReplacesDocs?: boolean;
/**
* Only for `require-(yields|returns|description|example|param|throws)` rule
*/
overrideReplacesDocs?: boolean;
tagNamePreference?: {
[k: string]: TagNamePreference | undefined;
};
[k: string]: unknown | undefined;
}
/**
* Configure JSX A11y plugin rules.
*
* See
* [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y#configurations)'s
* configuration for a full reference.
*/
interface JSXA11YPluginSettings {
/**
* Map of attribute names to their DOM equivalents.
* This is useful for non-React frameworks that use different attribute names.
*
* Example:
*
* ```json
* {
* "settings": {
* "jsx-a11y": {
* "attributes": {
* "for": [
* "htmlFor",
* "for"
* ]
* }
* }
* }
* }
* ```
*/
attributes?: {
[k: string]: string[] | undefined;
};
/**
* To have your custom components be checked as DOM elements, you can
* provide a mapping of your component names to the DOM element name.
*
* Example:
*
* ```json
* {
* "settings": {
* "jsx-a11y": {
* "components": {
* "Link": "a",
* "IconButton": "button"
* }
* }
* }
* }
* ```
*/
components?: {
[k: string]: string | undefined;
};
/**
* An optional setting that define the prop your code uses to create polymorphic components.
* This setting will be used to determine the element type in rules that
* require semantic context.
*
* For example, if you set the `polymorphicPropName` to `as`, then this element:
*
* ```jsx
* Hello
* ```
*
* Will be treated as an `h3`. If not set, this component will be treated
* as a `Box`.
*/
polymorphicPropName?: string;
[k: string]: unknown | undefined;
}
/**
* Configure Next.js plugin rules.
*/
interface NextPluginSettings {
/**
* The root directory of the Next.js project.
*
* This is particularly useful when you have a monorepo and your Next.js
* project is in a subfolder.
*
* Example:
*
* ```json
* {
* "settings": {
* "next": {
* "rootDir": "apps/dashboard/"
* }
* }
* }
* ```
*/
rootDir?: OneOrManyFor_String;
[k: string]: unknown | undefined;
}
/**
* Configure React plugin rules.
*
* Derived from [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react#configuration-legacy-eslintrc-)
*/
interface ReactPluginSettings {
/**
* Functions that wrap React components and should be treated as HOCs.
*
* Example:
*
* ```jsonc
* {
* "settings": {
* "react": {
* "componentWrapperFunctions": ["observer", "withRouter"]
* }
* }
* }
* ```
*/
componentWrapperFunctions?: string[];
/**
* Components used as alternatives to `