Are you linting yet?

Broonix December 3, 2015
Source
If you aren't you should be! If you are like me, you have a love and hate relationship with Javascript. It's used to do so much, but it's loose rule set makes it a potential nightmare. At work we already were using Checkstyle and FindBugs for our Java code, so why not apply the same idea to our Javascript and React code? There a few options, but we chose to go with eslint. It has a large number of plugins and support for React. Setup was dead simple. Create a .eslintrc file in the project root. Then add gulp-eslint to the gulp build chain. We decided to follow the airbnb style. We did make some small alterations. [Embedded code (GitHub Gist)] Now what happened next was not as simple: [Image: Screen-Shot-2015-12-02-at-2-19-32-PM.png] Clean up was pretty easy. Most of those errors and warnings were the use of var or small style violations. After a couple of hours we now have a much cleaner, consistent and more maintainable Javascript and React code. Read the original post with all embeds and interactive content at https://rants.broonix.ca/are-you-linting-yet/

Discussion in the ATmosphere

Loading comments...