-
Notifications
You must be signed in to change notification settings - Fork 180
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
remove ./node_modules/.bin from npm scripts #76
Conversation
9e90df2
to
7867582
Compare
"prepublish": "./node_modules/.bin/babel src --out-dir lib", | ||
"pretest": "./node_modules/.bin/babel src --out-dir lib", | ||
"test": "npm run-script lint && ./node_modules/.bin/mocha --compilers js:babel-core/register" | ||
"lint": "eslint src/**/*.js && eslint test/**/*.js", |
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.
does this work if eslint is not installed globally?
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.
to get this to work I normally have to modify my path to include :node_modules/.bin/
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.
I'm more in favor of the style of #75
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.
I don't have eslint
in my path, and I don't think I have it installed in npm global (npm ls -g | grep eslint
is empty).
npm lint
runs for me on windows (as do the other scripts).
I like the dot-delimiter because it makes this repo self-contained. Right now this config makes the assumption that the user has exported |
My vote would be for |
Here's a comment about this problem by isaacs (inventor of npm):
Note that he says "npm puts ./node_modules/.bin in the PATH". I did not need to install anything globally to get this to work. |
It works, but (as well as taking isaacs comment) I found it kind of hacky in that it creates scripts that really would only be used as building blocks for other scripts, and never run independently. |
:) Thanks for the insight. I don't know this kind of history / insight into npm - I wasn't aware it was this complex and debated. I actually generally work in C# (just using JS for a chrome extension), so when you talk about "too much dynamic linking" going on in node - I definitely hear that! So you've convinced me - since you value predictability and isolation over my arbitrary "cleanliness" of the scripts, #75 would be the way to go. |
@collinsauve cool glad I could convince you! There is no right or wrong answer here though. Totally game to leave it up to @tshaddix since he has to sign off on stuff like this too. :-) |
@vhmth I'm happy to go with whatever you see as the best option here :) |
Closing this in favor of #83 |
Fixes issue #74, which broke linting and tests on Windows.