diff --git a/explorer-nextjs/biome.json b/explorer-nextjs/biome.json new file mode 100644 index 0000000000..e4ae1d93fd --- /dev/null +++ b/explorer-nextjs/biome.json @@ -0,0 +1,30 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "vcs": { + "enabled": false, + "clientKind": "git", + "useIgnoreFile": false + }, + "files": { + "ignoreUnknown": false, + "ignore": ["node_modules", ".next", "public"] + }, + "formatter": { + "enabled": true, + "indentStyle": "space" + }, + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "javascript": { + "formatter": { + "quoteStyle": "double" + } + } +} diff --git a/explorer-nextjs/package.json b/explorer-nextjs/package.json index e4409c5910..02d6e99b72 100644 --- a/explorer-nextjs/package.json +++ b/explorer-nextjs/package.json @@ -6,7 +6,7 @@ "build": "next build", "build:prod": "yarn --cwd .. build && next build", "start": "next start", - "lint": "next lint" + "lint": "biome check --fix" }, "dependencies": { "@emotion/cache": "^11.13.5", @@ -26,11 +26,13 @@ "@mui/x-charts": "^7.22.3" }, "devDependencies": { + "@biomejs/biome": "1.9.4", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", "eslint": "^8", "eslint-config-next": "15.0.3", + "lefthook": "^1.8.5", "typescript": "^5" } } diff --git a/explorer-nextjs/src/components/button/index.tsx b/explorer-nextjs/src/components/button/index.tsx index 92d3f4a1bf..018913a09f 100644 --- a/explorer-nextjs/src/components/button/index.tsx +++ b/explorer-nextjs/src/components/button/index.tsx @@ -57,10 +57,10 @@ export const Button = ({ const padding = isTextButton ? "none" : isXtraSmall - ? "10px 23px" - : isSmall - ? "11px 23px" - : "15px 23px"; + ? "10px 23px" + : isSmall + ? "11px 23px" + : "15px 23px"; const CustomButtom = ( { return ( diff --git a/lefthook.yml b/lefthook.yml new file mode 100644 index 0000000000..1c9355e40f --- /dev/null +++ b/lefthook.yml @@ -0,0 +1,7 @@ +pre-commit: + commands: + check: + root: "explorer-nextjs/" + glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc,css}" + run: yarn biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files} + stage_fixed: true diff --git a/yarn.lock b/yarn.lock index 51c5cf7fd7..f144afdcf0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1198,6 +1198,60 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@biomejs/biome@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-1.9.4.tgz#89766281cbc3a0aae865a7ff13d6aaffea2842bf" + integrity sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog== + optionalDependencies: + "@biomejs/cli-darwin-arm64" "1.9.4" + "@biomejs/cli-darwin-x64" "1.9.4" + "@biomejs/cli-linux-arm64" "1.9.4" + "@biomejs/cli-linux-arm64-musl" "1.9.4" + "@biomejs/cli-linux-x64" "1.9.4" + "@biomejs/cli-linux-x64-musl" "1.9.4" + "@biomejs/cli-win32-arm64" "1.9.4" + "@biomejs/cli-win32-x64" "1.9.4" + +"@biomejs/cli-darwin-arm64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz#dfa376d23a54a2d8f17133c92f23c1bf2e62509f" + integrity sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw== + +"@biomejs/cli-darwin-x64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz#eafc2ce3849d385fc02238aad1ca4a73395a64d9" + integrity sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg== + +"@biomejs/cli-linux-arm64-musl@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz#d780c3e01758fc90f3268357e3f19163d1f84fca" + integrity sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA== + +"@biomejs/cli-linux-arm64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz#8ed1dd0e89419a4b66a47f95aefb8c46ae6041c9" + integrity sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g== + +"@biomejs/cli-linux-x64-musl@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz#f36982b966bd671a36671e1de4417963d7db15fb" + integrity sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg== + +"@biomejs/cli-linux-x64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz#a0a7f56680c76b8034ddc149dbf398bdd3a462e8" + integrity sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg== + +"@biomejs/cli-win32-arm64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz#e2ef4e0084e76b7e26f0fc887c5ef1265ea56200" + integrity sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg== + +"@biomejs/cli-win32-x64@1.9.4": + version "1.9.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz#4c7afa90e3970213599b4095e62f87e5972b2340" + integrity sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA== + "@chain-registry/client@^1.49.11": version "1.53.27" resolved "https://registry.yarnpkg.com/@chain-registry/client/-/client-1.53.27.tgz#07a4517c1c2532a397f9f94f0ba59323b05c5748" @@ -16992,6 +17046,72 @@ lazy-universal-dotenv@^3.0.1: dotenv "^8.0.0" dotenv-expand "^5.1.0" +lefthook-darwin-arm64@1.8.5: + version "1.8.5" + resolved "https://registry.yarnpkg.com/lefthook-darwin-arm64/-/lefthook-darwin-arm64-1.8.5.tgz#38fca1049db0ad053e55a6c374cfc294fc40a5a9" + integrity sha512-BXUcE+2TTkYRGhMB+6HwAbxhK72L4kFKbukb74VfSk9HYBFb/7IQXyUgsB2dik3LSTcDcl9SgOayzeLU9EqmGw== + +lefthook-darwin-x64@1.8.5: + version "1.8.5" + resolved "https://registry.yarnpkg.com/lefthook-darwin-x64/-/lefthook-darwin-x64-1.8.5.tgz#51e2001e9b042c4cd2df0d1222c6b8b52155b29d" + integrity sha512-xkjYwVlJBQiJALR9jJi6MpIF161z6Td3gyVJoGII95h9hETYZV2J7ox4PUGufE5EV8P0AXWveWo8cJWhWVbssw== + +lefthook-freebsd-arm64@1.8.5: + version "1.8.5" + resolved "https://registry.yarnpkg.com/lefthook-freebsd-arm64/-/lefthook-freebsd-arm64-1.8.5.tgz#4bad183bef18e2e59ebd2aa03b8a56a7bf0281d5" + integrity sha512-kL8+HxjAtMco824pZkBJiA3+q4djldNNw06atzgAxyy8/Kj+2NjlIaez88NPQHE4hAVMqtURzmRtnaruaRtT1g== + +lefthook-freebsd-x64@1.8.5: + version "1.8.5" + resolved "https://registry.yarnpkg.com/lefthook-freebsd-x64/-/lefthook-freebsd-x64-1.8.5.tgz#044e3939d0c3cf72c2179ddbb797c4b2d8abdad5" + integrity sha512-fQfSUbAQVhLalZFl6sFGJQVBJK9EsQpmXrv1Qunhi8QOY/f07a2onsWb+jI9sp31ITTe2Jtzu0h31ZCBqTWxQw== + +lefthook-linux-arm64@1.8.5: + version "1.8.5" + resolved "https://registry.yarnpkg.com/lefthook-linux-arm64/-/lefthook-linux-arm64-1.8.5.tgz#3da0499e6ae4bf4835207f5b36c69c77bdefdeef" + integrity sha512-gnBonAc3Heq+Sd+MzSbtLmZkYzSDZ+tTpLAfq2Q62qnVEZpWXFd3qfS2up5a7oUEDNcos7OHDqebSbowpNilZA== + +lefthook-linux-x64@1.8.5: + version "1.8.5" + resolved "https://registry.yarnpkg.com/lefthook-linux-x64/-/lefthook-linux-x64-1.8.5.tgz#1c9c449ff972a5a684e29040a2502039e2534e6e" + integrity sha512-lLsbnXy58Syw6VMJS554HbfrBKUZ0mBWvDbr0DGoDBvFyxtvv5kFMbF/ZlRpLKl7Ds9IqCCCW0NpsjsixX4Z+A== + +lefthook-openbsd-arm64@1.8.5: + version "1.8.5" + resolved "https://registry.yarnpkg.com/lefthook-openbsd-arm64/-/lefthook-openbsd-arm64-1.8.5.tgz#ab1ea2e674b421fdab125d48f6d3d76790291258" + integrity sha512-g3XFw/0q0T0Zd1vpPCO5l+ryFIyf+v/FFVPVb6HKvpDI4BYLFVzsZeVGzRiWZt1oJ0DI9qrrvdG4uJJBs4tSDQ== + +lefthook-openbsd-x64@1.8.5: + version "1.8.5" + resolved "https://registry.yarnpkg.com/lefthook-openbsd-x64/-/lefthook-openbsd-x64-1.8.5.tgz#bb5a423d8d27a3c3cfeaa94b590ce82d123918bd" + integrity sha512-GmfnPUMMxa/ckHS2L7zIobWusaUmDWZU0zQj016QXGYS4SN8l5ZRU/ht4Tg6bbQSO6HYhWcyfIXB1XjPJPpG7w== + +lefthook-windows-arm64@1.8.5: + version "1.8.5" + resolved "https://registry.yarnpkg.com/lefthook-windows-arm64/-/lefthook-windows-arm64-1.8.5.tgz#a2afed656ad57c79841df2cce9a199f1724245e1" + integrity sha512-e+6QAYD7PCsfVtPtnOMSC8PUiwnLCE9xCZq+dIK65/W/Ow84lSzHBR67Wl5MI3RiiGF2g8kulG+U1YZobXbdxQ== + +lefthook-windows-x64@1.8.5: + version "1.8.5" + resolved "https://registry.yarnpkg.com/lefthook-windows-x64/-/lefthook-windows-x64-1.8.5.tgz#ac4065a426e6ba05220f793cba1ac68b889c535e" + integrity sha512-NPZwHbSWuGmYe5EEjkQbvRaotPW9/maKK7kexqrHxjzL/mOaoHSEYlW6ByPz2RB+bvgoTCkNRXlPiDDoDSYv+w== + +lefthook@^1.8.5: + version "1.8.5" + resolved "https://registry.yarnpkg.com/lefthook/-/lefthook-1.8.5.tgz#8c29bee1f3029e28f0ddeb040e0515a6a93ff945" + integrity sha512-agsAaXJWoM9vOSVmKVYGPYT5IEzz4Upz0yWRva4L0mT+eObcesIrcMCnLLM+iGfweqC5exfDMm7BHUjTwoiGPg== + optionalDependencies: + lefthook-darwin-arm64 "1.8.5" + lefthook-darwin-x64 "1.8.5" + lefthook-freebsd-arm64 "1.8.5" + lefthook-freebsd-x64 "1.8.5" + lefthook-linux-arm64 "1.8.5" + lefthook-linux-x64 "1.8.5" + lefthook-openbsd-arm64 "1.8.5" + lefthook-openbsd-x64 "1.8.5" + lefthook-windows-arm64 "1.8.5" + lefthook-windows-x64 "1.8.5" + lerna@^7.3.0: version "7.4.2" resolved "https://registry.yarnpkg.com/lerna/-/lerna-7.4.2.tgz#03497125d7b7c8d463eebfe17a701b16bde2ad09"