knip icon indicating copy to clipboard operation
knip copied to clipboard

Support for external plugins

Open RebeccaStevens opened this issue 1 year ago • 1 comments

I'd like to write my own plugin for a package which pretty much only I use. Adding such a plugin to knip itself seems impractical to me and would make it harder for me to make incremental updates to it.

Ideally I'd want to do something like this:

import type { KnipConfig } from 'knip';
import { MyKnipPlugin } from 'my-library';

const config: KnipConfig = {
  entry: ['src/index.ts'],
  project: ['src/**/*.ts'],
  customPlugins: [
    MyKnipPlugin(/* my plugin options */),
  ],
};

export default config;

RebeccaStevens avatar May 06 '24 23:05 RebeccaStevens

Sorry, currently not having the bandwidth to increase the API surface area of Knip. Same for programmatical usage of Knip itself. It would mean I'd have to support more things, that can break. If I could work more on Knip I'd love to support this as well, but currently it's not manageable.

webpro avatar May 07 '24 10:05 webpro