简体   繁体   中英

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.

Made update to eslinttrc.json as below

ignorePatterns:[]

Not sure what I am missing

Found that access to and content of.eslintrc.json & angular.json were impacting me.

As I understand these files need to be "visible" (eg Same directory, root of project) from where you run the 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:

"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

These default File patterns did not match my project structure - and hence got the same error as the OP

    "lint": {
      "builder": "@angular-eslint/builder:lint",
      "options": {
        "lintFilePatterns": [
          "src/**/*.ts",
          "src/**/*.html"
        ]
      }
    }

Hope this helps folks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM