Airbnb linting

Posted on 28th January 2020

Two weeks into the creation of this Gatsby site, I added the Prettier plugin to my VS Code installs, as well as some opinionated settings in a .prettierrc file in my repo, but as I've been reading/watching things about React it became clear there was more I could do to optimise my workflow.

The addition of the ES Lint plugin, as well as the Airbnb configuration for both this and Prettier would allegedly make my code all the better - with plenty of smart code shuffling, lots more information in the integrated terminal to tell me where I've gone wrong or how I can improve things in terms of accessibility or quality every time I hit save.

I came across a guide on Medium by Jeffrey Zhen which proved to be extremely helpful in initially setting up the plugins, here is the link to the guide -

Quite a bit of tinkering was needed afterward though, like changing my components from .js to .jsx files, as well as switching off a couple of the linting preferences that were not working so well - react/jsx-one-expression-per-line I'm looking at you 😡. If you're considering using something like this in your projects, try and get them implented before you've written too much.

Apart from the work I did on day 1, I think this has been the largest commit that's been pushed to the site so far. I'm hoping it will work out to be one of the most helpful, on account of all the people who recommend the Airbnb way of coding. Now, if only I could earn Airbnb gift vouchers every time I linted my code...

Monkey typing on a laptop

Enjoyed this post? Feel free to share it with your audience using the links below:

Don't see your favourite social network on the list? Feel free to let me know and I'll get it added.


©2022 Pursuit of Loot. All rights reserved.