Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.
/ prettier-config Public archive

Share my favorite prettier config across projects

Notifications You must be signed in to change notification settings

tidusia/prettier-config

Repository files navigation

⚠️ Archived project, I now prefer to simply copy paste the file. Updated documentation is now on my second brain.


@tidusia/prettier-config

Github actions semantic-release

The way I found to share my favorite prettier config across projects

Installation

npm i -D @tidusia/prettier-config prettier

Then create a .prettierrc.js file at the root of your project with the following content :

module.exports = require("@tidusia/prettier-config");

Usage

Add the following scripts to your package.json :

{
  "scripts": {
    "prettier:write": "prettier . --write",
    "prettier:check": "prettier . --check"
  }
}

The prettier:write command will format all files in your project.

The format:check do not change files but check that all files are formatted properly. Something you can use in a pre-commit / CI for example.

Optional : set up your IDE

For example, in Webstorm, open "Preferences" -> "Languages & Frameworks" -> "JavaScript" -> "Prettier" (you need the Prettier plugin).

Choose your preferred prettier package (from node_module VS globally installed for example). Update the "Run for files:" glob pattern to whatever you find usefull in your project.

About

Share my favorite prettier config across projects

Resources

Stars

Watchers

Forks

Packages

No packages published