Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已将TSLint安装到 VS Code。
在我的 Angular 应用程序中,当我运行默认构建任务时,如何更新 VS Code 以针对我的源运行 TSLint?
用于 VS 代码的 TSLint 是一种视觉帮助,而不是构建工具。不要混淆它。
如果你想在你的默认构建任务中添加一个 linter,这将发生在你的package.json:
package.json
"scripts": { "build": "ng build --prod" }
将此行替换为
"scripts": { "build": "ng lint; ng build --prod" }
现在你可以运行
npm run build
并且您的项目将在构建之前进行 lint。