[英]An unhandled exception occurred: invalid lint configuration. Nothing to lint after migrating Tslint to eslint in Angular 12
將 tslint 遷移到 eslint 后出現上述錯誤。
對 eslinttrc.json 進行了如下更新
忽略模式:[]
不確定我錯過了什么
發現對 .eslintrc.json 和 angular.json 的訪問和內容影響了我。
據我了解,這些文件需要從運行 linter 的位置“可見”(例如,同一目錄、項目根目錄)。
接下來,.eslintrc.json 的默認內容在根目錄 Object 中包含此條目。此條目沒有影響我,但 YMMV - 根據您的項目進行調整:
"ignorePatterns": ["projects/**/*"]
接下來默認內容angular.json(用點號表示在JSON的什么地方可以找到這個條目):JSON path = projects.<YourProjectName>.architect.lint
這些默認文件模式與我的項目結構不匹配 - 因此得到與 OP 相同的錯誤
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
希望這對人們有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.