Add prettier precommit hook (#455)

pull/457/head
Yorke Rhodes 3 years ago committed by GitHub
parent d1c82dee90
commit 8f8ec87542
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .husky/pre-commit
  2. 4
      package.json
  3. 10
      yarn.lock

@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
yarn prettier

@ -2,7 +2,8 @@
"name": "@abacus-network/monorepo", "name": "@abacus-network/monorepo",
"scripts": { "scripts": {
"build": "yarn workspaces foreach --parallel --topological run build", "build": "yarn workspaces foreach --parallel --topological run build",
"prettier": "yarn workspaces foreach --parallel run prettier" "prettier": "yarn workspaces foreach --parallel run prettier",
"postinstall": "husky install"
}, },
"workspaces": [ "workspaces": [
"solidity/*", "solidity/*",
@ -13,6 +14,7 @@
"packageManager": "yarn@3.2.0", "packageManager": "yarn@3.2.0",
"devDependencies": { "devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^3.2.0", "@trivago/prettier-plugin-sort-imports": "^3.2.0",
"husky": "^8.0.0",
"prettier": "^2.2.1", "prettier": "^2.2.1",
"typescript": "^4.3.5" "typescript": "^4.3.5"
} }

@ -176,6 +176,7 @@ __metadata:
resolution: "@abacus-network/monorepo@workspace:." resolution: "@abacus-network/monorepo@workspace:."
dependencies: dependencies:
"@trivago/prettier-plugin-sort-imports": ^3.2.0 "@trivago/prettier-plugin-sort-imports": ^3.2.0
husky: ^8.0.0
prettier: ^2.2.1 prettier: ^2.2.1
typescript: ^4.3.5 typescript: ^4.3.5
languageName: unknown languageName: unknown
@ -9230,6 +9231,15 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"husky@npm:^8.0.0":
version: 8.0.1
resolution: "husky@npm:8.0.1"
bin:
husky: lib/bin.js
checksum: 943a73a13d0201318fd30e83d299bb81d866bd245b69e6277804c3b462638dc1921694cb94c2b8c920a4a187060f7d6058d3365152865406352e934c5fff70dc
languageName: node
linkType: hard
"iconv-lite@npm:0.4.24, iconv-lite@npm:^0.4.24": "iconv-lite@npm:0.4.24, iconv-lite@npm:^0.4.24":
version: 0.4.24 version: 0.4.24
resolution: "iconv-lite@npm:0.4.24" resolution: "iconv-lite@npm:0.4.24"

Loading…
Cancel
Save