Skip to content

Commit

Permalink
Add destructuredArrayIgnorePattern to eslint config (facebook#33552)
Browse files Browse the repository at this point in the history
Summary:
This adds the `destructuredArrayIgnorePattern` rule [recently introduced in `typescript-eslint`](typescript-eslint/typescript-eslint#4691), making underscored identifiers in array destructurings no longer an error, e.g.

```js
const [state, _dispatch] = useContext(MyContext);
```

would be acceptable if `state` is used.

## Changelog

[General] [Added] - Add destructuredArrayIgnorePattern to eslint config

Pull Request resolved: facebook#33552

Test Plan: Install the `react-native-community/eslint-config` package and test the example.

Reviewed By: lunaleaps, cipolleschi

Differential Revision: D40166101

Pulled By: ryancat

fbshipit-source-id: 1e30297bf40d65e09682c4f9f3b3dd432ba5310e
  • Loading branch information
fwcd authored and mohitcharkha committed Oct 17, 2022
1 parent 54b1556 commit 68c996f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/eslint-config-react-native-community/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ module.exports = {
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{argsIgnorePattern: '^_'},
{
argsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
},
],
'no-unused-vars': 'off',
'no-shadow': 'off',
Expand Down

0 comments on commit 68c996f

Please sign in to comment.