I have a mono repo with 20+ libraries and a few storybooks. Each library contains a single component.
When I run Eslint (the new builder) on a single library it takes 22 seconds to lint that single library of 1 component.
From my investigation it appears to be the creation of a TS program based on tsconfig.base.json which includes files in every app and library, not just the ones in the library I want to lint.
If for example I was to add the following to the .eslintrc.json file in the library folder, so it creates the TS program based on the files solely in that library I get a much more respectable 4 second linting time for that single library:
"parserOptions": {
"project": "./libs/react/box/tsconfig.*?.json"
}
While this workaround works when running the builder my IDE throws warnings so this isn't really a solution, it just demonstrates the issue.
Linting a single library should run fast, and not slow down based on the number of other apps and libraries in the repository.
yarn nx lint sample --skip-nx-cachelibs/sample/.eslintrc.json file uncomment out the parserOptions section
N/A
@nrwl/angular : 10.3.1
@nrwl/cli : 10.3.0
@nrwl/cypress : 10.3.1
@nrwl/eslint-plugin-nx : 10.3.1
@nrwl/express : Not Found
@nrwl/jest : 10.3.1
@nrwl/linter : 10.3.1
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/react : 10.3.1
@nrwl/schematics : Not Found
@nrwl/tao : 10.3.0
@nrwl/web : 10.3.1
@nrwl/workspace : 10.3.1
typescript : 4.0.3
Yeah, this is the manifestation of why I wrote this TODO when I last touched the workspace lint utils :) https://github.com/nrwl/nx/blob/992013ca0af7676cae3005b308c7496fa77bba9f/packages/workspace/src/utils/lint.ts#L277
We should be able to address this soon I think @FrozenPandaz - it naturally forms part of the overrides update for non-Angular projects that we discussed already
Most helpful comment
Yeah, this is the manifestation of why I wrote this
TODOwhen I last touched the workspace lint utils :) https://github.com/nrwl/nx/blob/992013ca0af7676cae3005b308c7496fa77bba9f/packages/workspace/src/utils/lint.ts#L277We should be able to address this soon I think @FrozenPandaz - it naturally forms part of the overrides update for non-Angular projects that we discussed already