koninos
koninos

Reputation: 5337

Migrate TSLint to ESLint in Angular with multiple projects, ng lint command hangs

I have successfully migrated another Angular 10 app with a single project from TSLint to ESLint, following the instructions of Angular ESLint. When I try to migrate an Angular 10 app with multiple projects under the projects/ folder (i.e. 'app' and 'myLib') and try to run 'ng lint' or 'npx ng lint app', then I only see 'Linting "app"...' and the command seems to hang. All required packages have been installed and the migration phase was errorless. Any ideas on the issue?

Upvotes: 5

Views: 1791

Answers (1)

koninos
koninos

Reputation: 5337

The actual problem was that linter was executed very very slowly (so slow that seemed to hang, unless you use debug), so in order for the issue to be fixed, in the inner .eslintrc.json of each project, under parserOptions, in the project array, I added tsconfig.json

"parserOptions": {
        "project": [
          "tsconfig.json",
          "projects/app/tsconfig.app.json",
          "projects/app/tsconfig.spec.json",
          "projects/app/e2e/tsconfig.json"
        ]
}

Upvotes: 5

Related Questions