* 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
2 lines
65 B
JSON
2 lines
65 B
JSON
{<<<PRETTIER_RANGE_START>>>"a"<<<PRETTIER_RANGE_END>>>:1, "b":2}
|