lab-lint
raw JSON → 0.0.3 verified Fri May 01 auth: no javascript deprecated
Integrates JSLint into the Spumko/Lab testing framework, enabling automatic JavaScript linting as part of test suites. Version 0.0.3 is the latest stable release, with no active development or updates since 2014. It is opinionated, scanning all .js files in /lib and /test directories by default. Configuration is done via a standard .jslint JSON file. This package is deprecated in favor of more modern linters like ESLint and newer test runners like Lab's built-in linting support.
Common errors
error Error: Cannot find module 'lab' ↓
cause lab-lint requires the 'lab' package as a peer dependency, which must be installed.
fix
Run 'npm install lab --save-dev' to add the lab testing framework.
error TypeError: lab-lint is not a function ↓
cause The package exports a function, not an object. Use require('lab-lint') as a function call.
fix
Replace 'var lint = require("lab-lint"); lint(Lab, dirname);' with 'require("lab-lint")(Lab, dirname);'.
Warnings
deprecated lab-lint is unmaintained and relies on JSLint, which is outdated and no longer recommended. Use ESLint with Lab's built-in or third-party linting support instead. ↓
fix Replace with eslint and lab-eslint or similar modern tools.
gotcha The function must be called with a Lab instance and dirname as arguments. Failure to do so will cause a runtime error. ↓
fix Ensure you pass the correct Lab object and __dirname.
gotcha Only .js files in /lib and /test directories are linted. This is hardcoded and not configurable. ↓
fix If you need different paths, consider forking the package or using a different linting integration.
breaking Requires Node.js 0.10.x or older; may not work on modern Node.js versions due to JSLint compatibility issues. ↓
fix Use a Node.js version <= 0.10.x or migrate to a modern linter.
Install
npm install lab-lint yarn add lab-lint pnpm add lab-lint Imports
- default wrong
import labLint from 'lab-lint';correctrequire('lab-lint')(Lab, dirname);
Quickstart
// test/lint.js
'use strict';
var Lab = require('lab');
var dirname = __dirname;
require('lab-lint')(Lab, dirname);
// Optional: Configure jslint via a .jslint file in project root
// Example .jslint:
// {
// "nomen": true,
// "vars": true
// }