knip icon indicating copy to clipboard operation
knip copied to clipboard

💡 Add description to `KnipConfig` types

Open rakleed opened this issue 1 year ago • 2 comments

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: https://github.com/webpro-nl/knip/blob/9590b9238d558098430f9535f95c1f40d437c2ec/packages/knip/src/ConfigurationValidator.ts#L47-L62

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

  • https://github.com/vitejs/vite/blob/9290d85b5d2ad64991bd296157cb3bcb959c341d/packages/vite/src/node/config.ts#L296
  • https://github.com/eslint/eslint/blob/5db226f4da9ad7d53a4505a90290b68d4036c082/lib/types/index.d.ts#L1254
  • https://github.com/prettier/prettier/blob/d9d0999aac70c04b06b35cbcb2c804b4a9c8d8a8/src/index.d.ts#L308

rakleed avatar Dec 26 '24 01:12 rakleed

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

webpro avatar Jan 04 '25 07:01 webpro

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

rakleed avatar Jan 04 '25 10:01 rakleed

I'll probably take a shot at this soon.

aryaemami59 avatar May 21 '25 10:05 aryaemami59

Thanks Arya, that'd be great!

webpro avatar May 25 '25 07:05 webpro