What is Linting?

Linting is a process of running a program to analyse your code for potential syntax errors.

lint was the name originally given to a particular program that flagged some suspicious and non-portable constructs (likely to be bugs) in C language source code. The term is now applied generically to tools that flag suspicious usage in software written in any computer language.

It can do the type checking, can check for variable declarations, any design / perform / security related checks based on the best practices and suggestions implemented (depending on the language and it’s “linter” application). Below pictures will give you a fair picture of what exactly the lines above mean. I have a single line of JavaScript code as follows: Linting1 and after running a linter application (JsLint) I get this information back in return: Linting2 and with that, I can easily figure out that I’ve missed to provide quotes on both of the sides of the name. Now I will go back and fix the code like: var myName = “Sunny”; and the error will go away on next linter run. Thanks!

Leave a Comment