Registry / testing / grunt-puglint

grunt-puglint

JSON →
library1.0.0jsnpmunverified

A Grunt plugin for linting Pug (formerly Jade) templates using pug-lint. Current stable version is 1.0.0, which updates pug-lint to v2.2.0 and renames the `preset` option to `config`, removing support for `.pugLintRc`. The plugin integrates with Grunt ~1.0.0 and allows configuration via inline rules or presets. Compared to running pug-lint directly, this plugin provides seamless integration into Grunt workflows.

npm install grunt-puglint
INSTALL
IMPORT
SIG · GRUNT-PUGLINT
G
grunt-puglint
testingjavascriptv1.0.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.

puglint
grunt.loadNpmTasks('grunt-puglint');
require('grunt-puglint');
Grunt plugins must be loaded via grunt.loadNpmTasks, not require.
puglint task configuration
puglint: { options: { config: { extends: 'clock' } }, src: ['**/*.pug'] }
puglint: { options: { preset: 'clock' }, src: ['**/*.pug'] }
Since v1.0.0, the option `preset` has been renamed to `config`.
config file
Use inline `config` object or `.pug-lintrc` file
Using `.pugLintRc` (deprecated)
v1.0.0 removed support for `.pugLintRc`. Use `config: { extends: 'path' }` or a `.pug-lintrc` file.

Installs grunt-puglint and configures a Grunt task to lint Pug files with custom rules.

npm install grunt-puglint --save-dev // Gruntfile.js module.exports = function(grunt) { grunt.loadNpmTasks('grunt-puglint'); grunt.initConfig({ puglint: { options: { config: { validateIndentation: 2, disallowHtmlText: true } }, src: ['templates/**/*.pug'] } }); grunt.registerTask('default', ['puglint']); };
Debug
Known issues
breakingThe `preset` option has been renamed to `config` in v1.0.0.
fix
Replace `preset: 'name'` with `config: { extends: 'name' }`.
affects: >=1.0.0
breakingSupport for `.pugLintRc` file was removed in v1.0.0.
fix
Use `config: { extends: '...' }` or a standard `.pug-lintrc` file (with hyphen).
affects: >=1.0.0
deprecatedThe `pug-lint-config-clock` preset is deprecated; it may be removed in future versions.
fix
Migrate to inline config or a community-supported preset.
affects: >=0.1.0
gotchaGrunt ~1.0.0 required; using older Grunt may cause undefined behavior.
fix
Ensure Grunt version is >=1.0.0.
affects: >=1.0.0
Errors
Common errors & fixes
Warning: Task "puglint" not found.
The plugin was not loaded with grunt.loadNpmTasks.
fix
Add `grunt.loadNpmTasks('grunt-puglint');` to your Gruntfile.
Fatal error: Cannot find module 'pug-lint'
pug-lint is not installed as a dependency.
fix
Run `npm install pug-lint --save-dev`.
Invalid options: preset is not allowed.
Using the deprecated 'preset' option with grunt-puglint v1.0.0+.
fix
Change `preset` to `config` as described in the documentation.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
gruntrequiredPeer dependency for Grunt plugin
pug-lintrequiredCore linting engine
Agent activity
2 hits · last 30 days
node
2
Resources
grunt-puglint — npm install grunt-puglint · libregistry