javascript: Fix eslint errors in all exercises
I have configured eslint in https://github.com/exercism/javascript/pull/479
But have not fixed errors in any exercise apart from hello-world. Instead I added all exercises to .eslintignore.
The plan is to do this:
- Pick one exercise (You can pick many but we prefer to have separate PRs so that it is easy to review - but if there are not many changes - you can pick 2-3 at once).
- Remove the exercise name from
.eslintignorefile - Run
npm run lint- This should show errors in those exercises. - Fix those errors - commit and raise a PR ๐
Note: The eslint configuration is not final. I did not have a good look at all errors, just put a sensible default in place. While fixing, if you encounter some error that you feel we should allow(ignore), feel free to comment on this issue.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (17 by maintainers)
Commits related to this issue
- Fix linting for pangram exercise ( #480 ) (#486) * Fix linting for pangram exercise * remove unnecessary variable initialization — committed to exercism/javascript by tarunvelli 6 years ago
- (#480) Armstrong numbers linting fixes (#482) * Install and use `babel-eslint` parser * Fix linting errors in 'armstrong-numbers' * Fix license information * Update NPM Lockfile and all pack... — committed to exercism/javascript by gargrave 6 years ago
- Fixed ESLint errors in Change exercise (part of issue #480) — committed to adamxtokyo/javascript by adamxtokyo 6 years ago
- Fixed ESLint errors in Change exercise (part of issue #480) (#523) * Fixed ESLint errors in Change exercise (part of issue #480) * Fixed typo causing build error in CI https://github.com/exerci... — committed to exercism/javascript by deleted user 6 years ago
- Fixed ESLint errors for Allergies exercise (part of issue #480) — committed to adamxtokyo/javascript by adamxtokyo 6 years ago
- Fixed ESLint errors for Allergies exercise (part of issue #480) — committed to adamxtokyo/javascript by adamxtokyo 6 years ago
- Clean up extraneous blank lines Clean up extraneous blank lines as part of issue #480 - Fix 10 cases of ESLint issue `no-multiple-empty-lines`. - Fix 36 cases of ESLint issue `padded-blocks`. As an a... — committed to xarxziux/exercism-javascript by xarxziux 6 years ago
- Clean up extraneous blank lines Clean up extraneous blank lines as part of issue #480 - Fix 10 cases of ESLint issue `no-multiple-empty-lines`. - Fix 36 cases of ESLint issue `padded-blocks`. As an a... — committed to xarxziux/exercism-javascript by xarxziux 6 years ago
- Clean up indent errors Clean up indent errors as part of issue #480 - Fix 31 cases of ESLint issue `indent`. As an added bonus, I've been able to remove the ISBN Identifier and Matrix exercises from ... — committed to xarxziux/exercism-javascript by xarxziux 6 years ago
- Clean up extraneous blank lines (#547) Clean up extraneous blank lines as part of issue #480 - Fix 10 cases of ESLint issue `no-multiple-empty-lines`. - Fix 36 cases of ESLint issue `padded-blocks`... — committed to exercism/javascript by xarxziux 6 years ago
- Clean up indent errors Clean up indent errors as part of issue #480 - Fix 30 cases of ESLint issue `indent`. — committed to xarxziux/exercism-javascript by xarxziux 6 years ago
- Clean up indent errors (#548) Clean up indent errors as part of issue #480 - Fix 30 cases of ESLint issue `indent`. — committed to exercism/javascript by xarxziux 6 years ago
- Clean-up of ESLint errors Clean-up of small, one-line ESLint errors as part of issue #480: - Hexadecimal: fix `no-plusplus` error. - Kindergarten Garden: fix `no-shadow` error. - Luhn: fix `no-param-r... — committed to xarxziux/exercism-javascript by xarxziux 6 years ago
- Clean-up of ESLint errors (#549) * Clean-up of ESLint errors Clean-up of small, one-line ESLint errors as part of issue #480: - Hexadecimal: fix `no-plusplus` error. - Kindergarten Garden: fix `no... — committed to exercism/javascript by xarxziux 6 years ago
- Fix ESLint errors in Flatten Array test script As per issue #480: - Fix all `max-len` ESLint errors in flatten-array.spec.js file. - Remove flatten-array from .eslintignore file. — committed to xarxziux/exercism-javascript by xarxziux 6 years ago
- Fix ESLint errors in OCR Number test script As per issue #480: - Fix all ESLint errors in ocr-numbers.spec.js file. I have NOT removed the OCR Numbers entry in .eslintconfig as the example,js file ha... — committed to xarxziux/exercism-javascript by xarxziux 6 years ago
- Fix ESLint errors in Flatten Array test and example scripts As per issue #480: - Fix all `max-len` ESLint errors in flatten-array.spec.js file. - Fix all ESLint errors in example.js file. - Remove fl... — committed to xarxziux/exercism-javascript by xarxziux 6 years ago
- Fix ESLint errors in Flatten Array test and example scripts (#562) As per issue #480: - Fix all `max-len` ESLint errors in flatten-array.spec.js file. - Fix all ESLint errors in example.js file. -... — committed to exercism/javascript by xarxziux 6 years ago
- Fix ESLint errors in OCR numbers example.js As per issue #480: - Fix two `no-plusplus` errors on lines 57 and 70. - Fix `one-var` error on line 66. - Rewrite `getDigit()` method. - Add disable rule fo... — committed to xarxziux/exercism-javascript by xarxziux 6 years ago
- lint minesweeper exercise (#566) per #480, lint minesweeper exercise. Notable linting details: 1. re-ordering functions so they are declared before use. 2. turn `annotate` into static method. — committed to exercism/javascript by serixscorpio 6 years ago
Iโd like to work on this pls
@lukejpreston
We have disabled eslint errors using .eslintignore for all exercises and plan to fix errors in 1-2 exercises at a time. This is to make CI happy for now while using it to fix errors by removing the exercises we fix. (See PRs attached to this issue for reference).
It fixes most of them but not all are fixable. You are free to use it but we would like to have each PR fix only 1-2 exercises entirely. This way it is easy to manage/review PRs.
According to eslint the reason this is because people tend to make typos of
|when they want||and same for&and&&. I think since we have test-cases, we need not worry about this and limit ourselves from using bitwise operators when needed - sometimes they lead to really elegant and efficient solutions. So I agree upon disabling this rule at project level.@adamxtokyo Thanks for contributing! We do not want to create separate issues for each PRs. Because the steps outlined in this issue description will be same for all exercises. For more clarity you are advised to look into linked PRs for other exercises. Discussion related to specific exercise as required can be taken up on the PR itself. Otherwise before starting if you have any doubts, you can always comment here.
Regarding contributing guidelines, that is a good point that you brought up. We have quite a few things going on in the CI and elsewhere that we should have a separate document explaining them. I will create a new issue for this thanks! Also I will look into your PR shortly.
@Futuro212 letโs not comment on related, but different, closed issues please. Would you mind opening a separate, new issue for this? Hopefully someone can help. Thanks!
I think the hacktoberfest label should be added to this issue, as it might help get this issue resolved faster
Trying my hand at helping out if there are no issues with it. ๐ Should be able to bust out a few.
@gargrave @tejasbubane @tarunvelli Iโm looking at the PRs now. Thanks for the patience.
Thanks a lot for the PRs! I am on a vacation for a week and would be able to look at them next week only. Meanwhile some other maintainers might have a chance to review.