Skip to content

Commit 9d68dd1

Browse files
Add prettier for staged files
1 parent eae18b0 commit 9d68dd1

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lint-staged

.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"printWidth": 100,
3+
"singleQuote": true,
4+
"tabWidth": 4,
5+
"trailingComma": "all",
6+
"endOfLine": "auto",
7+
"plugins": [
8+
"prettier-plugin-organize-imports"
9+
]
10+
}

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44
"author": "iExec",
55
"license": "Apache-2.0",
66
"scripts": {
7-
"test-builds": "bash test-builds.sh",
7+
"prepare": "husky",
88
"codegen": "graph codegen subgraph.template.yaml",
99
"test": "npm run codegen && graph test",
1010
"test-docker": "npm run codegen && docker run -it --rm -v $(pwd):/matchstick/subgraph rainprotocol/matchstick:main",
1111
"build": "npm run codegen && graph build subgraph.${NETWORK_NAME:-bellecour}.yaml"
1212
},
13+
"lint-staged": {
14+
"*.{js,ts}": [
15+
"prettier --write"
16+
]
17+
},
1318
"homepage": "https://github.com/iExecBlockchainComputing/PoCo-subgraph.git#readme",
1419
"repository": {
1520
"type": "git",
@@ -21,7 +26,11 @@
2126
"devDependencies": {
2227
"@graphprotocol/graph-cli": "^0.86.0",
2328
"@graphprotocol/graph-ts": "^0.35.1",
24-
"matchstick-as": "^0.6.0"
29+
"husky": "^9.1.6",
30+
"lint-staged": "^15.2.10",
31+
"matchstick-as": "^0.6.0",
32+
"prettier": "^3.3.3",
33+
"prettier-plugin-organize-imports": "^4.1.0"
2534
},
2635
"dependencies": {
2736
"@iexec/poco": "5.3.0",

0 commit comments

Comments
 (0)