1.0.1 • Published 7 years ago

lint-text v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

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.