Option for closing bracket to be on the same line
See original GitHub issueMetadata
@prettier/plugin-xml
version: '0.13.0- Options:
Our gradle spotless config:
format 'xml', {
target '**/*.xml'
prettier(['prettier': '2.0.5', '@prettier/plugin-xml': '0.13.0']).config(['parser': 'xml', 'tabWidth': 4])
}
xmlSelfClosingSpace
: truexmlWhitespaceSensitivity
:"strict"
(be 100% sure changing this to"ignore"
doesn’t fix your issue)- changing it to ignore actually throws an error:
(Error while formatting: TypeError: Cannot read property 'startLine' of undefined)
- changing it to ignore actually throws an error:
Input
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
...
android:orientation="horizontal">
Current output
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
...
android:orientation="horizontal"
>
Expected output
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
...
android:orientation="horizontal" >
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Keep else, catch, on same line as closing bracket in Visual ...
Go to Tool -> Option then General -> Text editor -> C++ -> Formatting -> New lines . Choose the following settings:.
Read more >Option for closing brackets on the same line. · Issue #63 · etingof ...
Apache 2.2, which is the version of Apache on CentOS 6, sometimes allows syntax like: Where the final closing brackets are on the...
Read more >vue/html-closing-bracket-newline
People have their own preference about the location of closing brackets. This rule enforces a line break (or no line break) before tag's...
Read more >What is a good practice? Opening brace in the same line or in ...
There is a real 3rd option as well: On same line for choices, loops and such and on a new line for functions:...
Read more >coding style - Should curly braces appear on their own line?
When I was a student I used to put curly braces on the same line, ... very close to equal that the possible...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m coming back to this because prettier core is introducing the
bracketSameLine
option in2.4.0
(https://github.com/prettier/prettier/pull/11006). I’ll support that option in this plugin too once I get a minute to implement. If any of the folks on this issue want to send a PR that’d be great.I (think) I’m using v0.13.1 and this doesn’t seem to be implemented, I still get the XML closing bracket in a new line, which is annoying.