Disable/TurnOff Angular ESLint "Async pipe results should not be negated"
Disable/TurnOff Angular ESLint "Async pipe results should not be negated"
在 运行 ng link 之后我看到了
/home/lans/projects/crm/new_frontend/src/app/modules/customers/list/list.component.html
228:12 warning Async pipe results should not be negated. Use (observable | async) === (false || null || undefined) to check its value instead @angular-eslint/template/no-negated-async
但代码差不多:
listLoading$ = new BehaviorSubject<boolean>(false);
和
<mat-paginator *ngIf="!(service.listLoading$ | async)"></mat-paginator>
如何禁用上面的警告/错误?
编辑项目根目录中的.eslintrc.json并添加5行从结束到你的项目
可能的变体是“关闭”/“警告”/“错误”
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "crm",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "crm",
"style": "kebab-case"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {
"@angular-eslint/template/no-negated-async": "off"
}
}
]
}
在 运行 ng link 之后我看到了
/home/lans/projects/crm/new_frontend/src/app/modules/customers/list/list.component.html
228:12 warning Async pipe results should not be negated. Use (observable | async) === (false || null || undefined) to check its value instead @angular-eslint/template/no-negated-async
但代码差不多:
listLoading$ = new BehaviorSubject<boolean>(false);
和
<mat-paginator *ngIf="!(service.listLoading$ | async)"></mat-paginator>
如何禁用上面的警告/错误?
编辑项目根目录中的.eslintrc.json并添加5行从结束到你的项目
可能的变体是“关闭”/“警告”/“错误”
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "crm",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "crm",
"style": "kebab-case"
}
]
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {
"@angular-eslint/template/no-negated-async": "off"
}
}
]
}