1.0.2 • Published 5 years ago

eslint-config-cmp-node v1.0.2

Weekly downloads
282
License
ISC
Repository
github
Last release
5 years ago

CMP Node.js - ESLint & Prettier Setup

DEMO

demo

What it does

  • Fixes linting & code formatting errors on SAVE (CTRL + S)
  • Enforces strict coding standard by making code more consistent & avoiding bugs across the team & all repositories.
  • Linting JavaScript is based on the latest standards using eslint-config-airbnb-base

1. Install Packages

npx install-peerdeps --dev eslint-config-cmp-node

2. Create .eslintrc file

{
  "extends": ["cmp-node"]
}

3. VS Code Setup. This will help us fix most of the linting & prettier issues ON SAVE (CTRL + S)

  • Install ESLint VSCode Extension
  • Now we need to setup some VS Code settings via Code/FilePreferencesSettings . OR Create settings.json in .vscode folder and add the below settings.
{
    "editor.formatOnSave": true,
    "eslint.autoFixOnSave": true
}

5. To overwrite eslint or prettier settings, just extend the rules in your .eslintrc file like this.

{
  "extends": [
    "cmp-node"
  ],
  "rules": {
    "prettier/prettier": [        // Prettier Rules.
      "error",
      {
        "singleQuote": true,
        "tabWidth": 8,
      }
    ],
    "no-console": 2,              // EsLint Rules.
  }
}

Reference

1.0.2

5 years ago

1.0.1

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago