1.1.0 • Published 4 years ago

@eduardoboucas/eslint-config v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Code standards

Configs for linters and formatters.

Setting up

  1. Copy .editorconfig, .eslintrc and .prettierrc to the root of the repository

  2. Install the required dependencies

    npm i @eduardoboucas/eslint-config @eduardoboucas/prettier-config eslint husky lint-staged prettier --save-dev
  3. Add the following blocks to package.json:

    "husky": {
      "hooks": {
        "pre-commit": "lint-staged"
      }
    },
    "lint-staged": {
      "*.{js,jsx,md,html,css}": [
        "prettier --write",
        "git add"
      ]
    }
  4. Add the following to your test npm script:

    eslint --ext js,jsx . && prettier --check '**/*.{js,jsx,md,html,css}'
  5. If you want to reformat an existing repository, run:

    ./node_modules/.bin/eslint --fix --ext js,jsx . && ./node_modules/.bin/prettier --write '**/*.{js,jsx,md,html,css}'