angular - eslint 未检测到角度组件 html nx.dev 中缺少的属性或函数
问题描述
以下template.component.html
函数copyTemplate()
未定义,但 eslint 未在控制台中显示错误。
<button type="button" (click)="copyTemplate(item.data)" class="btn btn-sm btn-simple-primary ml-2">
{{ 'words.make_copy' | flowTranslate:null:$flow.getTranslateData() }}
</button>
我正在使用NX.dev
带有单声道存储库的工作区
.eslintrc.json
在应用程序/应用程序中
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"parserOptions": { "project": ["libs/interfaces/tsconfig.*?.json"] },
"rules": {
"@angular-eslint/directive-selector": [
"error",
{ "type": "attribute", "prefix": "naologic", "style": "camelCase" }
],
"@angular-eslint/component-selector": [
"error",
{ "type": "element", "prefix": "naologic", "style": "kebab-case" }
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"rules": {}
}
]
}
.eslintrc.json
在项目根目录
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{ "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] }
]
}
],
"@angular-eslint/max-len": "off"
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"rules": {
"max-len": 0,
"no-empty-function": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {
"@angular-eslint/max-len": "off",
"max-len": "off"
}
}
]
}
解决方案
推荐阅读
- python - Selenium Webdriver 获取元素(Python)
- authentication - CakePHP 3.6 $this->Auth->identify() 在新创建的数据上返回 FALSE
- r - 闪亮的复选框
- sql-server - Node JS - SQL Server 流到文件奇怪的行为
- python - 正则表达式
- node.js - FoxyCart 信用卡支付测试
- tensorflow - TensorBoard:绘制每个步骤的“评估损失”图表
- c++ - 使用 Visual Studio 2017 编译 sfml
- unity3d - Unity 中网格渲染器的层
- ios - verifyPhoneNumber 不在 Firebase 电话身份验证中发送 SMS 消息