PHP CodeSniffer won't run in VSCode

1 week ago 3
ARTICLE AD BOX

I'm trying to get PHP CodeSniffer to run in my Visual Studio Code.
I have an identical second system (notebook) where it does work, but on my desktop, it simply won't lint.
Using the following (on both systems):

Fedora GNU/Linux 43 Visual Studio Code v1.106.3, installed through dnf (non-flatpak) PHP_CodeSniffer v4.0.1, installed globally using composer PHPCSutils v1.2.2, installed globally using composer php-compatibility dev-develop (5a53c1c), installed globally using composer valeryanm.vscode-phpsab v0.0.21, PHP Sniffer & Beautifier for Visual Studio Code

The ${HOME}/.composer/vendor/bin folder is in my $PATH.
I can run the phpcs and phpcbf executables in the terminal; even inside vscode's terminal.

Comparing both systems revealed no differences. I even removed ~/.vscode and ~/.config/Code from the desktop machine and copied those folders over from the notebook. It still won't work as expected. I tried from scratch with a blank VSCode, too.

On the working system, a PHP-file is linted upon opening the file. On the non-working system, nothing is linted, ever.
On the other hand, the keyboard shortcut F1 for "phpcbf Fix this file" does work.

Question: How can I diagnose this issue any further? What settings or environment specifics make PHPCS lint a file upon opening?

Thanks and kind regards,
FWieP

Read Entire Article