UNPKG

dclint

Version:

A command-line tool for validating and enforcing best practices in Docker Compose files.

42 lines (41 loc) 1.51 kB
import type { Rule, RuleCategory, RuleMessage, RuleMeta, RuleSeverity, RuleType } from './rules.types'; import type { LintContext } from '../linter/linter.types'; interface ServiceKeysOrderRuleInputOptions { groupOrder?: ServiceKeyGroup[]; groups?: Partial<Record<ServiceKeyGroup, string[]>>; } interface ServiceKeysOrderRuleOptions { groupOrder: ServiceKeyGroup[]; groups: Record<ServiceKeyGroup, string[]>; } declare enum ServiceKeyGroup { CORE = "Core Definitions", DEPENDENCIES = "Service Dependencies", DATA_MANAGEMENT = "Data Management and Configuration", ENVIRONMENT = "Environment Configuration", NETWORK = "Networking", RUNTIME = "Runtime Behavior", METADATA = "Operational Metadata", SECURITY = "Security and Execution Context", OTHER = "Other" } declare class ServiceKeysOrderRule implements Rule { static readonly name = "service-keys-order"; get name(): string; type: RuleType; category: RuleCategory; severity: RuleSeverity; meta: RuleMeta; fixable: boolean; getMessage({ serviceName, key, correctOrder, }: { serviceName: string; key: string; correctOrder: string[]; }): string; options: ServiceKeysOrderRuleOptions; constructor(options?: ServiceKeysOrderRuleInputOptions); private getCorrectOrder; check(context: LintContext): RuleMessage[]; fix(content: string): string; } export { type ServiceKeysOrderRuleInputOptions, ServiceKeyGroup, ServiceKeysOrderRule };