Skip to content

💡 Add description to KnipConfig types #892

Open
@rakleed

Description

@rakleed

Suggest an idea for Knip

I would like to use KnipConfig types in a configuration file, so the IDE could hint me more accurately.

/** @type { import('knip'). KnipConfig } */
const config = { ... };
export default config;

But without at least a description, it is not that helpful.

It would be nice if you add the description for every type in KnipConfig:

const rootConfigurationSchema = z.object({
rules: rulesSchema.optional(),
entry: globSchema.optional(),
project: globSchema.optional(),
paths: pathsSchema.optional(),
ignore: globSchema.optional(),
ignoreBinaries: stringOrRegexSchema.optional(),
ignoreDependencies: stringOrRegexSchema.optional(),
ignoreMembers: stringOrRegexSchema.optional(),
ignoreExportsUsedInFile: ignoreExportsUsedInFileSchema.optional(),
ignoreWorkspaces: z.array(z.string()).optional(),
includeEntryExports: z.boolean().optional(),
compilers: compilersSchema.optional(),
syncCompilers: z.record(z.string(), syncCompilerSchema).optional(),
asyncCompilers: z.record(z.string(), asyncCompilerSchema).optional(),
});

It's probably worth adding @default and @see. See:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions