这是indexloc提供的服务,不要输入任何密码
Skip to content

💡 [Types]: Expose workspace config #1353

@notaphplover

Description

@notaphplover

Context

As user I'm interested in defining my config in a knip.ts config file.

Most of my workspace config can be extended from a base config. I'm interested in accesing the workspace config type. With the addition of function configs, it's starting to become sort of cumbersome to access this type:

import { KnipConfig } from "knip";

type IsNotFunction<T> = T extends (...args: any) => any ? never : T;
type RecordValues<T> = T extends Record<any, infer U> ? U : never;

type KnipConfigObject = IsNotFunction<KnipConfig>;

type WorkspaceProjectConfig = RecordValues<
  Required<KnipConfigObject["workspaces"]>
>;

Feature request

Would it be possible to expose WorkspaceProjectConfig at dist/types.d.ts so we can access to it in a more straightforward way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions