javascript - 为什么 TFS 2017 Sonar Build Definition 给出 No valid rules have been specified 错误?
问题描述
我有一个为执行声纳任务的 HTML(TypeScript,Javascript)创建的 TFS 2017 构建定义,在执行声纳构建定义后,我收到错误: 我的构建摘要中显示没有指定有效规则消息。
此错误是在构建定义中的运行代码分析任务期间创建的。我确实尝试过谷歌搜索错误并找到了这个链接
在 Stack Overflow 上输入链接描述
在 GitHub 上在这里输入链接描述
他们建议在tslint.json中添加jsRules键等等,我试过了,但仍然收到同样的错误。
请在tslint.json内容下方找到
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"eofline": true,
"forin": true,
"import-blacklist": [
true,
"rxjs",
"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"
}
],
"typeof-compare": true,
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"directive-selector": [
true,
"attribute",
[
"nextgen"
],
"camelCase"
],
"component-selector": [
true,
"element",
[
"nextgen"
],
"kebab-case"
],
"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,
"invoke-injectable": true
}
}
请找到 tsconfig.json 内容-
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
}
}
解决方案
推荐阅读
- c# - NavMeshAgent 与 Unity 中的目标点朝向相同的方向
- node.js - 如何通过 node.js 运行机器人的 Kick 命令?
- reporting-services - 行组内的折线图在预览中展开
- delphi - 无法释放调用者组件
- stored-procedures - 在存储过程中使用光标
- ios - 如何自定义 Material Design TextField 组件错误状态 iOS
- visual-studio - “未加载 UWPHost.pdb”- 调试 Xamarin UWP 应用
- c# - 如何按文件名顺序合并文件
- nlp - 我可以对命名实体标签使用 one-hot 向量与词嵌入连接以改善神经机器翻译吗?
- knockout.js - Bootstrap 可编辑手风琴名称