Comparing version 1.0.0 to 1.0.1
const { CLIEngine } = require('eslint') | ||
const lintText = (options, texts) => { | ||
const lintText = (options, text) => { | ||
const cliEngine = new CLIEngine(options) | ||
return cliEngine.executeOnText(...texts) | ||
return cliEngine.executeOnText(text) | ||
} | ||
module.exports = lintText |
{ | ||
"name": "lint-text", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Convenience wrapper for ESLint’s CLIEngine.prototype.executeOnText()", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -13,3 +13,3 @@ [![Build Status](https://travis-ci.org/mightyiam/lint-text?branch=master)](https://travis-ci.org/mightyiam/lint-text) | ||
const cli = new CLIEngine({ some: 'options' }) | ||
cli.executeOnText('some', 'texts') | ||
cli.executeOnText('"some" && "code"') | ||
``` | ||
@@ -21,3 +21,3 @@ | ||
const lintText = require('lint-text') | ||
lintText({ some: 'options' }, ['some', 'texts']) | ||
lintText({ some: 'options' }, ['"some" && "code"']) | ||
``` | ||
@@ -33,9 +33,9 @@ | ||
### `lintText(options, texts)` | ||
### `lintText(options, text)` | ||
- `options`: | ||
will be passed to the `CLIEngine` constructor ([ESLint docs](http://eslint.org/docs/developer-guide/nodejs-api#cliengine)) | ||
- `texts`: | ||
will be passed as arguments to `executeOnText` ([ESLint docs](http://eslint.org/docs/developer-guide/nodejs-api#executeontext)) | ||
- `text`: | ||
will be passed as first argument to `executeOnText` ([ESLint docs](http://eslint.org/docs/developer-guide/nodejs-api#executeontext)) | ||
Returns what `executeOnText` returns. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2190