Skip to content

fix(linter): infer lint tasks with inputs using {workspaceRoot} to support nested projects #31488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025

Conversation

leosvelperez
Copy link
Member

Current Behavior

When running the lint task on a project that contains nested projects, the task runs over all the files, including the ones inside the nested projects, but the task cache status is not affected by changes to the files in nested projects. This only happens when the inputs are defined with {projectRoot}/... (what the @nx/eslint/plugin infers). The {projectRoot} token scopes the files inside the project without files in other nested projects. While the {workspaceRoot} token would include every file and wouldn't scope them to any particular project.

Expected Behavior

The @nx/eslint/plugin should infer lint tasks with their inputs using the {workspaceRoot} token to support nested projects. This would be more aligned with what the tool itself does, which runs over all the files inside the project root regardless of them being inside nested Nx projects.

Additionally, the difference in behavior between {workspaceRoot} and {projectRoot} should be documented.

Related Issue(s)

Fixes #31264

@leosvelperez leosvelperez self-assigned this Jun 6, 2025
@leosvelperez leosvelperez requested review from a team as code owners June 6, 2025 14:28
@leosvelperez leosvelperez requested a review from JamesHenry June 6, 2025 14:28
Copy link

vercel bot commented Jun 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jun 6, 2025 2:39pm

Copy link
Contributor

nx-cloud bot commented Jun 6, 2025

View your CI Pipeline Execution ↗ for commit def5c00.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 28m 32s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 17s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 5s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 3s View ↗
nx documentation ✅ Succeeded 1m 54s View ↗

☁️ Nx Cloud last updated this comment at 2025-06-06 15:03:05 UTC

@FrozenPandaz FrozenPandaz merged commit 6613dd2 into master Jun 6, 2025
8 checks passed
@FrozenPandaz FrozenPandaz deleted the eslint/update-plugin-inputs branch June 6, 2025 16:52
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inputs in group-level project don't include nested package sources unless using {workspaceRoot} — unexpected caching behavior
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy