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

Open
alecmev opened this issue Apr 19, 2024 · 0 comments
Open

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

alecmev opened this issue Apr 19, 2024 · 0 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
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