{"id":19877,"library":"eslint-plugin-prettier-doc","title":"eslint-plugin-prettier-doc","description":"ESLint plugin providing rules to enforce best practices when using Prettier's document builder API (prettier/doc). Current stable version is 1.1.0. Released under the MIT license by fisker. Active development with minor patch updates. Key differentiator: specifically targets Prettier Doc code patterns (e.g., deprecated concat, nested concat, empty ifBreak flatContents) to prevent common mistakes and deprecated usage.","status":"active","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/fisker/eslint-plugin-prettier-doc","tags":["javascript"],"install":[{"cmd":"npm install eslint-plugin-prettier-doc","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-prettier-doc","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-prettier-doc","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESLint plugins are typically required in CommonJS, but can be used with ESM via eslint-plugin-import or dynamic import.","wrong":"import plugin from 'eslint-plugin-prettier-doc'","symbol":"default export","correct":"const plugin = require('eslint-plugin-prettier-doc');"},{"note":"The 'plugin:' prefix is required when using ESLint's extends syntax.","wrong":"extends: ['eslint-plugin-prettier-doc/recommended']","symbol":"configs (e.g., 'recommended')","correct":"extends: ['plugin:prettier-doc/recommended']"},{"note":"Rule names are prefixed with 'prettier-doc/'. Using numeric severity is deprecated in ESLint; use string values like 'error'.","wrong":"rules: { 'prettier-doc/no-concat': 2 }","symbol":"rules: no-concat, no-nested-concat, etc.","correct":"rules: { 'prettier-doc/no-concat': 'error' }"}],"quickstart":{"code":"// install: npm install eslint-plugin-prettier-doc --save-dev\n\n// .eslintrc.json\n{\n  \"plugins\": [\"prettier-doc\"],\n  \"extends\": [\"plugin:prettier-doc/recommended\"],\n  \"rules\": {\n    \"prettier-doc/no-concat\": \"error\",\n    \"prettier-doc/no-nested-concat\": \"error\",\n    \"prettier-doc/no-single-doc-concat\": \"error\",\n    \"prettier-doc/no-empty-flat-contents-for-if-break\": \"error\"\n  }\n}\n\n// example.js (will trigger no-concat)\nconst doc = concat(['hello', line, 'world']);","lang":"javascript","description":"Shows installation, basic ESLint configuration with recommended preset, and a code example that violates the no-concat rule."},"warnings":[{"fix":"Replace concat(['a','b']) with ['a','b'].","message":"Use of `concat(…)` is deprecated in Prettier Doc; prefer array literals.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Update rule names in ESLint config: e.g., 'no-concat' remains same; check all rules.","message":"v1.0.0 changed rule names from 'prettier-doc/<old-name>' to 'prettier-doc/<new-name>'. Check migration if upgrading from 0.x.","severity":"breaking","affected_versions":"=1.0.0"},{"fix":"Temporarily disable `no-concat` rule when auto-fixing other rules, then re-enable.","message":"Disable `no-concat` before fixing `no-nested-concat` and `no-single-doc-concat` because the latter two rely on detecting concat calls.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Remove second argument if it's an empty string.","message":"The `no-empty-flat-contents-for-if-break` rule fires on `ifBreak(',', '')` but not on `ifBreak(',')`.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install eslint-plugin-prettier-doc --save-dev` and ensure it's in dependencies.","cause":"Plugin folder missing in node_modules; often due to missing install or incorrect name.","error":"Plugin 'prettier-doc' not found"},{"fix":"Use string severity: `'prettier-doc/no-concat': 'error'`.","cause":"Severity set to a number instead of 'off'/'warn'/'error'.","error":"Configuration for rule 'prettier-doc/no-concat' is invalid"},{"fix":"Check correct rule name: 'no-empty-flat-contents-for-if-break' (with hyphens). Update plugin to >=1.0.0.","cause":"Typo in rule name (e.g., missing hyphen) or using an old version before the rule was added.","error":"Referenced rule 'prettier-doc/no-empty-flat-contents-for-if-break' is not defined"},{"fix":"Ensure ESLint version is compatible (ESLint 8+ recommended).","cause":"ESLint version mismatch; plugin expects specific ESLint API.","error":"Cannot read property 'defineRules' of null"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}