From 462ef26ea2ab7f091bf2be020dc07bc15fb618cd Mon Sep 17 00:00:00 2001 From: Katalina Okano Date: Sun, 1 Aug 2021 16:30:58 -0400 Subject: [PATCH] chore: fix lint issues --- package.json | 2 ++ packages/api/utils/rate-limiting.ts | 2 +- packages/interactions/bindings.d.ts | 7 +++++++ packages/interactions/package.json | 1 + packages/interactions/tsconfig.json | 2 +- packages/worker-utils/package.json | 3 +++ tsconfig.json | 8 +++++++- yarn.lock | 5 +++++ 8 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 packages/interactions/bindings.d.ts diff --git a/package.json b/package.json index 65423fb..68be7e1 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,8 @@ "lint:terraform": "terraform fmt -recursive -check ./terraform", "lint:types": "tsc --noEmit", "lint:types-api": "yarn workspace @roleypoly/api run lint:types", + "lint:types-interactions": "yarn workspace @roleypoly/interactions run lint:types", + "lint:types-worker-utils": "yarn workspace @roleypoly/worker-utils run lint:types", "postinstall": "is-ci || husky install", "start": "run-p -c start:*", "start:bot": "yarn workspace @roleypoly/bot start", diff --git a/packages/api/utils/rate-limiting.ts b/packages/api/utils/rate-limiting.ts index 372cfb5..fa7f7c7 100644 --- a/packages/api/utils/rate-limiting.ts +++ b/packages/api/utils/rate-limiting.ts @@ -1,4 +1,4 @@ -import { WrappedKVNamespace } from './kv'; +import { WrappedKVNamespace } from '@roleypoly/worker-utils'; export const useRateLimiter = (kv: WrappedKVNamespace, key: string, timeoutSeconds: number) => diff --git a/packages/interactions/bindings.d.ts b/packages/interactions/bindings.d.ts new file mode 100644 index 0000000..f28be01 --- /dev/null +++ b/packages/interactions/bindings.d.ts @@ -0,0 +1,7 @@ +export {}; + +declare global { + const DISCORD_PUBLIC_KEY: string; + const UI_PUBLIC_URI: string; + const API_PUBLIC_URI: string; +} diff --git a/packages/interactions/package.json b/packages/interactions/package.json index 4378ddb..6a955d9 100644 --- a/packages/interactions/package.json +++ b/packages/interactions/package.json @@ -10,6 +10,7 @@ "@cloudflare/workers-types": "^2.2.2", "@roleypoly/types": "*", "@roleypoly/worker-utils": "*", + "@types/node": "^16.4.10", "tweetnacl": "^1.0.3" } } diff --git a/packages/interactions/tsconfig.json b/packages/interactions/tsconfig.json index 1b989a0..2c330c0 100644 --- a/packages/interactions/tsconfig.json +++ b/packages/interactions/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "outDir": "./dist", "lib": ["esnext", "webworker", "ES2020.BigInt", "ES2020.Promise"], - "types": ["@cloudflare/workers-types"], + "types": ["@cloudflare/workers-types", "node"], "target": "ES2019" }, "include": [ diff --git a/packages/worker-utils/package.json b/packages/worker-utils/package.json index 8e37e28..657b76e 100644 --- a/packages/worker-utils/package.json +++ b/packages/worker-utils/package.json @@ -1,6 +1,9 @@ { "name": "@roleypoly/worker-utils", "version": "0.1.0", + "scripts": { + "lint:types": "tsc --noEmit" + }, "devDependencies": { "@cloudflare/workers-types": "^2.2.2" } diff --git a/tsconfig.json b/tsconfig.json index cc23a2a..1ed7420 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -28,5 +28,11 @@ } }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules", "**/*.stories.tsx", "packages/api"] + "exclude": [ + "node_modules", + "**/*.stories.tsx", + "packages/api", + "packages/interactions", + "packages/worker-utils" + ] } diff --git a/yarn.lock b/yarn.lock index 0b2dcf4..4d2fbda 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3585,6 +3585,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.0.1.tgz#70cedfda26af7a2ca073fdcc9beb2fff4aa693f8" integrity sha512-hBOx4SUlEPKwRi6PrXuTGw1z6lz0fjsibcWCM378YxsSu/6+C30L6CR49zIBKHiwNWCYIcOLjg4OHKZaFeLAug== +"@types/node@^16.4.10": + version "16.4.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.10.tgz#e57e2a54fc6da58da94b3571b1cb456d39f88597" + integrity sha512-TmVHsm43br64js9BqHWqiDZA+xMtbUpI1MBIA0EyiBmoV9pcEYFOSdj5fr6enZNfh4fChh+AGOLIzGwJnkshyQ== + "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"