{"id":25947,"library":"mocha-pug-lint","title":"mocha-pug-lint","description":"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.","status":"maintenance","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/jonatanpedersen/mocha-pug-lint","tags":["javascript","mocha","mochaplugin","pug-lint"],"install":[{"cmd":"npm install mocha-pug-lint","lang":"bash","label":"npm"},{"cmd":"yarn add mocha-pug-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add mocha-pug-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required to run the tests","package":"mocha","optional":false},{"reason":"peer dependency required for linting functionality","package":"pug-lint","optional":false}],"imports":[{"note":"This package uses CommonJS and does not provide ESM exports. Use require() in Node environments.","wrong":"import mochaPugLint from 'mocha-pug-lint';","symbol":"mochaPugLint","correct":"const mochaPugLint = require('mocha-pug-lint');"}],"quickstart":{"code":"const mochaPugLint = require('mocha-pug-lint');\nconst path = require('path');\nconst globPatterns = ['./test/files/**/*.pug'];\nconst options = {\n  disallowAttributeConcatenation: true\n};\nmochaPugLint(globPatterns, options);","lang":"javascript","description":"Shows typical usage: requiring the function, specifying glob patterns for .pug files, and passing pug-lint options."},"warnings":[{"fix":"Call mochaPugLint() at the top level of your test file, not inside describe or it.","message":"Must run in Mocha test context outside of a describe/it block","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use path.resolve() or paths relative to project root.","message":"Glob patterns need to be relative to process.cwd() or absolute","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade Node to current LTS; package may still work but untested.","message":"Package uses Node >=6 engine, deprecated in modern Node environments","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run npm install mocha-pug-lint --save-dev","cause":"Package not installed or missing from node_modules","error":"Error: Cannot find module 'mocha-pug-lint'"},{"fix":"Use const mochaPugLint = require('mocha-pug-lint');","cause":"Using wrong import syntax (ESM import) on a CJS module","error":"TypeError: mochaPugLint is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}