-
-
Notifications
You must be signed in to change notification settings - Fork 625
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
Suggestion: prefer eslint syntax over style #589
Comments
The eslint config is not for students. It is for contributors contributing to this track repo. We do not enforce any style restriction on students. |
I know that we don't, but that's not how IDE's work. VS Code for example will pick up the eslint configuration by default if the plugin is active. Atom en Webstorm too! Evidently, we should change something as mentors áre referring to it in their comments :) |
Ok. Some very valid points that I completely took for granted:
I did not realize that we give the eslint config in exercises which students download. I assumed we only validate it from main package.json file
I did not know this as well. Looks like we definitely should do something about this. I am in the favor of not recommending anything to students - only use it for CI in our repo. For mentors, put a mentor note regarding the same. What do you think? |
This is because JS does not have a standard formatting tool (you mentioned the same in previous comment). Had it been golang or elixir, it would be good to recommend. Having said that I am OK with using |
I'm happy to actually strip all style items left in |
@tejasbubane I think we can choose a permutation one of these:
|
👍
I am OK with this. I would also recommend removing the eslint config from We have a CI check to ensure |
* Upgrade eslint and extract config - upgrade eslint to 5.15.3 - upgrade eslint-plugin-import to 2.16.0 - correctly use the import plugin - remove linebreak-style (fixes #502) - use eslint:recommended (fixes #589, fixes #480) In a later change we should turn on airbnb-base for maintaining via a script that switches this. In a later change, we should turn on several rules that guard against potential bugs, such as `no-shadow` `no-undefined` `no-var`; additionally we can add stylistic consistency without forcing style choises such as consistent spacing (but not required). * Saving files before refreshing line endings * Normalize all the line endings
With more and more tools becoming available to automatically format the code base to a certain set of style rules (and more comprehensive than
eslint --fix
, I'm also more inclined to stop teaching style preference, as indicated by mentor notes, mentor guidance docs and discussions on slack.The current state
Currently, the javavscript
package.json
sets a very restrictive code style (airbnb
) and I don't think this:We don't instruct or enforce these rules (#44 (comment)) strictly, but I seem them in mentoring comments and most IDE's will run these automagically if present.
Recommendation
I therefore recommend to drop down to eslint:recommend or if we must have a non-company style guide, use standard with semicolon rules disabled (people should decide about ASI themselves -- I don't think pushing people who know about ASI helps anyone, and TS doesn't have them either).
If this is something we want, I think doing it sooner rather than later is good and will speed up #480 greatly. The eslintignore list is still quite long and I don't think tháts particularly helpful.
As a final note, I think we should better communicate to the students to run
npm/yarn install
and thennpm/yarn test
. I also suggest runningtest
followed bylint
so that someone is only bugged once the test succeeds, instead of using a"pretest": "lint"
:The text was updated successfully, but these errors were encountered: