Skip to content

Repo: Export all rule Options and MessageId types #10555

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

Closed
JoshuaKGoldberg opened this issue Dec 26, 2024 · 2 comments · Fixed by #10556
Closed

Repo: Export all rule Options and MessageId types #10555

JoshuaKGoldberg opened this issue Dec 26, 2024 · 2 comments · Fixed by #10556
Labels
accepting prs Go ahead, send a pull request that resolves this issue locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. repo maintenance things to do with maintenance of the repo, and not with code/docs

Comments

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Dec 26, 2024

Suggestion

Splitting out of #7670 -> #8443 -> #10554: we're going to soon have a rule that enforces all types used in a file's exports are themselves exported. That's a lot of + export ... diffs. I'd like to send a PR to do that separately before #10554, to get that PR to be less huge.

Additional Info

💖

@JoshuaKGoldberg JoshuaKGoldberg added triage Waiting for team members to take a look repo maintenance things to do with maintenance of the repo, and not with code/docs labels Dec 26, 2024
@kirkwaiblinger
Copy link
Member

Do you plan to do this as well for the rules whose type parameters are inferred, like

Asking because I'm almost curious whether we should just infer the Options/MessageId types where we need them rather than even export the types, using utilities like the following:

/**
* Uses type inference to fetch the MessageIds type from the given RuleModule
*/
type InferMessageIdsTypeFromRule<T> =
T extends RuleModule<infer MessageIds, infer _TOptions>
? MessageIds
: T extends RuleCreateFunction<infer MessageIds, infer _TOptions>
? MessageIds
: unknown;

@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Jan 7, 2025
@JoshuaKGoldberg
Copy link
Member Author

No, just the ones that would violate the rule. I think inferring types is nice but will probably take a lot longer.

@github-actions github-actions bot added the locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. label Jan 15, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. repo maintenance things to do with maintenance of the repo, and not with code/docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants