我需要从我的tslint.json中删除下面的tslint规则。
应该以newline
‘
为了删除空白,我通过查看这个check-type删除了issue。
但是,当我在cli上运行ng lint命令时,仍然会出现错误。有人知道如何从我的tslint.json文件中删除上述规则吗?
tslint.json
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
false,
"check-space"
],
"curly": true,
"eofline": true,
"forin": true,
"import-blacklist": [
true,
"rxjs",
"rxjs/Rx"
],
"import-spacing": true,
"indent": [
false,
"spaces"
],
"interface-over-type-literal": true,
"label-position": true,
"max-line-length": [
true,
200
],
"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": [
false,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"directive-selector": [
true,
"attribute",
"app",
"camelCase"
],
"component-selector": [
true,
"element",
"app",
"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
}
}发布于 2019-11-05 06:08:06
删除tsLint中的以下内容:
"no-trailing-whitespace": true,
"whitespace": [ false, "check-branch", "check-decl", "check-operator", "check-separator", "check-type" ],
"quotemark": [ true, "single" ],
"eofline": true,
发布于 2019-11-05 06:15:43
1.文件应以新行结尾。
"eofline": true,2.尾随空格
"no-trailing-whitespace": false,3.缺失的空白
"whitespace": [
false,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],4.“应该是”
"quotemark": [
true,
"single"
],发布于 2019-11-05 06:21:12
下面是我在根文件夹中如何实现tslint.json文件的方法:
但是首先将"no-trailing-whitespace": true改为false in tslint.json
只是警告你。更漂亮的强制执行。你可能想看看那些更漂亮的医生。我花了一段时间微调我的曲子。现在我只是在我所有的应用程序中使用它。
.editorconfig文件中,我有以下内容,每一个新的角度应用程序都有:编辑器配置,见http://editorconfig.org root = true * charset = utf-8 indent_style = space indent_size =2 insert_final_newline = true trim_trailing_whitespace = true *.md max_line_length = off trim_trailing_whitespace = false
{ "arrowParens":“避免”,"bracketSpacing":真,"endOfLine":"auto","htmlWhitespaceSensitivity":“严格”,“半”:真,"singleQuote":真,"tabWidth":2,"trailingComma":"all","useTabs":false }
recommendation:文件夹vscode中的
extensions.json )。//请参阅http://go.microsoft.com/fwlink/?LinkId=827846以了解工作区建议。//扩展标识符格式:${publisher}.${name}。示例: vscode.csharp //扩展列表,这些扩展应该推荐给此工作区的用户。{“建议”:“Angular.ng-模板”、"DavidAnson.vscode-markdownlint“、"eamodio.gitlens”、"EditorConfig.EditorConfig“、”esbenp.premier-vscode“、"mike-co.import-sorter”、“ms-vscode.vscode-typescript-tslint”、"unwantedRecommendations":“amatiasq.sort-import”、"eg2.tslint“、"HookyQR.beautify”}
package.json添加这些,然后做npm install“更漂亮”:"1.18.2",“量角器”:"5.4.2",“tslint漂亮”:"1.18.0",“tslint-一致性-codestyle”:"1.16.0",“tslint漂亮”:"2.0.1",
{ "defaultSeverity":“错误”,“扩展”:“tslint:最新”,“tslint-config-漂亮”,“tslint-一致-codestyle”,“规则”:{……
https://stackoverflow.com/questions/58705282
复制相似问题