Visual Studio Code: Unable to locate phpcs

后端 未结 15 2005
梦毁少年i
梦毁少年i 2021-02-01 01:56

I am facing this issue in Visual Studio Code. I have already tried reinstalling the phpcs extension but still facing this issue.

Unable to locat

15条回答
  •  庸人自扰
    2021-02-01 02:14

    I had the same issue, I did the following to fix it:

    1. Install the phpcs by using composer with composer global require squizlabs/php_codesniffer

    2. Press Command + , (Click Code -> Preferences -> Settings)

    3. Select User Settings and locate 'PHP CodeSniffer'
    4. Scroll to 'Executatble Path' and put

      /Users/your-username/.composer/vendor/bin/phpcs

    This fixed the issue for me, I hope it does for you too. Cheers!

提交回复
热议问题