Registry / testing / eslint-plugin-prettier-fx

eslint-plugin-prettier-fx

JSON →
library5.0.2jsnpmunverified

An ESLint plugin that runs Prettier as an ESLint rule, reporting formatting differences as individual lint issues. Version 5.0.2 is the current stable release; the plugin has a steady release cadence. It integrates tightly with eslint-config-prettier to disable conflicting rules. Key differentiators: it allows Prettier formatting to be enforced via ESLint's reporting and auto-fix mechanisms, and supports custom Prettier options via rule configuration.

npm install eslint-plugin-prettier-fx
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-PRET
E
eslint-plugin-prettier-fx
testingjavascriptv5.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

plugin
import plugin from 'eslint-plugin-prettier'; export default [plugin];
const { prettier } = require('eslint-plugin-prettier');
ESM-only since v5; default import works for flat config.
configs.recommended
import plugin from 'eslint-plugin-prettier'; export default [...plugin.configs.recommended];
const { configs } = require('eslint-plugin-prettier');
Use plugin.configs.recommended with flat config; CJS require fails.
rules.prettier
import plugin from 'eslint-plugin-prettier'; export default { plugins: { prettier: plugin }, rules: { 'prettier/prettier': 'error' } };
rules: { 'prettier/prettier': ['error', { singleQuote: true }] }
Options are valid in rule configuration; ensure correct syntax.

Configure eslint-plugin-prettier in both legacy .eslintrc and flat config formats, with custom Prettier options.

// .eslintrc.js - CommonJS (legacy) module.exports = { plugins: ['prettier'], rules: { 'prettier/prettier': 'error', }, }; // eslint.config.js - Flat config (ESM, recommended) import pluginPrettier from 'eslint-plugin-prettier'; export default [ { plugins: { prettier: pluginPrettier, }, rules: { 'prettier/prettier': [ 'error', { singleQuote: true, semi: false, }, ], }, }, ];
Debug
Known issues
breakingFlat config (eslint.config.js) requires default import; plugin no longer exports CJS via require().
fix
Use `import plugin from 'eslint-plugin-prettier'` and spread plugin.configs if needed.
affects: >=5.0.0
breakingRemoved support for Node.js <14.18; Node 12 users cannot upgrade beyond v4.x.
fix
Upgrade Node.js to >=14.18 or stay on v4.x.
affects: >=5.0.0
deprecatedThe `.eslintrc` format (JSON, YAML, JS) is deprecated in favor of flat config.
fix
Migrate to eslint.config.js and use `import` syntax.
affects: >=5.0.0
gotchaPlugin does not install Prettier or ESLint; missing peer deps cause runtime errors.
fix
Run `npm install --save-dev eslint prettier` alongside this plugin.
affects: *
gotchaOption `trailingComma` default is 'es5' in Prettier v2 but 'all' in v3; failing lint runs.
fix
Set `trailingComma` explicitly in .prettierrc or rule options to match expected behavior.
affects: >=2.0.0
gotchaUsing `--fix` with this rule can drastically change code style; unexpected reflows may occur.
fix
Review changes before committing; consider running Prettier separately and only using this plugin for reporting.
affects: *
Errors
Common errors & fixes
Error: Failed to load plugin 'prettier' declared in '.eslintrc': Cannot find module 'eslint-plugin-prettier'
Plugin not installed as dev dependency.
fix
Run `npm install --save-dev eslint-plugin-prettier`.
Oops! Something went wrong! :( ESLint: 8.x. Failed to load config "prettier" to extend from.
Missing eslint-config-prettier when using `extends: ['prettier']` directly.
fix
Install eslint-config-prettier: `npm install --save-dev eslint-config-prettier` and use `extends: ['plugin:prettier/recommended']` instead.
Parsing error: Unexpected token (or similar parser error for .svelte/.vue files)
Missing appropriate parser (e.g., svelte-eslint-parser) for non-standard syntax.
fix
Install and configure eslint-plugin-svelte or vue-eslint-parser with the correct parser settings.
Error: Cannot find module 'prettier'
Prettier not installed.
fix
Run `npm install --save-dev prettier`.
TypeError: Cannot read properties of undefined (reading 'prettier')
Using CJS require() with flat config (ESM only since v5).
fix
Convert to ESM and use `import plugin from 'eslint-plugin-prettier'`.
Upgrade
Version history
5.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

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