Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

recommended lint preset

Essential, plus newer PHP syntax up to [php] version, the Laravel, Pest and PHPUnit quality rules, and simpler equivalents. The default lint preset. Turn it on in pun.toml:

[lint]
preset = "recommended"

Each preset includes the ones below it. Laravel, Pest, and PHPUnit rules also need their extension. PHP upgrade rules run only up to [php] version. Planned rules do not run. Presets and sets compares them all.

Enabled rules (311)

Rule Configuration Status
lint/arrays/no-implicit-array-creation "error" Ported
lint/classes/add-stringable "error" Ported
lint/classes/no-explicit-constructor-call "error" Ported
lint/classes/no-null-property-default "error" Ported
lint/classes/no-redundant-readonly "error" Ported
lint/classes/no-static-constructor-call "error" Ported
lint/classes/no-underscore-class "error" Ported
lint/classes/prefer-new-self "error" Ported
lint/classes/prefer-self-in-final "error" Ported
lint/comments/no-unused-ignore "error" Ported
lint/complexity/no-and-assignment "error" Ported
lint/complexity/no-compact "error" Ported
lint/complexity/no-concat-assign-new-item "error" Ported
lint/complexity/no-constant-condition "error" Ported
lint/complexity/no-constant-via-variable "error" Ported
lint/complexity/no-dirname-dir-concat "error" Ported
lint/complexity/no-duplicate-match-arm "error" Ported
lint/complexity/no-iterator-to-array-in-foreach "error" Ported
lint/complexity/no-negated-boolean-literal "error" Ported
lint/complexity/no-negated-group "error" Ported
lint/complexity/no-negated-instanceof-ternary "error" Ported
lint/complexity/no-phpdoc-class-case-mismatch "error" Ported
lint/complexity/no-redundant-isset "error" Ported
lint/complexity/no-redundant-literal-return "error" Ported
lint/complexity/no-redundant-null-check "error" Ported
lint/complexity/no-redundant-nullsafe "error" Ported
lint/complexity/no-redundant-write-visibility "error" Ported
lint/complexity/no-single-case-switch "error" Ported
lint/complexity/no-single-item-in-array "error" Ported
lint/complexity/no-sole-value-sprintf "error" Ported
lint/complexity/no-unused-label "error" Ported
lint/complexity/no-useless-array-values "error" Ported
lint/complexity/prefer-absolute-include "error" Ported
lint/complexity/prefer-array-literal "error" Ported
lint/complexity/prefer-coalesce-over-empty-ternary "error" Ported
lint/complexity/prefer-empty-array-compare "error" Ported
lint/complexity/prefer-explicit-array-comparison "error" Ported
lint/complexity/prefer-func-num-args "error" Ported
lint/complexity/prefer-if-statement "error" Ported
lint/complexity/prefer-in-array "error" Ported
lint/complexity/prefer-inline-array-return "error" Ported
lint/complexity/prefer-instance-method "error" Ported
lint/complexity/prefer-min-max "error" Ported
lint/complexity/prefer-not-in-array "error" Ported
lint/complexity/prefer-null-coalesce "error" Ported
lint/complexity/prefer-property-default "error" Ported
lint/complexity/prefer-property-exists "error" Ported
lint/complexity/prefer-simple-condition "error" Ported
lint/complexity/require-attribute-argument-order "error" Ported
lint/complexity/require-consistent-return "error" Ported
lint/complexity/require-is-a-allow-string "error" Ported
lint/complexity/require-named-argument-order "error" Ported
lint/complexity/require-previous-exception "error" Ported
lint/control-flow/no-assign-in-condition "error" Ported
lint/control-flow/no-else-after-return "error" Ported
lint/control-flow/no-empty-catch "error" Ported
lint/control-flow/no-for-init-overwrite "error" Ported
lint/control-flow/no-loop-variable-overwrite "error" Ported
lint/control-flow/no-return-assignment "error" Ported
lint/control-flow/no-superfluous-elseif "error" Ported
lint/control-flow/no-switch-continue "error" Ported
lint/control-flow/no-unsafe-finally "error" Ported
lint/control-flow/no-useless-return "error" Ported
lint/control-flow/prefer-bool-return "error" Ported
lint/control-flow/prefer-combined-isset "error" Ported
lint/control-flow/prefer-combined-unset "error" Ported
lint/control-flow/prefer-yield-from "error" Ported
lint/dead-code/no-always-false-condition "error" Ported
lint/dead-code/no-always-true-if "error" Ported
lint/dead-code/no-always-true-instanceof "error" Ported
lint/dead-code/no-and-true "error" Ported
lint/dead-code/no-cast-in-concat "error" Ported
lint/dead-code/no-condition-exact-return "error" Ported
lint/dead-code/no-dead-catch "error" Ported
lint/dead-code/no-dead-php-version-check "error" Ported
lint/dead-code/no-double-self-assignment "error" Ported
lint/dead-code/no-duplicate-array-key "error" Ported
lint/dead-code/no-duplicate-case-body "error" Ported
lint/dead-code/no-empty-block "error" Ported
lint/dead-code/no-empty-method "error" Ported
lint/dead-code/no-false-ternary "error" Ported
lint/dead-code/no-future-php-version-check "error" Ported
lint/dead-code/no-identical-branches "error" Ported
lint/dead-code/no-implode-ternary "error" Ported
lint/dead-code/no-invalid-return-tag "error" Ported
lint/dead-code/no-invalid-var-tag "error" Ported
lint/dead-code/no-null-tag-value "error" Ported
lint/dead-code/no-parent-call-without-parent "error" Ported
lint/dead-code/no-redundant-condition "error" Ported
lint/dead-code/no-redundant-default-argument "error" Ported
lint/dead-code/no-redundant-foreach-guard "error" Ported
lint/dead-code/no-redundant-promoted-assign "error" Ported
lint/dead-code/no-redundant-property-default "error" Ported
lint/dead-code/no-return-in-constructor "error" Ported
lint/dead-code/no-self-assignment "error" Ported
lint/dead-code/no-typed-property-instanceof "error" Ported
lint/dead-code/no-unreachable-code "error" Ported
lint/dead-code/no-unused-assignment "error" Ported
lint/dead-code/no-unused-constructor-param "error" Ported
lint/dead-code/no-unused-expression "error" Ported
lint/dead-code/no-unused-foreach-key "error" Ported
lint/dead-code/no-unused-global "error" Ported
lint/dead-code/no-unused-private-constant "error" Ported
lint/dead-code/no-unused-private-method "error" Ported
lint/dead-code/no-unused-private-method-param "error" Ported
lint/dead-code/no-unused-private-property "error" Ported
lint/dead-code/no-unused-promoted-property "error" Ported
lint/dead-code/no-unused-public-method-param "error" Ported
lint/dead-code/no-unused-return-type "error" Ported
lint/dead-code/no-unused-return-value "error" Ported
lint/dead-code/no-unused-static "error" Ported
lint/dead-code/no-useless-cast "error" Ported
lint/dead-code/no-useless-catch "error" Ported
lint/dead-code/no-useless-condition "error" Ported
lint/dead-code/no-useless-continue "error" Ported
lint/dead-code/no-useless-filter-var "error" Ported
lint/dead-code/no-useless-math "error" Ported
lint/dead-code/no-useless-override "error" Ported
lint/dead-code/no-useless-phpdoc-type "error" Ported
lint/dead-code/no-useless-ternary "error" Ported
lint/functions/no-assign-in-argument "error" Ported
lint/functions/no-extra-arguments "error" Ported
lint/functions/no-missing-format-argument "error" Ported
lint/functions/no-required-after-optional "error" Ported
lint/functions/no-swapped-explode-arguments "error" Ported
lint/functions/no-unused-closure-use "error" Ported
lint/functions/no-void-reference-return "error" Ported
lint/functions/require-array-filter-callback "error" Ported
lint/functions/require-strict-array-search "error" Ported
lint/functions/require-strict-function-call "error" Ported
lint/functions/require-strict-in-array "error" Ported
lint/imports/no-unused "error" Ported
lint/laravel/no-default-authorize "error" Ported
lint/laravel/no-request-all "error" Ported
lint/laravel/prefer-anonymous-migration "error" Ported
lint/laravel/prefer-array-validation-rules "error" Ported
lint/laravel/prefer-casts-method "error" Ported
lint/laravel/prefer-dedicated-status-assertion "error" Ported
lint/operators/no-loose-equality "error" Ported
lint/operators/no-useless-nullsafe "error" Ported
lint/operators/prefer-coalesce "error" Ported
lint/operators/prefer-coalesce-assign "error" Ported
lint/operators/prefer-coalesce-assign-over-fallback "error" Ported
lint/performance/prefer-explode-over-preg-split "error" Ported
lint/pest/no-before-all-in-describe "error" Ported
lint/pest/no-invalid-repeat "error" Ported
lint/pest/no-negated-boolean-matcher "error" Ported
lint/pest/no-redundant-type-expectation "error" Ported
lint/pest/no-redundant-uses "error" Ported
lint/pest/no-static-test-closure "error" Ported
lint/pest/prefer-chained-expect "error" Ported
lint/pest/prefer-defer "error" Ported
lint/pest/prefer-each-modifier "error" Ported
lint/pest/prefer-expect "error" Ported
lint/pest/prefer-extend "error" Ported
lint/pest/prefer-not-modifier "error" Ported
lint/pest/prefer-sequence "error" Ported
lint/pest/prefer-simpler-expectation "error" Ported
lint/pest/prefer-specific-expectations "error" Ported
lint/pest/prefer-strict-equality-matchers "error" Ported
lint/pest/prefer-to-be-between "error" Ported
lint/pest/prefer-to-be-instance-of "error" Ported
lint/pest/prefer-to-be-truthy-falsy "error" Ported
lint/pest/prefer-to-equal-with-delta "error" Ported
lint/pest/prefer-to-have-keys "error" Ported
lint/pest/prefer-to-have-method-on-class "error" Ported
lint/pest/prefer-to-have-properties "error" Ported
lint/pest/prefer-to-match-array "error" Ported
lint/pest/prefer-to-match-object "error" Ported
lint/pest/prefer-to-throw "error" Ported
lint/pest/require-type-matcher-first "error" Ported
lint/php-5.3/no-http-vars "error" Ported
lint/php-5.5/no-class-magic-constant "error" Ported
lint/php-5.5/prefer-static-over-get-called-class "error" Ported
lint/php-7.0/no-call-user-method "error" Ported
lint/php-7.0/no-list-from-string "error" Ported
lint/php-7.0/prefer-braced-variable-variable "error" Ported
lint/php-7.0/prefer-coalesce-return "error" Ported
lint/php-7.0/prefer-spaceship "error" Ported
lint/php-7.0/prefer-spaceship-return "error" Ported
lint/php-7.0/prefer-static-method-call "error" Ported
lint/php-7.0/prefer-time "error" Ported
lint/php-7.1/prefer-is-iterable "error" Ported
lint/php-7.1/prefer-multi-catch "error" Ported
lint/php-7.2/no-constant-define-name "error" Ported
lint/php-7.2/no-each "error" Ported
lint/php-7.2/no-list-each "error" Ported
lint/php-7.2/no-string-assert "error" Ported
lint/php-7.2/prefer-foreach-over-each "error" Ported
lint/php-7.3/no-case-insensitive-define "error" Ported
lint/php-7.3/no-heredoc-label-in-body "error" Ported
lint/php-7.3/prefer-is-countable "error" Ported
lint/php-7.3/prefer-setcookie-options "error" Ported
lint/php-7.4/no-filter-magic-quotes "error" Ported
lint/php-7.4/no-hebrevc "error" Ported
lint/php-7.4/no-mb-strrpos-encoding-offset "error" Ported
lint/php-7.4/no-reflection-export "error" Ported
lint/php-7.4/no-restore-include-path "error" Ported
lint/php-7.4/prefer-coalesce-assign-over-if "error" Ported
lint/php-8.0/no-int-get-headers-format "error" Ported
lint/php-8.0/no-unused-catch-variable "error" Ported
lint/php-8.0/no-version-compare-operator-alias "error" Ported
lint/php-8.0/prefer-static-class "error" Ported
lint/php-8.1/no-closure-from-callable "error" Ported
lint/php-8.1/no-null-preg-split-limit "error" Ported
lint/php-8.1/no-reflection-set-accessible "error" Ported
lint/php-8.2/add-skip-dots-flag "error" Ported
lint/php-8.2/no-dollar-brace-interpolation "error" Ported
lint/php-8.2/no-utf8-encode-decode "error" Ported
lint/php-8.3/add-const-type "error" Ported
lint/php-8.3/prefer-dynamic-class-constant "error" Ported
lint/php-8.3/prefer-json-validate "error" Ported
lint/php-8.3/prefer-ldap-uri "error" Ported
lint/php-8.3/prefer-readonly-anonymous-class "error" Ported
lint/php-8.3/prefer-self-class "error" Ported
lint/php-8.4/add-csv-escape-argument "error" Ported
lint/php-8.4/prefer-array-find "error" Ported
lint/php-8.4/prefer-round-mode-enum "error" Ported
lint/php-8.5/no-finfo-buffer-context "error" Ported
lint/php-8.5/no-null-array-key "error" Ported
lint/php-8.5/no-null-debug-info "error" Ported
lint/php-8.5/no-out-of-range-chr "error" Ported
lint/php-8.5/prefer-array-first-last "error" Ported
lint/php-8.5/prefer-ord-first-byte "error" Ported
lint/php-8.6/prefer-clamp "error" Ported
lint/phpdoc/no-mixed-overruled-by-native "error" Ported
lint/phpdoc/no-superfluous-tags "error" Ported
lint/phpdoc/no-useless-param "error" Ported
lint/phpdoc/no-useless-readonly "error" Ported
lint/phpdoc/no-useless-return "error" Ported
lint/phpdoc/no-useless-var "error" Ported
lint/phpdoc/no-void-on-magic-method "error" Ported
lint/phpunit/add-instanceof-assert "error" Ported
lint/phpunit/add-instanceof-assert-for-argument "error" Ported
lint/phpunit/add-mock-intersection-param "error" Ported
lint/phpunit/add-mock-intersection-type "error" Ported
lint/phpunit/add-stub-intersection-type "error" Ported
lint/phpunit/no-assert-same-type-mismatch "error" Ported
lint/phpunit/no-at-matcher "error" Ported
lint/phpunit/no-bare-mock-assign "error" Ported
lint/phpunit/no-bare-mock-builder "error" Ported
lint/phpunit/no-empty-test "error" Ported
lint/phpunit/no-entity-mock "error" Ported
lint/phpunit/no-expects-any "error" Ported
lint/phpunit/no-flipped-assertion "error" Ported
lint/phpunit/no-float-delta-parameter "error" Ported
lint/phpunit/no-mock-intersection-property "error" Ported
lint/phpunit/no-negated-assertion "error" Ported
lint/phpunit/no-setup-override-attribute "error" Ported
lint/phpunit/no-stub-with-expectations "error" Ported
lint/phpunit/no-test-constructor "error" Ported
lint/phpunit/no-unused-mock "error" Ported
lint/phpunit/no-unused-mock-property "error" Ported
lint/phpunit/no-value-object-mock "error" Ported
lint/phpunit/prefer-assert "error" Ported
lint/phpunit/prefer-assert-array-has-key "error" Ported
lint/phpunit/prefer-assert-count "error" Ported
lint/phpunit/prefer-assert-instanceof "error" Ported
lint/phpunit/prefer-assert-instanceof-over-empty "error" Ported
lint/phpunit/prefer-assert-instances-of "error" Ported
lint/phpunit/prefer-assert-string-contains "error" Ported
lint/phpunit/prefer-comparison-assertion "error" Ported
lint/phpunit/prefer-create-stub "error" Ported
lint/phpunit/prefer-create-stub-argument "error" Ported
lint/phpunit/prefer-create-stub-expression "error" Ported
lint/phpunit/prefer-create-stub-in-coalesce "error" Ported
lint/phpunit/prefer-data-provider "error" Ported
lint/phpunit/prefer-inline-create-stub "error" Ported
lint/phpunit/prefer-local-over-setup-property "error" Ported
lint/phpunit/prefer-mock-intersection-return "error" Ported
lint/phpunit/prefer-narrow-will-return-callback "error" Ported
lint/phpunit/prefer-narrow-with-consecutive "error" Ported
lint/phpunit/prefer-property-assertions "error" Ported
lint/phpunit/prefer-simple-callback-assert "error" Ported
lint/phpunit/prefer-simple-mock-expectation "error" Ported
lint/phpunit/prefer-simple-with-matcher "error" Ported
lint/phpunit/prefer-standalone-asserts-over-callback "error" Ported
lint/phpunit/prefer-stub-var "error" Ported
lint/phpunit/prefer-test-attribute "error" Ported
lint/phpunit/prefer-will-return-callback "error" Ported
lint/phpunit/prefer-with-is-instance-of "error" Ported
lint/phpunit/prefer-yield-data-provider "error" Ported
lint/phpunit/require-data-provider-newlines "error" Ported
lint/phpunit/require-data-provider-order "error" Ported
lint/phpunit/require-exact-test-argument-type "error" Ported
lint/phpunit/require-final-test-case "error" Ported
lint/phpunit/require-method-casing "error" Ported
lint/phpunit/require-mock-expects "error" Ported
lint/phpunit/require-strict-types-in-tests "error" Ported
lint/phpunit/require-string-assert-argument "error" Ported
lint/security/add-sensitive-parameter "error" Ported
lint/security/no-eval "error" Ported
lint/security/no-ffi "error" Ported
lint/security/no-global "error" Ported
lint/security/no-insecure-comparison "error" Ported
lint/security/no-literal-password "error" Ported
lint/security/no-request-variable "error" Ported
lint/security/no-tainted-data "error" Ported
lint/security/require-preg-quote-delimiter "error" Ported
lint/statements/add-safe-strict-types "error" Ported
lint/statements/no-empty "error" Ported
lint/statements/require-strict-types "error" Ported
lint/style/no-assign-in-ternary-branch "error" Ported
lint/style/no-redundant-final-const "error" Ported
lint/style/prefer-early-return "error" Ported
lint/style/prefer-early-return-over-prepared-value "error" Ported
lint/tags/no-invalid-open-tag "error" Ported
lint/types/no-loose-comparison "error" Ported
lint/types/no-nullsafe-on-non-null "error" Ported
lint/types/prefer-identical-same-type "error" Ported
lint/types/require-strict-param "error" Ported

Rules left off (524)

Last updated on

Was this page helpful?