eslint-plugin-vue-pug is an ESLint plugin designed to extend the linting capabilities of `eslint-plugin-vue` to support Pug templates within Vue Single File Components (SFCs). It enables developers to enforce coding standards and identify potential issues directly within their `<template lang="pug">` blocks. The current stable version is `0.6.2`, released in late 2022. Due to the lack of recent commits and releases since then, the package appears to be in a maintenance mode, with infrequent updates or new feature development. Its key differentiator is providing specific linting rules for Pug syntax within the Vue ecosystem, bridging a gap not covered by standard `eslint-plugin-vue` configurations alone. It relies heavily on `eslint-plugin-vue` for its core Vue-specific linting foundation.
npm install eslint-plugin-vue-pugVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to install and configure `eslint-plugin-vue-pug` in an ESLint configuration file (`.eslintrc.cjs`) for a Vue 3 project using Pug templates. This setup enables basic linting rules for Pug within Vue Single File Components, integrating with the recommended configurations of both `eslint` and `eslint-plugin-vue`.
Update your `.eslintrc` configuration to use `plugin:vue/vue3-recommended` (or another appropriate `eslint-plugin-vue` recommended config) and ensure `plugin:vue-pug/recommended` is also listed.
Ensure that your installed version of `eslint-plugin-vue` satisfies the peer dependency range specified by `eslint-plugin-vue-pug`. Typically, running `npm install` or `yarn install` will alert you to peer dependency issues, or explicitly install compatible versions.
Ensure your `.eslintrc` includes an appropriate `parser` in `parserOptions` (e.g., `@babel/eslint-parser` for JavaScript or `@typescript-eslint/parser` for TypeScript) to handle the `<script>` sections of your Vue files, as `@vue/eslint-parser` handles the overall SFC structure and template.
Ensure `eslint-plugin-vue-pug` is installed: `npm install eslint-plugin-vue-pug eslint-plugin-vue --save-dev` or `yarn add -D eslint-plugin-vue-pug eslint-plugin-vue`. Verify the plugin name 'vue-pug' is correctly spelled in your `.eslintrc` plugins array.
Ensure `eslint-plugin-vue` is correctly configured and its recommended configuration is extended, as it brings in `@vue/eslint-parser`. Also, verify that the Pug templates themselves are well-formed and valid Pug syntax.
Double-check the rule name for typos. Refer to the `eslint-plugin-vue-pug` documentation or its `lib/rules` directory on GitHub to confirm available rule names and their options.