When moving config files to typescript in order to take advantage of types, previous valid values does not match signature.
Reviewing types, there is a condition in wich UserConfig cannot use arrays for casing values. Is this correct ?
Expected Behavior
If Im not wrong, array values for casing rules should be allowed.
Current Behavior
import type { UserConfig } from '@commitlint/types';
const config: UserConfig = {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-case': [
2,
'always',
['lower-case', 'camel-case', 'pascal-case'], // ! Type 'string[]' is not assignable to type '"lowerCase"'.ts(2322)
],
},
};
Affected packages
Possible Solution
Types are complex, but signature for rule values should be something like 'lower-case' | 'camel-case' | ('lower-case' | 'camel-case')[]
Context
Your Environment
| Executable |
Version |
commitlint --version |
12.1.4 |
git --version |
2.27.0 |
node --version |
14.16.1 |
When moving config files to typescript in order to take advantage of types, previous valid values does not match signature.
Reviewing types, there is a condition in wich UserConfig cannot use arrays for casing values. Is this correct ?
Expected Behavior
If Im not wrong, array values for casing rules should be allowed.
Current Behavior
Affected packages
Possible Solution
Types are complex, but signature for rule values should be something like
'lower-case' | 'camel-case' | ('lower-case' | 'camel-case')[]Context
Your Environment
commitlint --versiongit --versionnode --version