commitlint
commitlint copied to clipboard
feat: how to mitigate errors when adding a new rule and not updating all relevant packages
Expected Behavior
See context
Current Behavior
See context
Affected packages
- [ ] cli
- [X] 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 (https://github.com/conventional-changelog/commitlint/pull/3871),
a certain amount of user has reported issues when updating commitlint:
- https://github.com/conventional-changelog/commitlint/pull/3871#issuecomment-1911312089
- https://github.com/conventional-changelog/commitlint/pull/3871#issuecomment-1916336429
- https://github.com/conventional-changelog/commitlint/pull/3871#issuecomment-1917735604
For reference:
Explanation of the cause of the error
The error is thrown here:
https://github.com/conventional-changelog/commitlint/blob/daa8b1baa8732b3f1f937d2453608d47b4952bff/%40commitlint/lint/src/lint.ts#L78-L86
all rules is declared reading the content of baseRules:
https://github.com/conventional-changelog/commitlint/blob/daa8b1baa8732b3f1f937d2453608d47b4952bff/%40commitlint/lint/src/lint.ts#L59-L62
baseRules
are imported from @commitlint-rules
:
https://github.com/conventional-changelog/commitlint/blob/daa8b1baa8732b3f1f937d2453608d47b4952bff/%40commitlint/lint/src/lint.ts#L4
in version 14.6.0
header-trim
definition has been added
https://github.com/conventional-changelog/commitlint/blob/daa8b1baa8732b3f1f937d2453608d47b4952bff/%40commitlint/rules/src/index.ts#L55
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 https://github.com/conventional-changelog/commitlint/issues/3871#issuecomment-1911455325
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 https://github.com/conventional-changelog/commitlint/issues/3871#issuecomment-1914327791
@escapedcat in order to avoid conflicts with ESM migration I'll wait merge of #3850 before working on a proposal.
Also, if agree and there is a spot available, I would like to join conventional-changelog / commitlint team.
Also, if agree and there is a spot available, I would like to join conventional-changelog / commitlint team.
tbh I'm not sure how to do this. Can tag /cc @dangreen , maybe he knows.
I don't have rights to add new members to organization. I'm not organization owner.
I don't have rights to add new members to organization. I'm not organization owner.
Sure, but do you know who to contact? Who added you? I was added by Mario but he's isn't available anymore.
@escapedcat I contacted with @bcoe via email.
Sure, but do you know who to contact? Who added you? I was added by Mario
Hey guys, not to be the party-wrecker here, but isn't it a bit early? I mean, maintainership is usually given to contributors that have many contributions to a project, not just 4. And it also usually offered to someone, not requested by someone (the only cases where I found the latter is done is when the project is kinda dying and someone steps up to save it from becoming irrelevant). Mind you, this is not envy or anything because, despite having more contributions myself (and more than double if I count the contributions of my team) I don't want to be maintainer myself, as I'm already at the helm of 2 or 3 projects, so I have too much on my plate.
With this I hope I'm not deterring Marc from making more great contributions. I just think that in general, maintainership is earned, not requested&granted.
I respectfully disagree with @knocte.
I'm involved in OSS a lot, and here is a true example that a I volunteer and request to be maintainer first: https://github.com/tamasfe/taplo/issues/403#issuecomment-1828235877 and I'm trust from the original author at https://github.com/tamasfe/taplo/issues/403#issuecomment-1913342635. So that I could finally finish the blocking PR https://github.com/tamasfe/taplo/pull/502
What I want to say is, we as volunteers, should be allowed to apply for membership so that we can make more valuable contributions. It's a honor yet responsibility.
Let's maybe stop here with this off-topic discussion? Unfortunately we do not have a chat currently but you could create a new issue to discuss things further.
My 2 cents are that I'm happy if people start trying to get into the org on their own initiative. So far we invited to join the commitlint "team" after activity over a longer period of time. Some joined, some refused.