-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Html: Enable jsxBracketSameLine option for html (fixes #5377) #9936
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`last_line.html - {"jsxBracketSameLine":false} format 1`] = ` | ||
====================================options===================================== | ||
jsxBracketSameLine: false | ||
parsers: ["html"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
<article | ||
id="electriccars" | ||
data-columns="3" | ||
data-index-number="12314" | ||
data-parent="cars">...</article> | ||
<span | ||
id="electriccars" | ||
data-columns="3" | ||
data-index-number="12314" | ||
data-parent="cars">...</span> | ||
|
||
=====================================output===================================== | ||
<article | ||
id="electriccars" | ||
data-columns="3" | ||
data-index-number="12314" | ||
data-parent="cars" | ||
> | ||
... | ||
</article> | ||
<span | ||
id="electriccars" | ||
data-columns="3" | ||
data-index-number="12314" | ||
data-parent="cars" | ||
>...</span | ||
> | ||
|
||
================================================================================ | ||
`; | ||
|
||
exports[`last_line.html - {"jsxBracketSameLine":true} format 1`] = ` | ||
====================================options===================================== | ||
jsxBracketSameLine: true | ||
parsers: ["html"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
<article | ||
id="electriccars" | ||
data-columns="3" | ||
data-index-number="12314" | ||
data-parent="cars">...</article> | ||
<span | ||
id="electriccars" | ||
data-columns="3" | ||
data-index-number="12314" | ||
data-parent="cars">...</span> | ||
|
||
=====================================output===================================== | ||
<article | ||
id="electriccars" | ||
data-columns="3" | ||
data-index-number="12314" | ||
data-parent="cars"> | ||
... | ||
</article> | ||
<span | ||
id="electriccars" | ||
data-columns="3" | ||
data-index-number="12314" | ||
data-parent="cars" | ||
>...</span | ||
> | ||
|
||
================================================================================ | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
run_spec(__dirname, ["html"], { jsxBracketSameLine: true }); | ||
run_spec(__dirname, ["html"], { jsxBracketSameLine: false }); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<article | ||
id="electriccars" | ||
data-columns="3" | ||
data-index-number="12314" | ||
data-parent="cars">...</article> | ||
<span | ||
id="electriccars" | ||
data-columns="3" | ||
data-index-number="12314" | ||
data-parent="cars">...</span> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be
bracketSameLine
or other name, notjsxBracketSameLine
, becausejsx
is nothtml
, I would advise to do:First PR.
jsxBracketSameLine
we will try value ofbracketSameLine
, if still nothing, use default valueSecond PR.
Third PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I addressed the naming issue in my post above. The eventual goal is that there is only one option, right? with
jsxBracketSameLine
being either a synonym ofangleBracketSameLine
(or whatever it is called) or deprecated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @prettier/core
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need rename
jsxBracketSameLine
first. Then apply to html .There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me look into a different pull request that starts with a rename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would a pull request for a rename include renaming in all the tests and docs? Should there be references to the old name in the docs? What section does the new option go in, now that it applies to both javascript AND html? Just trying to figure out what I need to submit here to get the ball rolling.
also, @alexander-akait , you wrote:
I think we could simplify that to "If a developer sets either of the settings to true, we print the bracket on the same line." The default is false, and we don't want to inadvertently create a new option here by treating jsxBracketSameLine differently from angleBracketSameLine. We are renaming an old option, not adding a new one.