Skip to content

[Update] Improve the range of mustache-interpolation-spacing #276

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

Merged
merged 2 commits into from
Dec 3, 2017

Conversation

mysticatea
Copy link
Member

@mysticatea mysticatea commented Dec 2, 2017

This PR improves the range of vue/mustache-interpolation-spacing errors.

It's currently:

image
Playground

I feel that this is confused a bit because the editor indicates that the errors exist on the identifier foo. (As a side note, this demo's editor is same as VSCode's, Microsoft/monaco-editor.) So I changed the range of the errors by:

image

The new range of the errors is on {{ and }}.

@mysticatea mysticatea requested a review from michalsnik December 2, 2017 10:31
@michalsnik michalsnik changed the title Fix: improve the range of mustache-interpolation-spacing [Fix] Improve the range of mustache-interpolation-spacing Dec 2, 2017
Copy link
Member

@michalsnik michalsnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment. Other than that LGTM 👍 Good change

const openBrace = template.getFirstToken(node)
const closeBrace = template.getLastToken(node)

if (!openBrace || !closeBrace || openBrace.type !== 'VExpressionStart' || closeBrace.type !== 'VExpressionEnd') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please wrap those into multiple lines? It'd be easier to read :)

@michalsnik michalsnik changed the title [Fix] Improve the range of mustache-interpolation-spacing [Update] Improve the range of mustache-interpolation-spacing Dec 2, 2017
@mysticatea
Copy link
Member Author

Done!

@michalsnik michalsnik merged commit 3137c1f into master Dec 3, 2017
@michalsnik michalsnik deleted the mustache-interpolation-spacing/improve-range branch December 3, 2017 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants