micromata / Baumeister

Unmaintained – :construction_worker: The aim of this project is to help you to build your things. From Bootstrap themes over static websites to single page applications.
MIT License
171 stars 37 forks source link

feat: Auto format code using prettier as pre-commit hook #269

Closed mischah closed 5 years ago

mischah commented 5 years ago

We are using prettier to format JavaScript, JSON and SCSS files automatically before you commit your files to Git via a pre-commit hook.

The prettier settings are defined in .prettierrc in the project root. In case prettier is to opinated for you or you don’t want Prettier to change your files without the chance to review the changes you just have to delete the pre-commit hook with in the package.json:

"husky": {
  "hooks": {
    "post-merge": "npm install",
    "pre-commit": "lint-staged"
  }
}

But we totally recommend you to give this workflow a chance, because it’s just one more thing you don’t have to care about.