Skip to content

Adopt the @effect/tsgo suggested rewrites - #249

Merged
GraemeF merged 2 commits into
mainfrom
comms-ugj0.1
Sep 29, 2026
Merged

GraemeF merged 2 commits into
mainfrom
comms-ugj0.1

Conversation

@GraemeF

@GraemeF GraemeF commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

TypeScript 7 with @effect/tsgo prints suggestion-level diagnostics on a clean typecheck. This rewrites the flagged code to the idiom each rule suggests, until the typecheck prints none. Behaviour is unchanged and no test assertion changes.

Most rewrites are Effect.succeedSome / succeedNone, asSome, orElseSucceed, filterOrElse, catchTags, forEach and runPromiseExit.

Four effectSucceedWithVoid sites returned Effect.succeed(undefined) as a real T | undefined value, where the suggested Effect.void does not typecheck. Those lookups, projectForCwd and the session id in rebuildNarrowSet, now return Option. They unwrap only where they meet the session context and the subscription seeding, which still take T | undefined. No rule is suppressed.

Rewrites every site tsc flags under preferSucceedSomeOrNone,
mapSomeToAsSome, catchToOrElseSucceed, flatMapConditionalToFilterOrFail,
multipleCatchTag, allOfMapToForEach and runOfExitToRunExit. Behaviour is
unchanged.

Four effectSucceedWithVoid sites are left as they are. Each returns a
real T | undefined value, so Effect.void does not typecheck there.
projectForCwd and the rebuildNarrowSet session-id branch returned
Effect.succeed(undefined) as a real value, which @effect/tsgo's
effectSucceedWithVoid flags and whose Effect.void rewrite does not
typecheck. They now return Option and unwrap only where they meet the
session context and the subscription seeding.
@GraemeF
GraemeF merged commit c0f2e10 into main Sep 29, 2026
2 checks passed
@GraemeF
GraemeF deleted the comms-ugj0.1 branch September 29, 2026 17:17
GraemeF added a commit that referenced this pull request Sep 29, 2026
Sets `ignoreEffectSuggestionsInTscExitCode` to `false` in the tsconfig
plugin entry. It defaults to `true`, so @effect/tsgo suggestions never
failed `tsc --noEmit`. Now every Effect diagnostic at every severity
fails the gate, so the suggestions cleared in #249 cannot come back.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant