fix(cli): improve format module resolving#464
Merged
marionebl merged 3 commits intoconventional-changelog:masterfrom Oct 11, 2018
byCedric:fix/format-module
Merged
fix(cli): improve format module resolving#464marionebl merged 3 commits intoconventional-changelog:masterfrom byCedric:fix/format-module
marionebl merged 3 commits intoconventional-changelog:masterfrom
byCedric:fix/format-module
Conversation
marionebl
reviewed
Oct 9, 2018
Contributor
marionebl
left a comment
There was a problem hiding this comment.
This is great! I have a minor nitpick
@commitlint/cli/src/cli.js
Outdated
| return parserPreset.parserOpts; | ||
| } | ||
|
|
||
| function resolveModulePath(name, cwd) { |
Contributor
There was a problem hiding this comment.
You could avoid the catch block via
function resolveModulePath(name, cwd) {
return resolveFrom.silent(__dirname, name) || resolveFrom.silent(cwd, name) || resolveGlobal.silent(name);
}
Member
Author
There was a problem hiding this comment.
These are those "Doh!" moments for me 😅 I've no clue why I didn't think about this. I will change it now! Thanks!
Member
Author
There was a problem hiding this comment.
Done! I've removed the extra resolveModulePath method. I used it for the try-catch contraption. Right now it's both easy to read, and the order is readable (at least, that's my opinion). 😄
Contributor
|
@byCedric Have you pushed your latest changes? |
Member
Author
|
@marionebl Now I have! 😅 |
Contributor
|
Thanks <3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #463
Motivation and Context
See issue #463
Usage examples
See issue #463
How Has This Been Tested?
See issue #463
Types of changes
Checklist: