Linting ESLint - Tuong-Nguyen/JavaScript-Structure GitHub Wiki

Enforce coding standard

  1. Config file: .eslintrc.json
  2. Define Rules
  3. Define Warning vs. Errors
  4. Plugins for frameworks: React - Angular, ...
  5. Preset: an pre-defined rules

ESLint Recommended

Install

npm install eslint --save-dev

Add .eslintrc.json file

{
  "parserOptions": {
    "ecmaVersion": 6
  },
  "rules": {
    "semi": 2
  }
}

Configure ESLint in webstorm

Ctrl+Alt+S > ESLint
Enable
Set configuration file

Webstorm will report warning/errors in code where violates eslint rules.