cloudflare / cloudflare/eslint-plugin-cflint
no-this-assignment: allow destructing assignment
Open
- Dominant language
- JavaScript
- Stars
- 16
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Is there a particular reason the [Destructuring assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) of `this` is forbidden?
Or is this just a special case which is not handled? If so, would it be possible to allow destructuring assignment as a special case?
Typescript example:
```typescript
class MyClass {
private x = 0
private y = 'Hello'
public foo() {
const { x, y } = this // ESLint: this is assigned to undefined(cflint/no-this-assignment)
}
}
```
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.