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: guard against type errors in prefer-t-regex #350

Merged
merged 2 commits into from
Jan 18, 2023

Conversation

spence-s
Copy link
Contributor

fixes some of the prefer-t-regex issues. #346 #347

@spence-s
Copy link
Contributor Author

Updated for @sindresorhus preferences.

Note the added test cases that currently cause this rule to throw 😅.

rules/prefer-t-regex.js Outdated Show resolved Hide resolved
rules/prefer-t-regex.js Show resolved Hide resolved
rules/prefer-t-regex.js Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Member

I think you misunderstood me in https://github.com/avajs/eslint-plugin-ava/pull/350/files#r1072500429. I meant if (!lookup) { return false }. Because the current check will allow undefined to continue in the function.

@spence-s
Copy link
Contributor Author

yes - ha did misunderstand, but good call!

@sindresorhus sindresorhus merged commit 40aaadc into avajs:main Jan 18, 2023
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.

2 participants