@invisionag/prettier-config

2.1.3 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @invisionag/prettier-config

Weekly Downloads

961

Version

2.1.3

License

MIT

Unpacked Size

3.79 kB

Total Files

8

Last publish

Collaborators

  • jj-ivx
  • ivx-github
  • jana_hehr
  • roberter26
  • birgithorn
  • alexj-ivx
  • amft
  • aitortomas
  • yashabfaryal0322
  • nleinich
  • johannesluedke
  • pgotthardt-ivx
  • hrabe
  • plore_ivx
  • patricialieske
  • plaudel
  • mblumtritt
  • sruehlemann
  • brerx
  • mohamedmmahfouz
  • mbrendler
  • jens.zobel
  • cwaider
  • kattelans
  • ftrautmann
  • lutz.peukert
  • fruetel
  • schmitze333
  • csprle
  • beckerei
  • stefan.schiffer
  • ahx
  • cloudwaechter
  • tobias
  • alexmarold
  • t_klepzig
  • susahope
  • mwannewitz
  • ivx-circle-ci
  • yichang
  • ivx-jenkins