@invisionag/prettier-config
v2.1.3
Published
This is our general config for prettier. This should be used whenever we use prettier.
Downloads
5,073
Maintainers
Keywords
Readme
@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:
- 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"