@@ -106,7 +106,11 @@ function transformDynamicJsAttribute(attr: any, env: TransformerEnv) {
106106 )
107107 }
108108
109- function addChange ( start : number | null | undefined , end : number | null | undefined , after : string ) {
109+ function addChange (
110+ start : number | null | undefined ,
111+ end : number | null | undefined ,
112+ after : string ,
113+ ) {
110114 if ( start == null || end == null ) return
111115
112116 let offsetStart = start - expressionPrefix . length
@@ -1038,7 +1042,7 @@ type HtmlNode =
10381042let html = defineTransform < HtmlNode > ( {
10391043 staticAttrs : [ 'class' ] ,
10401044
1041- load : [ 'prettier/plugins/html' ] ,
1045+ load : [ { name : 'prettier/plugins/html' , importer : ( ) => import ( 'prettier/plugins/html' ) } ] ,
10421046 compatible : [ 'prettier-plugin-organize-attributes' ] ,
10431047
10441048 parsers : {
@@ -1060,7 +1064,7 @@ type GlimmerNode =
10601064
10611065let glimmer = defineTransform < GlimmerNode > ( {
10621066 staticAttrs : [ 'class' ] ,
1063- load : [ 'prettier/plugins/glimmer' ] ,
1067+ load : [ { name : 'prettier/plugins/glimmer' , importer : ( ) => import ( 'prettier/plugins/glimmer' ) } ] ,
10641068
10651069 parsers : {
10661070 glimmer : { } ,
@@ -1110,15 +1114,46 @@ let js = defineTransform<import('@babel/types').Node>({
11101114 'babel-flow' : { load : [ prettierParserBabel ] } ,
11111115 'babel-ts' : { load : [ prettierParserBabel ] } ,
11121116 __js_expression : { load : [ prettierParserBabel ] } ,
1113- typescript : { load : [ 'prettier/plugins/typescript' ] } ,
1114- meriyah : { load : [ 'prettier/plugins/meriyah' ] } ,
1115- acorn : { load : [ 'prettier/plugins/acorn' ] } ,
1116- flow : { load : [ 'prettier/plugins/flow' ] } ,
1117- oxc : { load : [ '@prettier/plugin-oxc' ] } ,
1118- 'oxc-ts' : { load : [ '@prettier/plugin-oxc' ] } ,
1119- hermes : { load : [ '@prettier/plugin-hermes' ] } ,
1117+ typescript : {
1118+ load : [
1119+ {
1120+ name : 'prettier/plugins/typescript' ,
1121+ importer : ( ) => import ( 'prettier/plugins/typescript' ) ,
1122+ } ,
1123+ ] ,
1124+ } ,
1125+ meriyah : {
1126+ load : [
1127+ { name : 'prettier/plugins/meriyah' , importer : ( ) => import ( 'prettier/plugins/meriyah' ) } ,
1128+ ] ,
1129+ } ,
1130+ acorn : {
1131+ load : [ { name : 'prettier/plugins/acorn' , importer : ( ) => import ( 'prettier/plugins/acorn' ) } ] ,
1132+ } ,
1133+ flow : {
1134+ load : [ { name : 'prettier/plugins/flow' , importer : ( ) => import ( 'prettier/plugins/flow' ) } ] ,
1135+ } ,
1136+ oxc : {
1137+ load : [ { name : '@prettier/plugin-oxc' , importer : ( ) => import ( '@prettier/plugin-oxc' ) } ] ,
1138+ } ,
1139+ 'oxc-ts' : {
1140+ load : [ { name : '@prettier/plugin-oxc' , importer : ( ) => import ( '@prettier/plugin-oxc' ) } ] ,
1141+ } ,
1142+ hermes : {
1143+ load : [
1144+ { name : '@prettier/plugin-hermes' , importer : ( ) => import ( '@prettier/plugin-hermes' ) } ,
1145+ ] ,
1146+ } ,
11201147 astroExpressionParser : {
1121- load : [ 'prettier-plugin-astro' ] ,
1148+ load : [
1149+ {
1150+ name : 'prettier-plugin-astro' ,
1151+ importer : ( ) => {
1152+ // @ts -expect-error - This plugin doesn't have types
1153+ return import ( 'prettier-plugin-astro' )
1154+ } ,
1155+ } ,
1156+ ] ,
11221157 staticAttrs : [ 'class' ] ,
11231158 dynamicAttrs : [ 'class:list' ] ,
11241159 } ,
@@ -1133,7 +1168,7 @@ type SvelteNode = import('svelte/compiler').AST.SvelteNode & {
11331168
11341169let svelte = defineTransform < SvelteNode > ( {
11351170 staticAttrs : [ 'class' ] ,
1136- load : [ 'prettier-plugin-svelte' ] ,
1171+ load : [ { name : 'prettier-plugin-svelte' , importer : ( ) => import ( 'prettier-plugin-svelte' ) } ] ,
11371172
11381173 parsers : {
11391174 svelte : { } ,
@@ -1179,7 +1214,15 @@ type AstroNode =
11791214let astro = defineTransform < AstroNode > ( {
11801215 staticAttrs : [ 'class' , 'className' ] ,
11811216 dynamicAttrs : [ 'class:list' , 'className' ] ,
1182- load : [ 'prettier-plugin-astro' ] ,
1217+ load : [
1218+ {
1219+ name : 'prettier-plugin-astro' ,
1220+ importer : ( ) => {
1221+ // @ts -expect-error - This plugin doesn't have types
1222+ return import ( 'prettier-plugin-astro' )
1223+ } ,
1224+ } ,
1225+ ] ,
11831226
11841227 parsers : {
11851228 astro : { } ,
@@ -1192,7 +1235,7 @@ type MarkoNode = import('@marko/compiler').types.Node
11921235
11931236let marko = defineTransform < MarkoNode > ( {
11941237 staticAttrs : [ 'class' ] ,
1195- load : [ 'prettier-plugin-marko' ] ,
1238+ load : [ { name : 'prettier-plugin-marko' , importer : ( ) => import ( 'prettier-plugin-marko' ) } ] ,
11961239
11971240 parsers : {
11981241 marko : { } ,
@@ -1224,7 +1267,15 @@ type TwigNode =
12241267
12251268let twig = defineTransform < TwigNode > ( {
12261269 staticAttrs : [ 'class' ] ,
1227- load : [ '@zackad/prettier-plugin-twig' ] ,
1270+ load : [
1271+ {
1272+ name : '@zackad/prettier-plugin-twig' ,
1273+ importer : ( ) => {
1274+ // @ts -expect-error - This plugin doesn't have types
1275+ return import ( '@zackad/prettier-plugin-twig' )
1276+ } ,
1277+ } ,
1278+ ] ,
12281279
12291280 parsers : {
12301281 twig : { } ,
@@ -1240,7 +1291,7 @@ interface PugNode {
12401291
12411292let pug = defineTransform < PugNode > ( {
12421293 staticAttrs : [ 'class' ] ,
1243- load : [ '@prettier/plugin-pug' ] ,
1294+ load : [ { name : '@prettier/plugin-pug' , importer : ( ) => import ( '@prettier/plugin-pug' ) } ] ,
12441295
12451296 parsers : {
12461297 pug : { } ,
@@ -1259,7 +1310,12 @@ type LiquidNode =
12591310
12601311let liquid = defineTransform < LiquidNode > ( {
12611312 staticAttrs : [ 'class' ] ,
1262- load : [ '@shopify/prettier-plugin-liquid' ] ,
1313+ load : [
1314+ {
1315+ name : '@shopify/prettier-plugin-liquid' ,
1316+ importer : ( ) => import ( '@shopify/prettier-plugin-liquid' ) ,
1317+ } ,
1318+ ] ,
12631319
12641320 parsers : { 'liquid-html' : { } } ,
12651321
0 commit comments