Skip to content

Commit 05a716d

Browse files
committed
feat(template): add prettier for formating code
1 parent 4948534 commit 05a716d

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

generators/app/templates/.huskyrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"hooks": {
3-
"pre-commit": "yarn lint",
3+
"pre-commit": "pretty-quick --staged --pattern \"**/*.*(json|js|ts|yml|md)\" && yarn lint",
44
"pre-push": "yarn build"
55
}
66
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.rpt2_cache
2+
dist
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const config = require('@boringcodes/prettier-config');
2+
3+
module.exports = config;

generators/app/templates/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,24 @@
1313
"dist"
1414
],
1515
"scripts": {
16-
"clean": "rm -rf dist",
1716
"purge": "rm -rf node_modules",
17+
"clean": "rm -rf dist",
1818
"dev": "rollup -cw",
19+
"format": "prettier --write \"**/*.*(json|js|ts|yml|md)\"",
20+
"format:check": "prettier --check \"**/*.*(json|js|ts|yml|md)\"",
21+
"lint": "tslint --project tsconfig.json --config tslint.json",
1922
"prebuild": "yarn clean",
2023
"build": "rollup -c",
21-
"lint": "tslint --project tsconfig.json --config tslint.json",
2224
"release": "standard-version --no-verify",
2325
"release:major": "yarn release --release-as major",
2426
"release:minor": "yarn release --release-as minor",
2527
"release:patch": "yarn release --release-as patch"
2628
},
2729
"devDependencies": {
30+
"@boringcodes/prettier-config": "*",
2831
"husky": "^2.3.0",
32+
"prettier": "^2.0.2",
33+
"pretty-quick": "^2.0.1",
2934
"rollup": "^1.12.3",
3035
"rollup-plugin-async": "^1.2.0",
3136
"rollup-plugin-commonjs": "^10.0.0",

0 commit comments

Comments
 (0)