src/lib/engine.js
function configureESLint(options) {
	const ESLintConfig = {
		rules: options.rules
	}

	ESLintConfig.extends = 'xo'
	if (options.esnext) {
		ESLintConfig.extends = 'xo/esnext'
	}

	if (!options.semicolon) {
		ESLintConfig.rules.semi = [2, 'never']
	}

	if (options.space === false) {
		ESLintConfig.rules.indent = [
			2, 'tab', {
				SwitchCase: 1
			}
		]
	} else {
		ESLintConfig.rules.indent = [
			2, parseInt(options.space, 10), {
				SwitchCase: 0
			}
		]
	}

	ESLintConfig.rules['valid-jsdoc'] = [0]
	ESLintConfig.rules['require-jsdoc'] = [0]

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

	return () => new ESLint({
		baseConfig: ESLintConfig,
		fix: true,
		rules: options.rules
	})
}
function configureESLint(options) {
	const ESLintConfig = {
		rules: options.rules
	}

	ESLintConfig.extends = 'xo'
	if (options.esnext) {
		ESLintConfig.extends = 'xo/esnext'
	}

	if (!options.semicolon) {
		ESLintConfig.rules.semi = [2, 'never']
	}

	if (options.space === false) {
		ESLintConfig.rules.indent = [
			2, 'tab', {
				SwitchCase: 1
			}
		]
	} else {
		ESLintConfig.rules.indent = [
			2, parseInt(options.space, 10), {
				SwitchCase: 0
			}
		]
	}

	ESLintConfig.rules['valid-jsdoc'] = [0]
	ESLintConfig.rules['require-jsdoc'] = [0]

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

	return () => new ESLint({
		baseConfig: ESLintConfig,
		fix: true,
		rules: options.rules
	})
}
function configureESLint ( options ) { const ESLintConfig = { rules : options . rules } ESLintConfig . extends = 'xo' if ( options . esnext ) { ESLintConfig . extends = 'xo/esnext' } if ( ! options . semicolon ) { ESLintConfig . rules . semi = [ 2 , 'never' ] } if ( options . space === false ) { ESLintConfig . rules . indent = [ 2 , 'tab' , { SwitchCase : 1 } ] } else { ESLintConfig . rules . indent = [ 2 , parseInt ( options . space , 10 ) , { SwitchCase : 0 } ] } ESLintConfig . rules [ 'valid-jsdoc' ] = [ 0 ] ESLintConfig . rules [ 'require-jsdoc' ] = [ 0 ] console . debug ( stripIndent ` ${ clr . title } ${ clr . title . out } ` ) if ( console . canWrite ( 5 ) ) { console . pretty ( ESLintConfig , 2 ) } return ( ) => new ESLint ( { baseConfig : ESLintConfig , fix : true , rules : options . rules } ) }
Create a configured ESLint factory
@private
@param  {options} options - Job options
@return {Function} - Generate an ESLint configuration
Create a configured ESLint factory