Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

🐛 invalid code action of useOptionalChain #3257

Closed
1 task done
IWANABETHATGUY opened this issue Sep 20, 2022 · 1 comment · Fixed by #3277
Closed
1 task done

🐛 invalid code action of useOptionalChain #3257

IWANABETHATGUY opened this issue Sep 20, 2022 · 1 comment · Fixed by #3277
Assignees
Labels
A-Linter Area: linter S-Bug: confirmed Status: report has been confirmed as a valid bug
Milestone

Comments

@IWANABETHATGUY
Copy link
Contributor

IWANABETHATGUY commented Sep 20, 2022

Environment information

linux 
AMD

What happened?

(new foo || {}).bar

This code snippet will be fixed as

new foo?.bar

which is invalid syntax in typescript https://www.typescriptlang.org/play?#code/HYUw7gBAZg9jD8A6ARgQwE4Cgg

Expected result

Should not be fixed as
new foo?.bar

Code of Conduct

  • I agree to follow Rome's Code of Conduct
@IWANABETHATGUY IWANABETHATGUY added the S-To triage Status: user report of a possible bug that needs to be triaged label Sep 20, 2022
@ematipico
Copy link
Contributor

Adding a link to the playground

@ematipico ematipico added S-Bug: confirmed Status: report has been confirmed as a valid bug A-Linter Area: linter and removed S-To triage Status: user report of a possible bug that needs to be triaged labels Sep 21, 2022
@ematipico ematipico added this to the 0.10.0 milestone Sep 21, 2022
@ematipico ematipico self-assigned this Sep 26, 2022
@ematipico ematipico moved this to Done in Rome 2022 Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter S-Bug: confirmed Status: report has been confirmed as a valid bug
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants