Skip to content

benhigham/prettier-config

@benhigham/prettier-config

npm version npm downloads License

My personal Prettier configuration, designed to enforce consistent code formatting across my JavaScript and TypeScript projects.

Features

  • Sensible defaults for modern JavaScript/TypeScript development
  • Ensures consistent formatting across different IDEs and editors
  • Optimized for readability and maintainability
  • Compatible with Prettier v3

Installation

# npm
npm install --save-dev @benhigham/prettier-config

# yarn
yarn add --dev @benhigham/prettier-config

# pnpm
pnpm add --save-dev @benhigham/prettier-config

Usage

Method 1: Use in package.json (recommended)

{
  // ...
  "prettier": "@benhigham/prettier-config",
}

Method 2: Use in prettier.config.js

If you need to extend the configuration:

import benhighamPrettierConfig from '@benhigham/prettier-config';

/**
 * @type {import('prettier').Config}
 */
const config = {
  ...benhighamPrettierConfig,
  // your overrides here
};

export default config;

Method 3: Use in .prettierrc

"@benhigham/prettier-config"

Requirements

  • Node.js 18.20.x or higher
  • Prettier 3.x

License

This project is licensed under the MIT License.

About

My personal Prettier configuration.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Contributors 3

  •  
  •  
  •