solidjs-community / eslint-plugin-solid

Solid-specific linting rules for ESLint.
MIT License
206 stars 24 forks source link

Types don't exist in bundled package #128

Closed JoshuaKGoldberg closed 3 months ago

JoshuaKGoldberg commented 4 months ago

Describe the bug

I'm trying to use eslint-plugin-solid in an eslint.config.js with TypeScript's checkJs: true. eslint-plugin-solid's package.json claims dist/index.d.ts should exist:

https://github.com/solidjs-community/eslint-plugin-solid/blob/02d7879338bb0186f9765bb8dc537ba9f676e11f/package.json#L13

...but that file doesn't exist in the published package.

https://arethetypeswrong.github.io/?p=eslint-plugin-solid%400.13.1:

No types

Import resolved to JavaScript files, but no type declarations were found.

To Reproduce

https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAZwgG2AEzgMyhEcBEApgqgHYwC0YyArgObCkVKpr4DcAUJ4QB6Sw4aQpgCGNZPADaLdAF12QA

Expected behavior

Types should be included with the package.

Environment (please complete the following information):

Additional context

nix6839 commented 3 months ago

It seems like you are looking to use flat config, but the eslint-plugin-solid does not export flat config from the root of the module. Please refer to this link: https://github.com/solidjs-community/eslint-plugin-solid#flat-configuration

However, not exporting the type is actually a bug, so I will submit a PR for that.

Additionally, since other plugins supporting flat config export it from the root of the module, I will also submit a separate PR to export flat config from the root of the module for consistency.

joshwilsonvu commented 3 months ago

Thank you both—as you can probably expect, shipping types hasn't really been a priority until now, but it makes sense for use with flat config. I'll take a look at that PR

pauliesnug commented 3 months ago

I am also experiencing this issue, could this be merged? Thank you

nix6839 commented 3 months ago

Additionally, since other plugins supporting flat config export it from the root of the module, I will also submit a separate PR to export flat config from the root of the module for consistency.

I have opened a PR: https://github.com/solidjs-community/eslint-plugin-solid/pull/135. Reviews are welcome.