2

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.

Jafar Salami
  • 321
  • 4
  • 18

1 Answers1

0

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

Alex Andr
  • 9
  • 1
  • 1
    A good answer will always include an explanation why this would solve the issue, so that the OP and any future readers can learn from it. – Tyler2P Jan 27 '22 at 17:04