avajs / eslint-plugin-ava

ESLint rules for AVA
https://avajs.dev
MIT License
230 stars 49 forks source link

fix: guard against type errors in prefer-t-regex #350

Closed spence-s closed 1 year ago

spence-s commented 1 year ago

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

spence-s commented 1 year ago

Updated for @sindresorhus preferences.

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

sindresorhus commented 1 year ago

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 commented 1 year ago

yes - ha did misunderstand, but good call!