UNPKG

@kcws/lintstaged-config

Version:
45 lines 1.62 kB
import type { Builder } from "../models/Config"; import type { IBaseActionOptions } from "../actions/_base"; import { type IEslintOptions, type IPrettierOptions, type IShellcheckOptions, type IYamllintOptions } from "../actions"; /** * Default possible key * * @public */ export type DefaultKey = "jsts" | "json" | "sh" | "yaml"; /** * A helper type for select only application options without base action. * @beta */ export type OnlyAppOptions<T> = Pick<T, Exclude<keyof T, keyof IBaseActionOptions>>; /** * Custom type for default configuration builder * @beta */ export interface CustomDefaultConfig { /** custom config for jsts eslint */ eslint?: OnlyAppOptions<IEslintOptions> | false; /** custom config for jsts prettier */ jstsPrettier?: OnlyAppOptions<IPrettierOptions> | false; /** custom config for json prettier */ jsonPrettier?: OnlyAppOptions<IPrettierOptions> | false; /** custom config for shellcheck */ shellcheck?: OnlyAppOptions<IShellcheckOptions> | false; /** custom config for yamllint */ yamllint?: OnlyAppOptions<IYamllintOptions> | false; } /** * A function to define default configuration for lintstaged, * So you don't have to configure each action by yourself. * * @param builder - Config.Builder * @returns same builder with default configuration * * @remarks * * Notes: This function will append default config groups, not replace it. * * @internal */ export declare const defineDefaultConfig: <K extends string>(builder: Builder<K>, custom?: CustomDefaultConfig) => Builder<DefaultKey | K>; //# sourceMappingURL=default.d.ts.map