Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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}}`
)
}
})