Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(preset): ESLint recommended-bump is always "patch" #371

Merged

Conversation

ingmarh
Copy link
Contributor

@ingmarh ingmarh commented Sep 8, 2018

Recommended version bump detection with ESLint preset is broken since
conventional-changelog-eslint version 3.0.0:

npx conventional-recommended-bump -p eslint always returns "patch".

This is because the preset's parserOpts (re-used with v3.0.0)
"headerCorrespondence" is set to ['tag', 'message'] rather than
['type', 'subject'], which was used before in the ESLint preset
"conventional-recommended-bump" specific parserOpts
.

This adapts the ESLint preset's whatBump implementation to check "tag"
instead of "type", which fixes the issue.

Recommended version bump detection with ESLint preset is broken since
`conventional-changelog-eslint` version 3.0.0:

`npx conventional-recommended-bump -p eslint` always returns "patch".

This is because the preset's `parserOpts` (re-used with v3.0.0)
"headerCorrespondence" is set to `['tag', 'message']` rather than
`['type', 'subject']`, which was used before in the [ESLint preset
"conventional-recommended-bump" specific `parserOpts`][1].

This adapts the ESLint preset's `whatBump` implementation to check "tag"
instead of "type", which fixes the issue.

[1]: https://github.com/conventional-changelog/conventional-changelog/blob/ce1fd981f88ce201e996dfa833e4682de3aafcdd/packages/conventional-changelog-eslint/conventional-recommended-bump.js#L32-L35
@stevemao
Copy link
Member

Thanks @ingmarh ! Feel free to add some tests...

@stevemao stevemao merged commit 35e279d into conventional-changelog:master Sep 11, 2018
@ingmarh ingmarh deleted the fix/eslint-recommended-bump branch September 12, 2018 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants