-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Automatically install Dependencies and fix lint errors #1133
Conversation
* run lint-fix for airbnb AND standard * print message if user has to manually lint-fix
Hey @LinusBorg, I'd like to help you with testing this on windows. I'll try it out tomorrow. One suggestion I have is that it should be configurable to install using yarn. npm5 doesn't work very well on windows. |
Very good point, thanks. We could change the last question to be a choice:
|
* run lint-fix for airbnb AND standard * print message if user has to manually lint-fix
…k into auto-install-deps * 'auto-install-deps' of github.com:vuejs-templates/webpack: * Make autoinstall optional * run lint-fix for airbnb AND standard * print message if user has to manually lint-fix remove last airbnb template string fix string bug removed special airbnb template strings since we can auto-fix them now. Batman! # Conflicts: # meta.js # utils/index.js
The install step did not work correctly:
I got the same error with npm as well. |
Hm, and am bus able stack trace. Dammit :D |
Hm, I see you created the project in place instead of defining a sub directory name. I haven't tested that one tbh. Let's hope it's related to this and not windows. |
I tried the other way to init:
|
:( |
Give me some hints. Maybe I can help you fix it. |
I can't give you much. It seems the |
Okay, I'll look into it. |
return new Promise((resolve, reject) => { | ||
const spwan = spawn(cmd, args, Object.assign({ | ||
cwd: process.cwd(), | ||
stdio: 'inherit', |
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.
Reading through a few old node issues (e.g. nodejs/node-v0.x-archive#2318, nodejs/node-v0.x-archive#5841) i think we might just have to add shell: true
here to make it run properly on windows.
@sudo-suhas Maybe you can try that?
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 can confirm that this change fixes it.
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.
Awesome!
btw.. Instead of manually wrapping |
Are you planning to drop support for node 4? |
Because that would mean that we have to
A lot of hoops to jump through for convenience - I would only attempt this if it really was necessary to handle edge cases without excessive boilerplate code.
I would like to, and vue-cli's latest version doesn't support it anymore anyways. |
@LinusBorg The functionality that you have added to the template, it could be used by pretty much all templates right. So do you think it would make sense to implement it in the |
Not all need them, but there could be a flag to enable/disable it in meta.json - so yeah, that could make sense... |
I would still like to add it to the template first, and then integrate it in vue-cli. Release cycles for he cli are longer, and I can always deactivate it in this tempate quickly once the feature has been integrated into the template. this way, older cli versions can benefit from it as well... |
* develop: remove unnecessary exceptions bump version to 1.2.6 Add JX support (close #1146) Automatically install Dependencies and fix lint errors (#1133) Set `allChunks: true` by default (close #1110) (#1149) airbnb eslint config compatibility with vuex (#1003) Document babel target env configuration (#1144) Revert "remove uneccessary target.browsers (#1004)" (#1083) fix filename of `.eslintignore` (#1136) webpack.conf.js is not needed in jest and e2e (#1135) # Conflicts: # template/test/e2e/custom-assertions/elementCount.js
…es#1133) * Batman! * removed special airbnb template strings since we can auto-fix them now. * fix string bug * remove last airbnb template string * * Make autoinstall optional * run lint-fix for airbnb AND standard * print message if user has to manually lint-fix * webpack.conf.js is not needed in jest and e2e (vuejs-templates#1135) * fix filename of `.eslintignore` (vuejs-templates#1136) * Batman! * removed special airbnb template strings since we can auto-fix them now. * fix string bug * remove last airbnb template string * * Make autoinstall optional * run lint-fix for airbnb AND standard * print message if user has to manually lint-fix * used chalk to color up console logs * add option for yarn * change double quotes to single quotes, remove where possible * generalize log message
* develop: remove unnecessary exceptions bump version to 1.2.6 Add JX support (close vuejs-templates#1146) Automatically install Dependencies and fix lint errors (vuejs-templates#1133) Set `allChunks: true` by default (close vuejs-templates#1110) (vuejs-templates#1149) airbnb eslint config compatibility with vuex (vuejs-templates#1003) Document babel target env configuration (vuejs-templates#1144) Revert "remove uneccessary target.browsers (vuejs-templates#1004)" (vuejs-templates#1083) fix filename of `.eslintignore` (vuejs-templates#1136) webpack.conf.js is not needed in jest and e2e (vuejs-templates#1135) # Conflicts: # template/test/e2e/custom-assertions/elementCount.js
What this PR does
npm install
for you after you answered all the questionsnpm run lint -- --fix
to adjust the boilerplate code to the selected eslint configThis allows us to get rid of the ugly template strings we currently use to cater towards airbnb style, like this:
These make the template source files barely readable in places. Getting rid of them increases maintainability
TODO
npm install
after the project directory has been set up.npm run lint -- --fix
if airbnb preset was selected for eslintstandard
orairbnb
style and chose not to auto-install dependencies, we can't run lint-fix for him. In that case, print a not to run it themselves in the final console message.How can you help?
Take this for a spin. I surely have made a few minor mistakes, like typos in the new console messages, and maybe you find a big one as well.
In particular, testing it on windows would be very helpful.
If you find anything, just send a PR against this branch.