How to use eslint_d - 1 common examples

To help you get started, we’ve selected a few eslint_d examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github desktop / desktop / script / eslint.ts View on Github external
lint(args: string[], text?: string): void
}

const client: IClient = require('eslint_d/lib/client')

const ESLINT_ARGS = [
  '--cache',
  '--rulesdir=./eslint-rules',
  './{script,eslint-rules}/**/*.{j,t}s?(x)',
  './tslint-rules/**/*.ts',
  './app/*.js',
  './app/{src,typings,test}/**/*.{j,t}s?(x)',
  ...process.argv.slice(2),
]

client.lint(ESLINT_ARGS)

type ProcessOnExit = (cb: (code: number) => void) => void
/** HACK: allow process.on('exit') to be called with a `number` */
const onExit = process.on.bind(process, 'exit') as ProcessOnExit

onExit(code => {
  if (code && ESLINT_ARGS.indexOf('--fix') === -1) {
    console.error(
      chalk`{bold.green → To fix some of these errors, run {underline yarn eslint:fix}}`
    )
  }
})

eslint_d

Speed up eslint to accelerate your development workflow

MIT
Latest version published 22 days ago

Package Health Score

84 / 100
Full package analysis

Popular eslint_d functions