You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
With the language service plugin enabled, delete of an index-signature property reports TS2790 #820
With the @effect/language-service plugin enabled, effect-tsgo reports TS2790 for delete of an index-signature property (see the table below for exactly which). TypeScript allows it (5.9.3 and 7.0.2), and effect-tsgo itself allows it with the plugin off.
$ "$(node -e 'import("@effect/tsgo/lib/getExePath").then(m=>console.log(m.default()))')" -p tsconfig.json
index.ts(2,8): error TS2790: The operand of a 'delete' operator must be optional.
Compiler
Plugin
Result
effect-tsgo 0.51.1
on
TS2790
effect-tsgo 0.51.1
off
no error
typescript 7.0.2 tsc
on (ignored)
no error
Expected: no error; the plugin should not change this core diagnostic.
What triggers it:delete of a property that comes only from an index signature (no declared optional property):
In a real codebase that refuses Object.fromEntries(...) results and, with exactOptionalPropertyTypes, delete process.env.PATH. Upstream tsc 7.0.2 accepts all of these.
Across 53 TypeScript projects in our monorepo, this was the only difference in compiler diagnostics between effect-tsgo with the plugin and upstream TypeScript 7.0.2. Until it's fixed we compile with upstream and run effect-tsgo diagnostics as a second pass.
Source inspection points to a checker-state interaction. The stability usage rules call GetSymbolAtLocation, which can cache the synthetic index-signature symbol. A later type query can recheck the delete expression against that cached symbol and report the optionality error. The relevant code is in internal/rules/stability_api_usage.go and checkDeleteExpression in the compiler checker.
Activity
mattiamanzati commentedon Oct 11, 2026
Confirmed on Linux x64 with a locally built executable from commit
181b2b3fa1a9d1811a26a36935638ada2bbdf35c.The minimal index-signature example has these results:
experimentalApiUsageandunstableApiUsageset to"off", no diagnostics and exit code 0.The configuration for the third run is:
{ "compilerOptions": { "strict": true, "noEmit": true, "target": "ES2023", "types": [], "plugins": [{ "name": "@effect/language-service", "diagnosticSeverity": { "experimentalApiUsage": "off", "unstableApiUsage": "off" } }] }, "files": ["index.ts"] }Source inspection points to a checker-state interaction. The stability usage rules call
GetSymbolAtLocation, which can cache the synthetic index-signature symbol. A later type query can recheck the delete expression against that cached symbol and report the optionality error. The relevant code is ininternal/rules/stability_api_usage.goandcheckDeleteExpressionin the compiler checker.