Automattic / wp-prettier

Prettier is an opinionated JavaScript formatter.
https://prettier.github.io/prettier/
MIT License
51 stars 1 forks source link

Inconsistent Whitespace Inside Template Strings After the Upgrade to 2.0.4 #19

Closed porada closed 4 years ago

porada commented 4 years ago

After the upgrade to WP Prettier 2.0.4, I’m getting inconsistent whitespace padding inside template strings:

--- a/src/blocks/sections/hero/html/heading.js
+++ b/src/blocks/sections/hero/html/heading.js
@@ -16,7 +16,7 @@ export default ( { className, children, isImagePresent } ) => {
                'glp-text-brand',
                'glp-text-32',
                'glp-text-40@S',
-               `glp-text-${ isImagePresent ? 56 : 64 }@M`,
+               `glp-text-${ isImagePresent ? 56 : 64}@M`,
                'glp-color-primary',
                className,
        ] );

The same happens to all other template strings in the project.

Input

`glp-text-${ isImagePresent ? 56 : 64 }@M`

Output

`glp-text-${ isImagePresent ? 56 : 64}@M`

Expected behavior

// The previous behavior, consistent with WP standards:
`glp-text-${ isImagePresent ? 56 : 64 }@M`

// This one would also be fine with me:
`glp-text-${isImagePresent ? 56 : 64}@M`
sirreal commented 4 years ago

@Automattic/team-calypso Can y'all help out with this one?