Skip to content

no unix single ampersand

tannerbaum edited this page Feb 26, 2020 · 2 revisions

no-unix-single-ampersand

This rule is not fixable ✖︎

Why?

Using & as a way of parallelizing commands is a *nix bash idiom. It will not work the same way on for example Windows machines.

Examples

{
    "dev:watch": "npm run dev:watch:scripts & npm run dev:watch:styles" 🚨
}

yields

Use of unix single ampersand (&) in script 'dev:watch' is not allowed, consider using npm-run-all/run-p (no-unix-single-ampersand)

Solution

Use npm-run-all:

{
    "dev:watch": "run-p dev:watch:scripts dev:watch:styles" 🟢
}


scriptlint status
npm version badge
dependency badge
Issue badge
CI badge

Clone this wiki locally