Suggestion: prefer eslint syntax over style
See original GitHub issueWith 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:
- helps the student understand the language
- helps the student get fluent in a language
- helps the mentor mentoring as downloading exercises can result in wibbly wobblies all over the place
We don’t instruct or enforce these rules (https://github.com/exercism/javascript/issues/44#issuecomment-416760562) 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 then npm/yarn test
. I also suggest running test
followed by lint
so that someone is only bugged once the test succeeds, instead of using a "pretest": "lint"
:
{
"scripts": {
"test": "test:jest && test:lint",
"test:jest": "...",
"test:lint": "..."
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
I’m happy to actually strip all style items left in
eslint:recommended
btw! We are definitely in sync on reasoning and I agree with everything you say.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
eslint:recommend
as well - since it is less strict and opinionated thatairbnb
. But I would certainly put up a mentor note to atleast not make it a requirement for students (it is fine to subtly suggest, but not ok to make it a requirement for approving solutions).