eslint-config-quick/eslint-quick.js
function eslint(options) {
  if (typeof options === 'boolean') {
    options = { fail: options }
  }
  options = { ...new ESLintOptions(), ...options }

  return new Promise((resolve, reject) => {
    const args = generateArguments(options)
    const child = spawn('node', args, { stdio: options.stdio, cwd: path.resolve(options.appRootPath || getRootPath()) })

    function handleError(error) {
      if (options.fail === false) {
        resolve(false)
      } else {
        reject(cleanupError(error))
      }
    }

    child.on('error', handleError)

    child.on('exit', error => {
      if (error) {
        handleError(error)
      } else {
        resolve(true)
      }
    })
  })
}
function eslint(options) {
  if (typeof options === 'boolean') {
    options = { fail: options }
  }
  options = { ...new ESLintOptions(), ...options }

  return new Promise((resolve, reject) => {
    const args = generateArguments(options)
    const child = spawn('node', args, { stdio: options.stdio, cwd: path.resolve(options.appRootPath || getRootPath()) })

    function handleError(error) {
      if (options.fail === false) {
        resolve(false)
      } else {
        reject(cleanupError(error))
      }
    }

    child.on('error', handleError)

    child.on('exit', error => {
      if (error) {
        handleError(error)
      } else {
        resolve(true)
      }
    })
  })
}
function eslint ( options ) { if ( typeof options === 'boolean' ) { options = { fail : options } } options = { ... new ESLintOptions ( ) , ... options } return new Promise ( ( resolve , reject ) => { const args = generateArguments ( options ) const child = spawn ( 'node' , args , { stdio : options . stdio , cwd : path . resolve ( options . appRootPath || getRootPath ( ) ) } ) function handleError ( error ) { if ( options . fail === false ) { resolve ( false ) } else { reject ( cleanupError ( error ) ) } } child . on ( 'error' , handleError ) child . on ( 'exit' , error => { if ( error ) { handleError ( error ) } else { resolve ( true ) } } ) } ) }
Executes eslint for a project, asynchronously.
@param {boolean|ESLintOptions|undefined} [options=undefined] The options to use. If a boolean, options will be { fail: true|false }.
@returns {Promise<boolean>} A promise
Executes eslint for a project asynchronously .