Closed spl1nes closed 2 months ago
@spl1nes Thanks for reporting this. Javascript support will be removed in PHPCS 4.0, so this is unlikely to get fixed. There are other, JS specific, code styling tools available nowadays. I suggest you use those.
If a small fix for this issue could/would be submitted, I might accept it, but extensive changes to support this in the JS Tokenizer will not be accepted anymore.
Oh, nvm then. Thanks for the info, I didn't know about the dropped support for JS.
Describe the bug
This is not an important issue for me since it's just a little extra thing, but I do sometimes use this CodeSniffer for JS as well.
In JS (
?.
) we can do function chaining with null checks, just like in php (?->
). When I useSquiz.WhiteSpace.OperatorSpacing
in php the sniffer correctly recognizes that?->
is "one" operator and doesn't expect white spaces around?
. For consistency it would be good if it would also recognize?.
as "one" operator in JS and NOT demand a white space around?
.Code sample
Custom ruleset
To reproduce
Expected behavior
No errors.
Versions (please complete the following information)
Please confirm
master
branch of PHP_CodeSniffer.