Registry / devops / gulp-pug-linter

gulp-pug-linter

JSON →
library1.5.0jsnpmunverified

Gulp plugin for linting Pug (formerly Jade) template files using pug-lint. Stable version 1.5.0 (2021-02-06), no longer actively maintained (last release 2021). It wraps pug-lint with Gulp streams, supporting custom reporters, fail-after-error mode, and silence-on-success. Key differentiators: no-frills wrapper that works with existing pug-lint configuration files (.pug-lintrc, .pug-lint.json, package.json). Requires Node >=10.x. Alternatives: direct pug-lint CLI or other Gulp linters.

npm install gulp-pug-linter
INSTALL
IMPORT
SIG · GULP-PUG-LINTER
G
gulp-pug-linter
devopsjavascriptv1.5.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.

default
const pugLinter = require('gulp-pug-linter');
import pugLinter from 'gulp-pug-linter';
Package does not ship ESM; CommonJS only. Use require().
pugLinter
const pugLinter = require('gulp-pug-linter');
const { pugLinter } = require('gulp-pug-linter');
Default export, not named export. Use require() directly.
gulp.task
gulp.task('lint', () => gulp.src().pipe(pugLinter()))
gulp.task('lint', () => pugLinter.pipe())
Must pipe through a Gulp stream, not call pugLinter standalone.

Gulp task to lint all .pug files using default reporter and fail on errors.

const gulp = require('gulp'); const pugLinter = require('gulp-pug-linter'); gulp.task('lint:pug', () => gulp .src('./**/*.pug') .pipe(pugLinter({ reporter: 'default', failAfterError: true })) );
Debug
Known issues
breakingNode.js engine requirement >=10.x (dropped support for 8.x and below)
fix
Upgrade Node.js to version 10 or higher.
affects: >=1.4.0
breakingAPI changed in v1.0.0: new options object format (reporter, failAfterError) replaces old separate reporter() method
fix
Use options object, e.g., pugLinter({ reporter: 'default', failAfterError: true }).
affects: >=1.0.0
deprecatedSeparate reporter() stream handler (including 'fail' flag) deprecated since v0.7.0 and removed in v1.0.0
fix
Migrate to new options object API: pugLinter({ reporter: 'default', failAfterError: true }).
affects: >=0.7.0 <1.0.0
gotchaIf no reporter is specified and failAfterError is true, build fails without displaying lint errors
fix
Always provide a reporter (e.g., 'default') when using failAfterError.
affects: >=1.0.0
gotchaInvalid reporter value falls back to 'default' reporter silently (with warning printed to console)
fix
Ensure reporter value is valid: 'default', a string name, or a reporter function.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'gulp-pug-linter'
Package not installed or installed as devDependency but not in node_modules
fix
Run 'npm install gulp-pug-linter --save-dev'
TypeError: pugLinter is not a function
Using import statement in CommonJS environment or wrong import style
fix
Use 'const pugLinter = require('gulp-pug-linter');' instead of import or destructuring.
Error: Couldn't find pug-lint configuration file. See pug-lint's documentation for more info.
Missing .pug-lintrc or equivalent configuration file in project root
fix
Create a .pug-lintrc.json file with pug-lint rules, e.g., { "extends": "clockwork" }
Upgrade
Version history
1.5.0latest on npm
Audit
Dependencies
gulpoptionalGulp plugin interface
pug-lintrequiredCore linting engine
Agent activity
4 hits · last 30 days
node
4
Resources
gulp-pug-linter — npm install gulp-pug-linter · libregistry