简体   繁体   English

发生未处理的异常:无效的 lint 配置。 在 Angular 12 中将 Tslint 迁移到 eslint 后没有任何 lint

[英]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.

相关问题 Nx Angular TSLint 到 ESLint 迁移后的 Lint 错误 - Nx Angular Lint Error after TSLint to ESLint Migration 在Angular中用多个项目迁移TSLint到ESLint,ng lint命令挂起 - Migrate TSLint to ESLint in Angular with multiple projects, ng lint command hangs angular 项目中 ng lint 期间未处理的异常 - Unhandled exception during ng lint in angular project 带有 Angular 7 和 `ng lint` 的 TypeScript 中的自定义 TSLint 规则 - Custom TSLint Rule in TypeScript with Angular 7 and `ng lint` Angular 12 从 tslint 切换到 eslint 后模板 linting 不起作用 - Angular 12 template linting not working after switchting from tslint to eslint 尝试对 Angular 模板进行 lint 时出现 ESLint 错误 - ESLint error when trying to lint Angular templates 在架构中找不到“tsconfig”-将 tslint 迁移到 eslint (Angular v11) - 'tsConfig' is not found in schema - Migrating tslint to eslint (Angular v11) tslint更新错误“找不到模块&#39;tslint / lib / lint&#39;” - tslint update error “Cannot find module 'tslint/lib/lint'” 发生未处理的异常:工作区中未设置配置“dev” - An unhandled exception occurred: Configuration 'dev' is not set in the workspace 发生未处理的异常:工作区中未设置配置“es” - An unhandled exception occurred: Configuration 'es' is not set in the workspace
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM