Skip to content

Commit

Permalink
chore: Add prettier.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Oct 17, 2021
1 parent f4c1c7b commit c0e910f
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
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
11 changes: 11 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
**/*.md
**/*.svg
**/*.ejs
**/*.yml
package.json
node_modules
dist
build
coverage
lib
test
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" }
}
]
}
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
"types": "./lib/index.d.ts",
"exports": "./lib/index.js",
"scripts": {
"prepare": "husky install",
"start": "node lib/index.js",
"watch": "tsbb watch --disable-babel",
"build": "tsbb build --disable-babel",
"test": "tsbb test",
"coverage": "tsbb test --coverage"
"coverage": "tsbb test --coverage",
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\""
},
"repository": {
"type": "git",
Expand All @@ -32,7 +34,13 @@
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"lint-staged": {
"*.{js,jsx,tsx,ts,less,md,json}": "prettier --write"
},
"devDependencies": {
"husky": "7.0.2",
"lint-staged": "11.1.2",
"prettier": "2.3.2",
"tsbb": "3.4.4"
}
}

0 comments on commit c0e910f

Please sign in to comment.