Skip to content

Commit 15ae00f

Browse files
committed
chore: Add prettier config.
1 parent 144095e commit 15ae00f

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

.prettierignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
**/*.md
2+
**/*.svg
3+
**/*.ejs
4+
**/*.yml
5+
package.json
6+
node_modules
7+
dist
8+
build
9+
lib
10+
test

.prettierrc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 120,
5+
"overrides": [
6+
{
7+
"files": ".prettierrc",
8+
"options": { "parser": "json" }
9+
}
10+
]
11+
}

package.json

+15-1
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,27 @@
5454
"version": "lerna version --no-changelog --no-git-tag-version --no-push --yes",
5555
"publish": "npm run build && lerna publish from-package",
5656
"ci:publish": "lerna publish from-package --yes --no-verify-access",
57+
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
5758
"updated": "lerna updated",
5859
"clean": "lerna clean",
5960
"tsbb": "tsbb"
6061
},
62+
"husky": {
63+
"hooks": {
64+
"pre-commit": "lint-staged"
65+
}
66+
},
67+
"lint-staged": {
68+
"*.{js,jsx,ts,tsx,less,md,json}": [
69+
"prettier --write"
70+
]
71+
},
6172
"devDependencies": {
62-
"react-scripts": "4.0.1",
73+
"husky": "4.3.7",
6374
"lerna": "3.22.1",
75+
"lint-staged": "10.5.3",
76+
"prettier": "2.2.1",
77+
"react-scripts": "4.0.1",
6478
"tsbb": "1.7.9"
6579
}
6680
}

0 commit comments

Comments
 (0)