简体   繁体   English

如何在 vscode 中为角度项目设置正确的打字稿 linting?

[英]How to setup proper typescript linting for an angular project in vscode?

I would like to setup an angular project which uses the airbnb typescript styleguide and also formats the code on save in vscode.我想设置一个 angular 项目,它使用 airbnb 打字稿样式指南,并在 vscode 中保存时格式化代码。 I've tried to configure it with tslint-config-airbnb and also the prettier extension.我尝试使用tslint-config-airbnb以及更漂亮的扩展来配置它。 But somehow I can't manage it.但不知何故,我无法管理它。 Any help and suggestion is highly welcome!非常欢迎任何帮助和建议!

Install this plugin if not already there.如果还没有安装这个插件。

VC Code should be linting your project dynamically as you code and show errors just in time they appear. VC Code 应该在您编写代码时动态检查您的项目,并在错误出现时及时显示。

You may need to run linting manually (or on a testing environment).您可能需要手动(或在测试环境中)运行 linting。 In this case, you must be able to find "lint" script in your package.json which you execute as npm run lint .在这种情况下,您必须能够在 package.json 中找到作为npm run lint执行的“lint”脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM