nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.58k stars 2.36k forks source link

ng lint in v6 #503

Closed sirajc closed 6 years ago

sirajc commented 6 years ago

With v6, ng lint runs linting for all projects, in case of Nx for all apps and libs. If we look at the https://github.com/nrwl/nx-examples/blob/master/angular.json file, each lib has same two tsconfig.json configured, which means that ng lint will run lint on the same set of files?

For a large project, linting has become very slow in v6, hence looking for ways to optimize it.

Also, what linting is carried out by nx lint?

vsavkin commented 6 years ago

each lib has same two tsconfig.json configured

This is the way the way the Angular CLI does it right now. We don't want to deviate unless we have a very good reason to.

For a large project, linting has become very slow in v6, hence looking for ways to optimize it.

Don't rerun linting on all projects--only relint wha is affected. Also, use --parallel.

yarn affected:lint -- --base=master --head=HEAD --parallel

We have thoughts on how to speed up linting, but it will be different from the default CLI setup, so we evaluating if it is worth it.

rokie-web commented 6 years ago

The mentioned way (yarn affected:lint) by @vsavkin does work fine.

Anyhow, at our team we noticed the following behaviour: Executing a particular ng lint <projectname> on a small project does result in Done in 165.82s.

Doing the same excluding the nx-enforce-module-boundaries rule (which we really don't want to do) results in Done in 21.39s.

Any suggestions maybe?

vitalyiegorov commented 5 years ago

@vsavkin Recently our team also noticed that linting takes very long time, removing nx-enforce-module-boundaries speeded things up significantly.

danielquintero commented 5 years ago

We are having the same issue with a project at large scale. What we could find is that tsconfig.lib.json & tsconfig.spec.json which are included on the lint architect in angular.json extend from the main tsconfig.json, which will cause to also lint all of the declared paths per project being lint.

In our case running just affected is not a solution as we are working on tooling and many teams adding libs/features thus writing to angular.json, building all projects in CI taking over 40min for linting.

@vsavkin do you really need to extend from the main tsconfig.json for the above mentioned files?

jimdubbs commented 5 years ago

Im also experiencing extremely long linting times in our project as well. Not sure how to try disabling the nx-enforce-boundries in an effort to speed things up.

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.