import type { ReportDescriptor as BaseReportDescriptor, RuleFix, RuleListener } from "@typescript-eslint/utils/dist/ts-eslint"; import type { Rec, a, strings } from "typescript-misc"; export enum Casing { camelCase = "camelCase", // eslint-disable-next-line misc/consistent-enum-members -- Ok kebabCase = "kebab-case", // eslint-disable-next-line misc/consistent-enum-members -- Ok pascalCase = "PascalCase" } export enum Fixable { code = "code", whitespace = "whitespace" } export enum TypeGroup { any = "any", array = "array", arrayOrTuple = "arrayOrTuple", boolean = "boolean", complex = "complex", function = "function", never = "never", null = "null", number = "number", object = "object", parameter = "parameter", readonly = "readonly", string = "string", symbol = "symbol", tuple = "tuple", undefined = "undefined", unknown = "unknown" } export interface AllowDisallowPatterns { readonly allow: a.Mixed; readonly disallow: a.Mixed; } export interface Docs< O extends PropertyKey = never, S extends PropertyKey = never > { readonly description: string; readonly failExamples: string; readonly optionDescriptions?: Rec; readonly optionTypes?: Rec; readonly passExamples: string; readonly suboptionDescriptions?: Rec; readonly suboptionTypes?: Rec; } export type FilePattern = a.Mixed; export interface Matcher { /** * Checks if string matches condition. * @param str - String. * @returns _True_ if string matches condition, _false_ otherwise. */ (str: string): boolean; } export type Matchers = readonly Matcher[]; export type Options< O extends object, S extends object, K extends string = never > = O & { readonly [L in K]: SuboptionsArray }; export type RegexpPattern = a.Mixed; export type ReportDescriptor = BaseReportDescriptor; export type ReportDescriptors = ReadonlyArray< ReportDescriptor >; export type RuleFixes = readonly RuleFix[]; export type RuleListeners = readonly RuleListener[]; export type Selector = a.Mixed; export interface SharedSuboptions { readonly filesToLint?: strings; readonly filesToSkip?: strings; } export type Suboptions = SharedSuboptions & T; export type SuboptionsArray = ReadonlyArray>; export type TypeGroups = readonly TypeGroup[]; export type esRange = readonly [number, number]; export type esRanges = readonly esRange[];