@@ -13,7 +13,7 @@ import {
1313 type Theme ,
1414 path as pathUtils ,
1515} from '@shopify/theme-check-node'
16- import YAML from 'yaml'
16+ import { dump as yamlDump } from 'js- yaml'
1717
1818type OffenseMap = Record < string , Offense [ ] >
1919
@@ -265,9 +265,9 @@ export async function initConfig(root: string) {
265265 // The initialized config will extend the recommended settings and
266266 // will simply show the commented checks for the user to customize.
267267 const { settings} = await loadConfig ( undefined , root )
268- const checksYml = commentString ( YAML . stringify ( settings ) )
268+ const checksYml = commentString ( yamlDump ( settings ) )
269269
270- const initConfigYml = YAML . stringify ( { extends : 'theme-check:recommended' , ignore : [ 'node_modules/**' ] } )
270+ const initConfigYml = yamlDump ( { extends : 'theme-check:recommended' , ignore : [ 'node_modules/**' ] } )
271271
272272 await writeFile ( filePath , `${ initConfigYml } ${ checksYml } ` )
273273
@@ -301,7 +301,7 @@ export async function outputActiveConfig(themeRoot: string, configPath?: string,
301301 ...settings ,
302302 }
303303 const output = environment ? { [ environment ] : config } : config
304- outputResult ( YAML . stringify ( output ) )
304+ outputResult ( yamlDump ( output ) )
305305}
306306
307307export async function outputActiveChecks ( root : string , configPath ?: string , environment ?: string ) {
@@ -341,7 +341,7 @@ export async function outputActiveChecks(root: string, configPath?: string, envi
341341 } , { } )
342342
343343 const output = environment ? { [ environment ] : checksList } : checksList
344- outputResult ( YAML . stringify ( output ) )
344+ outputResult ( yamlDump ( output ) )
345345}
346346
347347interface ExtendedWriteStream extends NodeJS . WriteStream {
0 commit comments