import { Checker, Config, Context, ReportDescriptor, Rule, ast_d_exports } from "./types-jmHZQT0x.js"; import ts, { NodeArray, SyntaxKind, TypeFlags } from "typescript"; //#region src/rules/noBaseToString/noBaseToString.d.ts type NoBaseToStringOptions = { /** * Whether to also check values of type `unknown` * @default false */ checkUnknown?: boolean; /** * List of type names to ignore. * @default ["Error", "RegExp", "URL", "URLSearchParams"] */ ignoredTypeNames?: string[]; }; //#endregion //#region src/rules/noConfusingVoidExpression/noConfusingVoidExpression.d.ts type NoConfusingVoidExpressionOptions = { /** * Whether to ignore "shorthand" `() =>` arrow functions: those without `{ ... }` braces. * @default false */ ignoreArrowShorthand?: boolean; /** * Whether to ignore returns that start with the `void` operator. * @default false */ ignoreVoidOperator?: boolean; /** * Whether to ignore returns from functions with explicit `void` return types and functions with contextual `void` return types. * @default false */ ignoreVoidReturningFunctions?: boolean; }; //#endregion //#region src/rules/noFloatingPromises/noFloatingPromises.d.ts type NoFloatingPromisesOptions = { /** * Functions whose calls are safe to float. * @default [] */ allowList?: string[]; /** * Whether to ignore async IIFEs (Immediately Invoked Function Expressions). * @default false */ ignoreIIFE?: boolean; /** * Whether to ignore `void` expressions. * @default true */ ignoreVoid?: boolean; }; //#endregion //#region src/rules/noMeaninglessVoidOperator/noMeaninglessVoidOperator.d.ts type NoMeaninglessVoidOperatorOptions = { /** * Whether to suggest removing `void` when the argument has type `never`. * @default false */ checkNever?: boolean; }; //#endregion //#region src/rules/noMisusedPromises/noMisusedPromises.d.ts type NoMisusedPromisesOptions = { /** * Whether to warn when a Promise is provided to conditional statements. * @default true */ checksConditionals?: boolean; /** * Whether to warn when `...` spreading a `Promise`. * @default true */ checksSpreads?: boolean; /** * Whether to warn when a Promise is returned from a function typed as returning `void`. * `true` enables checking all cases. * @default true */ checksVoidReturn?: boolean | { /** Disables checking an asynchronous function passed as argument where the parameter type expects a function that returns `void`. */ arguments?: boolean; /** Disables checking an asynchronous function passed as a JSX attribute expected to be a function that returns `void`. */ attributes?: boolean; /** Disables checking an asynchronous method in a type that extends or implements another type expecting that method to return `void`. */ inheritedMethods?: boolean; /** Disables checking an asynchronous function passed as an object property expected to be a function that returns `void`. */ properties?: boolean; /** Disables checking an asynchronous function returned in a function whose return type is a function that returns `void`. */ returns?: boolean; /** Disables checking an asynchronous function used as a variable whose return type is a function that returns `void`. */ variables?: boolean; }; }; //#endregion //#region src/rules/noUnnecessaryBooleanLiteralCompare/noUnnecessaryBooleanLiteralCompare.d.ts type NoUnnecessaryBooleanLiteralCompareOptions = { /** * Whether to allow comparisons between nullable boolean variables and `false`. * @default true */ allowComparingNullableBooleansToFalse?: boolean; /** * Whether to allow comparisons between nullable boolean variables and `true`. * @default true */ allowComparingNullableBooleansToTrue?: boolean; }; //#endregion //#region src/rules/noUnnecessaryCondition/noUnnecessaryCondition.d.ts type NoUnnecessaryConditionOptions = { /** * Whether to ignore constant loop conditions, such as `while (true)`. * @default "never" */ allowConstantLoopConditions?: "always" | "never" | "only-allowed-literals"; /** * Whether to check the asserted argument of a type predicate function for unnecessary conditions. * @default false */ checkTypePredicates?: boolean; }; //#endregion //#region src/rules/noUnnecessaryTypeAssertion/noUnnecessaryTypeAssertion.d.ts type NoUnnecessaryTypeAssertionOptions = { /** * A list of type names to ignore. * @default [] */ typesToIgnore?: string[]; }; //#endregion //#region src/rules/onlyThrowError/onlyThrowError.d.ts type OnlyThrowErrorOptions = { /** * Whether to always allow throwing values typed as `any`. * @default true */ allowThrowingAny?: boolean; /** * Whether to always allow throwing values typed as `unknown`. * @default true */ allowThrowingUnknown?: boolean; /** * Whether to allow rethrowing caught values that are not `Error` objects. * @default true */ allowRethrowing?: boolean; /** * A list of identifiers to ignore. * @default [] */ allow?: string[]; }; //#endregion //#region src/rules/preferNullishCoalescing/preferNullishCoalescing.d.ts type PreferNullishCoalescingOptions = { /** * Whether to ignore arguments to the `Boolean` constructor. * @default false */ ignoreBooleanCoercion?: boolean; /** * Whether to ignore cases that are located within a conditional test. * @default true */ ignoreConditionalTests?: boolean; /** * Whether to ignore any logical or expressions that are part of a mixed logical expression (with `&&`). * @default false */ ignoreMixedLogicalExpressions?: boolean; /** * Whether to ignore any ternary expressions that could be simplified by using the nullish coalescing operator. * @default false */ ignoreTernaryTests?: boolean; /** * Whether to ignore any if statements that could be simplified by using the nullish coalescing operator. * @default false */ ignoreIfStatements?: boolean; /** * Whether to ignore all (`true`) or some (an object with properties) primitive types. * @default false */ ignorePrimitives?: { /** Ignore bigint primitive types. */ bigint?: boolean; /** Ignore boolean primitive types. */ boolean?: boolean; /** Ignore number primitive types. */ number?: boolean; /** Ignore string primitive types. */ string?: boolean; } /** Ignore all primitive types. */ | true; }; //#endregion //#region src/rules/preferOptionalChain/preferOptionalChain.d.ts type PreferOptionalChainOptions = { /** * Check operands that are typed as `any` when inspecting "loose boolean" operands. * @default true */ checkAny?: boolean; /** * Check operands that are typed as `bigint` when inspecting "loose boolean" operands. * @default true */ checkBigInt?: boolean; /** * Check operands that are typed as `boolean` when inspecting "loose boolean" operands. * @default true */ checkBoolean?: boolean; /** * Check operands that are typed as `number` when inspecting "loose boolean" operands. * @default true */ checkNumber?: boolean; /** * Check operands that are typed as `string` when inspecting "loose boolean" operands. * @default true */ checkString?: boolean; /** * Check operands that are typed as `unknown` when inspecting "loose boolean" operands. * @default true */ checkUnknown?: boolean; /** * Skip operands that are not typed with `null` and/or `undefined` when inspecting "loose boolean" operands. * @default false */ requireNullish?: boolean; }; //#endregion //#region src/rules/preferStringStartsEndsWith/preferStringStartsEndsWith.d.ts type PreferStringStartsEndsWithOptions = { /** * Whether to allow equality checks against the first or last element of a string. * @default "never" */ allowSingleElementEquality?: "always" | "never"; }; //#endregion //#region src/rules/restrictPlusOperands/restrictPlusOperands.d.ts type RestrictPlusOperandsOptions = { /** * Whether to allow `any` typed values. * @default false */ allowAny?: boolean; /** * Whether to allow `boolean` typed values. * @default true */ allowBoolean?: boolean; /** * Whether to allow potentially `null` or `undefined` typed values. * @default false */ allowNullish?: boolean; /** * Whether to allow `bigint`/`number` typed values and `string` typed values to be added together. * @default true */ allowNumberAndString?: boolean; /** * Whether to allow `regexp` typed values. * @default false */ allowRegExp?: boolean; }; //#endregion //#region src/rules/restrictTemplateExpressions/restrictTemplateExpressions.d.ts type RestrictTemplateExpressionsOptions = { /** * Types to allow in template expressions. * @default ["Error", "URL", "URLSearchParams"] */ allow?: string[]; /** * Whether to allow `any` typed values in template expressions. * @default false */ allowAny?: boolean; /** * Whether to allow `array` typed values in template expressions. * @default false */ allowArray?: boolean; /** * Whether to allow `boolean` typed values in template expressions. * @default false */ allowBoolean?: boolean; /** * Whether to allow `never` typed values in template expressions. * @default true */ allowNever?: boolean; /** * Whether to allow `nullish` typed values in template expressions. * @default false */ allowNullish?: boolean; /** * Whether to allow `number` typed values in template expressions. * @default true */ allowNumber?: boolean; /** * Whether to allow `regexp` typed values in template expressions. * @default false */ allowRegExp?: boolean; }; //#endregion //#region src/rules/strictBooleanExpressions/strictBooleanExpressions.d.ts type StrictBooleanExpressionsOptions = { /** * Whether to allow `any`s in a boolean context. * @default false */ allowAny?: boolean; /** * Whether to allow nullable `boolean`s in a boolean context. * @default false */ allowNullableBoolean?: boolean; /** * Whether to allow nullable `enum`s in a boolean context. * @default false */ allowNullableEnum?: boolean; /** * Whether to allow nullable `number`s in a boolean context. * @default false */ allowNullableNumber?: boolean; /** * Whether to allow nullable `object`s, `symbol`s, and functions in a boolean context. * @default true */ allowNullableObject?: boolean; /** * Whether to allow nullable `string`s in a boolean context. * @default false */ allowNullableString?: boolean; /** * Whether to allow `number`s in a boolean context. * @default true */ allowNumber?: boolean; /** * Whether to allow `string`s in a boolean context. * @default true */ allowString?: boolean; }; //#endregion //#region src/rules/switchExhaustivenessCheck/switchExhaustivenessCheck.d.ts type SwitchExhaustivenessCheckOptions = { /** * If `true`, allow `default` cases on switch statements with exhaustive * cases. * @default true */ allowDefaultCaseForExhaustiveSwitch?: boolean; /** * If `true`, require a `default` clause for switches on non-union types. * @default false */ requireDefaultForNonUnion?: boolean; /** * If `true`, the `default` clause is used to determine whether the switch statement is exhaustive for union types. * @default false */ considerDefaultExhaustiveForUnions?: boolean; }; //#endregion //#region src/rules/_utils/index.d.ts declare const defineRule: | undefined = undefined, Data = undefined>(fn: (options?: Options) => Rule) => (options?: Options | "off") => Rule; //#endregion //#region src/index.d.ts declare const defineConfig: (config: Config) => Config; type RulesSet Rule>> = RulesFnsMap & { all: () => Array>; }; declare const createRulesSet: Rule>>(rulesFunctions: T) => RulesSet; declare const core: RulesSet<{ awaitThenable: (options?: "off" | undefined) => Rule; dotNotation: (options?: "off" | undefined) => Rule; noArrayDelete: (options?: "off" | undefined) => Rule; noBaseToString: (options?: "off" | NoBaseToStringOptions | undefined) => Rule; noConfusingVoidExpression: (options?: "off" | NoConfusingVoidExpressionOptions | undefined) => Rule; noFloatingPromises: (options?: "off" | NoFloatingPromisesOptions | undefined) => Rule; noForInArray: (options?: "off" | undefined) => Rule; noImpliedEval: (options?: "off" | undefined) => Rule; noMeaninglessVoidOperator: (options?: "off" | NoMeaninglessVoidOperatorOptions | undefined) => Rule; noMisusedPromises: (options?: "off" | NoMisusedPromisesOptions | undefined) => Rule; noMisusedSpread: (options?: "off" | undefined) => Rule; nonNullableTypeAssertionStyle: (options?: "off" | undefined) => Rule; noRedundantTypeConstituents: (options?: "off" | undefined) => Rule; noUnnecessaryBooleanLiteralCompare: (options?: "off" | NoUnnecessaryBooleanLiteralCompareOptions | undefined) => Rule; noUnnecessaryCondition: (options?: "off" | NoUnnecessaryConditionOptions | undefined) => Rule; noUnnecessaryTemplateExpression: (options?: "off" | undefined) => Rule; noUnnecessaryTypeArguments: (options?: "off" | undefined) => Rule; noUnnecessaryTypeAssertion: (options?: "off" | NoUnnecessaryTypeAssertionOptions | undefined) => Rule; noUnnecessaryTypeConversion: (options?: "off" | undefined) => Rule; noUnsafeUnaryMinus: (options?: "off" | undefined) => Rule; noUselessDefaultAssignment: (options?: "off" | undefined) => Rule; onlyThrowError: (options?: "off" | OnlyThrowErrorOptions | undefined) => Rule; preferFind: (options?: "off" | undefined) => Rule; preferIncludes: (options?: "off" | undefined) => Rule; preferNullishCoalescing: (options?: "off" | PreferNullishCoalescingOptions | undefined) => Rule; preferOptionalChain: (options?: "off" | PreferOptionalChainOptions | undefined) => Rule; preferReduceTypeParameter: (options?: "off" | undefined) => Rule; preferReturnThisType: (options?: "off" | undefined) => Rule; preferStringStartsEndsWith: (options?: "off" | PreferStringStartsEndsWithOptions | undefined) => Rule; restrictPlusOperands: (options?: "off" | RestrictPlusOperandsOptions | undefined) => Rule; restrictTemplateExpressions: (options?: "off" | RestrictTemplateExpressionsOptions | undefined) => Rule; returnAwait: (options?: "off" | undefined) => Rule; strictBooleanExpressions: (options?: "off" | StrictBooleanExpressionsOptions | undefined) => Rule; switchExhaustivenessCheck: (options?: "off" | SwitchExhaustivenessCheckOptions | undefined) => Rule; }>; //#endregion export { ast_d_exports as AST, Checker, Config, Context, ReportDescriptor, Rule, RulesSet, core, createRulesSet, defineConfig, defineRule };