Skip to content

fix(prefer-includes-over-regex-test): skip non-string arguments when types are available - #190

Open
maksimgm wants to merge 1 commit into
e18e:mainfrom
maksimgm:fix/includes-over-regex-test-types
Open

maksimgm wants to merge 1 commit into
e18e:mainfrom
maksimgm:fix/includes-over-regex-test-types

Conversation

@maksimgm

Copy link
Copy Markdown

part of #171

makes the rule type-aware: with types, it skips arguments that aren't assignable to string (numbers, unknown, string | undefined, etc.), since .test() converts them and the string methods would throw. without types it works like before. any still gets fixed since it's assignable to string, like you said in the issue

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