prettier / prettier/plugin-pug

Bug: Prettier errorneously removes semicolon in-between expressions

Open
#431 8 comments 1 reaction 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 v2.4.1
Prettier v2.8.3
Framework vue
Node v16
OS linux

Prettier config

{
    "printWidth": 120,
    "endOfLine": "lf",
    "tabWidth": 4,
    "singleQuote": true,
    "semi": false,
    "trailingComma": "all",
    "arrowParens": "avoid",
    "bracketSpacing": false,
    "vueIndentScriptAndStyle": true,
    "proseWrap": "never",
    "pugAttributeSeparator": "as-needed",
    "bracketSameLine": true,
    "pugSortAttributesBeginning": [
        "^(is|v-is)$",
        "^v-for$",
        "^(v-if|v-else-if|v-else|v-show|v-cloak)$",
        "^(v-once|v-pre)$",
        "^id$",
        "^ref$", "^key$", "^(v-slot|slot)$",
        "^v-model$",
        "^v-.+$"
    ],
    "pugSortAttributesEnd": [
        "^@.+$",
        "^v-on$",
        "^v-text$",
        "^v-html$"
    ],
    "pugSortAttributes": "asc"
}

Input

<template lang="pug">
input#dropzone.image-input(
        @drop.stop.prevent='onDrop($event.dataTransfer.files); dragging = false')
</template>

Output or Error

image

Expected Output

Should be unchanged

Additional Context

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 reported formatting with the provided Pug input, Vue template, and Prettier v2.8.3 configuration. Trace the plugin's Pug formatting path and compare the generated output with the unchanged expected input; done means the semicolon between expressions is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
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.