- 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
pugExplicitDiv
andpugClassNotation=attribute
(#405) - Add
pugPreserveAttributeBrackets
option (#404) - Replace
trimRight
withtrimEnd
(c955b9f)
- Avoid use
.
or circular dependency insrc/options
files (#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
funding
key 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
singleQuote
option more precisely (#45)- for some configurations, this could be a "breaking" change
- Treat
v-t
from 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.pugAttributeSeparator
instead ofattributeSeparator
- Replace
pugClosingBracketPosition
withpugBracketSameLine
(#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
pugTabWidth
for calculating line length (#268)
- Preserve backticks for
class
andid
attributes (#261) - Apply
useTabs
also 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 fixespugSingleFileComponentIndentation
option in combination with prettier v2.3
- Handle
v-bind
expression separately (4827855)
- Same as
1.15.0
but withdist
folder (#211)
- Handle
svelte
syntax (#201) - Support bracket spacing for
interpolated-code
token (#208) - Fix invalid added
;
in front of template string (#206)
- New Documentation 📝
- New
pugFramework
option (#186) - Add
'attribute'
choice topugClassNotation
(#203)
Useful for e.g. Tailwind CSS / Windi CSS - Handle autocloseable tag with trailing text correctly (#182)
- Handle
v-slot
expression correctly (#180)
- Fix attribute interpolation using quotes (#179)
- Handle
v-on
expression separately (#176)
- Fix blank lines in inline syntax (#171)
- Set
prettier
peer dependency to>= 2.1.0
(#168) - Handle error thrown by interpolated code in pipeless script tag (#169)
- Option for disabling formatting of
class
andid
literals (#36) - Switching from
master
tomain
branch (#166)
- Format value of
style
attribute in tags (#162)
- Handle
for...of
in vuev-for
(#129) - Support embedded formatting of inline
script
andstyle
tags (#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
pugEmptyAttributes
andpugEmptyAttributesForceQuotes
option (#128) - Improve warning message (#143, c0319bf)
- Implement
pugWrapAttributesThreshold
option (#118) - Implement
pugWrapAttributesPattern
option (#126) - Support
//- prettier-ignore
comments 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
pugSortAttributesBeginning
andpugSortAttributesEnd
(#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:
pugPrintWidth
pugSingleQuote
pugTabWidth
pugUseTabs
pugBracketSpacing
pugSemi
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
bracketSpacing
option for attributes (#103)
- Support
bracketSpacing
option (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-lexer
to5.0.0
Support new tokeneachOf
- Introduce new option
closingBracketPosition
(#82)
Possible values:new-line
andlast-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
id
andclass
attributes (#63) -
Some minor internal changes like
- Fix wrapping of framework bindings (#61)
- Fix valid backslash escaping (#59)
- Transform only valid
id
attributes (#51) - Indent interpolated-code after outdent (#52)
- Suggest workarounds in README.md (8d69f1e, 58157f6)
- Fix space after
id
followed byinterpolated
code (#49)
- Introduce new option
commentPreserveSpaces
(#47)
Possible values:keep-all
,keep-leading
andtrim-all
- Handle
yield
token (94fdc0c) - Handle
slash
token (194f103) - Dont format
code
if formatter produces error (e105bae) - Dont format
code
is multiline (49b4b4c) - Fix code slicing (8478562)
- Fix whitespace issues (b7d26c7)
- Fix whitespace after
interpolation
andcall
(7670ade) - Fix whitespace after
filter
token (4ac7812) - Fix missing
key
foreach
token (aff4969) - Fix whitespace before
start-pug-interpolation
token (09e96a3) - Fix escaping of non-interpolated
text
(e5c3944) - Fix only text body (c32a8d1)
- Fix indent after newline for
interpolated-code
token (bfb90c6) - Fix partial quoted surrounded
attribute
token (20be986)
- Handle
else if
token (#38) - Handle
interpolation
token (#39) - Handle
blockcode
token (#40) - Handle
mustEscape
forinterpolated-code
token (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 thesemi
attribute and set it tofalse
, if semicolons are not wanted
- Move
prettier
todevDependencies
(#37) - Some minor changes like
- formatting
- using TS 3.7 optional chaining
- output test coverage
- Handle
while
andcase
token (#34)
- Handle
mustEscape
for bufferedcode
token (#31) - Updated README.md
- Handle
each
token (#29)
- Fix handling with
interpolated-code
token (#27)
- Handle
text-html
token (#24)
- Format Vue
v-slot
- Fix spaces around interpolated tags (#20)
- Fix indent for
include
(#18) - Fix space after
doctype
if 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:always
andas-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
singleQuote
option - 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
code
if 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-code
token -
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