2.1.3 • Published 6 months ago

@invisionag/prettier-config v2.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 months ago

@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-config

Then 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:

  1. Add the prettier gem to your Gemfile:
gem 'prettier'
  1. Install the ruby plugin:
npm i -D @prettier/plugin-ruby
  1. Use the ruby config:
- "prettier": "@invisionag/prettier-config"
+ "prettier": "@invisionag/prettier-config/ruby"
2.1.2

10 months ago

2.1.3

6 months ago

2.1.1

1 year ago

2.1.0-rc.0

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0-rc.0

2 years ago

1.0.0-rc.0

2 years ago

2.0.0

2 years ago

1.0.1

6 years ago

1.0.0

6 years ago