puglint-stylish
raw JSON → 1.1.0 verified Fri May 01 auth: no javascript
A stylish reporter for pug-lint, heavily inspired by jshint-stylish. Provides colorized, formatted output for lint results when using pug-lint >=1.2 <3.0.0. Version 1.1.0 is the latest stable release; the package is stable but sees infrequent updates. Unlike the default pug-lint reporter, puglint-stylish offers a cleaner, more readable presentation of errors and warnings, making it easier to scan large numbers of lint results.
Common errors
error Error: Cannot find module 'puglint-stylish' ↓
cause The reporter is not installed or not found in node_modules.
fix
Run: npm install --save-dev puglint-stylish
error pug-lint: Unknown reporter 'puglint-stylish' ↓
cause The --reporter flag is given just the package name, not the full path.
fix
Use: --reporter node_modules/puglint-stylish
Warnings
gotcha Reporter must be specified with full path to node_modules/puglint-stylish, not just the package name. ↓
fix Use --reporter node_modules/puglint-stylish instead of --reporter puglint-stylish.
gotcha Requires pug-lint version >=1.2 and <3.0.0. Incompatible with pug-lint 3.x and above. ↓
fix Downgrade pug-lint to 2.x or use a different reporter.
Install
npm install puglint-stylish yarn add puglint-stylish pnpm add puglint-stylish Imports
- default wrong
const reporter = require('puglint-stylish')correctimport reporter from 'puglint-stylish'
Quickstart
// Install: npm install --save-dev pug-lint puglint-stylish
// Run on the command line:
// pug-lint --reporter node_modules/puglint-stylish *.pug
// Example .pug file to lint:
// file.pug:
// doctype html
// html
// head
// title Test
// body
// h1 Hello
// Run: pug-lint --reporter node_modules/puglint-stylish file.pug
// Output will be styled with colored error/warning counts.