-
Notifications
You must be signed in to change notification settings - Fork 231
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: Generate typings for rules etc. #1469
Comments
Can you provide some real-world examples of where the types would actually be used? (beyond that someone could "one day" want to extend a rule, since I don't think anyone is doing that currently with our rules) My understanding is that ESLint tooling is still not in a good position to properly utilize typings for rules and that that doesn't change with the new flat config format. The downsides with shipping types is that they add a bit to the package size and increase the surface area of our build infrastructure since Babel doesn't support generating types - neither are particularly costly but relative to not having an actual common real world usecase they're pretty expensive... |
@G-Rath Sure! For this issue to be sparked, I was trying to implement a way to use export interface RuleOptions {
/**
* this is an example of a description for the rule.
*
* @see [rule-name](https://docs.example.com/rule-name.md)
*/
'jest/rule-name': string;
} would make all the difference. This would produce a much lesser impact. Alternatively, types could be provided in a separate package if bundle size is a concern. |
I think it would be fine to ship types. We already run I don't really care about bundle size, but we could also bundle up the types into a single file like we do in Jest (via https://www.npmjs.com/package/@microsoft/api-extractor) in order to minimise the impact |
As the new flat config format requires users to import plugins and their configs themselves, plugins can now be type checked within the config. This is the extra level of support for flat configs currently being tracked within eslint/eslint#18093. |
+1 on this, I'm getting a linter warning in |
Happy to take a PR! I don't care particularly about some other plugin (although it would be cool to support if the maintenance burden was low/non-existent), but not being annoying to people with |
Currently we package with Babel to pure JS, but it would be awesome if we could include some
.d.ts
files with the official build for programmatic, auto-completion, and extension use. This shouldn't be too difficult considering it's already written in TypeScript.The text was updated successfully, but these errors were encountered: