Skip to content

eng618/prettier-config

Repository files navigation

@ENG618/prettier-config

CI FOSSA Status code style: prettier NPM

npm (scoped) npm npm bundle size (scoped)

GitHub Release Date GitHub stars GitHub watchers GitHub forks GitHub issues

All Contributors

Twitter URL Twitter Follow

A baseline Prettier config, with sensible defaults. You can find it published here:

Usage

Install:

yarn add --dev @eng618/prettier-config

or

npm install --save-dev @eng618/prettier-config 

Edit package.json:

{
  // ...
  "prettier": "@eng618/prettier-config"
}

Or use in a Prettier config file (ESM):

// prettier.config.js or .prettierrc.js
import config from '@eng618/prettier-config';
export default config;

CommonJS usage:

// prettier.config.js or .prettierrc.js
const config = require('@eng618/prettier-config');
module.exports = config;

TypeScript projects:

// prettier.config.js or .prettierrc.js
import config from '@eng618/prettier-config';
export default config;

The package includes TypeScript declarations, so you'll get full type safety and IntelliSense support in TypeScript-aware editors.

Configuration Details

This configuration includes the following formatting rules:

  • Print Width: 120 characters (wider than default for modern screens)
  • Single Quotes: Uses single quotes instead of double quotes
  • Trailing Commas: Adds trailing commas in objects, arrays, and function parameters
  • Arrow Function Parens: Always includes parentheses around arrow function parameters
  • Tabs vs Spaces: Uses 2 spaces for indentation
  • Line Endings: Uses LF (Unix-style) line endings
  • YAML Files: Special override to use double quotes for YAML files

Note: This package migrated to ESM format in v2.3.0. If you're upgrading from an earlier version and encounter import errors, ensure your project supports ES modules or use the CommonJS example above.

Stargazers over time

Stargazers over time

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Eric Garcia

📖 💻 🚇

This project follows the all-contributors specification. Contributions of any kind welcome!

About

My configuration file for prettier

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors 2

  •  
  •