{"id":25486,"library":"eslint-config-plus-prettier","title":"eslint-config-plus-prettier","description":"ESLint shareable config that bundles ESLint, Prettier, and npm-package-json-lint into a single dependency. Current stable version 4.2.11 includes flat config support for ESLint v9+, TypeScript parsing via @typescript-eslint, import sorting with simple-import-sort, unused imports removal, and separate Prettier/npm-package-json-lint configs. Differentiates from alternatives like eslint-config-prettier by also providing opinionated lint rules (double quotes, semicolons, trailing commas) and optional strict TypeScript TSConfig. Offers two package lint profiles: one for libraries (requiring version range) and one for applications (allowing fixed versions).","status":"active","version":"4.2.11","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install eslint-config-plus-prettier","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-plus-prettier","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-plus-prettier","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for ESLint flat config (v9+)","package":"eslint","optional":false},{"reason":"peer dependency for Prettier formatting","package":"prettier","optional":false},{"reason":"optional peer dependency for TypeScript support","package":"typescript","optional":true}],"imports":[{"note":"ESM-only since v4; requires ESLint flat config. For CommonJS, rename file to eslint.config.cjs and use require().","wrong":"const config = require('eslint-config-plus-prettier')","symbol":"default export (config array)","correct":"import config from 'eslint-config-plus-prettier'"},{"note":"This is not a JavaScript export; it's a JSON config path used in package.json.","wrong":"import prettier from 'eslint-config-plus-prettier/prettier'","symbol":"Prettier config reference","correct":"add '\"prettier\": \"eslint-config-plus-prettier/prettier\"' to package.json"},{"note":"For server/applications use 'eslint-config-plus-prettier/packagelint/server'.","wrong":"import packagelint from 'eslint-config-plus-prettier/packagelint'","symbol":"npm-package-json-lint config","correct":"In .npmpackagejsonlintrc.json: { \"extends\": \"eslint-config-plus-prettier/packagelint\" }"},{"note":"This extends a JSON file via the 'extends' field in tsconfig, not an import.","wrong":"import tsconfig from 'eslint-config-plus-prettier/tsconfig'","symbol":"TypeScript TSConfig extends","correct":"In tsconfig.json: { \"extends\": \"eslint-config-plus-prettier/tsconfig\" }"}],"quickstart":{"code":"# Install as devDependency\nnpm install --save-dev --save-exact eslint-config-plus-prettier\n\n# package.json\n{\n  \"type\": \"module\",\n  \"scripts\": {\n    \"format\": \"prettier --write .\",\n    \"format:check\": \"prettier --check .\",\n    \"lint\": \"eslint --fix\",\n    \"lint:check\": \"eslint\",\n    \"package:lint\": \"npx npm-package-json-lint .\"\n  }\n}\n\n# eslint.config.js\nimport config from \"eslint-config-plus-prettier\";\nexport default [config];\n\n# package.json (add prettier config)\n{\n  \"prettier\": \"eslint-config-plus-prettier/prettier\"\n}","lang":"javascript","description":"Install the package, set up ESLint flat config, add Prettier reference in package.json, and add scripts for linting and formatting."},"warnings":[{"fix":"Upgrade to ESLint v9 and use eslint.config.js (flat config).","message":"v4 requires ESLint v9+ with flat config; does not support .eslintrc files.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Rename eslint.config.js to eslint.config.cjs and use module.exports or require().","message":"v4 is ESM-only; CommonJS projects must rename config file to eslint.config.cjs or use dynamic import.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Update to v4 and migrate to flat config.","message":"v3 uses legacy .eslintrc format; v4 uses flat config. v3 may stop receiving updates.","severity":"deprecated","affected_versions":">=3.0.0 <4.0.0"},{"fix":"Use \"prettier\": \"eslint-config-plus-prettier/prettier\" in package.json.","message":"Prettier config reference in package.json is a string path, not a require/import.","severity":"gotcha","affected_versions":"all"},{"fix":"Create a .npmpackagejsonlintrc.json file with extends field.","message":"npm-package-json-lint config must be in .npmpackagejsonlintrc.json, not via import.","severity":"gotcha","affected_versions":"all"},{"fix":"Create tsconfig.json with extends: 'eslint-config-plus-prettier/tsconfig'.","message":"TypeScript support requires a separate tsconfig.json that extends the provided config; ESLint config already handles TS parsing.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install eslint-plugin-unused-imports: npm install --save-dev eslint-plugin-unused-imports","cause":"Missing peer dependency for the unused-imports plugin.","error":"Error: Failed to load plugin 'unused-imports' declared in 'eslint-config-plus-prettier': Cannot find module 'eslint-plugin-unused-imports'"},{"fix":"Switch to eslint.config.js (flat config) and upgrade to ESLint v9.","cause":"Using legacy .eslintrc format with v4 which requires flat config.","error":"Error: .eslintrc.cjs: Environment key \"es2022\" is unknown"},{"fix":"Ensure eslint.config.js contains: import config from 'eslint-config-plus-prettier'; export default [config];","cause":"Incorrect import or export of config in eslint.config.js.","error":"TypeError: config is not a function or tuple"},{"fix":"Install TypeScript: npm install --save-dev typescript","cause":"TypeScript is not installed as a devDependency.","error":"Parsing error: Cannot find module 'typescript'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}