angular - TsLint :即使存在 ts lint 错误,Visual Studio 2017 构建也会成功
问题描述
我正在使用 .net core SPA angular 6 模板。
我已经从市场安装了 Type Script 分析器扩展,并且我已经完成了所有必需的设置。
https://marketplace.visualstudio.com/items?itemName=RichNewman.TypeScriptAnalyzer#overview
它适用于 Angular 7 模板,但不适用于 6。
这是 tslint 配置:
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"deprecation": {
"severity": "warn"
},
"eofline": true,
"forin": true,
"import-blacklist": [
true,
"rxjs/Rx"
],
"import-spacing": true,
"indent": [
true,
"spaces"
],
"interface-over-type-literal": true,
"label-position": true,
"max-line-length": [
true,
140
],
"member-access": false,
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-misused-new": true,
"no-non-null-assertion": true,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"prefer-const": true,
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": [
true,
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"directive-selector": [
true,
"attribute",
"app",
"camelCase"
],
"component-selector": [
true,
"element",
"app",
"kebab-case"
],
"no-output-on-prefix": true,
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true
}
}
您能否告诉我,如何将 tslint 错误视为构建错误?
解决方案
推荐阅读
- google-cloud-platform - GCP Dataflow flex 模板:无法启动 VM,[UNAVAILABLE] 'HTTP_503'
- python - /home 'assets' 处的 KeyError,使用 webpack 加载器
- python - Python 匹配案例(开关)性能
- google-bigquery - 复制表是否需要目标表具有相同的架构?
- angular - “删除”运算符的操作数必须是可选的/对象可能是角度 12 中的“未定义”错误
- c# - 统一寻路
- docker - 端口 8013 无法在 Docker 容器中运行的 MarkLogic 中安装数据中心中央战争文件
- flutter - 获取给定容器约束的 TextPainter 截断的字符偏移量
- python - 根据值为数据框单元格背景着色
- loops - 在snakemake中循环;检查站