- Add support for arrow function inside
filter, map, reduce
filter
- Optimize test runner by defining where to look for test files
- NPM script alias to run
prettier
has been removed
- Drop compatibility support for prettier 2
- Plugin system has been removed from this project
- Package has been renamed
@zackad/prettier-plugin-twig-melody
->@zackad/prettier-plugin-twig
- The parser has been renamed from
melody
intotwig
- Add support attribute names according to html5 specs
- Remove npm script to publish
- Integrate devenv into nix flakes
- Incorporate
switch-plugin
into core functionality - Replace
jest
withvitest
as test runner
- BREAKING: Change package name
prettier-plugin-twig-melody
->@zackad/prettier-plugin-twig-melody
- Publish package as
@zackad/prettier-plugin-twig-melody
into npm registry
- BREAKING: Drop compatibility with prettier lower than 2.3.0. Use version 0.4.6 if you need to use prettier older than 2.3.0
- Fix compatibility with prettier 3
- Add CI configuration for github actions
- Add support for devenv.sh, nix based tools to manage development environment
- Explicitly declare prettier configuration as yaml file
- Fix eslint configuration to support ECMAScript 2017, allowing
async
function - Fix license name to use valid SPDX
- Remove deprecated function usage of
concat
fromprettier.doc.builders
. Enforce this policy with eslint plugineslint-plugin-prettier-doc
usingprettier-doc/no-concat
rule. - Upgrade devDependencies to latest compatible version
- Bug fix: Leave parentheses in place in
'classA' ~ (not needsB ? ' classB')
- Bug fix (Melody): Whitespace trimming information was lost when using a conditional expression
- Bug fix: Expand the list of HTML tags treated as "inline"
- Bug fix: Filter expression was not correctly interpolated in a string
- Bug fix: Remove hard-coded space at the beginning of Twig comments
- Bug fix: Preserve leading (non-newline) whitespace in inline IF statement body
- Fix issue #1: Non-standard (custom) Twig tags don't make the parser crash any more, and receive at least some default printing. Complex tags can be configured using the
twigMultiTags
option.
- Fix issue #32: Curly braces around a binary expression were lost when they were in fact needed.
- Bug fix/optimization: ArrayExpression was causing too many newlines
- Bug fix: Filter target was losing parentheses, which was altering the meaning (e.g., conditional expression)
- Bug fix: Expressions like
not (a and b)
lost the parentheses, thus changing the meaning of the expression.
- Bug fix: Optimize group structure when using
SetStatement
,VariableDeclarationStatement
, and logical binary expressions. Previously, the group created bySetStatement
had only one breaking point (before the closing%}
), which led to some undesirable results.
- Fix:
twigMelodyPlugins
option is finally an array, not a string separated by|
any more.
- Fix: Stylistic improvements
- Bug fix: Mount statement of the form
mount ... from ...
were dropping the source. Fixed now.
- Bug fix: No breaking point before closing
%}
forfor
,if
,set
.
- Issue #24: Take the string contents into account when choosing the quote characters surrounding a string literal.
- Issue #22: Add
twigOutputEndblockName
option so that you can choose whether to print the name in the{% endblock %}
tag or not.
- Issue #21: Always use double quotes around interpolated strings
- Improve printing of HTML and Twig comments
- Introduction of
prettier-ignore
functionality - Better adherence to Twig coding standards
- Avoid dropping of backslash in string literal: trivago#11
- Not crashing when facing declarations (
<!DOCTYPE html>
) any more
- Avoid extraneous line breaks for zero-argument call expressions: trivago#10
- "If" statements can be in one line now, under certain circumstances
- New option
twigAlwaysBreakObjects
- New option
twigPrintWidth
- All util functions are public now (available to plugins)
- Optimizations: Fewer line breaks in a lot of cases, less indentation
- Long HTML comments are re-wrapped now
- Respect operator precedence in binary expressions (especially boolean)
Various small bug fixes and cosmetic optimizations
- Empty block was causing an error. Does not an more.
- Uses Melody 1.5.0
- Trim left and trim right marks are preserved for Twig tags
{%- ... -%}
- Uses Melody 1.4.0
- Whitespace trimming is now suppressed
- Trim left and trim right marks are preserved for expressions
{{- ... -}}
- MacroDeclarationStatement: There was an extraneous space after the opening parenthesis
- Plugin loading: project root path was not always correctly determined
- Make use of new
melody-parser
capabilities:- Add comment printing
- Pass parser option to leave character entities undecoded
- Preserve HTML comments
- Fix issue #2, where all final newlines in a file were skipped. Now, there will be one final newline.
- Fix attribute printing in objects. Computed attributes are now surrounded by
(...)
. Keys that don't need quotes will not be quoted.