feat: add javascript_not_expression switch#47
feat: add javascript_not_expression switch#47keithamus wants to merge 1 commit intoAndrewRadev:mainfrom
Conversation
d5bd6c1 to
8b79572
Compare
|
|
||
| Comparison to false vs negation operator (g:switch_builtins.javascript_not_expression) | ||
| > | ||
| if (foo == false) { } |
There was a problem hiding this comment.
Based on the regex, I think this should be a ===.
|
This might be reasonable, although I'm not sure about the pattern. The In general, I have to say I'm on the fence about whether this can be considered a common pattern that should be included in the built-ins. I can see the logic in it, and I can see that it might be a common thing in particular refactoring scenarios, but it could just be considered a nice-to have in specific situations. There's a wiki where I point people for this kind of stuff: https://github.com/AndrewRadev/switch.vim/wiki. Putting it in the wiki would also mean it's not necessary to worry too much about brackets and spaces and such, since it's not "official", but something people could copy and adjust to their needs. What are your thoughts on this idea? |
This adds a switch to JavaScript to switch between
something === falseand!something- which is a common thing I find I am refactoring.