8 Linters - GiovanniKaaijk/project-tech GitHub Wiki

Linters

Linters are extensions which you can add to your project, they are used to find errors in your code, making it easier to write good readable code.

To see which linter works best for me i researched three linters.

  • JS Hint
  • JS Lint
  • ESLint

JS Hint

JS Hint is fully configurable, you can decide what errors it need to show and which it needs to ignore. It has a big documentation on how to configure the linter. A disadvantage is that it takes some time to install and configure the linter, you can't use it after installing it.

Pros

  • Fully configurable
  • Supports a lot of languages
  • A big documentation
  • Basic es6 support

Cons

  • Takes a lot of time to install and configure
  • Hard to see which rule is causing an error

JS Lint

JS Lint is the oldest linter of these three. It is one of the first Javascript linters, making it have less features. You can't configure JS Lint, you can't see which rule is causing an error and it doesn't support es6.

Pros

  • Already configured and ready to use when installed

Cons

  • No es6 support
  • You can't see which rule is causing an error
  • Not configurable
  • A very small documentation

ESLint

ESLint is the newest linter of these three, designed to be extendible, coming with a lot of custom rules. ESLint has a lot of features but the documentation can be a hit or miss, the rules list is easy to follow but the configuration instructions can be confusing.

Pros

  • You can toggle every rule on or off
  • You can add your own rules
  • Loads of plugins available
  • Gives a clear output, easy to fix
  • Gives a lot of rules which are not available in other linters, making it more useful to detect problems.
  • Best es6 support, compared to other linters
  • Configurable by JSON, making it easy to share with project members

Cons

  • You need to configure it yourself
  • It is slow

My choise

By comparing the three linters, i found ESLint the best of them all, it has way more pros and less cons than the other linters. It is also easy to share with project members. I also chose for this linter since it supports es6, which I use to write Javascript.

Source

Sitepoint.com