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

format/statements/braces-position

In the format-laravel and format-psr12 presets. Safe fix.

What it does

Braces must be placed as configured.

Configuration

[format.rules]
"statements/braces-position" = true

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

Options

Name Type Allowed values Default Upstream name
allow-single-line-anonymous-functions bool Any true allow_single_line_anonymous_functions
allow-single-line-empty-anonymous-classes bool Any true allow_single_line_empty_anonymous_classes
anonymous-classes-opening-brace enum next-line-unless-newline-at-signature-end, same-line "same-line" anonymous_classes_opening_brace
anonymous-functions-opening-brace enum next-line-unless-newline-at-signature-end, same-line "same-line" anonymous_functions_opening_brace
classes-opening-brace enum next-line-unless-newline-at-signature-end, same-line "next-line-unless-newline-at-signature-end" classes_opening_brace
control-structures-opening-brace enum next-line-unless-newline-at-signature-end, same-line "same-line" control_structures_opening_brace
functions-opening-brace enum next-line-unless-newline-at-signature-end, same-line "next-line-unless-newline-at-signature-end" functions_opening_brace

Replaces

More format/statements rules · Edit this page

Last updated on

Was this page helpful?