Hey everybody. What do you do when all of your newly inherited project is badly intended and you got thousands upon thousands of linting errors?
Any way to automate this?
Gorka Molero
Front End Dev @ Cells
I don't start working until code is properly indented and easily readable / properly commented haha. If nothing else, it helps me better understand what the code was intended to do because I have to read all of it.
If you can't automate it - take it 1 module / section at a time and fix it when you have nothing better to do.
It's often easy to automate, either from IDE or linter itself.
But I often use the 'annotations' feature of IntelliJ IDEA, which is like git blame, except without the option to ignore whitespace changes.
So re-formatting the entire file pretty much erases its history for practical purposes and I end up not doing it.
Somasundaram Ayyappan
You can setup eslint indent rules and try using their auto-fix feature. It will not fix all the errors. I guess indentation will be fixed.
You can do auto-fix by running
eslint --fix.