-
-
Notifications
You must be signed in to change notification settings - Fork 386
Open
Labels
feature requestFeature requestFeature request
Description
Suggest an idea for Knip
In my use case, I need to create a custom function that accepts a Knip config object as a parameter, something like this:
export function createConfig({
compilers,
ignoreDependencies = [],
...config
}: KnipConfig = {}): KnipConfig {
return {
...,
...config,
}
}The problem is that KnipConfig seems to be a union of several types rather than just the plain config object type. I could not find any documentation mentioning the underlying types.
After looking through node_modules, I found RawConfiguration, which appears to match my use case better, but it cannot be imported.
Because of this, I currently have to do something like:
import type { KnipConfig } from "knip"
type KnipConfigObject = Exclude<KnipConfig, (...args: never[]) => unknown>
export function createConfig({
compilers,
ignoreDependencies = [],
...config
}: KnipConfigObject = {}): KnipConfig {
return {
...,
...config,
}
}It would be useful to expose the object config type separately, or otherwise make it possible to import the relevant subtype of KnipConfig.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestFeature requestFeature request