Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(filter-options): Require arguments to --scope and --ignore
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
4b81dad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change...
4b81dad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How exactly were these flags functional without arguments?
4b81dad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It allowed you to set up the command as an npm script and then optionally filter only if the arg was actually passed.
e.g.
So if you run
npm test
it tests all the ones that have changed, but if you runnpm test foo
it will only test the "foo" package.4b81dad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not the way you pass ad-hoc flags to an npm script, you have to use
--
to stop npm from parsing them. Your example only works for unrecognized positional arguments, and it's not a very robust pattern in any case.In general, if there isn't a test for it, it isn't a feature. As there was never a test for the previous behavior among over 700 tests currently extant, I don't consider it part of the public API, thus it is not a semver breaking change.
4b81dad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair, I use yarn and I think they do the
--
thing on your behalf for scripts so didn't think to include it in my example.Understood, thanks.