From 27152e02efeef2eab7e335b9dcf7152ce50715b5 Mon Sep 17 00:00:00 2001 From: Korrrba Date: Mon, 18 Mar 2024 12:36:04 +0100 Subject: [PATCH] chore: fix knip warnings in onboarding repository * Set correct entry points in knip.ts for onboarding repostiory to find all dependencies * add unlisted transitive dependencies to package.json that were imported directly * add no-unused-vars to two unused exports --- knip.ts | 19 ++-------- package.json | 2 ++ static/main.ts | 10 ------ static/scripts/onboarding/get-local-store.ts | 3 +- .../scripts/onboarding/github-login-button.ts | 2 +- static/scripts/rewards/constants.ts | 3 +- yarn.lock | 35 ++++++++++++++++++- 7 files changed, 44 insertions(+), 30 deletions(-) delete mode 100644 static/main.ts diff --git a/knip.ts b/knip.ts index dd6d8bd..39b7c3e 100644 --- a/knip.ts +++ b/knip.ts @@ -1,23 +1,10 @@ import type { KnipConfig } from "knip"; const config: KnipConfig = { - entry: ["build/index.ts"], - project: ["src/**/*.ts"], - ignore: ["src/types/config.ts"], + entry: ["static/scripts/onboarding/onboarding.ts", "static/scripts/rewards/index.ts"], + project: ["static/**/*.ts"], ignoreExportsUsedInFile: true, - ignoreDependencies: [ - "libsodium-wrappers", - "eslint-config-prettier", - "eslint-plugin-prettier", - "@ethersproject/providers", - "@octokit/core", - "@octokit/plugin-create-or-update-text-file", - "@octokit/rest", - "@types/libsodium-wrappers", - "@uniswap/permit2-sdk", - "ethers", - "yaml", - ], + ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier", "@octokit/core"], }; export default config; diff --git a/package.json b/package.json index 3269ed7..28c4e52 100644 --- a/package.json +++ b/package.json @@ -34,10 +34,12 @@ "@octokit/core": "^5.1.0", "@octokit/plugin-create-or-update-text-file": "^4.0.1", "@octokit/rest": "^20.0.2", + "@sinclair/typebox": "^0.32.15", "@supabase/supabase-js": "2.39.7", "@types/libsodium-wrappers": "^0.7.13", "@ubiquibot/configuration": "1.1.0", "@uniswap/permit2-sdk": "^1.2.0", + "axios": "^1.6.8", "dotenv": "^16.4.4", "ethers": "^5.7.2", "libsodium-wrappers": "^0.7.13", diff --git a/static/main.ts b/static/main.ts deleted file mode 100644 index b19bfa7..0000000 --- a/static/main.ts +++ /dev/null @@ -1,10 +0,0 @@ -export async function mainModule() { - console.log(`Hello from mainModule`); -} -mainModule() - .then(() => { - console.log("mainModule loaded"); - }) - .catch((error) => { - console.error(error); - }); diff --git a/static/scripts/onboarding/get-local-store.ts b/static/scripts/onboarding/get-local-store.ts index 3c481c0..0429cce 100644 --- a/static/scripts/onboarding/get-local-store.ts +++ b/static/scripts/onboarding/get-local-store.ts @@ -10,6 +10,7 @@ export function getLocalStore(key: string): T | null { return null; } -export function setLocalStore(key: string, value: T) { +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function setLocalStore(key: string, value: T) { localStorage[key] = JSON.stringify(value); } diff --git a/static/scripts/onboarding/github-login-button.ts b/static/scripts/onboarding/github-login-button.ts index c23efb0..319bf5f 100644 --- a/static/scripts/onboarding/github-login-button.ts +++ b/static/scripts/onboarding/github-login-button.ts @@ -65,4 +65,4 @@ function getSessionToken() { return null; } -export { gitHubLoginButton, getSessionToken }; +export { getSessionToken }; diff --git a/static/scripts/rewards/constants.ts b/static/scripts/rewards/constants.ts index 891a651..979c5d1 100644 --- a/static/scripts/rewards/constants.ts +++ b/static/scripts/rewards/constants.ts @@ -53,4 +53,5 @@ export const networkRpcs: Record = { }; export const permit2Address = "0x000000000022D473030F116dDEE9F6B43aC78BA3"; -export const nftAddress = "0xAa1bfC0e51969415d64d6dE74f27CDa0587e645b"; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const nftAddress = "0xAa1bfC0e51969415d64d6dE74f27CDa0587e645b"; diff --git a/yarn.lock b/yarn.lock index 46bb7c1..af700aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1542,6 +1542,11 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.32.14.tgz#ef0a4ed981515fd430cadfb65cb6c2719a0b5539" integrity sha512-EC77Mw8huT2z9YlYbWfpIQgN6shZE1tH4NP4/Trig8UBel9FZNMZRJ42ubJI8PLor2uIU+waLml1dce5ReCOPg== +"@sinclair/typebox@^0.32.15": + version "0.32.15" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.32.15.tgz#92dcdc12907f7c0f6d954ba3700b5bb888d2eb34" + integrity sha512-5Lrwo7VOiWEBJBhHmqNmf3TPB9ll8gcEshvYJyAIJyCZ2PF48MFOtiDHJNj8+FsNcqImaQYmxVkKBCBlyAa/wg== + "@snyk/github-codeowners@1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@snyk/github-codeowners/-/github-codeowners-1.1.0.tgz#45b99732c3c38b5f5b47e43d2b0c9db67a6d2bcc" @@ -2033,6 +2038,15 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== +axios@^1.6.8: + version "1.6.8" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" + integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + babylon@^6.9.1: version "6.18.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" @@ -2314,7 +2328,7 @@ colorette@^2.0.16, colorette@^2.0.20: resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== -combined-stream@^1.0.6, combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -3369,6 +3383,11 @@ flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== +follow-redirects@^1.15.6: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + for-each@^0.3.3: version "0.3.3" resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" @@ -3389,6 +3408,15 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw== +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -5058,6 +5086,11 @@ proxy-from-env@1.0.0: resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" integrity sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A== +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + psl@^1.1.33: version "1.9.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7"