Skip to content

Conversation

@azat-io
Copy link
Contributor

@azat-io azat-io commented May 1, 2025

Hello.

I am using SVGO for SVG minification on my project (example). In the root of my project there is a config for SVGO, which is marked as unused file:

Unused files
svgo.config.js  

The implementation follows the pattern of other similar plugins:

  • Created plugin in packages/knip/src/plugins/svgo/
  • Added test suite with fixtures
  • Registered plugin in main plugin index
  • Configuration logic recognizes standard SVGO config files

Documentation has been generated for the plugin using the standard docs generation scripts.

@pkg-pr-new
Copy link

pkg-pr-new bot commented May 1, 2025

Open in StackBlitz

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

commit: ee23be8

@webpro
Copy link
Member

webpro commented May 1, 2025

Thanks, this is great!

Happy to merge, but one little thing is missing: maybe the change didn't get in or maybe you didn't use the plugin creation script, but the JSON Schema isn't updated.

I just added a flag to the script so you can do this (from the packages/knip directory):

bun create-plugin --name svgo --graceful

Now we can use --force (to overwrite and start fresh) or --graceful to update existing plugins.

You can rebase from main first. Or update packages/knip/schema.json manually.

@azat-io
Copy link
Contributor Author

azat-io commented May 1, 2025

Rebased and added plugin to schema.json file.

@webpro webpro merged commit 5d68767 into webpro-nl:main May 2, 2025
24 checks passed
@webpro
Copy link
Member

webpro commented May 2, 2025

Thank you!

@webpro
Copy link
Member

webpro commented May 3, 2025

🚀 This pull request is included in v5.53.0. See Release 5.53.0 for release notes.

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

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