Skip to content

fix!: add uniqueItems: true in class-methods-use-this#20306

Closed
lumirlumir wants to merge 8 commits into
mainfrom
fix-add-uniqueitems-true-in
Closed

fix!: add uniqueItems: true in class-methods-use-this#20306
lumirlumir wants to merge 8 commits into
mainfrom
fix-add-uniqueitems-true-in

Conversation

@lumirlumir
Copy link
Copy Markdown
Member

@lumirlumir lumirlumir commented Nov 10, 2025

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[x] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

This PR is a follow-up to #20155.

In this PR, I've added uniqueItems: true to the schema for the exceptMethods option of the class-methods-use-this rule.

Given the rule's description and implementation, preventing duplicate exception names seems valid and safe.

image

Currently, adding the following test case to the valid tests does not produce any errors:

		{
			code: "class A { foo() {this} bar() {} }",
			options: [{ exceptMethods: ["bar", "bar"] }], // Duplicated.
			languageOptions: { ecmaVersion: 6 },
		},

Is there anything you'd like reviewers to focus on?

N/A

@eslint-github-bot eslint-github-bot Bot added breaking This change is backwards-incompatible bug ESLint is working incorrectly labels Nov 10, 2025
@github-project-automation github-project-automation Bot moved this to Needs Triage in Triage Nov 10, 2025
@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 10, 2025

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit 0d4e6c2
🔍 Latest deploy log https://app.netlify.com/projects/docs-eslint/deploys/691489ca91f5a000086067cd
😎 Deploy Preview https://deploy-preview-20306--docs-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the rule Relates to ESLint's core rules label Nov 10, 2025
@lumirlumir lumirlumir marked this pull request as ready for review November 10, 2025 08:51
@lumirlumir lumirlumir requested a review from a team as a code owner November 10, 2025 08:51
Comment thread docs/src/use/migrate-to-10.0.0.md Outdated
Co-authored-by: Tanuj Kanti <86398394+Tanujkanti4441@users.noreply.github.com>
@lumirlumir lumirlumir added the accepted There is consensus among the team that this change meets the criteria for inclusion label Nov 10, 2025
@lumirlumir lumirlumir moved this from Needs Triage to Implementing in Triage Nov 10, 2025
@mdjermanovic
Copy link
Copy Markdown
Member

@lumirlumir the scope of breaking changes for ESLint v10.0.0 is frozen. Can you please open an issue about these changes (adding uniqueItems: true; I think all rules where this change should be done can be included in the same issue) so we can add it to the ESLint v11 project.

@mdjermanovic
Copy link
Copy Markdown
Member

I'm going to close this PR so that we don't accidentally merge it as it isn't planned for ESLint v10. You can open a new one when we start preparing ESLint v11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted There is consensus among the team that this change meets the criteria for inclusion breaking This change is backwards-incompatible bug ESLint is working incorrectly rule Relates to ESLint's core rules

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

3 participants