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

format/types/nullable-for-null-default

In the format-laravel preset. Safe fix.

What it does

Adds or removes ? before single type declarations or |null at the end of union types when parameters have a default null value.

Configuration

[format.rules]
"types/nullable-for-null-default" = true

To skip it in some files, add a @pun-ignore-file comment.

Options

Name Type Allowed values Default Upstream name
use-nullable-type-declaration bool Any true use_nullable_type_declaration

Replaces

More format/types rules · Edit this page

Last updated on

Was this page helpful?