Skip to content
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

Target dependencies can be passed invalid parameters when dependency is a different task #9100

Closed
luxaritas opened this issue Feb 24, 2022 · 5 comments

Comments

@luxaritas
Copy link
Contributor

luxaritas commented Feb 24, 2022

Current Behavior

I currently have a core-based setup where I have my tsconfig for Jest including only the jest files, with a project reference pointing to the build tsconfig, so that it references the built files of my app. I have linter rules enabled that require type checking, and this means that I get lint errors if my main app is not built when I go to do a lint (which includes the test files). However, if I pass any parameters to my lint task, they also get passed to my build job - and my built job is tsc, which complains about invalid parameters.

Admittedly, I'm not sure that I like this tsconfig setup anyways, but there may still be other instances where this could prove to be problematic.

Expected Behavior

There should be some sort of control for determining whether any/some/all of the parameters passed to a task are passed to that task's dependencies, namely when the dependencies are a different type of task (though even if it's the same task it may still be relevant, as for example different built tasks may use different commands).

Environment

   Node : 16.13.2
   OS   : linux x64
   npm  : 8.4.1
   
   nx : 13.8.3
   @nrwl/cli : 13.8.3
   @nrwl/devkit : 13.8.3
   @nrwl/eslint-plugin-nx : 13.8.3
   @nrwl/jest : 13.8.3
   @nrwl/linter : 13.8.3
   @nrwl/tao : 13.8.3
   @nrwl/workspace : 13.8.3
   typescript : 4.5.5
   rxjs : 6.6.7
@Bielik20
Copy link
Contributor

Looks like something I am proposing here: #9034 in "Alternate Implementations".
I would appreciate input and some voice to that issue, maybe Nx Team will respond.

@AgentEnder
Copy link
Member

There are definitely some changes that should be made to loosen up targetDependencies, in case a target doesn't exist on a dependency or params are invalid on the dep.

@AgentEnder AgentEnder added the scope: core core nx functionality label Mar 14, 2022
@luxaritas
Copy link
Contributor Author

I think this may be at least mostly resolved by the new dependsOn configuration where you can specify what to do with params? It doesn't provide any fine-grained control, but that may be a separate issue

@github-actions
Copy link

github-actions bot commented Feb 2, 2023

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

@github-actions
Copy link

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.

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

No branches or pull requests

3 participants