Skip to content

Commit

Permalink
Add lint-staged to format-fix & lint-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
embiem committed Jan 28, 2022
1 parent d1d195b commit 9b3df22
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 2 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 lint-staged
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,23 @@
"next:test": "yarn workspace next-app run test",
"next:build": "yarn workspace next-app run build",
"e2e": "yarn workspace next-app run e2e",
"prepare": "yarn workspace hardhat run prepare"
"prepare": "husky install && yarn workspace hardhat run prepare"
},
"workspaces": [
"packages/*"
],
"devDependencies": {
"eslint": "^8.2.0",
"husky": "^7.0.4",
"prettier": "^2.4.1"
},
"lint-staged": {
"packages/hardhat/**/*.{ts,js,sol}": "yarn workspace hardhat prettier --write",
"packages/hardhat/**/*.{js,ts}": "yarn workspace hardhat eslint --fix",
"packages/hardhat/**/*.sol": "yarn workspace hardhat solhint --fix",
"packages/next-app/**/*.{ts,js,tsx,jsx}": [
"yarn workspace next-app prettier --write",
"yarn workspace next-app eslint --fix"
]
}
}
1 change: 1 addition & 0 deletions packages/next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"eslint-plugin-testing-library": "^5.0.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.3.1",
"prettier": "^2.5.1",
"react-test-renderer": "^17.0.2",
"typescript": "4.4.4",
"webpack": "^5.66.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-app/src/components/toasts/confirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CheckIcon } from "@chakra-ui/icons";
export const ConfirmToast = ({
message,
link_message,
link
link,
}: {
message: string;
link_message: string;
Expand Down
20 changes: 20 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9948,6 +9948,7 @@ __metadata:
resolution: "code-claim-site@workspace:."
dependencies:
eslint: ^8.2.0
husky: ^7.0.4
prettier: ^2.4.1
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -15215,6 +15216,15 @@ __metadata:
languageName: node
linkType: hard

"husky@npm:^7.0.4":
version: 7.0.4
resolution: "husky@npm:7.0.4"
bin:
husky: lib/bin.js
checksum: c6ec4af63da2c9522da8674a20ad9b48362cc92704896cc8a58c6a2a39d797feb2b806f93fbd83a6d653fbdceb2c3b6e0b602c6b2e8565206ffc2882ef7db9e9
languageName: node
linkType: hard

"iconv-lite@npm:0.4.24, iconv-lite@npm:^0.4.24":
version: 0.4.24
resolution: "iconv-lite@npm:0.4.24"
Expand Down Expand Up @@ -18728,6 +18738,7 @@ __metadata:
keccak256: ^1.0.6
merkletreejs: ^0.2.27
next: 12.0.3
prettier: ^2.5.1
react: 17.0.2
react-confetti: ^6.0.1
react-dom: 17.0.2
Expand Down Expand Up @@ -20327,6 +20338,15 @@ __metadata:
languageName: node
linkType: hard

"prettier@npm:^2.5.1":
version: 2.5.1
resolution: "prettier@npm:2.5.1"
bin:
prettier: bin-prettier.js
checksum: 21b9408476ea1c544b0e45d51ceb94a84789ff92095abb710942d780c862d0daebdb29972d47f6b4d0f7ebbfb0ffbf56cc2cfa3e3e9d1cca54864af185b15b66
languageName: node
linkType: hard

"pretty-bytes@npm:^5.6.0":
version: 5.6.0
resolution: "pretty-bytes@npm:5.6.0"
Expand Down

0 comments on commit 9b3df22

Please sign in to comment.