-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[consistent-indexed-object-style] fixer produces invalid code and deletes comments #4730
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
Comments
It is virtually impossible to determine whether mapped types or index signatures should be used if there are type aliases without making the rule type-aware. Maybe we should just use suggestions instead? |
We can certainly switch to suggestions if we can't reliably determine which should be used! |
I realized mapped types are more permissive than index access types. Mapped types also allow |
we could definitely do that.
|
Repro
Playground
Expected Result
I expect the first to be fixed with comment preserved, and the second to be fixed to valid code:
Actual Result
Additional Info
Versions
@typescript-eslint/eslint-plugin
5.16.0
@typescript-eslint/parser
5.16.0
TypeScript
4.6.3
ESLint
8.11.0
node
17.5.0
The text was updated successfully, but these errors were encountered: