Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 668 Bytes

husky-lint-staged.md

File metadata and controls

34 lines (26 loc) · 668 Bytes

Husky 🐶 + Lint Staged = 💘

All frontends projects use Husky and Lint Staged to prevent bad commits.

Configuration

Install the following libraries to your project:

yarn add husky lint-staged -D

Then add the following code:

package.json

  "husky": {
    "hooks": {
      "pre-commit": "tsc --noEmit && lint-staged"
    }
  },
  "lint-staged": {
    "*.{js,ts,tsx}": [
      "your command here",
      "your second command here",
    ],
    "*.{css,scss}": [
      "your command here",
    ]
  },

< Go back