Skip to content

fix: use any[] type for context.options#19584

Merged
nzakas merged 1 commit intomainfrom
issue-19579
Mar 28, 2025
Merged

fix: use any[] type for context.options#19584
nzakas merged 1 commit intomainfrom
issue-19579

Conversation

@fasttime
Copy link
Copy Markdown
Member

Prerequisites checklist

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

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

This pull request changes the type of the options property in Rule.RuleContext from unknown[] to any[]. I checked the @types/eslint types and the options property was specified to have type any[] in the original definition.

The issue has become apparent in ESLint v9.23.0 as a result of the changes made to Rule.RuleModule in #19531, where the create method was explicitly defined to accept an argument of type Rule.RuleContext.

Fixes #19579

What changes did you make? (Give an overview)

Updated type definition for Rule.RuleContext and added tests.

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

@github-project-automation github-project-automation Bot moved this to Needs Triage in Triage Mar 28, 2025
@eslint-github-bot eslint-github-bot Bot added the bug ESLint is working incorrectly label Mar 28, 2025
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 28, 2025

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit 829e006
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/67e64e84d56d020008ab0457

@fasttime fasttime marked this pull request as ready for review March 28, 2025 07:32
@fasttime fasttime requested a review from a team as a code owner March 28, 2025 07:33
Copy link
Copy Markdown
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@nzakas nzakas merged commit fb8cdb8 into main Mar 28, 2025
30 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Triage to Complete in Triage Mar 28, 2025
@nzakas nzakas deleted the issue-19579 branch March 28, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug ESLint is working incorrectly

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Bug: breaking change to RuleModule types in 9.23.0

2 participants