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

Nx plugin doesn't detect binaries without explicit executor #599

Closed
alecmev opened this issue Apr 19, 2024 · 3 comments
Closed

Nx plugin doesn't detect binaries without explicit executor #599

alecmev opened this issue Apr 19, 2024 · 3 comments
Labels
feature request Feature request good first issue Good for newcomers

Comments

@alecmev
Copy link

alecmev commented Apr 19, 2024

Given this configuration:

// nx.json
{
  "targetDefaults": {
    "fun": {
      "executor": "nx:run-commands"
    }
  }
}
// project.json
{
  "targets": {
    "fun": {
      "options": {
        "command": "rimraf /"
      } 
    }
  }
}

Knip reports rimraf as unused:

Unused devDependencies
                   
rimraf              package.json

Because it requires an explicit executor:

https://github.com/webpro/knip/blob/1ecdf800329dd9850771cbf270f451f85cff50b8/packages/knip/src/plugins/nx/index.ts#L56

I would propose just dropping .filter. I understand that it makes the heuristic more loose, but in reality, even when there's overlap with non-nx:run-commands executors, it's still semantically close enough. The only overlap in official executors I found is in @nx/remix:serve, and it would actually be good to consider it too.

@alecmev alecmev added the bug Something isn't working label Apr 19, 2024
@webpro webpro added good first issue Good for newcomers feature request Feature request and removed bug Something isn't working labels Apr 19, 2024
@webpro
Copy link
Collaborator

webpro commented Feb 11, 2025

This might've been fixed after some work in the Nx plugin recently?

@alecmev
Copy link
Author

alecmev commented Feb 15, 2025

Might have! Can't check though, sorry. Ultimately switched to Turbo, and don't work there anymore. Feel free to close!

@webpro
Copy link
Collaborator

webpro commented Feb 17, 2025

Thanks, alright then.

@webpro webpro closed this as completed Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants