Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Warning for passing flags to npm run #13693

Closed
tamzinblake opened this issue Aug 17, 2016 · 2 comments
Closed

Warning for passing flags to npm run #13693

tamzinblake opened this issue Aug 17, 2016 · 2 comments

Comments

@tamzinblake
Copy link
Contributor

What's the feature?

Issue a warning when a user passes flags to npm when using npm run

example: (the actual copy will certainly have to be better and is based on nothing)

$ npm run foo --bar
  Warning: flag was passed to npm run. You might have meant "npm run foo -- --bar"

If we're concerned about issuing warnings in the case that someone is legitimately using npm flags along with npm run (I don't know if there's an actual use case for that), maybe it would make sense to only warn if the flag is not one that npm understands.

What problem is the feature intended to solve?

When passing flags to npm run scripts, they need to come after a -- so that the flags don't get passed to npm instead of the run script, but if you forget to add the -- then the script will behave unexpectedly but there is not necessarily an indication of what you did wrong.

Is the absence of this feature blocking you or your team? If so, how?

It is not blocking my team but has repeatedly caused tens of minutes of confusion until someone spots the error (or calls me over so I can spot the error).

Is this feature similar to an existing feature in another tool?

I have no idea.

Is this a feature you're prepared to implement, with support from the npm CLI team?

Yes, assuming folks think this is a good idea.

@legodude17
Copy link
Contributor

This actually should be pretty easy to implement and sounds to me like a good idea.

@npm-robot
Copy link

We're closing this issue as it has gone seven days without activity and without being labeled. If we haven't even labeled in issue in seven days then we're unlikely to ever read it.

If you are still experiencing the issue that led to you opening this or this is a feature request you're still interested in then we encourage you to open a new issue. If this was a support issue, you may be better served by joining package.communty and asking your question there.

For more information about our new issue aging policies and why we've instituted them please see our blog post.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants