Skip to content

Commit 5af37a4

Browse files
committed
chore(react-component-tsx): Add prettier config.
1 parent 44fee6f commit 5af37a4

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

Diff for: example/react-component-tsx/.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

Diff for: example/react-component-tsx/.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+
}

Diff for: example/react-component-tsx/package.json

+15-1
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,25 @@
1818
"css:build": "compile-less -d src -o lib/esm",
1919
"css:watch": "compile-less -d src -o lib/esm --watch",
2020
"ts:watch": "tsbb watch --env-name esm:dev --env-name cjs --target react",
21-
"ts:build": "tsbb build --target react"
21+
"ts:build": "tsbb build --target react",
22+
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\""
2223
},
2324
"repository": {
2425
"type": "git",
2526
"url": "https://github.com/kktjs/kkt.git"
2627
},
2728
"author": "",
2829
"license": "MIT",
30+
"husky": {
31+
"hooks": {
32+
"pre-commit": "lint-staged"
33+
}
34+
},
35+
"lint-staged": {
36+
"*.{js,jsx,tsx,ts,less,md,json}": [
37+
"prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\""
38+
]
39+
},
2940
"peerDependencies": {
3041
"@babel/runtime": ">=7.10.0",
3142
"react": ">=16.9.0",
@@ -41,7 +52,10 @@
4152
"@types/react": "17.0.0",
4253
"@types/react-dom": "17.0.0",
4354
"compile-less-cli": "1.6.0",
55+
"husky": "4.3.7",
4456
"kkt": "6.0.12",
57+
"lint-staged": "10.5.3",
58+
"prettier": "2.2.1",
4559
"react": "17.0.1",
4660
"react-dom": "17.0.1",
4761
"tsbb": "1.7.9"

0 commit comments

Comments
 (0)