tape-eslint
raw JSON → 1.2.1 verified Fri May 01 auth: no javascript
Integrate ESLint linting into tape test suites. Version 1.2.1 (stable, infrequent releases) allows running ESLint as part of tape tests in the same Node process, reducing overhead versus a separate lint step. Supports customization of file patterns, ignores, and ESLint CLIEngine options. Designed for Node.js, it gracefully disables itself in browserified test environments. Requires ESLint as a peer dependency.
Common errors
error Error: Cannot find module 'eslint' ↓
cause tape-eslint requires eslint as a peer dependency; it is not installed.
fix
npm install --save-dev eslint
error Error: Cannot find module 'tape-eslint' ↓
cause tape-eslint is not installed.
fix
npm install --save-dev tape-eslint
error TypeError: lint is not a function ↓
cause Using ESM import (import lint from 'tape-eslint') which is not supported.
fix
Use const lint = require('tape-eslint') instead.
Warnings
deprecated Package is unmaintained; last release 2016-08-03. ESLint versions after 1.x may break compatibility. ↓
fix Use tape-eslint 1.2.1 with ESLint 1.x or consider alternatives like eslint-tape.
gotcha Browserify usage: require('tape-eslint')() returns a noop function in browser environments, potentially confusing users expecting linting to run. ↓
fix No action needed; it's by design but should be documented clearly.
gotcha ESLint peer dependency is not automatically installed; must be installed separately. ↓
fix Run npm install --save-dev tape-eslint eslint.
deprecated Uses deprecated eslint.CLIEngine API; may break with ESLint >=2.0. ↓
fix Use a newer package or pin ESLint to 1.x.
Install
npm install tape-eslint yarn add tape-eslint pnpm add tape-eslint Imports
- default
const lint = require('tape-eslint') - default (with options) wrong
import lint from 'tape-eslint'correctconst lint = require('tape-eslint')({ files: ['index.js'] }) - tape test usage
const test = require('tape'); test('lint', require('tape-eslint')())
Quickstart
const test = require('tape');
const lint = require('tape-eslint');
test('eslint', lint({
files: ['index.js', 'test/*.js'],
ignore: ['dist/**'],
eslint: { configFile: '.eslintrc' }
}));