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

Add defaultOptions to all rules #2665

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Add defaultOptions to all rules #2665

wants to merge 3 commits into from

Conversation

FloEdelmann
Copy link
Member

@FloEdelmann FloEdelmann commented Jan 7, 2025

ESLint v9.17.0 introduced defaultOptions:

Even though earlier ESLint versions don't have official support for this property (i.e. context.options returns the raw user-provided options rather than merged user options and default options), adding it shouldn't hurt.

In the future, we could write our own helper function to merge user options and default options and thus standardize how rules normalize the user-provided options. Also, we could automate (parts of) the rule docs' "Options" sections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant