Skip to content

Commit

Permalink
Add destructuredArrayIgnorePattern to eslint config (#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: #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 facebook-github-bot committed Oct 12, 2022
1 parent 51f2027 commit 0c5ef57
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 0c5ef57

Please sign in to comment.