import type { ConcernConfig, ResolvedConcern } from "#types/concern.types"; import type { ESLint, Linter, Rule } from "eslint"; import type { GovlabEslintSettings } from "#types/config.types"; import type { InstallRecord } from "#types/dependency.types"; import type { QualityRuleRecord } from "#types/catalog.types"; export type RuleOptionValue = number[] | boolean | number | string; export type RuleOptions = Record; export type EslintRuleEntry = "error" | ["error", RuleOptions]; interface EmitExclude { rule?: string[]; category?: string[]; } export interface EmitPolicy { rules?: string[]; exclude?: EmitExclude; concerns?: ConcernConfig; activePlugins?: string[]; overrides?: Record; options?: Record>; } export interface ValueContext { overrides: Record; conceptOverride: Map; conceptMin: Map; } export interface EmitContext { ruleByKey: Map; concernMap: Map; valueCtx: ValueContext; extraOptions: Record>; excludeRules: Set; excludeCategories: Set; } export interface GovlabRuleDocs { description: string; canonical: string[]; ruleId: string; url?: string | undefined; } export interface GovlabRuleSpec { ruleId: string; description: string; canonical: string[]; messages: Record; type?: "layout" | "problem" | "suggestion"; fixable?: "code" | "whitespace"; hasSuggestions?: boolean; schema?: Rule.RuleMetaData["schema"]; url?: string; } export type GovlabSettings = Partial; export interface SettingsCarrier { settings?: { govlab?: GovlabSettings } | undefined; } export interface FilenameCarrier { filename: string; } export interface ScopeCarrier extends FilenameCarrier, SettingsCarrier {} export interface InstalledPlugin { plugin: unknown; record: InstallRecord; } export interface LoadedPlugin { plugin: unknown; record: { npm?: string | null | undefined }; } export interface BaseContext { globals?: Record; plugins: Record; rules: Linter.RulesRecord; settings: Linter.Config["settings"]; tsParser: unknown; } export interface TsTestScopeOptions { tsParser: unknown; language: Linter.Config["languageOptions"]; disabled: Linter.RulesRecord; extraGlobs?: string[]; } export interface CoreState { htmlPlugin: unknown; installed: InstalledPlugin[]; plugins: Record; rules: Linter.RulesRecord; settings: Linter.Config["settings"]; tsParser: unknown; }