[英]An unhandled exception occurred: invalid lint configuration. Nothing to lint after migrating Tslint to eslint in Angular 12
After migrating tslint to eslint getting error as the above mentioned.将 tslint 迁移到 eslint 后出现上述错误。
Made update to eslinttrc.json as below对 eslinttrc.json 进行了如下更新
ignorePatterns:[]忽略模式:[]
Not sure what I am missing不确定我错过了什么
Found that access to and content of.eslintrc.json & angular.json were impacting me.发现对 .eslintrc.json 和 angular.json 的访问和内容影响了我。
As I understand these files need to be "visible" (eg Same directory, root of project) from where you run the linter.据我了解,这些文件需要从运行 linter 的位置“可见”(例如,同一目录、项目根目录)。
Next, the default content of.eslintrc.json contains this entry in the root Object. This entry did not affect me, but YMMV - adjust per your project:接下来,.eslintrc.json 的默认内容在根目录 Object 中包含此条目。此条目没有影响我,但 YMMV - 根据您的项目进行调整:
"ignorePatterns": ["projects/**/*"]
Next the default content of angular.json (using a dot notation to indicate where in the JSON To find this entry): JSON path = projects.<YourProjectName>.architect.lint接下来默认内容angular.json(用点号表示在JSON的什么地方可以找到这个条目):JSON path = projects.<YourProjectName>.architect.lint
These default File patterns did not match my project structure - and hence got the same error as the OP这些默认文件模式与我的项目结构不匹配 - 因此得到与 OP 相同的错误
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
Hope this helps folks.希望这对人们有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.