Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lint): noUselessThisAlias #23

Merged
merged 1 commit into from
Aug 22, 2023
Merged

Conversation

Conaclos
Copy link
Member

Summary

This closes rome#4481 by implementing noUselessThisAlias.
As discussed in rome#4481 we diverge from eslint and unicorn by allowing this aliasing where required.

The rule ignores complex cases such as:

function f() {
    const [self] = [this];
    return () => {
        self.g();
    }
}

The rule could be smarter. However, this code is unlikely to exist.

Test Plan

Tests included.

@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter A-Website Area: website L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis labels Aug 20, 2023
@Conaclos Conaclos added this to the v1.1.0 milestone Aug 20, 2023
@Conaclos Conaclos temporarily deployed to Website deployment August 20, 2023 22:22 — with GitHub Actions Inactive
@Conaclos Conaclos temporarily deployed to Website deployment August 22, 2023 14:53 — with GitHub Actions Inactive
@Conaclos Conaclos temporarily deployed to Website deployment August 22, 2023 14:56 — with GitHub Actions Inactive
@Conaclos Conaclos temporarily deployed to Website deployment August 22, 2023 21:57 — with GitHub Actions Inactive
@Conaclos Conaclos merged commit e04d018 into main Aug 22, 2023
17 checks passed
@Conaclos Conaclos deleted the conaclos/noUselessThisAlias branch August 22, 2023 22:12
@Conaclos Conaclos added the A-Changelog Area: changelog label Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project A-Website Area: website L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📎 Implement noThisAlias, @typescript-eslint/no-this-alias
2 participants