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.
Common errors
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. Warnings
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.
Install
npm install prettier-config-hudochenkov yarn add prettier-config-hudochenkov pnpm add prettier-config-hudochenkov Imports
- default wrong
const prettierConfig = require('prettier-config-hudochenkov')correctimport prettierConfig from 'prettier-config-hudochenkov' - default wrong
"prettier": "./node_modules/prettier-config-hudochenkov"correct"prettier": "prettier-config-hudochenkov" in package.json - default wrong
module.exports = require('prettier-config-hudochenkov')correct// prettier.config.js export { default } from 'prettier-config-hudochenkov';
Quickstart
npm install --save-dev prettier prettier-config-hudochenkov
echo '{
"prettier": "prettier-config-hudochenkov"
}' > package.json
npx prettier --check .