-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run prettier on repo
- Loading branch information
Showing
3 changed files
with
48 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,39 @@ | ||
# @bokub / prettier-config | ||
|
||
> My personal [Prettier](https://prettier.io) config. | ||
[![Code style][style-src]][style-href] | ||
[![Downloads][downloads-src]][downloads-href] | ||
|
||
## Usage | ||
> My personal [Prettier](https://prettier.io) config / workflow | ||
**Install**: | ||
#### Install | ||
|
||
```bash | ||
# Just the config | ||
npm i -D @bokub/prettier-config | ||
|
||
# Whole package | ||
npm i -D prettier pretty-quick husky @bokub/prettier-config | ||
npm i -D prettier @bokub/prettier-config | ||
``` | ||
|
||
**Add the following to your `package.json`**: | ||
#### Add the following to your `package.json`: | ||
|
||
```jsonc | ||
```json | ||
{ | ||
"scripts": { | ||
"pretty-quick": "pretty-quick" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "pretty-quick --staged" | ||
} | ||
}, | ||
"prettier": "@bokub/prettier-config" | ||
"prettier": "@bokub/prettier-config" | ||
} | ||
``` | ||
|
||
#### _Optional:_ Setup pre-commit hook | ||
|
||
```bash | ||
npx husky-init | ||
npm i -D pretty-quick | ||
npx husky set .husky/pre-commit 'pretty-quick --staged' | ||
``` | ||
|
||
#### _Optional:_ Run prettier on old code | ||
|
||
```bash | ||
npx prettier --write . | ||
``` | ||
|
||
[style-src]: https://flat.badgen.net/badge/code%20style/prettier/ff69b4 | ||
[style-href]: https://github.com/prettier/prettier | ||
[downloads-src]: https://flat.badgen.net/npm/dt/@bokub/prettier-config | ||
[downloads-href]: https://www.npmjs.com/package/@bokub/prettier-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"printWidth": 120, | ||
"vueIndentScriptAndStyle": true | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"printWidth": 120, | ||
"vueIndentScriptAndStyle": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
{ | ||
"name": "@bokub/prettier-config", | ||
"version": "2.0.0", | ||
"description": "bokub's favorite prettier config", | ||
"author": "bokub", | ||
"license": "MIT", | ||
"homepage": "https://github.com/bokub/prettier-config", | ||
"main": "index.json", | ||
"files": [ | ||
"package.json", | ||
"index.json", | ||
"README.md" | ||
], | ||
"keywords": [ | ||
"prettier", | ||
"config", | ||
"prettier-config" | ||
] | ||
"name": "@bokub/prettier-config", | ||
"version": "2.0.1", | ||
"description": "bokub's favorite prettier config", | ||
"author": "bokub", | ||
"license": "MIT", | ||
"homepage": "https://github.com/bokub/prettier-config", | ||
"main": "index.json", | ||
"files": [ | ||
"package.json", | ||
"index.json", | ||
"README.md" | ||
], | ||
"keywords": [ | ||
"prettier", | ||
"config", | ||
"prettier-config" | ||
] | ||
} |