Easier: WPCS Workspace Based

1. composer.json (composer.lock must be exist)

{
    "name": "project-name",
    "description": "...",
    "require": {
    },
    "require-dev": {
        "wp-coding-standards/wpcs": "^2.3"
    },
    "scripts": {
      "post-install-cmd": [
        "phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs",
        "phpcs --config-set default_standard WordPress"
      ],
      "test": [
        "phpcs --ignore=./vendor ./"
      ],
      "fix": [
        "phpcbf --ignore=./vendor ./"
      ]
    }
}Code language: JSON / JSON with Comments (json)

2. Install the VS Code Extension

PHP Sniffer & Beautifier: https://marketplace.visualstudio.com/items?itemName=ValeryanM.vscode-phpsab


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.