productive-eslint
Version:
Mildly strict and sufficiently practical ESLint config based on Evgeny Orekhov's eslint-config-hardcore
46 lines (45 loc) • 1.53 kB
TypeScript
import { Linter } from "eslint";
import { FlatConfigComposer } from "eslint-flat-config-utils";
//#region src/utils/presets.d.ts
/**
* Presets for ESLint config.
*
* - AutoFixable: only rules with ESLint autofix support.
* - Recommended: autofixable rules plus mechanical non-autofixable rules.
*/
declare enum Preset {
AUTO_FIXABLE = "autoFixable",
RECOMMENDED = "recommended"
}
//#endregion
//#region src/index.config.d.ts
/** Options for the main config factory. */
interface IOptions {
/** Files to ignore. Defaults to empty array. */
ignores?: string[];
/** Preset: autoFixable or recommended. Defaults to recommended. */
preset?: Preset;
/** Enable RxJS rules. Auto-detected from installed packages when not set. */
rxjs?: boolean;
/** Enable Vue rules. Auto-detected from installed packages when not set. */
vue?: boolean;
}
/**
* Main config factory.
*
* @param options The options for generating the ESLint configuration.
* @param options.ignores Additional glob patterns to ignore.
* @param options.rxjs Enable RxJS rules. Auto-detected when not set.
* @param options.preset Preset: autoFixable (only auto-fixable rules) or
* recommended (permanent mechanical baseline). Defaults to recommended.
* @param options.vue Enable Vue rules. Auto-detected when not set.
* @returns The generated ESLint configuration.
*/
declare const createConfig: ({
ignores,
preset,
rxjs,
vue
}?: IOptions) => FlatConfigComposer<Linter.Config>;
//#endregion
export { IOptions, Preset, createConfig };