src/lib/engine.js
function configureESFormatter(options) {
	const ESFormatConfig = {
		root: true,
		allowShebang: true,
		indent: {value: '\t'},
		whiteSpace: {
			before: {
				IfStatementConditionalOpening: -1
			},
			after: {
				IfStatementConditionalClosing: -1,
				FunctionReservedWord: 1
			}
		},
		lineBreak: {after: {ClassDeclarationClosingBrace: 0}}
	}
	if (options.space > 0) {
		ESFormatConfig.indent.value = ' '.repeat(parseInt(options.space, 10))
	}

	console.debug(stripIndent`
		${clr.title}esFormatter Options${clr.title.out}:
	`)
	if (console.canWrite(5)) {
		console.pretty(ESFormatConfig, 2)
	}

	return () => esFormatter.rc(ESFormatConfig)
}
function configureESFormatter(options) {
	const ESFormatConfig = {
		root: true,
		allowShebang: true,
		indent: {value: '\t'},
		whiteSpace: {
			before: {
				IfStatementConditionalOpening: -1
			},
			after: {
				IfStatementConditionalClosing: -1,
				FunctionReservedWord: 1
			}
		},
		lineBreak: {after: {ClassDeclarationClosingBrace: 0}}
	}
	if (options.space > 0) {
		ESFormatConfig.indent.value = ' '.repeat(parseInt(options.space, 10))
	}

	console.debug(stripIndent`
		${clr.title}esFormatter Options${clr.title.out}:
	`)
	if (console.canWrite(5)) {
		console.pretty(ESFormatConfig, 2)
	}

	return () => esFormatter.rc(ESFormatConfig)
}
function configureESFormatter ( options ) { const ESFormatConfig = { root : true , allowShebang : true , indent : { value : '\t' } , whiteSpace : { before : { IfStatementConditionalOpening : - 1 } , after : { IfStatementConditionalClosing : - 1 , FunctionReservedWord : 1 } } , lineBreak : { after : { ClassDeclarationClosingBrace : 0 } } } if ( options . space > 0 ) { ESFormatConfig . indent . value = ' ' . repeat ( parseInt ( options . space , 10 ) ) } console . debug ( stripIndent ` ${ clr . title } ${ clr . title . out } ` ) if ( console . canWrite ( 5 ) ) { console . pretty ( ESFormatConfig , 2 ) } return ( ) => esFormatter . rc ( ESFormatConfig ) }
Create a configured ESformatter factory
@private
@param  {options} options - Job options
@return {Function} - Generate an ESFormatter configuration
Create a configured ESformatter factory