DEV Community

Discussion on: How to program better (or This is what is wrong with your code)

Collapse
 
michaelcurrin profile image
Michael Currin

Regarding linters I can recommend prettier for JS and Black for Python. They will lint your code and even format it for you. Best if you setup VS Code to format on save. :)

They both have sensible defaults and pride themselves on limited config options compared with others like Flake8 for Python.
This is to deliberately prevent devs having to decide (ie argue) should we configure the linter use double or single quotes and semicolons or not and tabs or spaces and where do we wrap and when do we use commas...
The linter tells you what you need to use and you stick to that and move on!
And they give a bit flexibility so you configure them if you want.

See also Bikeshedding which in programming means when you argue about style issues like tabs vs spaces rather than on decisions which affect performance, architecture, business logic, etc.
en.wiktionary.org/wiki/bikeshedding

Collapse
 
michaelcurrin profile image
Michael Currin

I use Black in python project here locally and in VS Code and in GH Pages

No config. Just defaults.

Makefile

black .