Skip to content

Latest commit

 

History

History
71 lines (50 loc) · 1019 Bytes

README.md

File metadata and controls

71 lines (50 loc) · 1019 Bytes

@singularit/eslint-config npm

Usage

Install

npm install eslint @singularit/eslint-config -D

Config .eslintrc.js

module.exports = {
    extends: "@singularit"
}

Add script for package.json

For example:

{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  }
}

Githooks with husky and lint-staged

  1. Install and setup husky
npx husky-init && npm install
  1. Add lint-staged to pre-commit hook
# .husky/pre-commit

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

- npm test
+ npx lint-staged
  1. Configure lint-staged
// package.json
{
  ...
+ "lint-staged": {
+   "*.{js,jsx,ts,tsx,vue,md,yml,yaml}": "eslint --fix --max-warnings 0"
+ }
  ...
}

License

MIT

Credits