This website requires JavaScript.
Explore
Help
Sign In
vitalif
/
prettier
Watch
1
Star
0
Fork
You've already forked prettier
0
Code
Issues
Pull Requests
Releases
Wiki
Activity
58350cbe59
prettier
/
tests
/
return-outside-function
/
jsfmt.spec.js
2 lines
60 B
JavaScript
Raw
Normal View
History
Unescape
Escape
(Babylon) Allow `return` outside function (#1608) This makes it easier to format code snippets including a `return` statement, without having to format the entire function. For example, given the following code: ```js function f() { return someVeryLongStringA && someVeryLongStringB && someVeryLongStringC && someVeryLongStringD } ``` a developer could select the line containing `return`, then use prettier to format the code to: ```js function f() { return ( someVeryLongStringA && someVeryLongStringB && someVeryLongStringC && someVeryLongStringD ); } ``` which can then be reindented by the editor. --- Related to https://github.com/prettier/prettier/issues/593
2017-05-15 00:45:33 +03:00
run
_spec
(
_
_dirname
,
{
parser
:
"babylon"
}
,
[
"typescript"
]
)
;