unloco
unloco

Reputation: 7330

PhpStorm: How to disable PHPCS for Javascript

PHPCS is checking my JS files on PhpStorm,

I need to disable this feature

I added this line in the file phpcs.xml.dist but no luck

<exclude-pattern>*\.(inc|css|js)</exclude-pattern>

Upvotes: 38

Views: 11796

Answers (2)

IndyDevGuy
IndyDevGuy

Reputation: 176

Update for newest PhpStorm (2022.3).

The location to change the checked files is now under File | Settings | PHP | Quality Tools and select PHP_CodeSniffer or search for PHP_CodeSniffer

There is not checkbox anymore, it is now a text input with file extensions separated by commas. In the screenshot I removed js and css extensions which are there by default.

enter image description here

Upvotes: 8

unloco
unloco

Reputation: 7330

Finally found it, I had to disable some extensions in PhpStorm config
File | Settings | Editor | Inspections > PHP Code Sniffer Validation
Or search:
PHP Code Sniffer Validation
or
PHP_CodeSniffer validation

enter image description here

There is a related bug though
https://youtrack.jetbrains.com/issue/WI-44308

Upvotes: 83

Related Questions