Skip to content

prepost trigger defined

tannerbaum edited this page Feb 26, 2020 · 3 revisions

This rule is not fixable ✖︎

Why?

package.json script hooks are scripts that are automatically triggered before or after other scripts. Here, the project is built before publishing it on npm, yet before that, the build directory is cleared:

{
    "prepublish": "npm run build",
    "build": "...",
    "prebuild": "rimraf dist/"
}

How?/Examples

If these scripts are defined, there should also be a trigger script:

"scripts": {
    "pretest:lint": "npm run build" 🚨
    "test:eslint": "eslint ./src"
}

yields some custom hooks (pretest:lint) are missing their trigger script(s) (prepost-trigger-defined)


scriptlint status
npm version badge
dependency badge
Issue badge
CI badge

Clone this wiki locally