-
Good afternoon. I am encountering an incorrect error in PhpStorm. When using HTML inside JS files, I get the following PHPCS error:
When I try to fix it, I get the following result:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
That doesn't look like valid JavaScript to me. Maybe it's JSX? PHP_CodeSniffer does not support JSX. Using PHP_CodeSniffer on JavaScript is discouraged, and won't be supported in the future. I recommend that you use a linter which supports the language that you are writing in. PHP_CodeSniffer works just fine for PHP. |
Beta Was this translation helpful? Give feedback.
-
For reference: this question was originally posted in squizlabs/PHP_CodeSniffer#3959 |
Beta Was this translation helpful? Give feedback.
That doesn't look like valid JavaScript to me. Maybe it's JSX? PHP_CodeSniffer does not support JSX.
Using PHP_CodeSniffer on JavaScript is discouraged, and won't be supported in the future. I recommend that you use a linter which supports the language that you are writing in. PHP_CodeSniffer works just fine for PHP.