Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💡 Add description to KnipConfig types #892

Open
rakleed opened this issue Dec 26, 2024 · 2 comments
Open

💡 Add description to KnipConfig types #892

rakleed opened this issue Dec 26, 2024 · 2 comments
Labels
feature request Feature request

Comments

@rakleed
Copy link
Contributor

rakleed commented Dec 26, 2024

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:

@rakleed rakleed added the feature request Feature request label Dec 26, 2024
@rakleed rakleed changed the title 💡 Add description to KnipConfig types 💡 Add description to KnipConfig types Dec 26, 2024
@webpro
Copy link
Collaborator

webpro commented Jan 4, 2025

Great idea, @rakleed. Would you be up for a pull request to add this?

@rakleed
Copy link
Contributor Author

rakleed commented Jan 4, 2025

I don't know if I'll have the opportunity anytime soon. If anyone wants to do this, that would be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request
Projects
None yet
Development

No branches or pull requests

2 participants