Skip to content

Commit

Permalink
don't enforce object destructuring in case of assignment without decl…
Browse files Browse the repository at this point in the history
…aration
  • Loading branch information
zloirock committed Sep 7, 2024
1 parent a31a6b8 commit 461733a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/eslint/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,18 @@ const base = {
// require const declarations for variables that are never reassigned after declared
'prefer-const': [ERROR, { destructuring: 'all' }],
// require destructuring from arrays and/or objects
'prefer-destructuring': ERROR,
'prefer-destructuring': [ERROR, {
VariableDeclarator: {
array: true,
object: true,
},
AssignmentExpression: {
array: true,
object: false,
},
}, {
enforceForRenamedProperties: false,
}],
// prefer the exponentiation operator over `Math.pow()`
'prefer-exponentiation-operator': ERROR,
// disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals
Expand Down

0 comments on commit 461733a

Please sign in to comment.