Description
Expected Behavior
See context
Current Behavior
See context
Affected packages
- cli
- core
- prompt
- config-angular
Possible Solution
- Adding a "troubleshooting" section in the docs explaining the reason of the issue and how to resolve it.
- Integrate
RangeError: Found invalid rule names
with an additional description providing the user a clue that some@commitlint/packages
should be updated (a link to the new documentation section could do the trick).
What do you think? If you agree I can work on a PR.
Context
After adding header-trim
rule (#3871),
a certain amount of user has reported issues when updating commitlint:
- feat(rules): add header-trim rule #3871 (comment)
- feat(rules): add header-trim rule #3871 (comment)
- feat(rules): add header-trim rule #3871 (comment)
For reference:
Explanation of the cause of the error
The error is thrown here:
commitlint/@commitlint/lint/src/lint.ts
Lines 78 to 86 in daa8b1b
all rules is declared reading the content of baseRules:
commitlint/@commitlint/lint/src/lint.ts
Lines 59 to 62 in daa8b1b
baseRules
are imported from @commitlint-rules
:
in version 14.6.0
header-trim
definition has been added
commitlint/@commitlint/rules/src/index.ts
Line 55 in daa8b1b
Running command line from CLI doesn't throw any error.
If I have to make a guess not all required packages have updated to version 18.6.0
.
Originally posted by @marcalexiei in #3871 (comment)
Solution
[!WARNING]
The source of this error is likely a mismatch of version between@commitlint
packages innode_modules
Detailed explanation can be found in a comment above.
If someone is relying on a config which depends on an earlier version of @commitlint/config-conventional
be sure to update it:
npm update @commitlint/config-conventional
Originally posted by @marcalexiei in #3871 (comment)