我想将规则变成@angular-eslint/no-host-metadata-property警告而不是错误,但我不知道如何配置它。
错误消息如下所示:
使用@HostBinding或@HostListener而不是元
host数据属性(https://angular.io/styleguide#style-06-03)@angular-eslint/no-host-metadata-property
这是我eslintrc.json在根级别的文件中尝试过的:
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"overrides": [
{
"files": ["*.ts"],
"rules": {
....
"@angular-eslint/no-host-metadata-property": "warn",
}
"plugins": ["@angular-eslint/eslint-plugin", "eslint-plugin-import", "@typescript-eslint"]
}
}
Run Code Online (Sandbox Code Playgroud)
这是针对 Angular 12 项目的。我运行 nx 迁移命令将 linting 规则从 tslint 转换为 eslint。我怎样才能推翻这个规则?
如何覆盖 中的 eslint 规则plugin:@nrwl/nx/typescript?我已对 的根目录进行了此更改.eslintrc.json。
"rules": {\n "@typescript-eslint/member-ordering": "warn"\n},\nRun Code Online (Sandbox Code Playgroud)\n并且在引入违反规则的演示后仍然出现错误
\nD:\\me\\sample\\apps\\my-app\\src\\app\\app.component.ts\n 16:3 error Member outOfOrder should be declared before all instance method definitions @typescript-eslint/member-ordering\n\n\xe2\x9c\x96 1 problem (1 error, 0 warnings)\n\nLint errors found in the listed files.\nRun Code Online (Sandbox Code Playgroud)\n我也尝试将规则更改添加到overrides打字稿部分。