Linters - ybouz2/project-tech GitHub Wiki

What is linting?

Linting is the automated checking of your source code for programmatic and stylistic errors. This is done by using a lint tool.

Why it is important?

It reduces errors and improves the quality of your code.

Here’s how lint tools are typically fit into the development process.

  1. Write the code.
  2. Compile it.
  3. Analyze it with the linter.
  4. Review the bugs identified by the tool.
  5. Make changes to the code to resolve the bugs.
  6. Link modules once the code is clean.
  7. Analyze them with the linter.
  8. Do manual code reviews.

Compare Linters

JSLint

JSLint

It is a static code analysis tool used in software development for checking if JavaScript source code complies with coding rules. It is provided primarily as a browser-based web application accessible through their domain, but there are also command-line adaptations.

Pro's

  • Enforces a very high standard
  • No setup required

Cons

  • Highly opinionated
  • Difficult to know which rule is causing which error

ESLint

ESLint

ESLint statically analyzes your code to quickly find problems. ESLint is built into most text editors and you can run ESLint as part of your continuous integration pipeline.

Pro's

  • Good ES6 support
  • Highly flexible ruleset
  • Clear warnings and error messages
  • Functionality can be extended with a wide variety of plugins

Cons

  • Requires some configuration before use
  • The documentation can be a hit or miss

JSHint

JSHint

JSHint is a community-driven tool that detects errors and potential problems in JavaScript code. Since JSHint is so flexible, you can easily adjust it in the environment you expect your code to execute. JSHint is publicly available and will always stay this way.

Pro's

  • Customizable ruleset
  • Comes with support for many librariers
  • Basic ES6 support

Cons

  • No way to support ESnext
  • Difficult to know which rule is causing an error

My choice

I've never heard or worked with a linter, so this in new for me but after some research i decided to choose for ESLint because every where I was reading about linters ESLint came up and people where positive about. Als a reason to choose for ESLint was because most of my fellow students also work with it so in that case if i'm stuck with something I could ask them for help.


Sources: JSHint JSHint Slant Review ESLint ESLint Slant Review JSLint JSLint Slant Review