Skip to content
public-library›Rules›TypeScript›Preserve caller-owned data

Preserve caller-owned data

MEDIUM#typescript Sign in to star Preserve caller-owned data, 0 stars

Sign in to star rules

Star this rule if you find it useful.

When transforming data owned by a caller or shared state, return a new value instead of mutating the input. Declare such inputs as readonly so that the compiler rejects accidental mutation.

In the full rule