temporalio / temporalio/sdk-typescript

[Feature Request] Add lint rule that prevents Query handlers from mutating state

Open
#868 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
917
Forks
224
Avg merge
3d 16h
Merged PRs (30d)
43

Description

Is your feature request related to a problem? Please describe.

The only hole in TS's enforced determinism (besides intentionally escaping the vm) is mutating state in Query handlers.

Describe the solution you'd like

A lint rule that prevents mutations in Query handlers.

Additional context

From Roey:

https://github.com/jfmengels/eslint-plugin-fp/blob/master/docs/rules/no-mutation.md

Unsure if there's a way to apply it to specific functions. May need to fork.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the referenced eslint-plugin-fp no-mutation rule and determine how Query handlers can be identified in the TypeScript SDK. Done means a lint rule prevents state mutation specifically within Query handlers, with the applicable behavior verified by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.