I know what you are thinking, but no, this article is not about cleaning out your dryer or belly button. A linter, when it comes to software development, is actually a tool that is meant to automate the cleanup of your code. A linter can do many different things, from catching bugs to cleaning up indentation.
Possible Linter Features
As we hinted at above, linters are capable of many different things. Most are independent tools built by third parties, so the features can vary significantly. At a minimum, a linter will usually be able to maintain consistent formatting and industry conventions for whatever language you are coding in. From there, they can get as detailed as picking up type errors or recommending that you don’t define string literals deep in your code.
Linter Options
There are many different linters available, and typically multiple for whatever language you are using. JSLint and ESLint are popular for Javascript. Pylint and Flake8 are commonly used linters for Python. Most languages will have many linter options, so I recommend looking up the most popular linters for the language you are writing in and trying one of those out that has good reviews and many users!
Why Should I Use One?
Although it may seem like a pain to constantly have a tool looking over your shoulder and correcting you, it is very important to maintain code consistency and quality. Often times we cannot be trusted to always uphold our own standards we would like to have, so it is good to put tools in place that will not let us overlook the small but important details. If you can entrench these small details into your every day workflow, then over time the linter will barely be doing any work in the first place!