Skip to content

[@typescript-eslint/consistent-indexed-object-style] Fails on circular references #2687

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
3 tasks done
papb opened this issue Oct 18, 2020 · 5 comments · Fixed by #4347
Closed
3 tasks done

[@typescript-eslint/consistent-indexed-object-style] Fails on circular references #2687

papb opened this issue Oct 18, 2020 · 5 comments · Fixed by #4347
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@papb
Copy link
Contributor

papb commented Oct 18, 2020

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

{
  "rules": {
    "@typescript-eslint/consistent-indexed-object-style": ["error"]
  }
}
type Tree = {
	[key: string]: number | Tree;
};

Expected Result

Since it is not possible to convert that to a Record, the rule should not trigger.

type Tree = Record<string, number | Tree>; // Type alias 'Tree' circularly references itself.

Actual Result

The rule triggered.

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin latest
@typescript-eslint/parser latest
TypeScript 4.0.2
ESLint latest
node 12
@papb papb added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Oct 18, 2020
@bradzacher bradzacher added bug Something isn't working good first issue Good for newcomers and removed triage Waiting for team members to take a look labels Oct 18, 2020
@lakshyabatman
Copy link

@papb I'm interested to work on this issue, so I have to put up a condition to check if the value type is same as the node type.
Right?

@papb
Copy link
Contributor Author

papb commented Nov 15, 2020

Hi @lakshyabatman! Thank you! I think so, yes.

@Paril

This comment has been minimized.

@bradzacher
Copy link
Member

With any issue in opened in this project - it either has a visible progress in the form of an attached PR, or it has no progress.

We are a community run project. The volunteer maintainers spend most of their time triaging issues and reviewing PRs. This means that most issues will not progress unless a member of the community steps up and champions it.

If this issue is important to you - consider being that champion.

If not - please just subscribe to the issue and wait patiently.
Your comment does not bump issue priority in any way and just serves to spam everyone subscribed to the issue.

@jp7837
Copy link
Contributor

jp7837 commented Jan 12, 2022

I've linked the issue above in the TypeScript repo which is currently still open.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2022
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 bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
7 participants