From e86057d989e9e05db0a55c750264d1c518784334 Mon Sep 17 00:00:00 2001 From: Umar Ahmed Date: Tue, 23 Jan 2024 18:36:13 -0500 Subject: [PATCH 1/3] chore: add vscode configs --- .gitignore | 9 ++++++++- .vscode/extensions.json | 3 +++ .vscode/settings.json | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 0b65d56..41be8f1 100644 --- a/.gitignore +++ b/.gitignore @@ -116,4 +116,11 @@ node_modules !.yarn/plugins !.yarn/releases !.yarn/sdks -!.yarn/versions \ No newline at end of file +!.yarn/versions + +# vscode files +.vscode/* +!.vscode/settings.json +!.vscode/launch.json +!.vscode/tasks.json +!.vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..c83e263 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["esbenp.prettier-vscode"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..25fa621 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib" +} From 985672a3f72df8ff80412b87b1efc2a7649dfd4d Mon Sep 17 00:00:00 2001 From: Umar Ahmed Date: Tue, 23 Jan 2024 18:36:22 -0500 Subject: [PATCH 2/3] chore: add node engines --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index fe19ef3..becac4d 100644 --- a/package.json +++ b/package.json @@ -29,5 +29,8 @@ "tsx": "^3.12.7", "typescript": "^5.1.6" }, - "packageManager": "yarn@3.6.1" + "packageManager": "yarn@3.6.1", + "engines": { + "node": "^18.0.0" + } } From cb8613520c2f604e8ec81caaeac0dcb6489a9341 Mon Sep 17 00:00:00 2001 From: Umar Ahmed Date: Tue, 23 Jan 2024 18:36:32 -0500 Subject: [PATCH 3/3] wip: make TS more strict --- src/utils/flags.ts | 2 +- tsconfig.json | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/flags.ts b/src/utils/flags.ts index b9e297b..6bd91ce 100644 --- a/src/utils/flags.ts +++ b/src/utils/flags.ts @@ -18,7 +18,7 @@ export function isFlagEnabled(slug: string, flag: Flags): boolean { const config = orgFlags[slug]; - if (!(flag in config)) { + if (!config || !(flag in config)) { return false; } diff --git a/tsconfig.json b/tsconfig.json index c144ef7..ba30e0b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,6 +10,8 @@ "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, + "noUncheckedIndexedAccess": true, + "noImplicitAny": true, "skipLibCheck": true, "paths": { "~/*": ["./*"]