Skip to content

搭建ts开发环境之引入tslint #4

@wildfirecode

Description

@wildfirecode

TSLint是一个可扩展的静态分析工具,用于检查TypeScript代码的可读性,可维护性和功能性错误。它受到现代编辑和构建系统的广泛支持,并且可以使用您自己的纤维规则,配置和格式化程序进行定制。

tslint命令行

使用命令行修复指定的文件集合的问题

tslint --fix './src/**/*.ts'

tslint和现代编辑器Visual Studio Code

tslint最常见的使用方式便是和编辑器结合起来。tslint插件是连接tslint和vscode的桥梁。在vscode的问题窗口可以看到tslint的警告。还可以在编辑区使用手动的方式或快捷键ctrl+.来快速修复检测出的问题。

1

tslint和webstorm

具体参考webstorm官方文档

建议的代码规范

[todo]

把tslint集入CI系统

[todo]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions