How to run phpcs on WordPress-Develop files without installing PHP
I've been running all my dev projects via Docker to avoid the pitfalls of installing server software on my computer. This also lets me jump between macheines very easily since everything I need is wrapped up in dockerfiles, docker-compose files or package.json scripts.
WordPress development doesn't work like that. The default development environment expects PHP to be installed and will try to run PHPCS validation checks from a local instance of PHP.
Use Composer's Docker image
The official Composer Docker image is extremely versatile. It can run arbitrary shell commands if the passed argument isn't a Composer keyword.