Skip to content

eslint-plugin: Back-port new rules around empty object types from v8 #9437

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 Jun 26, 2024 · 6 comments · Fixed by #9443
Closed

eslint-plugin: Back-port new rules around empty object types from v8 #9437

JoshuaKGoldberg opened this issue Jun 26, 2024 · 6 comments · Fixed by #9443
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement New feature or request locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@JoshuaKGoldberg
Copy link
Member

Overview

Back in #8977 on the v8 branch, we'd deprecated ban-types + no-empty-interfaces and split functionality into a new no-empty-object-type rule. Yay!

Coming over from #8977 (comment): there's no reason why we couldn't also add that rule in v7 too. We can leave it out of recommended rulesets for now, and just have it available if users want to use it in the meantime.

💖

@JoshuaKGoldberg JoshuaKGoldberg added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Jun 26, 2024
@bradzacher bradzacher added enhancement New feature or request accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Jun 26, 2024
@Vinccool96
Copy link
Contributor

Leave this to me!

@JoshuaKGoldberg
Copy link
Member Author

@Vinccool96 your enthusiasm is noted and appreciated 😄 thanks! But, we generally try to avoid "cookie licking" in the issue tracker: https://typescript-eslint.io/contributing/issues#issue-claiming. Sometimes folks will claim an issue and then drop out, leaving it hanging ("licked").

@Vinccool96
Copy link
Contributor

Is it normal that, in the v8 version of the rule, this doesn't create an error?

interface Base {
  name: string;
}
interface Derived {
  age: number;
}
// valid because extending multiple interfaces can be used instead of a union type
interface Both extends Base, Derived {}

I know it says in the comment valid because extending multiple interfaces can be used instead of a union type, but (the default option of allowInterfaces is never, so why is this valid?

@JoshuaKGoldberg
Copy link
Member Author

That would be a separate discussion or issue from this one 🙂. Off the top of my head I don't remember, and it would be good to have that as a standalone discoverable discussion/issue.

@Vinccool96
Copy link
Contributor

How do I make the playground use v8 for the issue?

@JoshuaKGoldberg
Copy link
Member Author

@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 Jul 9, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 9, 2024
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 enhancement New feature or request locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
3 participants