4

I want to add phpcs CodeSniffer in VScode. I'm getting an error phpcs: Request workspace/configuration failed with message: Unable to locate phpcs. Please add phpcs to your global path or use composer dependency manager to install it in your project locally. in visual studio. I installed PHPCS and PEAR also. these code I tried in user-setting and workspace settings also "phpcs.composerJsonPath": "C:/wamp/wpcs/composer.json" in VScode. But didn't get where and how should I set the path? my path directory is C:\wamp\wpcs\phpcs. Can anyone suggest me how to do?

1 Answer 1

3

Finally, I got the answer. First, I added extensions phpcs and wpcs in VScode then in the user-settings I have added these arguments make sure PEAR and PHPCS, WPCS are installed in the local directory.

{
"phpcs.standard": "WordPress",
"phpcs.enable": true,
"php.validate.executablePath": "C:/wamp/bin/php/php5.6.25",
"phpcs.executablePath": "C:/wamp/bin/php/php5.6.25/phpcs.bat",
"phpcs.autoConfigSearch": true
}

After setup everything now its working fine.

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

Comments

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.