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

💡include line and column number for unused dependencies/devDependencies #930

Closed
momesana opened this issue Jan 31, 2025 · 3 comments
Closed
Labels
feature request Feature request

Comments

@momesana
Copy link

momesana commented Jan 31, 2025

Suggest an idea for Knip

Currently we only get the filename (i. e. package.json) for issues of type dependency/devDependency but it would be helpful to include line and column number so a tool displaying the information allows us to jump to the correct code line. In the following JSON fragment you see the output of a sample run with the current version of knip (5.43.6):

"issues": [
    {
      "file": "package.json",
      "dependencies": [
        {
          "name": "@fontsource-variable/noto-sans"
        },
        {
          "name": "@fontsource/noto-sans-jp"
        },
        {
          "name": "@fontsource/noto-sans-kr"
        },
        {
          "name": "@fontsource/noto-sans-mono"
        },
        {
          "name": "@fontsource/noto-sans-sc"
        },
        {
          "name": "@fontsource/noto-sans-tc"
        },
        {
          "name": "chart.js"
        }
      ],
      "devDependencies": [
        {
          "name": "@formatjs/cli"
        },
        {
          "name": "@swc/plugin-formatjs"
        },
        {
          "name": "eslint-plugin-cypress"
        },
        {
          "name": "prettier-plugin-organize-imports"
        }
      ]

As you can see there is no line/column number information provided.

@momesana momesana added the feature request Feature request label Jan 31, 2025
@webpro webpro closed this as completed in 72cbcfa Feb 10, 2025
@webpro
Copy link
Member

webpro commented Feb 11, 2025

🚀 This issue has been resolved in v5.44.0. See Release 5.44.0 for release notes.

Using Knip in a commercial project? Please consider becoming a sponsor.

@webpro
Copy link
Member

webpro commented Feb 11, 2025

Thanks for the report, @momesana! You made me do it :)

@momesana
Copy link
Author

momesana commented Feb 11, 2025

Thank you very much. Works like a charm!

Image

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request
Projects
None yet
Development

No branches or pull requests

2 participants