A quick overview of linters
Source: https://www.perforce.com/blog/qac/what-is-linting

Recently, in class, we did an activity on creating a lint script. The activity honestly confused me a little bit out of the many questions I had about it. One of the questions I wanted to explore is more about what linters do and why we use them. The activity gives a brief description of what linters are and their purpose.
According to the activity, Linters are tools that check the formatting and style of code and files in projects. Some extensions, like the one used earlier in the activity, markdownlint, can perform some of this checking, but not all tools are available as extensions. I would like to understand them a bit more, so I chose a source that went into extensive detail about what linting is and linters.
It scans the code for things that don’t necessarily prevent the code from running but can cause bigger issues later on, such as small bugs, conflicting formatting, and bad style choices. It can also look for common errors like indexing beyond arrays, dereferencing null pointers, unreachable code, and non-portable constructs.
It’s better suited for programming languages like Python and JavaScript because they are interpreted languages that don’t have a compiling phase, so linting helps with keeping up consistency. Linting is more effective in code that follows standard rules and is in projects that need to adhere to shared style guidelines.
Linters are a basic form of static analysis tool, which are any tools that can analyze code without running it. More advanced tools are able to detect:
- Deeper data-flow problems
- Runtime risks
- Security vulnerabilities
- Complex rule violations
- Defects across multiple files or modules
Linters are a very helpful tool but they do have some limitation that needed to be accounted for when wanting to use it on a project.
Pros
- Catch small issues early
- Improve code consistency
- Reduce time spent on reviews
- Support teamwork and shared standards
- Great for beginners who need guidance
- Fit well into Agile workflows
Cons
- Can produce many warnings
- Sometimes flags harmless code
- Cannot detect deep logic problems
- Needs to be configured correctly
- Can slow you down
Overall, I learned that Linters are one of many analysis tools that can be used in a program, and I also learned one of the ways methodologies like Scrum are able to keep transparency and deal with continuity and consistency issues when dealing with a larger team.
I would like to become more familiar with creating lint scripts, so I can integrate them more into my programs, especially since consistency is something I have issues with, the more I learn about how to code better.
From the blog CS@Worcester – A Beginner's Journey Through Computer Science by Christiana Serwaah and used with permission of the author. All other rights reserved by the author.
