From 7b6f446615f7e7680eaf230c995ea4dea57d035f Mon Sep 17 00:00:00 2001 From: pommee Date: Sat, 27 Sep 2025 10:58:11 +0200 Subject: [PATCH] chore: update commitlint with custom rules --- client/commitlint.config.js | 1 - client/commitlint.config.ts | 54 +++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) delete mode 100644 client/commitlint.config.js create mode 100644 client/commitlint.config.ts diff --git a/client/commitlint.config.js b/client/commitlint.config.js deleted file mode 100644 index fa584fb..0000000 --- a/client/commitlint.config.js +++ /dev/null @@ -1 +0,0 @@ -export default { extends: ["@commitlint/config-conventional"] }; diff --git a/client/commitlint.config.ts b/client/commitlint.config.ts new file mode 100644 index 0000000..a68d419 --- /dev/null +++ b/client/commitlint.config.ts @@ -0,0 +1,54 @@ +import { + RuleConfigCondition, + RuleConfigSeverity, + TargetCaseType, + UserConfig +} from "@commitlint/types"; + +const config: UserConfig = { + parserPreset: "conventional-changelog-conventionalcommits", + rules: { + "body-leading-blank": [RuleConfigSeverity.Warning, "always"] as const, + "body-max-line-length": [ + RuleConfigSeverity.Error, + "always", + 999999 + ] as const, + "footer-leading-blank": [RuleConfigSeverity.Warning, "always"] as const, + "footer-max-line-length": [ + RuleConfigSeverity.Error, + "always", + 100 + ] as const, + "header-max-length": [RuleConfigSeverity.Error, "always", 100] as const, + "header-trim": [RuleConfigSeverity.Error, "always"] as const, + "subject-case": [ + RuleConfigSeverity.Error, + "never", + ["sentence-case", "start-case", "pascal-case", "upper-case"] + ] as [RuleConfigSeverity, RuleConfigCondition, TargetCaseType[]], + "subject-empty": [RuleConfigSeverity.Error, "never"] as const, + "type-case": [RuleConfigSeverity.Error, "always", "lower-case"] as const, + "type-empty": [RuleConfigSeverity.Error, "never"] as const, + "type-enum": [ + RuleConfigSeverity.Error, + "always", + [ + "build", + "chore", + "ci", + "docs", + "feat", + "fix", + "perf", + "refactor", + "revert", + "style", + "ui", + "test" + ] + ] as [RuleConfigSeverity, RuleConfigCondition, string[]] + } +}; + +export default config;