airbnb / airbnb/javascript

Ignore property modifications on params named "state"

Open
#2,485 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
148k
Forks
26.6k
PR merge metrics
No merged PRs in 30d

Description

The [`no-param-reassign` rule](https://github.com/airbnb/javascript/blob/4ee732639396362c6981b1aa4730934c3baa7919/packages/eslint-config-airbnb-base/rules/best-practices.js#L228-L246) allows property modifications for params with certain names, like `acc` and `response`. I would like to suggest that `state` is also allowed, for users of Redux Toolkit. The Redux Toolkit documentation [recommends this](https://redux-toolkit.js.org/usage/immer-reducers#linting-state-mutations).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in packages/eslint-config-airbnb-base/rules/best-practices.js at the linked no-param-reassign configuration and compare the existing allowed parameter names. Update the configuration so property modifications on parameters named "state" are allowed, then verify the rule behavior for Redux Toolkit-style state updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
tooling
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.