From 4069985cad9b2da629e441cc1f02fd0e4be7f4a0 Mon Sep 17 00:00:00 2001 From: Johannes Ewald Date: Wed, 11 Dec 2024 17:38:40 +0100 Subject: [PATCH] fix: Turn of TS's exactOptionalPropertyTypes --- eslint/presets/typescript.test/main.ts | 4 ++++ typescript/base.json | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/eslint/presets/typescript.test/main.ts b/eslint/presets/typescript.test/main.ts index b22efd4..0d4216e 100644 --- a/eslint/presets/typescript.test/main.ts +++ b/eslint/presets/typescript.test/main.ts @@ -5,6 +5,10 @@ import test from "./test.json" with { type: "json" }; // eslint-disable-next-line @typescript-eslint/naming-convention const snake_case = 123; +// Should not complain about missing dot-notation here since +// we're using TS's noPropertyAccessFromIndexSignature +process.env["SOME_ENV_VAR"] = "test"; + class SomeClass { #someProp = true; private someEventHandler = () => { diff --git a/typescript/base.json b/typescript/base.json index 5120699..f36440b 100644 --- a/typescript/base.json +++ b/typescript/base.json @@ -2,7 +2,9 @@ "compilerOptions": { "checkJs": true, "esModuleInterop": true, - "exactOptionalPropertyTypes": true, + // We decided to turn off `exactOptionalPropertyTypes` because it's too strict + // by complaining about too much unproblematic code. We may revisit this decision later. + "exactOptionalPropertyTypes": false, "forceConsistentCasingInFileNames": true, "isolatedModules": true, "lib": ["DOM", "ESNext"],