Skip to content

Conversation

@nyarthan
Copy link
Contributor

@nyarthan nyarthan commented Oct 3, 2025

  • include all valid configuration file locations / extensions
  • enable plugin if config exists (I think it's common enough to install lefthook via a different method than as a node module e.g. in a nix setup)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 3, 2025

Open in StackBlitz

npm i https://pkg.pr.new/knip@1285

commit: 2db4919

Copy link
Member

@webpro webpro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Just not sure if we should enable the plugin by config file existence, though.

];

const isEnabled: IsPluginEnabled = async ({ dependencies, cwd }) =>
Boolean(hasDependency(dependencies, enablers) || (await _firstGlob({ cwd, patterns })));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue with enabling the plugin by config file existence is that we'll no longer be able to determine the opposite: how can we mark the dependency as unused in the future (as it is still often listed)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense - maybe we need another way of "force enabling" a plugin for these cases?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants