dclint
Version:
A command-line tool for validating and enforcing best practices in Docker Compose files.
38 lines (37 loc) • 1.26 kB
TypeScript
import type { Rule, RuleCategory, RuleMessage, RuleMeta, RuleSeverity, RuleType } from './rules.types';
import type { LintContext } from '../linter/linter.types';
interface TopLevelPropertiesOrderRuleInputOptions {
customOrder?: TopLevelKeys[];
}
interface TopLevelPropertiesOrderRuleOptions {
customOrder: TopLevelKeys[];
}
declare enum TopLevelKeys {
X_PROPERTIES = "x-properties",
VERSION = "version",
NAME = "name",
INCLUDE = "include",
SERVICES = "services",
NETWORKS = "networks",
VOLUMES = "volumes",
SECRETS = "secrets",
CONFIGS = "configs"
}
declare class TopLevelPropertiesOrderRule implements Rule {
static readonly name = "top-level-properties-order";
get name(): string;
type: RuleType;
category: RuleCategory;
severity: RuleSeverity;
meta: RuleMeta;
fixable: boolean;
options: TopLevelPropertiesOrderRuleOptions;
constructor(options?: TopLevelPropertiesOrderRuleInputOptions);
getMessage({ key, correctOrder }: {
key: string;
correctOrder: string[];
}): string;
check(context: LintContext): RuleMessage[];
fix(content: string): string;
}
export { type TopLevelPropertiesOrderRuleInputOptions, TopLevelKeys, TopLevelPropertiesOrderRule };