{"version":3,"file":"printers.mjs","names":[],"sources":["../src/printers.ts"],"sourcesContent":["import type { AstPath, Printer } from \"prettier\";\n\nimport * as estree from \"prettier/plugins/estree\";\n\nimport type { CollectibleNode } from \"./types.js\";\n\nimport { modifyNodeIfMissingBrackets } from \"./modifyNodeIfMissingBrackets.js\";\n\n// @ts-expect-error -- estree does not provide public exports\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\nconst estreePrinter: Printer = estree.printers.estree;\n\nfunction withCurly(printer: Printer): Printer {\n\treturn {\n\t\t...printer,\n\t\tprint(path: AstPath<CollectibleNode>, options, print, args) {\n\t\t\tmodifyNodeIfMissingBrackets(path);\n\n\t\t\treturn printer.print(path, options, print, args);\n\t\t},\n\t};\n}\n\nexport const printers: Record<string, Printer> = {\n\testree: withCurly(estreePrinter),\n\t// @ts-expect-error -- Prettier calls lazy printer factories, but its types only accept Printer objects\n\t\"estree-oxc\": async () => {\n\t\tconst oxc = await import(\"@prettier/plugin-oxc\");\n\t\treturn withCurly(oxc.printers[\"estree-oxc\"]);\n\t},\n};\n"],"mappings":";;;AAUA,MAAM,gBAAyB,OAAO,SAAS;AAE/C,SAAS,UAAU,SAA2B;CAC7C,OAAO;EACN,GAAG;EACH,MAAM,MAAgC,SAAS,OAAO,MAAM;GAC3D,4BAA4B,IAAI;GAEhC,OAAO,QAAQ,MAAM,MAAM,SAAS,OAAO,IAAI;EAChD;CACD;AACD;AAEA,MAAa,WAAoC;CAChD,QAAQ,UAAU,aAAa;CAE/B,cAAc,YAAY;EAEzB,OAAO,WAAU,MADC,OAAO,wBAAA,CACJ,SAAS,aAAa;CAC5C;AACD"}