pug-lint-config-ctrl

raw JSON →
1.3.0 verified Fri May 01 auth: no javascript maintenance

A shareable configuration for pug-lint enforcing coding standards for the ctrl framework. Current version 1.3.0 (no recent updates, appears stable). Defines rules for Pug/Jade templates (indentation, attribute order, etc.). Requires pug-lint ^2.3.0 as a peer dependency. Simple 'extends' usage similar to ESLint configs. Limited adoption; alternatives: pug-lint-config-google or custom configs. Not actively maintained (last update likely 2016).

error Error: Cannot find module 'pug-lint-config-ctrl'
cause pug-lint-config-ctrl not installed or missing from node_modules.
fix
Run: npm install --save-dev pug-lint-config-ctrl
error Configuration for rule "extends" is invalid: Expected a string but got an array.
cause Extends set to an array instead of a string.
fix
Change "extends": ["ctrl"] to "extends": "ctrl"
error pug-lint: No configuration found
cause No .pug-lintrc.json file found in project root or parent directories.
fix
Create a .pug-lintrc.json file with at least {"extends": "ctrl"}
gotcha The config file must be named .pug-lintrc.json or configured via package.json; using a .eslintrc file will not work as shown in README.
fix Create .pug-lintrc.json in project root with the extends field.
deprecated This package appears unmaintained since 2016; may not work with newer versions of pug-lint.
fix Consider migrating to an alternative config or custom rules.
npm install pug-lint-config-ctrl
yarn add pug-lint-config-ctrl
pnpm add pug-lint-config-ctrl

Install, configure with extends, and run pug-lint programmatically using this config.

// Install: npm install --save-dev pug-lint pug-lint-config-ctrl
// Create .pug-lintrc.json in project root:
{
  "extends": "ctrl"
}

// Run pug-lint:
const pugLint = require('pug-lint');
const linter = new pugLint();
linter.configure(require('pug-lint-config-ctrl'));
const errors = linter.checkFile('template.pug');
console.log(errors);