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

Rule Change: array-callback-return should support Stage 4 Array.prototype.toSorted` #16842

Closed
1 task done
sosukesuzuki opened this issue Jan 31, 2023 · 1 comment · Fixed by #16845
Closed
1 task done
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules

Comments

@sosukesuzuki
Copy link
Contributor

sosukesuzuki commented Jan 31, 2023

What rule do you want to change?

array-callback-return

What change to do you want to make?

Generate more warnings

How do you think the change should be implemented?

A new default behavior

Example code

[1, 2, 3].toSorted(
  (a, b) {
    if (cond1) return -1
    if (cond2) return 1
  }
);

What does the rule currently do for this code?

Do nothing

What will the rule do after it's changed?

Warns as for Array.prototype.sort.

Participation

  • I am willing to submit a pull request to implement this change.

Additional comments

Change array by copy proposal reaches to Stage 4
ref: tc39/proposals@ad4df84

@sosukesuzuki sosukesuzuki added enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules labels Jan 31, 2023
@nzakas nzakas added the accepted There is consensus among the team that this change meets the criteria for inclusion label Jan 31, 2023
@nzakas
Copy link
Member

nzakas commented Jan 31, 2023

Makes sense to me. Feel free to open a pull request.

@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Aug 3, 2023
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Aug 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants