Skip to content
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

Range formatting a white-space throws. #2247

Closed
CiGit opened this issue Jun 24, 2017 · 2 comments
Closed

Range formatting a white-space throws. #2247

CiGit opened this issue Jun 24, 2017 · 2 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Comments

@CiGit
Copy link
Member

CiGit commented Jun 24, 2017

echo " " | prettier --range-start 1 --range-end 2
TypeError: Cannot read property 'node' of undefined

Expected:
Not an error at least, same output or striped selected white-spaces

@vjeux
Copy link
Contributor

vjeux commented Jun 24, 2017

cc @josephfrazier

josephfrazier added a commit to josephfrazier/prettier that referenced this issue Jun 24, 2017
josephfrazier added a commit to josephfrazier/prettier that referenced this issue Jun 24, 2017
vjeux pushed a commit that referenced this issue Jun 24, 2017
* Add failing test for range-formatting whitespace

See #2247 (comment)

* Return original input when specified range is unformattable

Fixes #2247
@josephfrazier
Copy link
Collaborator

Thanks for the report, @CiGit! I think that using the original input is the correct thing to do in this case, so I opened #2250 with a fix.

@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 7, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests

3 participants