嘿,npm和茨林特都有问题,我希望你能帮我。好的,下面是我的情况和代码:
package.json
"scripts": {
"lint": "tslint -c tslint.json 'src/app/**/*.ts'",
"pretest": "npm run lint ",
"test": "echo 'No test are made'",
...
},当我运行命令npm test时,这是输出:
输入端
$ npm test输出端
> keoom@1.0.0 pretest c:\Users\Hjorth\Documents\github\keoom-angular
> npm run lint
> keoom@1.0.0 lint c:\Users\Hjorth\Documents\github\keoom-angular
> tslint -c tslint.json 'src/app/**/*.ts'
> keoom@1.0.0 test c:\Users\Hjorth\Documents\github\keoom-angular
> echo 'No test are made'
'No test are made'如果我只运行命令tslint -c tslint.json 'src/app/**/*.ts',那么在另一方面,请查看linting错误。
输入端
$ tslint -c tslint.json 'src/app/**/*.ts'输出端
src/app/app.component.ts[1, 27]: " should be '因此,正如您所看到的,我的代码中有一个线性错误,但是如果我没有直接运行脚本,它将不会显示。我所期待的是:
当我运行npm test时,脚本pretest将运行,并且该脚本将运行脚本lint,然后在运行test脚本之前,它将退出test脚本,因为它将发现线轴错误。
任何有帮助的人。
发布于 2016-08-10 21:32:20
问题在于tslint命令中围绕文件规范的引号:
"lint": "tslint -c tslint.json 'src/app/**/*.ts'"
^ ^如果删除这些错误,您应该会看到tslint报告的预期错误。
https://stackoverflow.com/questions/38881133
复制相似问题