eslint rule: no-deep-destructuring should handle ArrayPattern#35698
Merged
samouri merged 3 commits intoampproject:mainfrom Aug 17, 2021
Merged
eslint rule: no-deep-destructuring should handle ArrayPattern#35698samouri merged 3 commits intoampproject:mainfrom
samouri merged 3 commits intoampproject:mainfrom
Conversation
|
Hey @erwinmombay, @jridgewell! These files were changed: |
5 tasks
jridgewell
requested changes
Aug 16, 2021
| @@ -170,6 +170,7 @@ function _createBody(head, base, prs) { | |||
|
|
|||
Contributor
There was a problem hiding this comment.
The rule can be disabled in build-system/.eslintrc.js
Member
Author
There was a problem hiding this comment.
Why would we do that? I guess depends on our reason for banning:
- Difficult to read nested destructures: applies to both
build-systemandsrc - Difficult to create transforms on Pattern nodes (only applies to
src)
Contributor
There was a problem hiding this comment.
I think they're all difficult to read, but the only reason I care is the difficulty to create transforms.
src/preact/component/3p-frame.js
Outdated
| return countGenerators[type](); | ||
| }, [type]); | ||
|
|
||
| // eslint-disable-next-line local/no-deep-destructuring |
jridgewell
approved these changes
Aug 17, 2021
caroqliu
pushed a commit
to caroqliu/amphtml
that referenced
this pull request
Aug 17, 2021
…ject#35698) * eslint rule: no-deep-destructuring should handle ArrayPattern * Ignore pre-existing destructures * fix instead of ignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary
Partial for #35694
Explicitly bans these kinds of patterns: