Skip to content
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

No space after colon of ternary operator in array literal #598

Open
dkorpel opened this issue Mar 21, 2024 · 0 comments
Open

No space after colon of ternary operator in array literal #598

dkorpel opened this issue Mar 21, 2024 · 0 comments

Comments

@dkorpel
Copy link

dkorpel commented Mar 21, 2024

Input:

const x = [0 ? 1 : 2];
const y = 0 ? 1 : 2;

Expected output: the same.
Actual dfmt output:

const x = [0 ? 1: 2];
const y = 0 ? 1 : 2;

dfmt removes the space after the 1 in the array. Perhaps it's formatting it like an array index designator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant