conventional-changelog / commitlint

📓 Lint commit messages
https://commitlint.js.org
MIT License
16.61k stars 890 forks source link

@commitlint/load silently fails to load conventional changelog preset if it has a scoped package name #2488

Open javier-garcia-meteologica opened 3 years ago

javier-garcia-meteologica commented 3 years ago

conventional-changelog supports scoped package names @scope/conventional-changelog-custom-preset but commitlint doesn't.

https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog#preset

commitlint will only load presets that start with 'conventional-changelog-', without scopes.

https://github.com/conventional-changelog/commitlint/blob/73c30c3c7bb119dcde947b6dde26596cd9c983f4/%40commitlint/load/src/utils/load-parser-opts.ts#L18-L22

It's also very difficult to troubleshoot because there is no error. Commitlint silently ignores parserOpts and uses the default options instead.

escapedcat commented 3 years ago

Hi, is this related to or a duplicate of #2108?

javier-garcia-meteologica commented 3 years ago

@escapedcat, I don't think so. The issue you linked refers to scopes in commit headers, like fix(@foo/bar): fix some bug.

Here I'm referring to presets used in commitlint configurations

module.exports = {    
  parserPreset: '@my-org/conventional-changelog-my-org',    
  rules: {
  ...
  }
};
escapedcat commented 3 years ago

Ok, thanks for checking