You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
phpcs fails to properly detect small numbers formatted in scientific notation (i.e. '1E-6')
from what I can see in src/Tokenizers/PHP.php, there is float support present, so PHP is not affected.
however the JS Tokenizer (around L846) for numbers seems to lack this support (and therefore also emits errors)
Code sample
varnum=1e-6;
Custom ruleset
none
To reproduce
Steps to reproduce the behavior:
Create a file called test.js with the code sample above...
Run command from below ...
See error message displayed
$ phpcs -s --standard=PSR12 test.js
FILE: test.js
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Expected at least 1 space before "-"; 0 found
| | (PSR12.Operators.OperatorSpacing.NoSpaceBefore)
1 | ERROR | [x] Expected at least 1 space after "-"; 0 found
| | (PSR12.Operators.OperatorSpacing.NoSpaceAfter)
---------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
Expected behavior
no errors reported
Versions (please complete the following information):
OS: Windows 10
PHP: 7.2.32
PHPCS: 3.7.1
Standard: PSR12
Additional context
none
The text was updated successfully, but these errors were encountered:
I decided to remove support for JS and CSS a while ago, but full support can't be removed until version 4 is released: #2448
In the meantime, I wont be making any additional changes to JS or CSS tokenizing or sniffs. Please use a tool that supports modern versions of these languages.
Describe the bug
phpcs fails to properly detect small numbers formatted in scientific notation (i.e. '1E-6')
from what I can see in src/Tokenizers/PHP.php, there is float support present, so PHP is not affected.
however the JS Tokenizer (around L846) for numbers seems to lack this support (and therefore also emits errors)
Code sample
Custom ruleset
none
To reproduce
Steps to reproduce the behavior:
test.js
with the code sample above...Expected behavior
no errors reported
Versions (please complete the following information):
Additional context
none
The text was updated successfully, but these errors were encountered: