lint-text

1.0.1 • Public • Published

Build Status Standard - JavaScript Style Guide

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 the CLIEngine constructor (ESLint docs)
  • text:
    will be passed as first argument to executeOnText (ESLint docs)

Returns what executeOnText returns.

Package Sidebar

Install

npm i lint-text

Weekly Downloads

0

Version

1.0.1

License

ISC

Last publish

Collaborators

  • mightyiam