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

Ensure rules bail out early when no rule present #293

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

bmish
Copy link
Member

@bmish bmish commented Aug 20, 2022

For rules that use utils.getRuleInfo() to get the current rule to operate on, bail out early if no rule is found (and add tests for this). Benefits include:

  • Simplifies rule implementations
  • Avoids performance hit from needlessly running node visitors on a non-rule
  • Reduces chance of bugs from running on a non-rule

@bmish bmish added the bug label Aug 20, 2022
@aladdin-add aladdin-add merged commit d1e03a1 into eslint-community:main Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants