lint-text
v1.0.1
Published
Convenience wrapper for ESLint’s CLIEngine.prototype.executeOnText()
Downloads
2
Maintainers
Readme
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" && "code"')
Do
const lintText = require('lint-text')
lintText({ some: 'options' }, ['"some" && "code"'])
Features
- one line less
- no
new
- tested better than patience
API
lintText(options, text)
options
:
will be passed to theCLIEngine
constructor (ESLint docs)text
:
will be passed as first argument toexecuteOnText
(ESLint docs)
Returns what executeOnText
returns.