Package Spotlight: ESLint

Package Spotlight: ESLint

Most companies have code quality and code writing standards. But similar to the CSS code standards mentioned in a different post, what good are code standards if they aren’t automatically enforced?

A peer review may catch some but not all. This is where ESLint comes in to help automatically find and suggest fixes for all of the rules we have enabled for this package.

We sat down and defined a specific set of code standards we were going to enforce and enabled them on ESLint. ESLint can scan on demand during development to catch issues as well as automatically on build. Some rules are just suggestions for improving code, others are considered errors and code cannot be released to production without corrections.

Since we write our JavaScript using es6 (ECMAScript 6) we also want to enforce future code standards as a best practice today so that we can easily grow. So things like using const means this is a constant value. ESLint is smart enough to determine if you’re trying to modify a constant value. It’s also smart enough to notice you declared a variable as let but never changed it so you should use const instead.

There are performance and other optimizations that go along with ESLint. As an example if you declare a bunch of variables but never use them that just adds unnecessary memory utilization to your application and reduces readability to a developer. ESLint is a strategic package we use to help release quality code every release.

Package Name: ESLint
Website: https://eslint.org/

a woman sitting at a table using a laptop computer
Blog
Virginia

Seven Ideas for Slow Season

It’s hard to avoid having an “off-season” in any business. This is especially true in the tourism industry. By its very nature, the travel industry

Read More »

Request a Demonstration