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

Bug: Plugin throws error when parsing object shorthand notation #147

Closed
lephuongbg opened this issue Oct 28, 2020 · 2 comments · Fixed by #155
Closed

Bug: Plugin throws error when parsing object shorthand notation #147

lephuongbg opened this issue Oct 28, 2020 · 2 comments · Fixed by #155
Assignees
Labels
framework: Vue Related to the framework Vue type: enhancement Functionality that enhances existing features

Comments

@lephuongbg
Copy link

Info

Tool Version
Plugin v1.10.0
Prettier v2.1.2
Node v14.8.0
OS linux

Input

//- template.vue
span {{$t(expanded ? "panel_title_without_title" : "panel_title", {index: index + 1, title})}}

Output or Error

[PugPrinter:formatText]:  SyntaxError: Missing expected :
    at i (/var/app/web/node_modules/prettier/parser-angular.js:46:16461)
    at e.parseNgInterpolation (/var/app/web/node_modules/prettier/parser-angular.js:46:17640)
    at s (/var/app/web/node_modules/prettier/parser-angular.js:46:28364)
    at Object.e.parseInterpolation (/var/app/web/node_modules/prettier/parser-angular.js:46:28664)
    at /var/app/web/node_modules/prettier/parser-angular.js:46:29282
    at Object.parse (/var/app/web/node_modules/prettier/parser-angular.js:46:28970)
    at Object.parse (/var/app/web/node_modules/prettier/index.js:13575:19)
    at coreFormat (/var/app/web/node_modules/prettier/index.js:14851:25)
    at format (/var/app/web/node_modules/prettier/index.js:15073:14)
    at formatWithCursor (/var/app/web/node_modules/prettier/index.js:15090:12)

Expected Output

//- template.vue
span {{$t(expanded ? "panel_title_without_title" : "panel_title", {index: index + 1, title})}}

Additional Context

The output seems to be fine (as may be it was kept as-is without any changes, not really sure)

@Shinigami92
Copy link
Member

I'm sorry to inform you that I will probably not have time until the weekend to keep working on it

@Shinigami92 Shinigami92 self-assigned this Oct 31, 2020
@Shinigami92 Shinigami92 added framework: Vue Related to the framework Vue type: enhancement Functionality that enhances existing features labels Oct 31, 2020
@Shinigami92
Copy link
Member

I have shortened the warning like some others
This has now been released 1.10.1
Thank you for using my plugin and for being part of the pug community 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework: Vue Related to the framework Vue type: enhancement Functionality that enhances existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants