Skip to content

Commit

Permalink
chore: add prettier.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Sep 7, 2021
1 parent febb885 commit 9da36cc
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package.json
dist
build
lib
esm
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 120,
"overrides": [
{
"files": ".prettierrc",
"options": { "parser": "json" }
}
]
}
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
"require": "./cjs/index.js"
},
"scripts": {
"prepare": "npm run build",
"prepare": "husky install && npm run build",
"watch": "tsbb watch",
"build": "tsbb build",
"doc": "kkt build --app-src ./website",
"start": "kkt start --app-src ./website"
"start": "kkt start --app-src ./website",
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,html,less,md,json}'"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -56,6 +57,11 @@
"react-app/jest"
]
},
"lint-staged": {
"*.{js,jsx,ts,tsx,html,less,md,json}": [
"prettier --write"
]
},
"devDependencies": {
"@codemirror/lang-cpp": "0.19.1",
"@codemirror/lang-html": "0.19.1",
Expand All @@ -79,7 +85,10 @@
"@uiw/react-shields": "1.1.1",
"@uiw/reset.css": "1.0.5",
"code-example": "3.0.6",
"husky": "7.0.2",
"kkt": "6.11.0",
"lint-staged": "11.1.2",
"prettier": "2.3.2",
"react": "17.0.2",
"react-dom": "17.0.2",
"tsbb": "3.0.4"
Expand Down

0 comments on commit 9da36cc

Please sign in to comment.