How to configure package.json to run eslint script

后端 未结 4 1268
借酒劲吻你
借酒劲吻你 2021-02-01 00:10

So I am using eslint as a linter for my react project and I would like it to check all of my .js files.

I am able to do this through the script:

<         


        
4条回答
  •  天命终不由人
    2021-02-01 00:51

    To add to TranBrian10's solution, I installed eslint locally, so calling eslint in the terminal results in a command not found error.

    I was able to get around this by using npx eslint instead:

    `eslint . --ext .js` -> `npx eslint . --ext .js`
    

    And as GollyJer noted, this won't work for Windows due to the . syntax

提交回复
热议问题