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

lint/performance/prefer-static-closure

Not in any set. Unsafe fix: it can change behaviour.

What it does

Lambdas not (indirectly) referencing $this must be declared static.

Configuration

[lint.rules]
"performance/prefer-static-closure" = "error"

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

Replaces

More lint/performance rules · Edit this page

Last updated on

Was this page helpful?