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

Catch and format SyntaxErrors as eslint violations #141

Merged
merged 2 commits into from Dec 28, 2018

Conversation

BPScott
Copy link
Member

@BPScott BPScott commented Dec 28, 2018

If Prettier can't format a file due to not being able to parse the given
content it throws a SyntaxError. If that happens then announce the
error as an ESLint rule violation instead of crashing.

The most plausible form of SyntaxErrors are when vue files contain invalid HTML such as no self-closing tags (e.g. <template><div></template> is invalid due to there being no </div>

Fixes #140.

If Prettier can't format a file due to not being able to parse the given
content it throws a SyntaxError. If that happens then announce the
error as an ESLint rule violation instead of crashing.
@BPScott BPScott merged commit 4a0e57d into master Dec 28, 2018
@BPScott BPScott deleted the report-syntax-errors branch December 28, 2018 07:12
@BPScott
Copy link
Member Author

BPScott commented Dec 28, 2018

@not-an-aardvark I've not got npm access to publish. Would you be able to push out a new version when you find the time (no rush, go enjoy your Christmas holidays!)

@not-an-aardvark
Copy link
Member

Sure, just published as v3.0.1.

@BPScott
Copy link
Member Author

BPScott commented Dec 28, 2018

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants