eslint-plugin-unicorn icon indicating copy to clipboard operation
eslint-plugin-unicorn copied to clipboard

missing TypeScript declaration file

Open Zamiell opened this issue 2 months ago • 3 comments

Now that ESLint 9 is released and everyone is migrating to flat config, importing the plugin into a flat config by following the official documentation actually results in a red squiggly line, because no declaration file exists (when using checkJs and/or @ts-check).

I suspect many/most users will be using TypeScript to validate that their new flat configs do not have typos in them. Thus, shipping a declaration file for this plugin would really be appreciated!

Zamiell avatar May 01 '24 13:05 Zamiell

same here image

TheElegantCoding avatar May 04 '24 05:05 TheElegantCoding

Types already available https://github.com/eslint-types/define-config-plugin-types/tree/main/types/unicorn

Maybe @Shinigami92 can help us move to this repo?

fisker avatar May 08 '24 03:05 fisker

Types already available eslint-types/define-config-plugin-types@main/types/unicorn

Maybe @Shinigami92 can help us move to this repo?

I can try to help, but unfortunate I currently have much todo with maintaining node-pg-migrate, @faker-js/faker and private work, plus vacation & enjoying a bit of rest-freetime for my own ^^' Right now I'm also not migrated to eslint v9 and all current tries are resulting in failures somehow, especially due to eslint-plugin-deprecation 😖

There is also a post by @nzakas that the eslint v8->v9 migration path will get a bit more stabilization in "near" future.

If someone wants to tackle a PR for unicorn, have a look into my script https://github.com/eslint-types/define-config-plugin-types/blob/main/scripts/generate-plugin-dts.ts and take everything needed to build up a starting base for unicorn types itself. Then I assume they just need to be bundled into one index.d.ts and shipped via package.json "types" field.

Shinigami92 avatar May 08 '24 06:05 Shinigami92