fly-pug-lint
raw JSON → 0.0.11 verified Fri May 01 auth: no javascript deprecated
fly-pug-lint is a plugin for the Fly task runner (version 0.0.11) that integrates pug-lint for linting Pug (formerly Jade) templates. It allows developers to lint Pug files using Fly's streaming API, supporting both async/await and generator function syntax. The plugin delegates to pug-lint for configuration, typically using a .pug-lintrc.js file. It requires Fly ^1.3.1 as a peer dependency. Compared to standalone pug-lint, it offers seamless integration with Fly workflows but is limited by Fly's maintenance status.
Common errors
error TypeError: this.source(...).puglint is not a function ↓
cause The plugin is not properly installed or imported as a Fly plugin. The function 'puglint' must be imported and used as a method on the Fly instance.
fix
Ensure fly-pug-lint is installed (npm install -D fly-pug-lint) and import { puglint } from 'fly-pug-lint' in your Flyfile.
error Cannot find module 'pug-lint' ↓
cause pug-lint is not automatically installed; it is a peer dependency of fly-pug-lint.
fix
Install pug-lint: npm install -D pug-lint
error Cannot find module 'fly' ↓
cause Fly is not installed or not in the project's dependencies.
fix
Install Fly: npm install -D fly@^1.3.1
Warnings
deprecated Fly task runner is no longer actively maintained. ↓
fix Migrate to another task runner like Gulp or use standalone pug-lint.
gotcha The plugin exports only named export 'puglint', not default. Using import default will result in undefined. ↓
fix Use import { puglint } from 'fly-pug-lint' or require('fly-pug-lint').puglint.
gotcha Requiring the package directly returns an object, not a function. Developers may mistakenly use require('fly-pug-lint') as a function. ↓
fix Use require('fly-pug-lint').puglint or import { puglint } from 'fly-pug-lint'.
breaking The plugin requires Fly ^1.3.1 and may not work with older versions of Fly due to API changes. ↓
fix Ensure Fly version is >=1.3.1.
Install
npm install fly-pug-lint yarn add fly-pug-lint pnpm add fly-pug-lint Imports
- puglint wrong
const { puglint } = require('fly-pug-lint')correctimport { puglint } from 'fly-pug-lint' - puglint (default) wrong
const puglint = require('fly-pug-lint').defaultcorrectimport puglint from 'fly-pug-lint' - CommonJS require wrong
const puglint = require('fly-pug-lint')correctconst puglint = require('fly-pug-lint').puglint
Quickstart
import { puglint } from 'fly-pug-lint';
export async function lintPug() {
await this
.source('src/**/*.pug')
.puglint({
extends: '.pug-lintrc.js',
disallowIdAttributeWithStaticValue: true
});
}