UNPKG

@eventcatalog/linter

Version:

A linter for EventCatalog to validate frontmatter and resource references

22 lines 1.12 kB
import { ValidationError } from '../types'; export type RuleSeverity = 'error' | 'warn' | 'off'; export interface RuleConfig { severity: RuleSeverity; options?: Record<string, any>; } export interface ConfigOverride { files: string[]; rules: Record<string, RuleSeverity | [RuleSeverity, Record<string, any>]>; } export interface LinterConfig { rules: Record<string, RuleSeverity | [RuleSeverity, Record<string, any>]>; ignorePatterns?: string[]; overrides?: ConfigOverride[]; } export declare const DEFAULT_RULES: Record<string, RuleSeverity>; export declare const loadConfig: (rootDir: string) => LinterConfig; export declare const parseRuleConfig: (rule: RuleSeverity | [RuleSeverity, Record<string, any>]) => RuleConfig; export declare const shouldIgnoreFile: (filePath: string, ignorePatterns: string[]) => boolean; export declare const getEffectiveRules: (filePath: string, config: LinterConfig) => Record<string, RuleConfig>; export declare const applyRuleSeverity: (errors: ValidationError[], rules: Record<string, RuleConfig>) => ValidationError[]; //# sourceMappingURL=index.d.ts.map