-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix all out-of-the-box ESLint errors #2157
Comments
Yeah, those are from the default ESLint config. We just need to fix those for the generated project. |
Ok, great. I first generated the project a couple of weeks ago and didn't get these errors. If there is a workaround that I can do now that'd be great, otherwise I'll await your bug fixes. Thanks mate |
@samlasalle Technically they're mostly not really bugs. They are just instances of where the generated code breaks with the linting rules we've defined in the ESLint config. If you're not familiar with ESLint you can see their rules here: http://eslint.org/docs/rules/. So as with other linting rules what is reported as errors or warnings can simply be indentation being what's been decided by rules or white-space missing. There are however on the other hand some rules that can indicate that something is wrong like Bottom-line is that the Eslint errors and warnings could guide you to something that's wrong with the code but @Awk34 Been thinking to integrate Eslint's own auto-fix feature as an optional part of the gulp-pipeline. It fixes some of the easier fixes like indentation and semi-colons whilere there seems to be some plans to add more complex rule fixes in future major updates (see eslint/eslint#5329). Already got it working locally for the server using gulp-if to only change the files that are changed from fixes. Additionally changing the order environment variables are loaded with Would additionally upgrade Eslint to 3.0.0 and pose the question if we want to continue using the Eslint rules we have or begin extending other rules like: airbnb-rules (a lot of rules) or the rules recommended by Eslint (marked on their rules page)? This way the maintenance is kind of place elsewhere while it's still relatively easy to change. So would expect the following commits:
@Awk34 Sound like welcome changes or something I should leave out in a coming PR? |
with `fix` enabled. Should automatically get rid of a lot of ESLint issues. fixes #2157
with `fix` enabled. Should automatically get rid of a lot of ESLint issues. fixes #2157
Hi guys, thanks for the speedy responses. I am quite new to using github and am now unsure how to go about getting these fixes on to my machine. Do I have to wait for them to be committed to the master branch and then re-download generator-angular-fullstack? Or can I somehow download just the gen-run-eslint-fix branch. |
@samlasalle the quick fix, which will be applied to every project once that pull requests is merged and a new version released, is running the eslint command with the fix flag ( |
@samlasalle To expand on @Awk34's advice, you might have to run the client and server code separately to use their own specific eslint config that is also later used in the gulp pipeline. So for the server it'd be: eslint --fix -c server/.eslintrc.js 'server/**/**/*.js' Something similar for the client. Will also be required to install some more @Awk34 True, #2158 looks like a good stride towards fixing most of the trivial eslint errors/warnings. My point was however also to whether we add a feature to the gulp pipeline that does this each time eslint is run so as to avoid having to fix trivial errors like indentation. At the same time I imagine not everyone wanting it so maybe an opt-in through configuration or generator choice might be warranted. Something we want? Or skip? |
@Koslun as to adding |
Thanks for the responses guys I appreciate it. |
I have installed the angular-fullstack generator as per the instructions however I am getting a large amount of errors, most of them telling me that 'angular' is not defined, or that the expected indentation doesn't match the generated indentation.
I have previously gotten this working on a different EC2 instance with none of these issues and I have no idea what I've done differently.
I can still enter the URL on my browser and the title is returned to that tab, and in the CLI where gulp serve is running it shows three GET requests with code 200, however no pages are being served. I am unsure what to do.
Attached is my output from gulp serve:
The text was updated successfully, but these errors were encountered: