I have set up eslint to check my two js files. When I run eslint ./file1.js ./file2.js the eslint works fine however when i try to automate it by adding it to my package.json file like this:
"scripts": {
"start": "node file1.js"
"pretest": "eslint .\file1.js .\file2.js"
},
and try to run it by using 'npm run pretest' in my CLI it returns this error, rather than running normally like it does when I type the eslint command directly in my CLI:
npm ERR! code EJSONPARSE
npm ERR! file C:\filepath\package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected string in JSON at position 148 while parsing '{
npm ERR! JSON.parse "name": "progproj",
npm ERR! JSON.parse "ve'
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\fatim\AppData\Roaming\npm-cache\_logs\2021-01-18T00_05_33_552Z-debug.log
Aucun commentaire:
Enregistrer un commentaire