how to do linting using nodemon?

后端 未结 3 966
醉酒成梦
醉酒成梦 2021-02-07 14:49

Can I use nodemon to lint my javascript? I am not using any build tool e.g. gulp or grunt and want to maximize the use of node and npm.

The output from nodemon can be pi

3条回答
  •  爱一瞬间的悲伤
    2021-02-07 15:10

    I use Standard.js for linting and I can get it to work with nodemon using the below package.json script.

    "scripts": {
      "lint": "standard",
      "dev": "nodemon ./app --exec \"npm run lint && node\""
      "start": "nodemon ./app"
    }

    When I run npm run dev, any changes I make will be monitored and linted. I tested this in Windows using PowerShell.

提交回复
热议问题