Registry / testing / eslint-plugin-prettier-doc

eslint-plugin-prettier-doc

JSON →
library1.1.0jsnpmunverified

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.

npm install eslint-plugin-prettier-doc
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-PRET
E
eslint-plugin-prettier-doc
testingjavascriptv1.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export
const plugin = require('eslint-plugin-prettier-doc');
import plugin from 'eslint-plugin-prettier-doc'
ESLint plugins are typically required in CommonJS, but can be used with ESM via eslint-plugin-import or dynamic import.
configs (e.g., 'recommended')
extends: ['plugin:prettier-doc/recommended']
extends: ['eslint-plugin-prettier-doc/recommended']
The 'plugin:' prefix is required when using ESLint's extends syntax.
rules: no-concat, no-nested-concat, etc.
rules: { 'prettier-doc/no-concat': 'error' }
rules: { 'prettier-doc/no-concat': 2 }
Rule names are prefixed with 'prettier-doc/'. Using numeric severity is deprecated in ESLint; use string values like 'error'.

Shows installation, basic ESLint configuration with recommended preset, and a code example that violates the no-concat rule.

// install: npm install eslint-plugin-prettier-doc --save-dev // .eslintrc.json { "plugins": ["prettier-doc"], "extends": ["plugin:prettier-doc/recommended"], "rules": { "prettier-doc/no-concat": "error", "prettier-doc/no-nested-concat": "error", "prettier-doc/no-single-doc-concat": "error", "prettier-doc/no-empty-flat-contents-for-if-break": "error" } } // example.js (will trigger no-concat) const doc = concat(['hello', line, 'world']);
Debug
Known issues
deprecatedUse of `concat(…)` is deprecated in Prettier Doc; prefer array literals.
fix
Replace concat(['a','b']) with ['a','b'].
affects: >=1.0.0
breakingv1.0.0 changed rule names from 'prettier-doc/<old-name>' to 'prettier-doc/<new-name>'. Check migration if upgrading from 0.x.
fix
Update rule names in ESLint config: e.g., 'no-concat' remains same; check all rules.
affects: =1.0.0
gotchaDisable `no-concat` before fixing `no-nested-concat` and `no-single-doc-concat` because the latter two rely on detecting concat calls.
fix
Temporarily disable `no-concat` rule when auto-fixing other rules, then re-enable.
affects: >=1.0.0
gotchaThe `no-empty-flat-contents-for-if-break` rule fires on `ifBreak(',', '')` but not on `ifBreak(',')`.
fix
Remove second argument if it's an empty string.
affects: >=1.0.0
Errors
Common errors & fixes
Plugin 'prettier-doc' not found
Plugin folder missing in node_modules; often due to missing install or incorrect name.
fix
Run `npm install eslint-plugin-prettier-doc --save-dev` and ensure it's in dependencies.
Configuration for rule 'prettier-doc/no-concat' is invalid
Severity set to a number instead of 'off'/'warn'/'error'.
fix
Use string severity: `'prettier-doc/no-concat': 'error'`.
Referenced rule 'prettier-doc/no-empty-flat-contents-for-if-break' is not defined
Typo in rule name (e.g., missing hyphen) or using an old version before the rule was added.
fix
Check correct rule name: 'no-empty-flat-contents-for-if-break' (with hyphens). Update plugin to >=1.0.0.
Cannot read property 'defineRules' of null
ESLint version mismatch; plugin expects specific ESLint API.
fix
Ensure ESLint version is compatible (ESLint 8+ recommended).
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
eslint-plugin-prettier-doc — npm install eslint-plugin-prettier-doc · libregistry