Commit a235694c authored by Kent C. Dodds's avatar Kent C. Dodds Committed by Dan Abramov
Browse files

Add lint-staged + husky for prettier auto-formatting on commit (#1759)

parent 837f5449
4 merge requests!12191Lim.Pisey.168:/Identified - We are currently investigating reports of missing build logs. The issue has been identified and a resolution is in progress. We will provide a further update when available.Mar 21, 09:02 UTC,!12853brikk,!5717Automatically extract project file structure from build bundle file,!1933Add note about installing watchman
Showing with 10 additions and 3 deletions
+10 -3
...@@ -4,7 +4,5 @@ If you changed any code, there are just two more things to do: ...@@ -4,7 +4,5 @@ If you changed any code, there are just two more things to do:
* Provide us with clear instructions on how you verified your changes work. Bonus points for screenshots! * Provide us with clear instructions on how you verified your changes work. Bonus points for screenshots!
* If you changed any code, run `npm run format` in the root folder, and commit and push the changes.
Happy contributing! Happy contributing!
--> -->
...@@ -9,12 +9,21 @@ ...@@ -9,12 +9,21 @@
"publish": "tasks/release.sh", "publish": "tasks/release.sh",
"start": "node packages/react-scripts/scripts/start.js", "start": "node packages/react-scripts/scripts/start.js",
"test": "node packages/react-scripts/scripts/test.js --env=jsdom", "test": "node packages/react-scripts/scripts/test.js --env=jsdom",
"format": "prettier --trailing-comma es5 --single-quote --write 'packages/*/*.js' 'packages/*/!(node_modules)/**/*.js'" "format": "prettier --trailing-comma es5 --single-quote --write 'packages/*/*.js' 'packages/*/!(node_modules)/**/*.js'",
"precommit": "lint-staged"
}, },
"devDependencies": { "devDependencies": {
"eslint": "3.16.1", "eslint": "3.16.1",
"husky": "^0.13.2",
"lerna": "2.0.0-beta.38", "lerna": "2.0.0-beta.38",
"lerna-changelog": "^0.2.3", "lerna-changelog": "^0.2.3",
"lint-staged": "^3.3.1",
"prettier": "^0.21.0" "prettier": "^0.21.0"
},
"lint-staged": {
"*.js": [
"prettier --trailing-comma es5 --single-quote --write",
"git add"
]
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment