Static GitHub Issues

[369] How does "precommit" script work in package.json?

prev: "this" inside of a method returns an unexpected Object
next: Development instructions

Excuse me. I'm confused about the "precommit" script in package.json:

"precommit": "npm run lint",

How can I trigger this script? Like executing npm run precommit? Or add a hook in .git manually?

What is the best practice to do? And what is your way to trigger this script?

Thanks first ฅ' ω 'ฅ

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c315">#c315</a>)</em></sub></div>