Silencing errors on failures for npm run-script

前端 未结 4 1691
抹茶落季
抹茶落季 2021-02-18 15:18

When you run npm test and it fails, you get the test outputs + a single error message, like so:

npm ERR! Test failed.  See above for more details.
<         


        
4条回答
  •  面向向阳花
    2021-02-18 15:56

    If you don't care about preserving the return code of the linter process, you can always configure your package.json like this:

    {
      // ...
      "scripts": {
        // ...
        "lint": "eslint . || true",
      }
    }
    

提交回复
热议问题