@guildeducationinc/prettier-config
Advanced tools
Comparing version 2.0.0 to 2.0.1
37
index.js
@@ -1,1 +0,36 @@ | ||
module.exports = require('./prettier.config') | ||
module.exports = { | ||
printWidth: 100, | ||
semi: true, | ||
singleQuote: true, | ||
trailingComma: "es5", | ||
jsxSingleQuote: true, | ||
overrides: [ | ||
{ | ||
files: [ | ||
".babelrc", | ||
".pretterrc", | ||
"*.json" | ||
], | ||
excludeFiles: [ | ||
"*.d.ts" | ||
], | ||
options: { | ||
parser: "json" | ||
} | ||
}, | ||
{ | ||
files: [ | ||
"*.ts", | ||
"*.tsx" | ||
], | ||
excludeFiles: [ | ||
"*.d.ts" | ||
], | ||
options: { | ||
parser: "typescript" | ||
} | ||
} | ||
] | ||
} |
{ | ||
"name": "@guildeducationinc/prettier-config", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "description": "Guild Education's Prettier Config", |
@@ -10,2 +10,3 @@ # Guild Prettier Config | ||
``` | ||
## Usage | ||
@@ -25,3 +26,4 @@ | ||
Next, run | ||
Next, run | ||
```bash | ||
@@ -33,11 +35,13 @@ yarn prettier --write "src/**/*.{ts,tsx,js,jsx}" | ||
## Optional: Add pre-commit hook | ||
## Optional: Add pre-commit hook | ||
While optional, it's highly recommended to add a pre-commit hook so that prettier runs on all commits. This automates prettier and prevents any files from becoming out of sync with our formatting. | ||
```bash | ||
yarn add husky --dev | ||
yarn add -D husky | ||
yarn add -D lint-staged | ||
``` | ||
Then, add to your `package.json` | ||
```diff | ||
@@ -61,5 +65,14 @@ { | ||
Or, add a `prettier.config.js` file in the root of your project with the following | ||
``` | ||
module.exports = { | ||
...require('@guildeducationinc/prettier-config'), | ||
}; | ||
``` | ||
### FAQ | ||
#### Ignoring files | ||
To ignore files, add a `.prettierignore` to the root of your project and add any glob patterns of files you'd like for prettier to ignore. | ||
To ignore files, add a `.prettierignore` to the root of your project and add any glob patterns of files you'd like for prettier to ignore. |
2463
75
3