Skip to content

feat: report malformed rule deprecation metadata#147

Merged
mdjermanovic merged 4 commits into
eslint:mainfrom
xbinaryx:rule-tester-meta-deprecated-validation
Jun 29, 2026
Merged

feat: report malformed rule deprecation metadata#147
mdjermanovic merged 4 commits into
eslint:mainfrom
xbinaryx:rule-tester-meta-deprecated-validation

Conversation

@xbinaryx

@xbinaryx xbinaryx commented May 2, 2026

Copy link
Copy Markdown
Contributor

Summary

RuleTester should validate the shape of meta.deprecated on the rule under test and throw an assertion error when the value does not match the documented boolean | DeprecatedInfo contract.

Related Issues

eslint/eslint#20603

Comment thread designs/2026-rule-tester-meta-deprecated-validation/README.md
Comment thread designs/2026-rule-tester-meta-deprecated-validation/README.md
@nzakas nzakas added the Initial Commenting This RFC is in the initial feedback stage label May 6, 2026
nzakas
nzakas previously approved these changes May 6, 2026

@nzakas nzakas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall LGTM. Just left a couple of notes for clarification.

Comment thread designs/2026-rule-tester-meta-deprecated-validation/README.md
Comment thread designs/2026-rule-tester-meta-deprecated-validation/README.md Outdated

## Drawbacks

This is a breaking change for rule packages whose tests currently pass with malformed deprecation metadata. Some projects may also be storing custom, nonstandard fields under `meta.deprecated`; those projects will need to remove those fields or move them elsewhere.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Worth noting that we've decided breaking changes to RuleTester are acceptable outside of major version bumps because they affect plugin developers only and not end users. The utility is meant to ensure compatibility with the version of ESLint being used.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't recall us deciding that, can you provide a link (to a TSC meeting where we discussed this?). As far as I'm aware, all breaking changes to RuleTester were always considered breaking changes to ESLint as well and thus required a major version bump.

Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
Comment thread designs/2026-rule-tester-meta-deprecated-validation/README.md Outdated
Comment thread designs/2026-rule-tester-meta-deprecated-validation/README.md
@nzakas

nzakas commented May 28, 2026

Copy link
Copy Markdown
Member

@xbinaryx there's some feedback for you to consider.

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>

@nzakas nzakas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks like it's in good shape to me so moving to Final Commenting.

@nzakas nzakas added Final Commenting This RFC is in the final week of commenting and removed Initial Commenting This RFC is in the initial feedback stage labels Jun 19, 2026

@fasttime fasttime left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM pending @mdjermanovic's suggestion.

@mdjermanovic mdjermanovic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@mdjermanovic

Copy link
Copy Markdown
Member

The final commenting period has expired, so merging.

@mdjermanovic
mdjermanovic merged commit 85b1518 into eslint:main Jun 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Final Commenting This RFC is in the final week of commenting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants