pug-lint-vue

raw JSON →
0.4.0 verified Fri May 01 auth: no javascript deprecated

A CLI tool that lints Pug (formerly Jade) templates inside Vue single-file components (.vue). It wraps the pug-lint library and scans template tags with 'lang="pug"' attribute. This is the only package that specifically targets Pug templates in Vue files, as opposed to generic Pug or Vue linting tools. The current stable version is 0.4.0, though the project appears unmaintained since 2018, with no recent releases or activity. It requires pug-lint as a peer dependency. For CI or pre-commit hooks on Vue + Pug projects, it may still function but lacks active support.

error Error: Cannot find module 'pug-lint'
cause Missing peer dependency pug-lint
fix
npm install pug-lint
error pug-lint-vue: command not found
cause Package not installed globally or not in PATH
fix
Run via npx or install globally: npm install -g pug-lint-vue
error TypeError: Cannot read property 'someRule' of undefined
cause pug-lint version incompatibility; pug-lint-vue expects a specific rule format
fix
Install a specific version of pug-lint that works, e.g., npm install pug-lint@2.6.0
error Unexpected token: 'pug' (or parse errors with Vue template syntax)
cause The tool ONLY lints templates with lang="pug"; other templates are ignored but may be parsed as JavaScript incorrectly
fix
Ensure your .vue template <template> tag explicitly has lang="pug". Remove or ignore other templates.
deprecated Package has not been updated since 2018; may be incompatible with newer versions of pug-lint or Node.js.
fix Consider migrating to other tooling that supports Vue 3 + Pug, e.g., eslint-plugin-vue-pug (if available) or manually lint Pug templates.
gotcha Does not support Vue 3 or Composition API; only works with Vue 2 single-file components.
fix For Vue 3 projects, use a different linting approach such as custom ESLint rules or regex-based checks.
gotcha Requires pug-lint as a peer dependency; pug-lint itself is no longer actively maintained.
fix Install pug-lint explicitly: npm install pug-lint
breaking Removed dependency on pug-lint in version 0.3.0? (unclear changelog)
fix Always install pug-lint separately.
npm install pug-lint-vue
yarn add pug-lint-vue
pnpm add pug-lint-vue

Installs both packages, configures basic pug-lint rules, and runs the CLI against a directory of .vue files.

npm install pug-lint-vue pug-lint
# Create .pug-lintrc.json with sample rules:
# {
#   "disallowMultipleSpaces": true,
#   "requireSpaceAfterCodeOperator": true
# }
# Lint all .vue files in src/:
npx pug-lint-vue src/
# Or specify files directly:
npx pug-lint-vue src/App.vue src/components/