-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
area:rangesIssues about formatting/ignoring/etc segments of filesIssues about formatting/ignoring/etc segments of fileslang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken
Description
Environments:
- Prettier Version: 1.18.2
- Running Prettier via: CLI
- Runtime: Node 10
- Operating System: MacOS
Steps to reproduce:
echo "'aaa';\n'bbb';" | prettier --range-start 0 --range-end 1 --parser babel
'aaa';
'bbb';
Expected behavior:
Following behavior is currently documented:
The range will extend:
Backwards to the start of the first line containing the selected statement.
Forwards to the end of the selected statement.
So it should format only first quotes.
In fact there is no range I can specify so only first quote is formatted.
Actual behavior:
It formats both quotes
Additional notes:
The first range that results in formatting of both quotes is following:
echo "'aaa';\n'bbb';" | prettier --range-start 0 --range-end 14 --parser babel
"aaa";
"bbb";
Strangely nothing is formatted when range-start is 1 (again, against what is documented):
echo "'aaa';\n'bbb';" | prettier --range-start 1 --range-end 14 --parser babel
'aaa';
'bbb';
Metadata
Metadata
Assignees
Labels
area:rangesIssues about formatting/ignoring/etc segments of filesIssues about formatting/ignoring/etc segments of fileslang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:needs discussionIssues needing discussion and a decision to be made before action can be takenIssues needing discussion and a decision to be made before action can be taken