{"id":19879,"library":"eslint-plugin-prettier","title":"eslint-plugin-prettier","description":"Runs Prettier as an ESLint rule, reporting formatting differences as individual lint issues. Current stable version is v5.5.5, released Jan 2025. Requires ESLint >=8, Prettier >=3, and eslint-config-prettier >=7. Actively maintained with monthly releases. Ships TypeScript types and supports flat config (eslint.config.js) and legacy .eslintrc. Integrates with eslint-config-prettier to disable conflicting rules. Notable features: supports non-JS languages (CSS, JSON) via @eslint/css and @eslint/json plugins, Svelte support, and configurable options like 'usePrettierrc' and 'fileInfoOptions'. Faster than prettier-eslint as it avoids double parsing.","status":"active","version":"5.5.5","language":"javascript","source_language":"en","source_url":"https://github.com/prettier/eslint-plugin-prettier","tags":["javascript","eslint","eslintplugin","eslint-plugin","prettier","typescript"],"install":[{"cmd":"npm install eslint-plugin-prettier","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-prettier","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-prettier","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, plugin runs inside ESLint","package":"eslint","optional":false},{"reason":"peer dependency, core formatting engine","package":"prettier","optional":false},{"reason":"peer dependency, recommended to disable conflicting rules","package":"eslint-config-prettier","optional":true}],"imports":[{"note":"Default import works in both ESM and CJS contexts via bundler, but ESM is preferred for flat config","wrong":"const plugin = require('eslint-plugin-prettier')","symbol":"plugin","correct":"import plugin from 'eslint-plugin-prettier'"},{"note":"This is the flat config export. In CJS, use require with .default if needed.","wrong":"require('eslint-plugin-prettier').configs.recommended","symbol":"recommended","correct":"import recommended from 'eslint-plugin-prettier/recommended'"},{"note":"For legacy .eslintrc, use the 'recommended' string in extends array, not the config object directly.","wrong":"require('eslint-plugin-prettier/recommended')","symbol":"configs.recommended","correct":"const { configs } = require('eslint-plugin-prettier'); configs.recommended"}],"quickstart":{"code":"// eslint.config.js\nimport eslintPluginPrettier from 'eslint-plugin-prettier';\nimport eslintConfigPrettier from 'eslint-config-prettier';\n\nexport default [\n  {\n    plugins: {\n      prettier: eslintPluginPrettier,\n    },\n    rules: {\n      'prettier/prettier': 'error',\n      'arrow-body-style': 'off',\n      'prefer-arrow-callback': 'off',\n    },\n  },\n  eslintConfigPrettier,\n];\n\n// Then run: npx eslint .\n// This will check all files with Prettier formatting.","lang":"javascript","description":"Flat config setup with eslint-plugin-prettier and eslint-config-prettier to automatically fix formatting."},"warnings":[{"fix":"Upgrade Prettier to v3+ and ESLint to v8+.","message":"Requires Prettier >=3.0.0 and ESLint >=8.0.0 as peer dependencies since v5.0.0.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Use Node 14.18+ or 16+; for CJS projects, use dynamic import or upgrade to Node 22+ with require(esm) support.","message":"v5.x drops support for Node.js <14.18 and uses ESM exports internally; some bundlers may need configuration.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Rename the 'options' property to 'prettierOptions' in rule configuration.","message":"The 'prettier/prettier' rule options object now uses 'prettierOptions' instead of 'options' in v5.5.0+.","severity":"deprecated","affected_versions":">=5.5.0"},{"fix":"Add 'arrow-body-style': 'off' and 'prefer-arrow-callback': 'off' in your ESLint rules.","message":"Incompatible with eslint-plugin-prettier's own 'arrow-body-style' and 'prefer-arrow-callback' rules; must disable them manually or use the recommended config.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Use 'import recommended from \"eslint-plugin-prettier/recommended\"' and spread it in your config array.","message":"When using flat config, the recommended config is exported as 'eslint-plugin-prettier/recommended' (a single config object), not 'plugin.configs.recommended'.","severity":"gotcha","affected_versions":">=5.4.0"}],"env_vars":null,"search_vec":"'2025':25 '3':30 '7':36 '8':28 'activ':37 'avoid':93 'config':34,48,57 'configur':80 'conflict':61 'css':70 'current':18 'differ':13 'disabl':60 'doubl':94 'eslint':2,9,27,33,56,90,97,100 'eslint-config-pretti':32,55 'eslint-plugin':99 'eslint-plugin-pretti':1 'eslint.config.js':49 'eslint/css':73 'eslint/json':75 'eslintplugin':98 'eslintrc':52 'faster':86 'featur':64 'fileinfoopt':85 'flat':47 'format':12 'individu':15 'integr':53 'issu':17 'jan':24 'javascript':96 'js':68 'json':71 'languag':69 'legaci':51 'like':82 'lint':16 'maintain':38 'month':40 'non':67 'non-j':66 'notabl':63 'option':81 'pars':95 'plugin':3,76,101 'prettier':4,6,29,35,58,89,102 'prettier-eslint':88 'releas':23,41 'report':11 'requir':26 'rule':10,62 'run':5 'ship':42 'stabl':19 'support':46,65,78 'svelt':77 'type':44 'typescript':43,103 'useprettierrc':83 'v5.5.5':22 'version':20 'via':72","created_at":"2026-04-25T11:20:09.658062+00:00","updated_at":"2026-04-25T11:20:09.658062+00:00","problems":[{"fix":"Run 'npm install --save-dev eslint-plugin-prettier'.","cause":"Plugin not installed or not in node_modules.","error":"Error: Failed to load plugin 'prettier' declared in 'plugins': Cannot find module 'eslint-plugin-prettier'"},{"fix":"Upgrade to eslint-plugin-prettier v5.4.1+ which bumps synckit to v0.11.7.","cause":"Bug in synckit <=0.11.6 used by prettier-linter-helpers.","error":"TypeError: Cannot read properties of undefined (reading 'message')","affected_versions":">=5.4.0"},{"fix":"Install and configure @typescript-eslint/parser or eslint-plugin-react.","cause":"ESLint parser is not configured for the file type (e.g., TypeScript or JSX).","error":"Parsing error: Unexpected token }"},{"fix":"Add 'prettier: eslintPluginPrettier' to the plugins object in your flat config.","cause":"Plugin not listed in 'plugins' array in flat config.","error":"ESLint couldn't determine the plugin for rule 'prettier/prettier'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/prettier/eslint-plugin-prettier","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-plugin-prettier","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}