lint-text
Convenience wrapper for ESLint’s CLIEngine.prototype.executeOnText()
Instead of
const { CLIEngine } = require('eslint')
const cli = new CLIEngine({ some: 'options' })
cli.executeOnText('some', 'texts')
Do
const lintText = require('lint-text')
lintText({ some: 'options' }, ['some', 'texts'])
Features
- one line less
- no
new
- tested better than patience
API
lintText(options, texts)
options
:
will be passed to the CLIEngine
constructor (ESLint docs)texts
:
will be passed as arguments to executeOnText
(ESLint docs)
Returns what executeOnText
returns.