Skip to content

a1exevs/prettier-config

Repository files navigation

Prettier Config logo

Description

Reusable Prettier configuration to keep your code style consistent across projects.

📦 Installation

npm install --save-dev prettier @alexevs/prettier-config
# or
yarn add -D prettier @alexevs/prettier-config

⚙️ Usage

Create a prettier.config.cjs in the root of your project and re-export this configuration. If your project relies on CommonJS, you can also name the file prettier.config.js:

// prettier.config.cjs
module.exports = require('@alexevs/prettier-config');

You can extend the base options by spreading them:

module.exports = {
  ...require('@alexevs/prettier-config'),
  printWidth: 80,
};

Add a formatting script to your package.json if you haven't already:

{
  "scripts": {
    "format": "prettier --write ."
  }
}

👥 Who is this for?

Developers who maintain multiple JavaScript or TypeScript projects and want a single source of truth for Prettier settings.

📜 License

MIT

About

Shared Prettier configuration used across multiple projects.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published