phpcs: Referenced sniff "PHPCompatibility.PHP.RemovedExtensions" does not exist

Viewed 517

I am trying to install PHP CodeSniffer with WordPress Coding standards on VSCode Windows. I got the PHP Code Beautifier and Fixer to work however the errors are not highlighted and an error appears saying "phpcs: Referenced sniff "PHPCompatibility.PHP.RemovedExtensions" does not exist".

I have installed phpcs correctly as shown in the print screen below.

enter image description here

I then setup up the setting on vscode:

{
    "workbench.settings.editor": "json",
    "phpcs.enable": true,
    "phpcs.executablePath": "C:\\Users\\jafsa\\wpcs\\vendor\\bin\\phpcs.bat",
    "phpcs.standard": "WordPress",
    "phpcs.showWarnings": true,
    "phpcs.showSources": true,
    "phpcbf.enable": true,
    "phpcbf.executablePath": "C:\\Users\\jafsa\\wpcs\\vendor\\bin\\phpcbf.bat",
    "phpcbf.onsave": true,
    "phpcbf.standard": "WordPress",
}

The code is formatted however no errors appear and an error appears saying "PHPCompatibility.PHP.RemovedExtensions" does not exist".

enter image description here

Any help would be appreciated.

1 Answers

You need just remove phpcs.xml.dist file from your theme.

Related