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

fix: Support legacy schema properties #128

Merged
merged 1 commit into from
Nov 4, 2024
Merged

fix: Support legacy schema properties #128

merged 1 commit into from
Nov 4, 2024

Conversation

mdjermanovic
Copy link
Member

Prerequisites checklist

What is the purpose of this pull request?

Updates @eslint/compat utility to support legacy schema property of rules.

What changes did you make? (Give an overview)

Updated fixupRule() to copy top-level schema property into rule's meta object.

This covers:

  • Legacy function-style rules, which were allowed to specify schema as schema property of the function.
  • Object-style rules that were mistakenly specifying schema as top-level schema property, which was never officially supported but used to work in ESLint < 9.

Related Issues

Fixes #127

I tested this with eslint-plugin-fp and eslint-plugin-filenames rules mentioned in the original issue.

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

@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Nov 2, 2024
Copy link
Member

@fasttime fasttime 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! Leaving open until Monday in case someone else wants to review.

Copy link
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 3a87bbb into main Nov 4, 2024
17 checks passed
@nzakas nzakas deleted the issue127 branch November 4, 2024 16:24
@github-actions github-actions bot mentioned this pull request Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted bug Something isn't working
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

Bug: @eslint/compat fixupPluginRules() does not work with rule options
3 participants