Skip to content

Commit fdcf183

Browse files
Zamiellclaude
andcommitted
fix(types): use readonly arrays for "as const" compatibility
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 parent a3ca58e commit fdcf183

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

@commitlint/types/src/rules.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ export type RuleConfig<
7878

7979
export type CaseRuleConfig<V = RuleConfigQuality.User> = RuleConfig<
8080
V,
81-
TargetCaseType | TargetCaseType[]
81+
TargetCaseType | readonly TargetCaseType[]
8282
>;
8383
export type LengthRuleConfig<V = RuleConfigQuality.User> = RuleConfig<
8484
V,
8585
number
8686
>;
8787
export type EnumRuleConfig<V = RuleConfigQuality.User> = RuleConfig<
8888
V,
89-
string[]
89+
readonly string[]
9090
>;
9191
export type ObjectRuleConfig<
9292
V = RuleConfigQuality.User,
@@ -115,12 +115,18 @@ export type RulesConfig<V = RuleConfigQuality.User> = {
115115
"references-empty": RuleConfig<V>;
116116
"scope-case":
117117
| CaseRuleConfig<V>
118-
| ObjectRuleConfig<V, { cases: TargetCaseType[]; delimiters?: string[] }>;
118+
| ObjectRuleConfig<
119+
V,
120+
{ cases: readonly TargetCaseType[]; delimiters?: readonly string[] }
121+
>;
119122
"scope-delimiter-style": EnumRuleConfig<V>;
120123
"scope-empty": RuleConfig<V>;
121124
"scope-enum":
122125
| EnumRuleConfig<V>
123-
| ObjectRuleConfig<V, { scopes: string[]; delimiters?: string[] }>;
126+
| ObjectRuleConfig<
127+
V,
128+
{ scopes: readonly string[]; delimiters?: readonly string[] }
129+
>;
124130
"scope-max-length": LengthRuleConfig<V>;
125131
"scope-min-length": LengthRuleConfig<V>;
126132
"signed-off-by": RuleConfig<V, string>;

0 commit comments

Comments
 (0)