Skip to content

Commit 52fac03

Browse files
committedSep 16, 2017
🔧🚨👷 Add prettier for auto formatting incl. pre-commit hock
1 parent e06d368 commit 52fac03

File tree

3 files changed

+454
-12
lines changed

3 files changed

+454
-12
lines changed
 

‎package.json

+12-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"start": "next start",
1515
"untrack-sketch": "git update-index --skip-worktree ./static/gitmoji-triangle.sketch",
1616
"track-sketch": "git update-index --no-skip-worktree ./static/gitmoji-triangle.sketch",
17-
"update-sketch": "npm run track-sketch && git commit -m '🍱📦 Updating Sketchfile' ./static/gitmoji-triangle.sketch && npm run untrack-sketch"
17+
"update-sketch": "npm run track-sketch && git commit -m '🍱📦 Updating Sketchfile' ./static/gitmoji-triangle.sketch && npm run untrack-sketch",
18+
"precommit": "lint-staged"
1819
},
1920
"dependencies": {
2021
"next": "^3.2.2",
@@ -26,11 +27,21 @@
2627
"@types/node": "^8.0.28",
2728
"@types/react": "^15.6.2",
2829
"concurrently": "^3.5.0",
30+
"husky": "^0.14.3",
31+
"lint-staged": "^4.2.1",
2932
"prettier": "^1.7.0",
33+
"tslint": "^5.7.0",
34+
"tslint-config-prettier": "^1.5.0",
3035
"typescript": "^2.5.2"
3136
},
3237
"prettier": {
3338
"singleQuote": false,
3439
"trailingComma": "es5"
40+
},
41+
"lint-staged": {
42+
"{pages,static}/**/*.{ts,tsx,js,json,html,css}": [
43+
"prettier --list-different --write",
44+
"git add"
45+
]
3546
}
3647
}

‎tslint.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,9 @@
137137
"check-separator",
138138
"check-type"
139139
]
140-
}
140+
},
141+
"extends": [
142+
"tslint:latest",
143+
"tslint-config-prettier"
144+
]
141145
}

0 commit comments

Comments
 (0)
Please sign in to comment.