cloudflare / cloudflare/eslint-plugin-cflint

no-this-assignment: allow destructing assignment

Open
#19 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.