2.1.3 • Published 2 years ago
@invisionag/prettier-config v2.1.3
@invisionag/prettier-config
This is our general config for prettier. This should be used whenever we use prettier.
Installation
Install prettier and this configuration.
npm i -D prettier @invisionag/prettier-configThen extend the prettier configuration by adding the following to your package.json.
{
  "prettier": "@invisionag/prettier-config"
}Your package.json should look something like this:
{
  "private": true,
  "scripts": {
    "lint": "prettier -c .",
    "format": "prettier -w ."
  },
  "devDependencies": {
    "@invisionag/prettier-config": "*",
    "prettier": "*"
  },
  "prettier": "@invisionag/prettier-config"
}Ignoring files
It is recommended to ignore all files that are ignored by git:
 {
   "private": true,
   "scripts": {
-    "lint": "prettier -c .",
+    "lint": "prettier -c . --ignore-path .gitignore",
-    "format": "prettier -w ."
+    "format": "prettier -w . --ignore-path .gitignore"
   },If there are files that should not be formatted but are not excluded by git you should use a .prettierignore instead.
Ruby
To support ruby files you have to do the following:
- Add the prettier gem to your Gemfile:
gem 'prettier'- Install the ruby plugin:
npm i -D @prettier/plugin-ruby- Use the ruby config:
- "prettier": "@invisionag/prettier-config"
+ "prettier": "@invisionag/prettier-config/ruby"2.1.2
2 years ago
2.1.3
2 years ago
2.1.1
3 years ago
2.1.0-rc.0
3 years ago
2.1.0
3 years ago
2.0.1
3 years ago
2.0.0-rc.0
4 years ago
1.0.0-rc.0
4 years ago
2.0.0
4 years ago
1.0.1
8 years ago
1.0.0
8 years ago