prettier / prettier/plugin-pug

Bug: Missing semicolon after 'echo' (php in jade)

Open
#257 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
208
Forks
49
Avg merge
4h 26m
Merged PRs (30d)
8

Description

Info

Tool Version
Plugin v1.16.1
Prettier v2.3.2
Framework none
Node v16.5
OS win

Prettier config

{
    "endOfLine": "crlf",
    "printWidth": 100,
    "proseWrap": "always",
    "singleQuote": true,
    "tabWidth": 4
}

Input

- echo get_field("hero_content");

Output or Error

missing semicolon after 'echo'

SyntaxError: Missing semicolon. (1:5)
> 1 | echo get_field("hero_content"); 

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 ...'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the error with the provided - echo get_field("hero_content"); input, the .jade extension, and npx prettier --write "./_jade/front-page.jade". Start by tracing how the plugin parses echo and require in this Pug/Jade context; done means the input formats without the reported missing-semicolon error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, pug, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.