2.1.0 • Published 3 years ago

@tidusia/prettier-config v2.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

@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": "prettier --ignore-path .gitignore \"**/*.{js,jsx,ts,tsx,json,md,mdx,html,css}\"",
    "format": "npm run prettier -- --write",
    "format:check": "npm run prettier -- --check"
  }
}

The format command will format all files (not git-ignored) in your project that have the matching extension.

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 match the pattern you specified in the prettier script in your package.json (from the section above).

2.1.0

3 years ago

2.0.0

3 years ago

1.0.0

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago