dodona
dodona copied to clipboard
Add formatter for JavaScript/TypeScript
This was recently mentioned in #3597, and I have also thought this a few times already.
Some well-known ones are:
- https://standardjs.com/ (this would also replace eslint)
- https://prettier.io/
What is the advantage of standardjs? Since we're already using eslint can't we just use that for formatting? In fact, that's what I'm doing in vscode.
What is the advantage of standardjs? Since we're already using eslint can't we just use that for formatting? In fact, that's what I'm doing in vscode.
If ESLint is able to do formatter tasks, then there is no advantage for us I think, then it's probably enough to enable more rules.
The strange thing is that many of the small style issues mentioned in #3597 are reported (and fixed) in my editor:

As far as I know, this uses the .eslintrc file in the repo. Maybe these smaller things are reported as warnings instead of errors (which is why linting doesn't fail) and @jorg-vr hasn't enabled eslint in his editor.
Does yarn run lint --fix fix these issues? (@jorg-vr Do you run that command to fix simple issues?)
yarn run lint --fix does not fix anything in #3597
It reports 0 errors and 737 warnings
Mostly max-len and no-jquery errors
I lists no warnings for the edits @chvp made Warnings are highlighted in my editor (Rubymine)
ESLint does seem to have rules for those things, e.g. https://eslint.org/docs/rules/space-infix-ops and https://eslint.org/docs/rules/space-in-parens. Maybe it's as simple as enabling more rules then?
Relevant: https://eslint.org/blog/2023/10/deprecating-formatting-rules/