@shayanthenerd/eslint-config
Version:
A modern, flexible ESLint configuration for enforcing best practices and maintaining a consistent coding style
12 lines (11 loc) • 548 B
TypeScript
import { DeepNonNullable, Tail } from "./helpers.js";
import { ESLintSchema } from "./eslint-schema.js";
//#region src/types/eslintRules.d.ts
/*** CoreRules & PluginRules ***/
type RuleNames = keyof ESLintSchema;
/*** RuleOptions ***/
type Rule<RuleName extends RuleNames> = DeepNonNullable<ESLintSchema>[RuleName];
type RuleConfigs<RuleName extends RuleNames> = Tail<Rule<RuleName>>;
type RuleOptions<RuleName extends RuleNames, Index extends (0 | 1 | 2) = 0> = NonNullable<RuleConfigs<RuleName>[Index]>;
//#endregion
export { type RuleOptions };