-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Feature Request]: Add TypeScript types #3797
Comments
typescript-eslint provides a typed wrapper for configs.
|
I'll probably add types eventually, but in the meantime, a DT package would be the way to go. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Here's a PR that adds this through type generation based on the JSDocs: #3830 |
@voxpelli thanks for adding this! I submitted a request for types back in #3776, so it's great to see it happen! One issue though - I updated to v7.37.0, but TypeScript is still complaining there are no type declarations. Are we sure the types are being generated + added to the package build correctly? I noticed there is no "main": "index.js",
"types": "index.d.ts", If this is a bug, should we open a new issue for this? |
Oh, I forgot to add that? 🫣 Yeah, would be great to add that, can you validate that it works when that's been added? Though I did add a test that should have validated that the types are working properly when used in a module, is that test then broken? 🤔 |
I would, but I can't find the type file to point to - there's no Here is what I see in my It's possible the type declarations are being excluded when publishing to npm. Or maybe I just don't know where to look. You can see what has been published by browsing the package files here. Do you see your type files? |
Looks like the building of the types and the publishing failed: https://github.com/jsx-eslint/eslint-plugin-react/actions/runs/11062995632/job/30739408890 Yet it did publish 🤔 |
I published manually, locally. The types built fine, afaik. Indeed, the publish workflow failed and I couldn't reproduce that locally. If there's a bug then it'd be great to get that fixed. |
I'll open a separate issue for this. |
Is there an existing issue for this?
Description Overview
It is possible to have the ESLint config be type checked using JSDoc comments and the
// @ts-check
annotation comment: e.g.But this package doesn't export types ATM. It would be nice if it did export types so it works without errors using this. Most/all other plugins I used do have types.
Expected Behavior
For the package to have TypeScript types
eslint-plugin-react version
v7.35.0
eslint version
v9.8.0
node version
v18.20.4
The text was updated successfully, but these errors were encountered: