Skip to content

Commit

Permalink
feat: add prettier.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 29, 2021
1 parent 355d839 commit e5ebdce
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 6 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
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
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
**/*.md
**/*.svg
**/*.ejs
**/*.yml
package.json
node_modules
dist
build
lib
test
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 120,
"endOfLine": "auto",
"overrides": [
{
"files": ".prettierrc",
"options": { "parser": "json" }
}
]
}
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
"description": "Converting HEX & RGB colors to UIColor/NSColor/Color for both Objective C & Swift.",
"private": true,
"scripts": {
"prepare": "husky install",
"start": "kkt start",
"build": "kkt build"
"build": "kkt build",
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\""
},
"repository": {
"type": "git",
"url": "https://github.com/uiwjs/ui-color.git"
},
"author": "",
"author": "Kenny Wong <wowohoo@qq.com>",
"license": "MIT",
"dependencies": {
"@uiw/react-github-corners": "1.4.0",
Expand All @@ -27,7 +29,15 @@
"@types/react": "17.0.11",
"@types/react-color": "3.0.4",
"@types/react-dom": "17.0.8",
"kkt": "6.10.4"
"husky": "6.0.0",
"lint-staged": "11.0.0",
"kkt": "6.10.4",
"prettier": "2.3.2"
},
"lint-staged": {
"*.{js,jsx,tsx,ts,less,md,json}": [
"prettier --write"
]
},
"browserslist": {
"production": [
Expand Down
4 changes: 1 addition & 3 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"extends": [
"config:base"
]
"extends": ["config:base"]
}

0 comments on commit e5ebdce

Please sign in to comment.