Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork149
chore: add eslint as linter#1315
Uh oh!
There was an error while loading.Please reload this page.
Conversation
pano9000 commentedMar 2, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
so, I've ran a quick count on the errors using (edit: the data above is only showing the typescript-eslint related entries, the "regular" eslint rules are missing, just if anyones wondering, why the numbers don't add up). The "no explicit any" error is notthat bad after all – I though it would've been a higher count, after doing a first scroll through :-D @eliandoran what do you think? |
pano9000 commentedMar 2, 2025
quick aside, regarding failing CI: looks like it will land soon though :-) |
pano9000 commentedMar 3, 2025
ok, it has been released -> will update and rebase the branch accordingly later this evening: |
pano9000 commentedMar 3, 2025
PR ready for a first start :-) |
77d9423 tob568307Comparerules will need some finetuning still
purposely *not* named as dev:eslint, just to "decouple" the script from eslint, in case there ever is the need to change that :-)
For TS projects this is already enforced by tsc, see:https://eslint.org/docs/latest/rules/no-undef#handled_by_typescript
using it is not recommended for ts-eslint:https://typescript-eslint.io/troubleshooting/faqs/eslint#can-i-use-eslints---cache-with-typescript-eslint
this is already used across codebase: using "_" as placeholder for deliberately unused vars (e.g. when destructuring arrays)
4c0ecc4 intodevelopUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Hi,
this PR adds an initial eslint configuration that we can use for linting our code base.
https://typescript-eslint.io/
It still needs some rule refinement for our current stage, because we still have lots of "any" types, which it complains about with the default rules
majority is complains about use of "any".
I'll likely work on the rules first, before marking the PR as ready :-)closesTriliumNext/Trilium#5524closesTriliumNext/Trilium#5026