UNPKG

dclint

Version:

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

42 lines (41 loc) 1.54 kB
import type { LintContext } from '../linter/linter.types'; import type { Rule, RuleCategory, RuleSeverity, RuleType, RuleMeta, RuleMessage } from './rules.types'; export interface ServiceKeysOrderRuleInputOptions { groupOrder?: GroupOrderEnum[]; groups?: Partial<Record<GroupOrderEnum, string[]>>; } interface ServiceKeysOrderRuleOptions { groupOrder: GroupOrderEnum[]; groups: Record<GroupOrderEnum, string[]>; } export declare enum GroupOrderEnum { CoreDefinitions = "Core Definitions", ServiceDependencies = "Service Dependencies", DataManagementAndConfiguration = "Data Management and Configuration", EnvironmentConfiguration = "Environment Configuration", Networking = "Networking", RuntimeBehavior = "Runtime Behavior", OperationalMetadata = "Operational Metadata", SecurityAndExecutionContext = "Security and Execution Context", Other = "Other" } export default 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 {};