Input:
<View a={true} b={false} />
Actual Output:
<View
a={true}
b={false}
/>
Expected Output
<View
a={true}
b={false} />
Is there an option to control this closing format?
Hello @booker-laputa
I think you might need to give more information because I don't see the difference between
Actual Output:
<View a={true} b={false} />
Expected Output
<View a={true} b={false} />
@RobinMalfait , the editor auto formatted my code
I have updated
The "/>" is expected to be on the same line as "b={false}" but the actual output is "/>" always live in a new line
This is currently how prettier works, and I don't think that they are going to change it.
You can try to create an issue over there: https://github.com/prettier/prettier
Or
You can use an eslint plugin (https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md) and enable eslint integration: prettier.eslintIntegration: true,
You might need to ask for that functionality in the eslint plugin.
Closing for now since we can't change the styling in this extension.
Isn't https://github.com/prettier/prettier-vscode#prettierjsxbracketsameline-default-false
the option you are looking for?
Hah, I didn't even know that existed, my bad!
jsxBracketSameLine is for opening bracket
jsxBracketSameLine === true
<Text
style={...}>
TEXT_HERE
</Text>
jsxBracketSameLine === false
<Text
style={...}
>
TEXT_HERE
</Text>
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
jsxBracketSameLineis for opening bracketjsxBracketSameLine=== truejsxBracketSameLine=== false