{"id":26121,"library":"pug-lint-config-migration-v2","title":"pug-lint Migration Configuration for Pug v2","description":"Provides a pug-lint configuration preset that helps migrate Pug templates from v1 to v2 by enabling rules that detect deprecated or incompatible patterns. Version 1.0.2 is the latest stable release, updated infrequently. Key differentiator: this is an official preset from the Pug team, ensuring accurate migration checks for breaking changes between Pug v1 and v2, such as attribute syntax and iteration.","status":"active","version":"1.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/pugjs/pug-lint-config-migration-v2","tags":["javascript","pug","pug-lint","lint"],"install":[{"cmd":"npm install pug-lint-config-migration-v2","lang":"bash","label":"npm"},{"cmd":"yarn add pug-lint-config-migration-v2","lang":"bash","label":"yarn"},{"cmd":"pnpm add pug-lint-config-migration-v2","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; required to run the linter with this configuration","package":"pug-lint","optional":true}],"imports":[{"note":"The config name is just 'migration-v2', not the full package name.","wrong":"Using 'extends': 'pug-lint-config-migration-v2' (full package name)","symbol":"migration-v2","correct":"In .pug-lintrc.json: { \"extends\": \"migration-v2\" }"},{"note":"pug-lint is a dev dependency; install it locally, not globally.","wrong":"npm install pug-lint (missing --save-dev)","symbol":"pug-lint","correct":"npm install --save-dev pug-lint"},{"note":"Only JSON format is supported for this config package; other formats may not resolve 'migration-v2' correctly.","wrong":"Using .pug-lintrc.js or .pug-lintrc.yml without proper formatting","symbol":".pug-lintrc.json","correct":"Create .pug-lintrc.json in project root with the extends field"}],"quickstart":{"code":"// Step 1: Install dependencies\nnpm i --save-dev pug-lint pug-lint-config-migration-v2\n\n// Step 2: Create .pug-lintrc.json in project root\n{\n  \"extends\": \"migration-v2\"\n}\n\n// Step 3: Run linter\n./node_modules/.bin/pug-lint .\n// Expected output: list of warnings/errors for Pug v2 migration","lang":"javascript","description":"Install pug-lint and the migration config, add .pug-lintrc.json with extends, then run the linter on your Pug files."},"warnings":[{"fix":"Replace attribute values with template literals or string expressions, e.g., a(href=`/${user.id}`) Profile.","message":"Pug v2 removes support for inline JavaScript expressions in tag attributes using parentheses (e.g., a(href='/') Home). Use interpolation or string syntax.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use div(attributes) or spread attributes with the rest syntax: div(...attrs).","message":"Pug v2 drops the '&attributes' syntax for splat attributes; you must use object spread in attributes.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Replace mixins with includes or composition patterns.","message":"The 'mixin' keyword is deprecated in Pug v2 in favor of 'include' or component-based approaches.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Update iteration order: 'each value, index in array' (value first, then index).","message":"Pug v2 changes the iteration of arrays and objects: 'each value, index in array' now yields index as the second variable, not first.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Convert style objects to CSS strings: style=\"color: red; font-size: 14px\" or use a helper.","message":"Pug v2 no longer supports the 'style' attribute as an object directly; must be a string or inline style string.","severity":"breaking","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install --save-dev pug-lint' in your project root.","cause":"pug-lint not installed or not in node_modules.","error":"Error: Cannot find module 'pug-lint'"},{"fix":"Ensure your .pug-lintrc.json contains: { \"extends\": \"migration-v2\" } and run 'npm install --save-dev pug-lint-config-migration-v2'.","cause":"The extends value in .pug-lintrc.json is incorrect or the package is not installed.","error":"Configuration file error: Could not load config \"migration-v2\" from package \"pug-lint-config-migration-v2\""},{"fix":"Update pug-lint to version >=2.3.0 as specified in peer dependencies.","cause":"pug-lint-config-migration-v2 presets include rules that may not exist in older pug-lint versions.","error":"Error: Unknown rule 'some-rule'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}