- Followup for: Handle unexpected missing block SyntaxError when parsing unbuffered code (#600)
- Handle unexpected missing block SyntaxError when parsing unbuffered code (#600)
- Handle TS syntax in vue context (#365)
- Enhance quotation of variable formatting (#512)
- Enhance quotation of vue v-bind (#531)
- Add
pugPreserveWhitespaceoption (#567)
- Fix special case for escaped double quotes in Vue expressions (#529)
- Multiple fixes for class attribute conversions (#509)
- Add option to set indent depth of closing brackets (#502)
- Fix class attributes not counting towards attribute wrapping (#503)
Dropped support for Prettier v2 and CJS (#458)
If you are using Prettier v2 / CJS, you need to stay on 2.5.2.
This version does not contain any changes to the plugin itself, but only internal changes to the docs, build and CI.
This might be the last version that supports Prettier v2 as well as CJS.
The next version will probably the v3 release and will only support Prettier v3 and ESM.
- Fix whitespace in interpolations (#447)
- Dropped support for node v14 (#441)
- Fix trailing whitespace after class (#442)
- No changes, just an update to TypeScript v5 and therefore possibly better emitted code.
- Omit leading semicolon in code expressions (#428)
- Transform trailing whitespace to recommended way (#417)
- Preserve script tag after
//- prettier-ignore(#402) - Fix indent with
pugExplicitDivandpugClassNotation=attribute(#405) - Add
pugPreserveAttributeBracketsoption (#404) - Replace
trimRightwithtrimEnd(c955b9f)
- Avoid use
.or circular dependency insrc/optionsfiles (#398)
- Rework logging (#172)
- Update docs to VitePress v1 (alpha)
- Known issue: The "Get Started" link is not working correctly right now.
Click on "Guide" in the upper right nav menu for now.
- Known issue: The "Get Started" link is not working correctly right now.
- Dropped support for node v12 (faf9f2e)
- Handle vue
v-directives when framework is set to vue (#362)
- Fix single quotes in framework interpolation (#339)
- Add
fundingkey to package.json (#350)
- Handle nested Angular translations (#329)
at least don't fail for now
- Handle colon token in combination with
pugClassLocation: 'after-attributes'(#326)
- New option
pugClassLocation(#313)
- Handle
singleQuoteoption more precisely (#45)- for some configurations, this could be a "breaking" change
- Treat
v-tfrom vue-i18n as Vue expression (#310)
- Fix indentation issue of inline javascript (#307)
- Add type definitions that can be used in
.prettierrc.cjs
- Remove non prefixes options (#295)
You now need to use e.g.pugAttributeSeparatorinstead ofattributeSeparator - Replace
pugClosingBracketPositionwithpugBracketSameLine(#291)
- Preserve escaped quotes within bindings (#303)
- Fix handling of
prettier-ignore(#292)
- Handle Vue slot shorthand formatting (#289)
- Fix indentation of templates starting with class or ID when using
pugSingleFileComponentIndentation(#282)
- Fix trailing indentations after pipeless text (#278)
- Use
pugTabWidthfor calculating line length (#268)
- Preserve backticks for
classandidattributes (#261) - Apply
useTabsalso for code interpolations (#262)
- Prevent wrong quotation (#255)
- New option
pugExplicitDiv(#241) - Ignore formatting for single line interpolated attributes (#238)
- Handle non-JS script content (#244)
- Fix corrupt attribute values on dynamically bound Vue props without quotes (#250)
- Upgrade to Prettier v2.3
This fixespugSingleFileComponentIndentationoption in combination with prettier v2.3
- Handle
v-bindexpression separately (4827855)
- Same as
1.15.0but withdistfolder (#211)
- Handle
sveltesyntax (#201) - Support bracket spacing for
interpolated-codetoken (#208) - Fix invalid added
;in front of template string (#206)
- New Documentation 📝
- New
pugFrameworkoption (#186) - Add
'attribute'choice topugClassNotation(#203)
Useful for e.g. Tailwind CSS / Windi CSS - Handle autocloseable tag with trailing text correctly (#182)
- Handle
v-slotexpression correctly (#180)
- Fix attribute interpolation using quotes (#179)
- Handle
v-onexpression separately (#176)
- Fix blank lines in inline syntax (#171)
- Set
prettierpeer dependency to>= 2.1.0(#168) - Handle error thrown by interpolated code in pipeless script tag (#169)
- Option for disabling formatting of
classandidliterals (#36) - Switching from
mastertomainbranch (#166)
- Format value of
styleattribute in tags (#162)
- Handle
for...ofin vuev-for(#129) - Support embedded formatting of inline
scriptandstyletags (#158)
If there are problems, please create an issue
- Fix handling of initial indentation for
pugSingleFileComponentIndentation(#145) - Fix bracket interpolation in combination with
pugSingleFileComponentIndentation(#148) - Do not wrap attributes in enclosed code interpolation (#149)
- Print warning for parsed object shorthand notation (#147)
- Add
'pug'tovscodeLanguageIds(#150)
- Implement
pugEmptyAttributesandpugEmptyAttributesForceQuotesoption (#128) - Improve warning message (#143, c0319bf)
- Implement
pugWrapAttributesThresholdoption (#118) - Implement
pugWrapAttributesPatternoption (#126) - Support
//- prettier-ignorecomments inside pug templates (#125) - Add middle attributes sorting (#120)
- Fix counting of current line-length (#121)
- Fix handling of literal attributes (#130)
- Add @lehni and @SkyaTura as contributors
- Support sorting of attributes with
pugSortAttributesBeginningandpugSortAttributesEnd(#22)
Example
This feature was planned since1.2.0, but it was always a bit unstable and opinionated.
If there are any bugs, please report them. - Pass more prettier code-interpolation options (#117)
- Allow "none" as an option for attributeSeparator (#102)
- Improve warning message (03777f5)
- Fix wrapped attribute multiline code indentation (5a6082c)
This plugin now supports alias options!
You can configure pug embedded in vue with them 🎉
So instead of
{
"singleQuote": true,
"overrides": [
{
"files": ["*.pug"],
"options": {
"singleQuote": false
}
}
]
}you can now write
{
"singleQuote": true,
"pugSingleQuote": false
}Aliases added for:
pugPrintWidthpugSingleQuotepugTabWidthpugUseTabspugBracketSpacingpugSemi
Because prettier currently have something like a bug, you need to set e.g. "pugSingleQuote": "true" instead of "pugSingleQuote": true, if you want to set it to true
This needs to be done only for boolean true values
If an alias is not set, the plugin will fallback to the non alias version
And in the special case of singleQuote option will take the inverse as before
So no breaking changes are introduced
- Fix escape id for complex id values (559ee6d)
- Fix indentation of objects in multiline class attributes (#110)
- Support
bracketSpacingoption for attributes (#103)
- Support
bracketSpacingoption (only text-token) (#98)
- Trim input on left side (#97)
- Fix sorting of occurring id behind classes (#95)
- Ignore formatting of interpolation attribute values (#94)
- Fix indentation in multi-line blank lines (#89)
- Fix semi in code interpolation (#85)
- Upgrade
pug-lexerto5.0.0
Support new tokeneachOf
- Introduce new option
closingBracketPosition(#82)
Possible values:new-lineandlast-line
- Support Prettier v2 (Prettier v1 is no longer supported, use v1.1.11)
Minor change:
//- Input
v-btn(@click="toggle = !toggle")
//- Output (1.1.11)
v-btn(@click="(toggle = !toggle)")
//- Output (1.2.0)
v-btn(@click="toggle = !toggle")- Just a dependency update
- Suppress formatting for Angular if there is more than one binding within an attribute value (#78)
- Support more Vue expressions (
v-if,v-else-if,v-for,v-text,v-html) (b671027)
- Improve accuracy of
printWidth(0ffe395)
- Calculate correct line width (26fefff)
- Fix indentation for
doctype(51d3860) - Handle Angular pipe with parameter (#70)
- Handle space for indented
text(#74)
- Fix handling of classes (#72)
- Improve handling of Angular attribute values (#67, #68)
- Restructure internal code
- Add issue templates
-
Improve handling of
idandclassattributes (#63) -
Some minor internal changes like
- Fix wrapping of framework bindings (#61)
- Fix valid backslash escaping (#59)
- Transform only valid
idattributes (#51) - Indent interpolated-code after outdent (#52)
- Suggest workarounds in README.md (8d69f1e, 58157f6)
- Fix space after
idfollowed byinterpolatedcode (#49)
- Introduce new option
commentPreserveSpaces(#47)
Possible values:keep-all,keep-leadingandtrim-all
- Handle
yieldtoken (94fdc0c) - Handle
slashtoken (194f103) - Dont format
codeif formatter produces error (e105bae) - Dont format
codeis multiline (49b4b4c) - Fix code slicing (8478562)
- Fix whitespace issues (b7d26c7)
- Fix whitespace after
interpolationandcall(7670ade) - Fix whitespace after
filtertoken (4ac7812) - Fix missing
keyforeachtoken (aff4969) - Fix whitespace before
start-pug-interpolationtoken (09e96a3) - Fix escaping of non-interpolated
text(e5c3944) - Fix only text body (c32a8d1)
- Fix indent after newline for
interpolated-codetoken (bfb90c6) - Fix partial quoted surrounded
attributetoken (20be986)
- Handle
else iftoken (#38) - Handle
interpolationtoken (#39) - Handle
blockcodetoken (#40) - Handle
mustEscapeforinterpolated-codetoken (d8f6446) - Add support for
unless(ca0b537) - Improve formatting of code attribute (47c0355, d6c896c)
- Apply semicolons correctly (48c58b8)
This could lead to a slight change
You can override thesemiattribute and set it tofalse, if semicolons are not wanted
- Move
prettiertodevDependencies(#37) - Some minor changes like
- formatting
- using TS 3.7 optional chaining
- output test coverage
- Handle
whileandcasetoken (#34)
- Handle
mustEscapefor bufferedcodetoken (#31) - Updated README.md
- Handle
eachtoken (#29)
- Fix handling with
interpolated-codetoken (#27)
- Handle
text-htmltoken (#24)
- Format Vue
v-slot
- Fix spaces around interpolated tags (#20)
- Fix indent for
include(#18) - Fix space after
doctypeif there is no value
- No real changes to
1.0.0-alpha.11
- Fix preceding div if there is a normal class attribute
- Improve interpolation in text and bindings
- Introduce new option
attributeSeparator(#13)
Possible values:alwaysandas-needed
- Correct quotes for Angular attributes (#10)
- Support mixins (#11)
- Fix some issues with indentation
- Fix buffered attributes
- Suppress log output in production
- Support for wrap after
printWidth(#8)
Currently not very accurate, but works
- Fix indentation for comments
- Improve indentation for tags
- Support
singleQuoteoption - Setup eslint with TypeScript configuration (#4)
- Setup Azure Pipelines
- Fix indentation of piped text
- Fix indentation after
outdent
-
Improvement of indents, empty lines and spaces
-
Keep indent for
codeif wanted//- Input block page_meta - var page_title = "Markdown" - var page_description = "This is a page description." //- Output (1.0.0-alpha.2) block page_meta - var page_title = "Markdown" - var page_description = "This is a page description." //- Output (1.0.0-alpha.3) block page_meta - var page_title = "Markdown" - var page_description = "This is a page description."
-
Correct some unnecessary blank lines
-
Correct a missing whitespace after
interpolated-codetoken -
Handle new Tokens
-
Improve space formatting
Use recommended solutions link
//- Input v-btn(color="primary", name="save", @click="save", :disabled="saving", :loading="saving") v-icon save | {{ $t('mylangkeys.crud.save') }} //- Output (1.0.0-alpha.1) v-btn(color="primary", name="save", @click="save", :disabled="saving", :loading="saving") v-icon save | {{ $t('mylangkeys.crud.save') }} //- Output (1.0.0-alpha.2) v-btn(color="primary", name="save", @click="save", :disabled="saving", :loading="saving") v-icon save | | {{ $t('mylangkeys.crud.save') }}
- Initial alpha release