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

feat: merge rule.meta.defaultOptions before validation #166

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JoshuaKGoldberg
Copy link

Fixes #165.

I felt unsure labeling this as "feat" vs. "fix" - the root behavior is, arguably, a bug fix for feature support of rule.meta.defaultOptions... 🤷

Code roughly copied from eslint/eslint#17656.

nzakas
nzakas previously approved these changes Jul 3, 2024
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.

Overall LGTM. Just one note about syntax.

Would like @mdjermanovic to review before merging.

lib/shared/config-validator.js Show resolved Hide resolved
nzakas
nzakas previously approved these changes Jul 3, 2024
@nzakas
Copy link
Member

nzakas commented Jul 17, 2024

@eslint/eslint-tsc This PR is still looking for another review.

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.

Sorry for the late review. I just left a few suggestions. Other than that, I think this looks good.

lib/shared/config-validator.js Outdated Show resolved Hide resolved
lib/shared/deep-merge-arrays.js Outdated Show resolved Hide resolved
lib/shared/deep-merge-arrays.js Outdated Show resolved Hide resolved
lib/shared/deep-merge-arrays.js Outdated Show resolved Hide resolved
tests/lib/shared/deep-merge-arrays.js Outdated Show resolved Hide resolved
Co-authored-by: Francesco Trotta <github@fasttime.org>
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! Pending a last review from @mdjermanovic.

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

This LGTM, but I think we should hold off merging until eslint/eslint#17656 is approved to make sure the changes are synchronized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Merge Candidates
Development

Successfully merging this pull request may close these issues.

Fix: Validate options after applying defaults, not before
5 participants