The Wayback Machine - https://web.archive.org/web/20200529215146/https://github.com/airbnb/javascript/pull/1917
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow modification of draft and draftState for "immer" #1917

Open
wants to merge 1 commit into
base: master
from

Conversation

@brummelte
Copy link

brummelte commented Sep 15, 2018

The immer library requires the modification of parameter properties.

immerjs/immer#189

The immer library requires the modification of parameter properties.

immerjs/immer#189
'ctx', // for Koa routing
'req', // for Express requests
'request', // for Express requests
'res', // for Express responses
'response', // for Express responses
'$scope', // for Angular 1 scopes
'draft', // for immer
'draftState', // for immer

This comment has been minimized.

Copy link
@ljharb

ljharb Sep 16, 2018

Collaborator

i don't think we need to add specific exceptions for every mutating pattern, and i'm not yet convinced that immer's pattern of encouraging mutation in code is a beneficial one.

@spawnia
Copy link

spawnia commented Nov 29, 2018

As @mweststrate summarized quite nicely, this exception is really the only way for the no-param-reassign rule to play nicely with immer: immerjs/immer#189 (comment)

@ljharb i think the popularity of immer is evidence enough that it is useful, and those 2 extra lines of config should be well worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.