-
-
Save frozeny/bbe44cf919c54a94d6331aa67262c7cc to your computer and use it in GitHub Desktop.
Revisions
-
primaryobjects revised this gist
Jul 4, 2017 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -28,9 +28,8 @@ - Run the following commands: ```bash npm install npm install prettier lint-staged pre-commit --save-dev ``` ## References -
primaryobjects revised this gist
Jul 1, 2017 . No changes.There are no files selected for viewing
-
primaryobjects revised this gist
Jul 1, 2017 . 1 changed file with 20 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,22 +2,30 @@ - Create your .git repository. - Edit `package.json` to add a `scripts`, `pre-commit`, and `lint-staged` section, as shown below. ```js { "name": "example", "main": "app.js", "dependencies": { "express": "*", }, "scripts": { "pre-commit": "lint-staged" }, "pre-commit": [ "pre-commit" ], "lint-staged": { "*.js": [ "prettier --write", "git add" ] } } ``` - Run the following commands: ```bash npm install prettier -g -
primaryobjects revised this gist
Jul 1, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
LoadingSorry, something went wrong. Reload?Sorry, we cannot display this file.Sorry, this file is invalid so it cannot be displayed. -
primaryobjects revised this gist
Jul 1, 2017 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -24,3 +24,8 @@ npm install npm install lint-staged pre-commit --save-dev ``` ## References - [prettier](https://www.npmjs.com/package/prettier) - [pre-commit](https://github.com/observing/pre-commit) -
primaryobjects created this gist
Jul 1, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ # Setting up prettier as a pre-commit hook for Git commits. - Create your .git repository. - Edit `package.json` to add following section: ```js "scripts": { "pre-commit": "lint-staged" }, "pre-commit": [ "pre-commit" ], "lint-staged": { "*.js": [ "prettier --write", "git add" ] } ``` - Run the following commands: ```bash npm install prettier -g npm install npm install lint-staged pre-commit --save-dev ```