Skip to content
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

JavaScript: Indentation after object parameter #3928

Closed
2 of 3 tasks
szepeviktor opened this issue Nov 24, 2023 · 2 comments
Closed
2 of 3 tasks

JavaScript: Indentation after object parameter #3928

szepeviktor opened this issue Nov 24, 2023 · 2 comments

Comments

@szepeviktor
Copy link

szepeviktor commented Nov 24, 2023

Describe the bug

PSR12: Indentation after object parameter.
When the second parameter of React.createElement is removed there is no error.

Code sample

function doit()
{
    window.wc.wcBlocksRegistry.registerPaymentMethod({
        label: React.createElement('img', {
            foo: 'bar'
        }),
        content: 'text'
    });
}

To reproduce

Steps to reproduce the behavior:

 7 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
   |       |     (Generic.WhiteSpace.ScopeIndent.IncorrectExact)

Expected behavior

No errors.

Versions (please complete the following information)

Operating System Debian stretch
PHP version 7.4
PHP_CodeSniffer version 3.7.2
Standard PSR-12
Install type composer

Please confirm:

  • I have searched the issue list and am not opening a duplicate issue.
  • I confirm that this bug is a bug in PHP_CodeSniffer and not in one of the external standards.
  • I have verified the issue still exists in the master branch of PHP_CodeSniffer.
@jrfnl
Copy link
Contributor

jrfnl commented Nov 24, 2023

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.

@szepeviktor
Copy link
Author

You made me very glad that PHPCS will be a PHP-only tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants