-
-
Notifications
You must be signed in to change notification settings - Fork 44
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: Missing semicolon after 'echo' (php in jade) #257
Comments
The pug lexer can parse this somehow and returns [
{"type":"code","loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":34}},"val":"echo get_field(\"hero_content\");","mustEscape":false,"buffer":false},
{"type":"newline","loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":1}}},
{"type":"eos","loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":1}}}
] As you can see it recognize the hot part as type code I think it is maybe a deprecated feature from jade? If so I will not support it 🙁 sorry for that. Otherwise please provide my
Nevertheless, it seems that this just produces a warning and not an error, so I assume the rest of the file gets formatted as wanted? So maybe you need to life with that and just ignore the warnings 🤔 |
I'm compiling the jade files to PHP via gulp and gulp-jade-php. The echo statement comes from vanilla PHP and prints the result of the get_field() function which is simply a string. Another equivalent example would be a simple line of - require '/test.php'; But I'm getting the feeling that this wasn't meant for php to begin with |
I am really sad that I cannot help you from my part, cause IMO this is not only the special case of the deprecated usage of jade, but also the assumption that php is involved but js syntax is assumed. Feel free to close this issue or discuss further with me about how I can help you 🙂 |
Info
Prettier config
Input
- echo get_field("hero_content");
Output or Error
missing semicolon after 'echo'
Expected Output
no error
Additional Context
I don't know if it makes a difference, but I am using this plugin with .jade as the file extension (rather than .pug).
When running
npx prettier --write "./_jade/front-page.jade"
I am seeing the error. There should NOT be a semicolon after echo.PS: Same thing happens with '- require ...'
The text was updated successfully, but these errors were encountered: