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
/
range_json
/
issue2297.json
2 lines
65 B
JSON
Raw
Normal View
History
Unescape
Escape
Allow formatting ranges of JSON (#2298) * Add test for https://github.com/prettier/prettier/issues/2297 * Add JSON types to isSourceElement() See https://github.com/prettier/prettier/issues/2297 * Avoid expanding format range when possible This fixes https://github.com/prettier/prettier/issues/2297 * Move JSON range test into tests/range_json This is so that the AST_COMPARE=1 tests don't try to parse JSON with Flow. * Check parser in isSourceElement() Otherwise JSON formatting would format weird things inside of JS. See https://github.com/prettier/prettier/pull/2298#discussion_r124407056 * Use arrow functions instead of .bind() See https://github.com/prettier/prettier/pull/2298#discussion_r124409783 * Add test of range-formatting JSON identifier See https://github.com/prettier/prettier/pull/2298/files#r124410750 * Allow range-formatting JSON identifier See https://github.com/prettier/prettier/pull/2298/files#r124410750 * Fix lint
2017-06-28 02:04:42 +03:00
{
"a"
:
<
<
<
P
R
E
T
T
I
E
R
_
R
A
N
G
E
_
S
T
A
R
T
>
>
>
1
<
<
<
P
R
E
T
T
I
E
R
_
R
A
N
G
E
_
E
N
D
>
>
>
,
"b"
:
2
}