Registry / testing / mocha-pug-lint

mocha-pug-lint

JSON →
library1.1.0jsnpmunverified

Allows developers to run pug-lint as Mocha tests. This package integrates pug-lint (a linter for Pug/Jade templates) with the Mocha test framework, enabling linting as part of the test suite. Current stable version is 1.1.0. Last release was in 2017, with low maintenance cadence. Key differentiator: simplifies linting by treating it as a test, so failures break the build naturally. Alternatives: separate lint step in build pipeline. Supports Node >=6, uses CJS require.

npm install mocha-pug-lint
INSTALL
IMPORT
SIG · MOCHA-PUG-LINT
M
mocha-pug-lint
testingjavascriptv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mochaPugLint
const mochaPugLint = require('mocha-pug-lint');
import mochaPugLint from 'mocha-pug-lint';
This package uses CommonJS and does not provide ESM exports. Use require() in Node environments.

Shows typical usage: requiring the function, specifying glob patterns for .pug files, and passing pug-lint options.

const mochaPugLint = require('mocha-pug-lint'); const path = require('path'); const globPatterns = ['./test/files/**/*.pug']; const options = { disallowAttributeConcatenation: true }; mochaPugLint(globPatterns, options);
Debug
Known issues
gotchaMust run in Mocha test context outside of a describe/it block
fix
Call mochaPugLint() at the top level of your test file, not inside describe or it.
affects: >=1.0.0
gotchaGlob patterns need to be relative to process.cwd() or absolute
fix
Use path.resolve() or paths relative to project root.
affects: >=1.0.0
deprecatedPackage uses Node >=6 engine, deprecated in modern Node environments
fix
Upgrade Node to current LTS; package may still work but untested.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'mocha-pug-lint'
Package not installed or missing from node_modules
fix
Run npm install mocha-pug-lint --save-dev
TypeError: mochaPugLint is not a function
Using wrong import syntax (ESM import) on a CJS module
fix
Use const mochaPugLint = require('mocha-pug-lint');
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
mocharequiredpeer dependency required to run the tests
pug-lintrequiredpeer dependency required for linting functionality
Agent activity
2 hits · last 30 days
node
2
Resources
mocha-pug-lint — npm install mocha-pug-lint · libregistry