Skip to content

Commit 1bfa668

Browse files
committed
feat(prettier): add husky pre commit
1 parent 0e7e493 commit 1bfa668

File tree

7 files changed

+240
-8
lines changed

7 files changed

+240
-8
lines changed

.github/workflows/pancake-top100-sync.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
with:
2020
path: |
2121
node_modules
22-
key: yarn-${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}
22+
key:
23+
yarn-${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}
2324

2425
- name: Yarn install
2526
run: yarn install
@@ -48,7 +49,9 @@ jobs:
4849
author: Maskbook maintainer bot <bot@mask.io>
4950
branch: auto-sync-token-list
5051
title: ":chore: sync token list from Pancakeswap"
51-
body: "## (🤖 I am a robot) updates or error report \n\n```diff\n${{ env.GIT_DIFF }}\n```"
52+
body:
53+
"## (🤖 I am a robot) updates or error report \n\n```diff\n${{
54+
env.GIT_DIFF }}\n```"
5255
assignees: |
5356
guanbinrui
5457
unclebill

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx pretty-quick --staged

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- repo: https://github.com/pre-commit/mirrors-prettier
2+
rev: "" # Use the sha or tag you want to point at
3+
hooks:
4+
- id: prettier

.prettierrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
{}
1+
{
2+
"proseWrap": "always"
3+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The token lists for Mask Network.
2525
| CELO | 42220 | [latest](https://tokens.r2d2.to/latest/42220/tokens.json) | [token-list](https://tokenlists.org/token-list?url=https://tokens.r2d2.to/latest/42220/tokens.json) |
2626
| Avalanche | 43114 | [latest](https://tokens.r2d2.to/latest/43114/tokens.json) | [token-list](https://tokenlists.org/token-list?url=https://tokens.r2d2.to/latest/43114/tokens.json) |
2727
| Aurora | 1313161554 | [latest](https://tokens.r2d2.to/latest/1313161554/tokens.json) | [token-list](https://tokenlists.org/token-list?url=https://tokens.r2d2.to/latest/1313161554/tokens.json) |
28-
| HECO | 128 | [latest](https://tokens.r2d2.to/latest/128/tokens.json) | [token-list](https://tokenlists.org/token-list?url=https://tokens.r2d2.to/latest/128/tokens.json)
28+
| HECO | 128 | [latest](https://tokens.r2d2.to/latest/128/tokens.json) | [token-list](https://tokenlists.org/token-list?url=https://tokens.r2d2.to/latest/128/tokens.json) |
2929

3030
## Versions
3131

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"scripts": {
99
"build": "./scripts/build.sh",
1010
"publish": "gh-pages -d ./dist",
11-
"prettier": "prettier -c ."
11+
"prettier": "prettier -c .",
12+
"prepare": "husky install"
1213
},
1314
"dependencies": {
1415
"@uniswap/token-lists": "^1.0.0-beta.24",
@@ -17,7 +18,9 @@
1718
},
1819
"devDependencies": {
1920
"gh-pages": "^3.1.0",
21+
"husky": "^7.0.0",
2022
"node-fetch": "^2.6.1",
21-
"prettier": "2.5.1"
23+
"prettier": "2.5.1",
24+
"pretty-quick": "^3.1.3"
2225
}
2326
}

0 commit comments

Comments
 (0)