How to install phpcs for magento 2
Step-by-Step Installation of phpcs for Magento 2
Install PHP_CodeSniffer via Composer, If it's not already installed. Create A directory and open the terminalcomposer require --dev squizlabs/php_codesniffer
composer require --dev magento/magento-coding-standard
vendor/bin/phpcs --config-set installed_paths vendor/magento/magento-coding-standard
vendor/bin/phpcs -i
vendor/bin/phpcs --standard=Magento2 app/code/Vendor/Module
vendor/bin/phpcbf --standard=Magento2 app/code/Vendor/Module