import { Linter } from "eslint"; //#region src/ESLintConfig.d.ts /** * Concat multiple flat configs into a single flat config array. * * It also resolves promises and flattens the result. * * @example * * ```ts * import eslint from '@eslint/js' * * export default ESLintConfig.concat( * { * plugins: {}, * rules: {}, * }, * // It can also takes a array of configs: * [ * { * plugins: {}, * rules: {}, * } * // ... * ], * // Or promises: * Promise.resolve({ * files: ['*.ts'], * rules: {}, * }) * ); * ``` * @param configs */ declare function concat(...configs: Array> | Promise | ReadonlyArray | T>): Promise>; /** * Always return 'off'. `_status` is the previous rule value. * * @param _status */ declare function fixme(_status: [number | string, ...Array] | number | string | undefined): "off"; /** * Maps rule names and values using the provided mapping function. * * @example * ```ts * ESLintConfig.mapRules( * { * 'rule-name': 'error', * 'rule-to-drop': 'error', * }, * (rule, value) => { * if (rule === 'rule-name') return ['new-rule-name', value]; * return undefined; * } * ); // { 'new-rule-name': 'error' } * ``` * @param rules * @param mapFn */ declare function mapRules(rules: Record, mapFn: (rule: string, value: any) => [string, any] | undefined): Record; /** * Return a new merged flat configuration * * @param configs */ declare function merge(...configs: Array): T; /** * Renames rules in the given object according to the given map. * * Given a map `{ 'old-prefix': 'new-prefix' }`, and a rule object * `{ 'old-prefix/rule-name': 'error' }`, this function will return * `{ 'new-prefix/rule-name': 'error' }`. * * @param rules The object containing the rules to rename. * @param map The object containing the rename map. */ declare function renameRules(rules: Record, map: Record): Record; /** * @namespace */ export declare const ESLintConfig: Readonly<{ concat: typeof concat; fixme: typeof fixme; mapRules: typeof mapRules; merge: typeof merge; renameRules: typeof renameRules; }>; //#endregion //#region src/interopDefault.d.ts /** * Resolves a module or promise-like object, returning the default export if available. * * @example * ```ts * // modules.ts * export default { * foo: true * }; * // Async API * const modPromise = import('./module'); * interopDefault(modPromise); // == Promise.resolve({ foo: true }) * // Sync API * const mod = await import('./module'); * interopDefault(mod); // == { foo: true } * ``` * * @template T - The type of the module or promise-like object. * @param m The module or promise-like object to resolve. */ export declare function interopDefault(m: PromiseLike): Promise; export declare function interopDefault(m: T): T extends { default: infer U; } ? U : T; //#endregion //#region src/LanguageId.d.ts /** * A list of "vscode-like" language identifiers (i.e. "javascript", "javascriptreact") */ export type LanguageId = keyof LanguageIdMap; export interface LanguageIdMap { css: true; graphql: true; javascript: true; javascriptreact: true; jpeg: true; json: true; jsonc: true; less: true; markdown: true; sass: true; scss: true; typescript: true; typescriptreact: true; vue: true; yaml: true; } //#endregion //#region src/meta.d.ts export declare const meta: Readonly<{ buildNumber: number; name: string; version: string; }>; //#endregion //#region src/Project.d.ts /** * A type of a file extension */ export type Extension = `.${string}`; /** * Object hash of all well-known file extension category to file extensions mapping */ export type ExtensionRegistry = Record>; /** * Supported ECMA version * * @example * ```ts * Project.ecmaVersion() // 2022 * ``` */ declare function ecmaVersion(): 2022; /** * Return a list of extensions * * @example * ```ts * Project.queryExtensions(['javascript']); // ['.js', '.cjs', ...] * Project.queryExtensions(['typescript', 'typescriptreact']); // ['.ts', '.mts', ..., '.tsx'] * ``` * * @param languages */ declare function queryExtensions(languages: Array): ReadonlyArray; /** * Supported file extensions * * @example * ```ts * Project.sourceExtensions() // ['.ts', '.js', ...] * ``` */ declare function sourceExtensions(): readonly `.${string}`[]; /** * Resource file extensions * * @example * ```ts * Project.resourceExtensions() // ['.css', '.sass', ...] * ``` */ declare function resourceExtensions(): readonly `.${string}`[]; /** * Return a RegExp that will match any list of extensions * * @param extensions * @example * ```ts * Project.extensionsToRegExp(['.js', '.ts']) // RegExp = /(\.js|\.ts)$/ * ``` */ declare function extensionsToRegExp(extensions: ReadonlyArray): RegExp; /** * Return a list of test glob matchers for a list of extensions. * This is useful to generate globs for vitest/jest matchers * * @param extensions * @param options * @param options.testExtensions dotted compound extensions (e.g. `.spec`, `.test`) * @param options.testFolders * @example * ```ts * Project.extensionsToTestGlob(['.js', '.ts']); * // ['', ''] * * Project.extensionsToTestGlob(['.js', '.ts'], { testExtensions: ['.unit'] }); * // ['', ''] * ``` */ declare function extensionsToTestGlob(extensions: ReadonlyArray, options?: { testExtensions?: ReadonlyArray; testFolders?: ReadonlyArray; }): Array; /** * Create a new glob pattern based on the provided options. * * @param options The glob options to use when generating the glob pattern. * * @example * ```ts * Project.glob({ fileExtensions: [['.js', '.ts']] }); // '*.@(js|ts)' * Project.glob({ fileExtensions: [['.js']], nested: true }); // '**\/*.js' * ``` */ declare function glob(options: Project.glob.Options): string; /** * Files and folders to always ignore * * @example * ```ts * IGNORED // ['node_modules/', 'build/', ...] * ``` */ declare function ignored(): readonly string[]; export declare const Project: Readonly<{ ecmaVersion: typeof ecmaVersion; extensionsToRegExp: typeof extensionsToRegExp; extensionsToTestGlob: typeof extensionsToTestGlob; glob: typeof glob; ignored: typeof ignored; queryExtensions: typeof queryExtensions; resourceExtensions: typeof resourceExtensions; sourceExtensions: typeof sourceExtensions; }>; export declare namespace Project { namespace glob { interface Options { /** * An extension stack * * @example * ```ts * Project.glob({ fileExtensions: [['.js']] }); // '*.js' * Project.glob({ fileExtensions: ['.@(js|ts)'] }); // '*.@(js|ts)' * Project.glob({ fileExtensions: [['.js', '.ts']] }); // '*.@(js|ts)' * Project.glob({ fileExtensions: [['.spec', '.test'], ['.js', '.ts', '.tsx']] }); // '*.@(spec|test).@(js|ts|tsx)' * Project.glob({ fileExtensions: [] }); // '*' * ``` */ fileExtensions?: ReadonlyArray | string> | undefined; /** * The stem (basename without extension) of the file to match. * * @example * ```ts * Project.glob({ fileStem: 'index', fileExtensions: ['.*'] }); // 'index.*' * ``` */ fileStem?: ReadonlyArray | string | undefined; /** * Ancestor folders to include in the glob pattern. * * @example * ```ts * Project.glob({ ancestorFolders: ['src'] }); // 'src/**​/*' * ``` */ folderAncestors?: ReadonlyArray | string | undefined; /** * Parent folders to include in the glob pattern (immediate parent folders). * * @example * ```ts * Project.glob({ folderParents: ['src'] }); // 'src/*' * ``` */ folderParents?: ReadonlyArray | string | undefined; /** * Whether to match files in nested folders. * * @default false * @example * ```ts * Project.glob({ nested: true }); // '* /*' * Project.glob({ nested: true, fileExtensions: [['.js']] }); // '**\/*.js' * ``` */ nested?: boolean | undefined; } } } //#endregion //#region src/ProjectScript.d.ts /** * Project common scripts */ export declare const ProjectScript: { readonly Build: "build"; readonly Clean: "clean"; readonly CodeAnalysis: "code-analysis"; readonly Coverage: "coverage"; readonly Develop: "develop"; readonly Docs: "docs"; readonly Format: "format"; readonly Install: "install"; readonly Lint: "lint"; readonly Prepare: "prepare"; readonly Release: "release"; readonly Rescue: "rescue"; readonly Spellcheck: "spellcheck"; readonly Test: "test"; readonly Typecheck: "typecheck"; readonly Validate: "validate"; }; export type ProjectScript = (typeof ProjectScript)[keyof typeof ProjectScript]; //#endregion //# sourceMappingURL=index.d.ts.map