Skip to content

Commit 0c5ef57

Browse files
fwcdfacebook-github-bot
authored andcommitted
Add destructuredArrayIgnorePattern to eslint config (#33552)
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
1 parent 51f2027 commit 0c5ef57

File tree

1 file changed

+4
-1
lines changed
  • packages/eslint-config-react-native-community

1 file changed

+4
-1
lines changed

packages/eslint-config-react-native-community/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ module.exports = {
5353
rules: {
5454
'@typescript-eslint/no-unused-vars': [
5555
'error',
56-
{argsIgnorePattern: '^_'},
56+
{
57+
argsIgnorePattern: '^_',
58+
destructuredArrayIgnorePattern: '^_',
59+
},
5760
],
5861
'no-unused-vars': 'off',
5962
'no-shadow': 'off',

0 commit comments

Comments
 (0)