Registry / testing / eslint-config-plus-prettier

eslint-config-plus-prettier

JSON →
library4.2.11jsnpmunverified

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).

npm install eslint-config-plus-prettier
INSTALL
IMPORT
SIG · ESLINT-CONFIG-PLUS
E
eslint-config-plus-prettier
testingjavascriptv4.2.11
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.

default export (config array)
import config from 'eslint-config-plus-prettier'
const config = require('eslint-config-plus-prettier')
ESM-only since v4; requires ESLint flat config. For CommonJS, rename file to eslint.config.cjs and use require().
Prettier config reference
add '"prettier": "eslint-config-plus-prettier/prettier"' to package.json
import prettier from 'eslint-config-plus-prettier/prettier'
This is not a JavaScript export; it's a JSON config path used in package.json.
npm-package-json-lint config
In .npmpackagejsonlintrc.json: { "extends": "eslint-config-plus-prettier/packagelint" }
import packagelint from 'eslint-config-plus-prettier/packagelint'
For server/applications use 'eslint-config-plus-prettier/packagelint/server'.
TypeScript TSConfig extends
In tsconfig.json: { "extends": "eslint-config-plus-prettier/tsconfig" }
import tsconfig from 'eslint-config-plus-prettier/tsconfig'
This extends a JSON file via the 'extends' field in tsconfig, not an import.

Install the package, set up ESLint flat config, add Prettier reference in package.json, and add scripts for linting and formatting.

# Install as devDependency npm install --save-dev --save-exact eslint-config-plus-prettier # package.json { "type": "module", "scripts": { "format": "prettier --write .", "format:check": "prettier --check .", "lint": "eslint --fix", "lint:check": "eslint", "package:lint": "npx npm-package-json-lint ." } } # eslint.config.js import config from "eslint-config-plus-prettier"; export default [config]; # package.json (add prettier config) { "prettier": "eslint-config-plus-prettier/prettier" }
Debug
Known issues
breakingv4 requires ESLint v9+ with flat config; does not support .eslintrc files.
fix
Upgrade to ESLint v9 and use eslint.config.js (flat config).
affects: >=4.0.0
breakingv4 is ESM-only; CommonJS projects must rename config file to eslint.config.cjs or use dynamic import.
fix
Rename eslint.config.js to eslint.config.cjs and use module.exports or require().
affects: >=4.0.0
deprecatedv3 uses legacy .eslintrc format; v4 uses flat config. v3 may stop receiving updates.
fix
Update to v4 and migrate to flat config.
affects: >=3.0.0 <4.0.0
gotchaPrettier config reference in package.json is a string path, not a require/import.
fix
Use "prettier": "eslint-config-plus-prettier/prettier" in package.json.
affects: all
gotchanpm-package-json-lint config must be in .npmpackagejsonlintrc.json, not via import.
fix
Create a .npmpackagejsonlintrc.json file with extends field.
affects: all
gotchaTypeScript support requires a separate tsconfig.json that extends the provided config; ESLint config already handles TS parsing.
fix
Create tsconfig.json with extends: 'eslint-config-plus-prettier/tsconfig'.
affects: all
Errors
Common errors & fixes
Error: Failed to load plugin 'unused-imports' declared in 'eslint-config-plus-prettier': Cannot find module 'eslint-plugin-unused-imports'
Missing peer dependency for the unused-imports plugin.
fix
Install eslint-plugin-unused-imports: npm install --save-dev eslint-plugin-unused-imports
Error: .eslintrc.cjs: Environment key "es2022" is unknown
Using legacy .eslintrc format with v4 which requires flat config.
fix
Switch to eslint.config.js (flat config) and upgrade to ESLint v9.
TypeError: config is not a function or tuple
Incorrect import or export of config in eslint.config.js.
fix
Ensure eslint.config.js contains: import config from 'eslint-config-plus-prettier'; export default [config];
Parsing error: Cannot find module 'typescript'
TypeScript is not installed as a devDependency.
fix
Install TypeScript: npm install --save-dev typescript
Upgrade
Version history
4.2.11latest on npm
Audit
Dependencies
eslintrequiredpeer dependency for ESLint flat config (v9+)
prettierrequiredpeer dependency for Prettier formatting
typescriptoptionaloptional peer dependency for TypeScript support
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-config-plus-prettier — npm install eslint-config-plus-prettier · libregistry