question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`nx run-many --target=lint --all` doesnt check linting rules for a fresh nx workspace

See original GitHub issue

Current Behavior

Running the command yarn nx run-many --target=lint --projects=spa --skip-nx-cache doesn’t catch lint errors/warnings. Instead running the command yarn nx run spa:lint --skip-nx-cache properly catches the lint issues.

Expected Behavior

Running the command yarn nx run-many --target=lint --all should lint all projects in the repo.

Steps to Reproduce

https://github.com/mondo192/nx-workspace

  1. Clone the repo above
  2. yarn install etc.
  3. run the two linter commands above
  4. They dont behave the same

Failure Logs

Environment


   Node : 16.14.2
   OS   : linux x64
   yarn : 3.2.0
   
   nx : 13.9.5
   @nrwl/angular : Not Found
   @nrwl/cypress : 13.9.5
   @nrwl/detox : Not Found
   @nrwl/devkit : 13.9.5
   @nrwl/eslint-plugin-nx : 13.9.5
   @nrwl/express : Not Found
   @nrwl/jest : 13.9.5
   @nrwl/js : 13.9.5
   @nrwl/linter : 13.9.5
   @nrwl/nest : 13.9.5
   @nrwl/next : Not Found
   @nrwl/node : 13.9.5
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 13.9.5
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 13.9.5
   @nrwl/web : 13.9.5
   @nrwl/workspace : 13.9.5
   typescript : 4.5.5
   rxjs : 7.5.5
   ---------------------------------------
   Community plugins:

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
meeroslavcommented, May 5, 2022

Actually, this is a feature, not a bug.

Nx commands that (potentially) run target on multiple projects (such as affected or run-many) now by default run in the compact view. For linter, this means that warnings are hidden. If you would run the same command with --verbose you would achieve the same result:

yarn nx run-many --target=lint --projects=spa --skip-nx-cache --verbose

Please note that this refers only to warnings. In case of error, your report would exit the compact view and show the full error message.

Screenshot 2022-05-05 at 15 41 53

0reactions
meeroslavcommented, Nov 2, 2022

@ElvenSpellmaker this is not a workaround nor it influences the caching.

Caching is done per command, so when you add --verbose you are changing the command. If you would run it again you would see that the result is cached (if run was successful). The only speed difference you might see is the amount of time it takes to print our all the logs vs compact one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

run-many - CLI command - Nx
Run target for multiple listed projects.
Read more >
ESLint: Your Nx Workspace Rules - James Henry - YouTube
In this talk we will cover what it takes to create and run lint rules directly in your Nx workspace specific to your...
Read more >
Speed up your Yarn Workspace with Nx | by Emily Xiong
If you run yarn test , notice it would run linting for each app and library (in this repo, it uses the test...
Read more >
Setting Up A DevOps Pipeline With Nx - Christian Lüdemann
If you notice in the ci.yml , the lint job is slightly different from the rest. Nx has a special command called workspace-lint...
Read more >
How to pass arguments to eslint when using nx lint
However, when using nx lint / nx run-many --all --target=lint / nx affected:lint - these arguments don't appear to be supported, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found