user1956396
user1956396

Reputation: 55

Liniting deprecated wp function over version 4.9.0 phpcs vscode

in my current project i'm using the following configuration

composer.json:

    "require-dev": {
    "php": "^7.4 || ^8.0",
    "dealerdirect/phpcodesniffer-composer-installer": "1.0.0",
    "phpcompatibility/php-compatibility": "^9.3.5",
    "phpcompatibility/phpcompatibility-wp": "2.1.4",
    "squizlabs/php_codesniffer": "3.7.2",
    "wp-coding-standards/wpcs": "2.3.0"
  },
  "config": {
    "allow-plugins": {
      "dealerdirect/phpcodesniffer-composer-installer": true
    },
    "platform": {
      "php": "7.4"
    }
  }

My phpcs.xml.dist file looks like:

<ini name="error_reporting" value="E_ALL &#38; ~E_DEPRECATED" />

<!-- Configs -->
<config name="minimum_supported_wp_version" value="6.0" />
<config name="testVersion" value="7.4-" />

<!-- PHP Compatibility -->
<rule ref="PHPCompatibilityWP"/>

<!-- Rules -->
<rule ref="WordPress-Docs" />
<rule ref="WordPress-Extra" />

So when I test for deprecated WordPress features, they are only considered up to version 4.9. See the picture belong! wp_make_content_images_responsive() is deprecated since version 5.5.0 and i'm not getting any errors!

enter image description here

Upvotes: 0

Views: 155

Answers (0)

Related Questions