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.

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.