File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
2
const path = require ( 'path' ) ;
3
3
const fs = require ( 'fs' ) ;
4
+ const prettier = require ( 'prettier' ) ;
4
5
const {
5
6
packageDirectoryNames,
6
7
packagesRoot,
@@ -51,10 +52,10 @@ const generatePackageTSConfig = () => {
51
52
const tsConfig = { ...tsConfigBase , references } ;
52
53
const tsconfigPath = path . join ( packageDirectory , 'tsconfig.json' ) ;
53
54
54
- fs . writeFileSync (
55
- tsconfigPath ,
56
- TSCONFIG_COMMENT + JSON . stringify ( tsConfig , null , ' ' )
57
- ) ;
55
+ const content = TSCONFIG_COMMENT + JSON . stringify ( tsConfig , null , ' ' ) ;
56
+ const formattedContent = prettier . format ( content , { parser : 'json' } ) ;
57
+
58
+ fs . writeFileSync ( tsconfigPath , formattedContent ) ;
58
59
59
60
console . log ( `Generated tsconfig for ${ packageJSONData . name } ` ) ;
60
61
}
You can’t perform that action at this time.
0 commit comments