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
prefer-string-slice
: Keep optional chaining in autofix
#1085
prefer-string-slice
: Keep optional chaining in autofix
#1085
Conversation
What about |
And |
This is already tested
I'll add this one in an hour or so |
}, | ||
{ | ||
code: 'foo.bar.substr?.()', | ||
output: 'foo.bar.slice?.()', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this, the old one is testing object has .substr
, but new one testing .slice
exists, if someone mean to test it is a string
and foo.bar
is an array
, it's broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope no one use this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you want
Keep optional chaining in auto fix
Fixes #999