Search code examples
visual-studio-codephpcs

vscode phpcs: referenced sniff Universal.WhiteSpace.DisallowInlineTabs does not exist


I have had a lot of issues setting up phpcs and vscode — they worked perfectly for a while, but then after reorganizing some folders, I moved my wpcs repo somewhere else. Now trying to reconfigure phpcs and cannot figure out what the problem is. I keep getting an error that Universal.WhiteSpace.DisallowInlineTabs does not exist. Here is a screenshot enter image description here

Any idea what's going on?


Solution

  • I used homebrew to install phpcs instead of composer. Because I didn't want to switch to composer I started using PHPCSUtils's 'Non-Composer based integration' but realized that I didn't want to have to manually update the package every time a new release came out.

    Instead I cloned PHPCSUtils and PHPCSExtras into directories in the same parent folder as my WPCS directory. Then I symlinked them into the WPCS folder

    git clone git@github.com:WordPress/WordPress-Coding-Standards.git wpcs
    git clone git@github.com:PHPCSStandards/PHPCSExtra.git
    git clone git@github.com:PHPCSStandards/PHPCSUtils.git
    cd wpcs
    ln -s ../PHPCSUtils/PHPCSUtils PHPCSUtils
    ln -s ../PHPCSExtra/Universal Universal
    ln -s ../PHPCSExtra/NormalizedArrays NormalizedArrays