Reworking Groundwork 2. Prettier & ESLint

I am by nature very tidy with my code. But still I get in a kafuddle, so after listening to Folks That Know™ like @wesbos, @una and @chrisdhanaraj, I installed vscode and added the Prettier formatting package and ESLint linting package.

By adding these things at the beginning of the re-working of Groundwork, I hope that my code is in a more consistent state at the end of the road.

Installing the extensions is straightforward in vscode and I added them both as dev dependencies for the project, as I think they should be an integral part.

I then ran the $ eslint --init command to install a config file locally, choosing a well-recommended Airbnb style without the side salad of React, in a JSON sauce.

The only tricky bit is Integrating Prettier with ESLint, for there is a bit of overlap between formatting and linting. I went with turning off ESLint’s formatting rules with a $ npm install --save-dev eslint-config-prettier.

It’s all installed. It’s all committed. Doubtless I will be shouting at my computer ”NOT LIKE THAT” in the days to come…

UPDATE:

Indeed I did start shouting at my computer, specifically not to wrap my Markdown prose. Luckily, Ryan Zimmerman pointed out on the Prettier Gitter channel that there is a prose wrap setting for Markdown.

I’m also using single quotes, as that’s what all the cool kids seem to be doing, and installed a .prettierrc.json for these options.