terriajs
terriajs copied to clipboard
lint: add eslint to typescript files
What this PR does
Fixes #3303 Fixes #4565
IMHO this is something that should be done long time ago. There is still 89 issues (57 errors, 32 warnings) (https://github.com/zoran995/terriajs-i18n/runs/7266057805?check_suite_focus=true).
I have removed the rules that are active from eslint:recommended
, and sepparated config for javascript and typescript files. Lot of issues were fixable using eslint -fix
.
Gulp was complaining that it can't find eslint/bin/eslint.js
(something like that) so I moved it to lint
script in package.json
From what I see it was only used as part of ci.yml
and npm-publish.yml
scripts.
Checklist
- ~[ ] There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)~
- ~[ ] I've updated relevant documentation in
doc/
.~ - [ ] I've updated CHANGES.md with what I changed.
- ~[ ] I've provided instructions in the PR description on how to test this PR.~
this is the current state
issue type | count |
---|---|
@typescript-eslint/no-unused-vars | 27 |
react-hooks/exhaustive-deps | 16 |
@typescript-eslint/ban-ts-comment | 11 |
react/display-name | 8 |
no-constant-condition | 3 |
@typescript-eslint/no-non-null-asserted-optional-chain | 3 |
react/jsx-no-useless-fragment | 2 |
react/jsx-key | 2 |
@typescript-eslint/ban-types | 1 |
no-ex-assign | 1 |
no-new | 1 |
no-fallthrough | 1 |
react/no-children-prop | 1 |
react-hooks/rules-of-hooks | 1 |
no-empty | 1 |
no-empty-pattern | 1 |
superseded by https://github.com/TerriaJS/terriajs/pull/6985