Skip to content

Commit d3c78b7

Browse files
Trivo25dannywillems
authored andcommitted
(florian) follow up to include plugins in standalone
1 parent 515c857 commit d3c78b7

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/build/js-layout-to-types-v2.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
import assert from 'node:assert';
44
import fs from 'node:fs/promises';
5-
import prettier from 'prettier';
5+
import prettier from 'prettier/standalone';
66
import prettierRc from '../../.prettierrc.cjs';
7+
import parserTypeScript from 'prettier/parser-typescript';
8+
import * as prettierPluginEstree from 'prettier/plugins/estree';
79

810
const leafTypes = {
911
number: 'number',
@@ -343,6 +345,7 @@ out += `\
343345

344346
const prettyOut = await prettier.format(out, {
345347
parser: 'typescript',
348+
plugins: [parserTypeScript, prettierPluginEstree],
346349
...prettierRc,
347350
});
348351

src/build/js-layout-to-types.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import fs from 'node:fs/promises';
22
import path from 'node:path';
33
import { fileURLToPath } from 'node:url';
4-
import prettier from 'prettier';
4+
import prettier from 'prettier/standalone';
5+
import parserTypeScript from 'prettier/parser-typescript';
6+
import * as prettierPluginEstree from 'prettier/plugins/estree';
7+
58
import prettierRc from '../../.prettierrc.cjs';
69

710
// let jsLayout = JSON.parse(process.argv[2]);
@@ -218,6 +221,7 @@ async function writeTsFile(content, relPath) {
218221
let absPath = path.resolve(selfPath, relPath);
219222
content = await prettier.format(content, {
220223
filepath: absPath,
224+
plugins: [parserTypeScript, prettierPluginEstree],
221225
...prettierRc,
222226
});
223227
await fs.writeFile(absPath, content);

0 commit comments

Comments
 (0)