@@ -619,7 +619,10 @@ export function print(path: FastPath, options: ParserOptions, print: PrintFn): D
619619 return concat ( [
620620 'class:' ,
621621 node . name ,
622- node . expression . type === 'Identifier' && node . expression . name === node . name
622+ node . expression . type === 'Identifier' &&
623+ node . expression . name === node . name &&
624+ options . svelteAllowShorthand &&
625+ ! options . svelteStrictMode
623626 ? ''
624627 : concat ( [ '=' , ...printJsExpression ( ) ] ) ,
625628 ] ) ;
@@ -632,7 +635,7 @@ export function print(path: FastPath, options: ParserOptions, print: PrintFn): D
632635 : '' ,
633636 ] ;
634637
635- if ( isOrCanBeConvertedToShorthand ( node ) ) {
638+ if ( isOrCanBeConvertedToShorthand ( node ) || node . value === true ) {
636639 if ( options . svelteStrictMode ) {
637640 return concat ( [ ...prefix , '="{' , node . name , '}"' ] ) ;
638641 } else if ( options . svelteAllowShorthand ) {
@@ -641,10 +644,6 @@ export function print(path: FastPath, options: ParserOptions, print: PrintFn): D
641644 return concat ( [ ...prefix , '={' , node . name , '}' ] ) ;
642645 }
643646 } else {
644- if ( node . value === true ) {
645- return concat ( [ ...prefix ] ) ;
646- }
647-
648647 const quotes = ! isLoneMustacheTag ( node . value ) || options . svelteStrictMode ;
649648 const attrNodeValue = printAttributeNodeValue ( path , print , quotes , node ) ;
650649 if ( quotes ) {
0 commit comments