prettier-config-hudochenkov

raw JSON →
0.4.0 verified Sat Apr 25 auth: no javascript

A shareable Prettier configuration created by hudochenkov. As of version 0.4.0, it is an ESM-only package requiring Prettier 3 and Node >=16. Key features include a specific set of opinionated defaults with trailingComma set to 'all'. It differentiates from other shared configs by being minimal and focused on personal preferences. The package has migrated to ESM and removed support for Prettier 1.x and 2.x. It is intended for developers who want to adopt the author's Prettier style without custom configuration.

error Cannot find module 'prettier-config-hudochenkov'
cause Package not installed or incorrect import path.
fix
Run npm install --save-dev prettier-config-hudochenkov and ensure your configuration file correctly references it.
error Error [ERR_REQUIRE_ESM]: require() of ES Module not supported.
cause Using CommonJS require() with an ESM-only package (v0.4.0+).
fix
Use import prettierConfig from 'prettier-config-hudochenkov' or switch to dynamic import.
error Validation Error: prettier-config-hudochenkov: Invalid configuration: unknown option `jsxBracketSameLine`.
cause Using an outdated version of the config that still references the deprecated option.
fix
Update to prettier-config-hudochenkov@0.3.0 or later, and use bracketSameLine instead.
breaking CommonJS require() is no longer supported. This package is ESM-only since v0.4.0.
fix Use import syntax or switch to version 0.3.0 if you need CommonJS.
breaking Dropped support for Prettier 2 and Prettier 1. Peer dependency requires Prettier ^3.0.1.
fix Upgrade Prettier to v3 or use version 0.3.0 for Prettier 2.
deprecated Option `jsxBracketSameLine` is replaced by `bracketSameLine` since v0.3.0.
fix Use `bracketSameLine` instead.
breaking Node.js version <16 is no longer supported since v0.4.0.
fix Upgrade Node.js to v16 or later.
gotcha The config sets `trailingComma` to `all` (changed from `es5` in v0.4.0). Ensure your codebase is compatible.
fix Review code for trailing commas in function parameters and other places where it might break older syntax.
npm install prettier-config-hudochenkov
yarn add prettier-config-hudochenkov
pnpm add prettier-config-hudochenkov

Installs Prettier and the shared config, sets it in package.json, and runs Prettier to check formatting.

npm install --save-dev prettier prettier-config-hudochenkov

echo '{
  "prettier": "prettier-config-hudochenkov"
}' > package.json

npx prettier --check .