Latest Posts:

Learn what is the purpose of code style And linting tool

Learn what is the purpose of code style linting tool

A limiting toll helps to avoid silly mistakes when writing Java scripts. A good listing tool or a lender will indicate to avoid the write the wrong typing of of a variable name or incorrectly or to make syntax errors and. A good listing tool can also help make sure a project adheres to a coding standard.


These are the available linters here: JSLINT, JSHINT, JSCS AND ESLINT.


JSLINT:-
Pros:-

  1.  Comes configured and ready to go
  2. Cons:-
  3. JSLint doesn’t have a configuration file, that may create a problem on                                        changing the setting
  4. Limited number of configuration options, many rules cannot be disabled
  5. You can’t add custom rules
  6. Undocumented features
  7. Difficult to know which rule is causing which error


JSHINT:-
Pros

  1.   Most settings can be configured
  2.  Supports a configuration file, making it easier to use in larger projects Cons
  3.   Difficult to know which rule is causing an error
  4.  Has two types of option: enforcing and relaxing (which can be used to make JSHINT stricter, or to suppress its warnings). This can make configuration slightly confusing
  5.  No custom rule support


JSCS:-
Pros

  1.  Supports custom reporters, which can make it easier to integrate with other tools
  2.  Presets and ready-made configuration files can make it easy to set up if you follow one of the available coding styles
  3.  Has a flag to include rule names in reports, so it’s easy to figure out which rule is causing which error
  4.  Can be extended with custom plugins
  5.  Cons
  6.  Only detects coding style violations. JSCS doesn’t detect potential bugs such as unused variables, or accidental global s, etc.
  7.   Slowest of the four, but this is not a problem in typical use


ESLINT:-
Pros

  1.  Flexible: any rule can be toggled, and many rules have extra settings that can be tweaked
  2.  Very extensible and has many plugins available
  3.  Easy to understand output
  4.  Includes many rules not available in other linters, making ESLint more useful for detecting problems
  5. Best ES6 support, and also the only tool to support JSX
  6.  Supports custom reporters
  7. Cons

  8. Some configuration required slow, but not a hindrance
Share on Google Plus
    Blogger Comment
    Facebook Comment