Skip to content

Commit

Permalink
Merge pull request #236 from hackdays-io/add_biome_lefthook
Browse files Browse the repository at this point in the history
Biome と Lefthookの設定を加えました!
  • Loading branch information
yu23ki14 authored Jan 9, 2025
2 parents 4d856cc + 5749bc1 commit 5137190
Show file tree
Hide file tree
Showing 152 changed files with 8,544 additions and 8,018 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test-contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ jobs:
run: yarn install
working-directory: ./pkgs/contract

- name: Lint Check
run: yarn lint
working-directory: ./pkgs/contract

- name: Run Hardhat tests
run: |
npx hardhat test > ./test-results.txt
Expand Down
7 changes: 0 additions & 7 deletions .prettierignore

This file was deleted.

37 changes: 0 additions & 37 deletions .prettierrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"biomejs.biome",
"NomicFoundation.hardhat-solidity",
"tintinweb.solidity-visual-auditor",
"jebbs.plantuml",
Expand Down
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "biomejs.biome",
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"[plantuml]": {
"editor.defaultFormatter": "jebbs.plantuml"
}
},
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true
}
47 changes: 47 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": [
"**/node_modules",
"**/build",
"**/dist",
"**/coverage",
"**/temp",
"**/tmp",
"**/out",
"**/target",
"**/public",
"**/docs",
"**/contract/artifacts",
"**/contract/cache",
"**/contract/test",
"**/subgraph/generated",
"**/subgraph/build",
"**/frontend/gql"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
}
}
5 changes: 5 additions & 0 deletions lefthook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pre-commit:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true . && git update-index --again
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@
"engines": {
"node": ">=20"
},
"workspaces": [
"pkgs/*"
],
"workspaces": ["pkgs/*"],
"scripts": {
"biome:format": "npx biome format --write .",
"biome:check": "npx biome check --apply .",
"frontend": "yarn workspace frontend",
"contract": "yarn workspace contract",
"cli": "yarn workspace cli",
"document": "yarn workspace document"
"document": "yarn workspace document",
"subgraph": "yarn workspace subgraph"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"lefthook": "^1.10.1"
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
46 changes: 23 additions & 23 deletions pkgs/cli/scripts/hat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { hatsSubgraphClient } from "../src/modules/hatsProtocol";
* HatsProtocolの機能を試すためのスクリプト
*/
const main = async () => {
/*
/*
// hatの情報を取得する。
const hat = await hatsSubgraphClient.getHat({
chainId: optimism.id,
Expand Down Expand Up @@ -34,29 +34,29 @@ const main = async () => {
console.log(hat);
*/

// ツリー情報を全て取得する。
const tree = await hatsSubgraphClient.getTree({
chainId: optimism.id,
treeId: 163,
props: {
hats: {
props: {
prettyId: true,
status: true,
createdAt: true,
details: true,
maxSupply: true,
eligibility: true,
imageUri: true,
toggle: true,
levelAtLocalTree: true,
currentSupply: true,
},
},
},
});
// ツリー情報を全て取得する。
const tree = await hatsSubgraphClient.getTree({
chainId: optimism.id,
treeId: 163,
props: {
hats: {
props: {
prettyId: true,
status: true,
createdAt: true,
details: true,
maxSupply: true,
eligibility: true,
imageUri: true,
toggle: true,
levelAtLocalTree: true,
currentSupply: true,
},
},
},
});

console.log(tree);
console.log(tree);
};

main().catch(console.error);
Loading

0 comments on commit 5137190

Please sign in to comment.