---
title: "format/types"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

Type declarations, type checks and inferred types. Also in [lint](/docs/rules/lint/types) (77) and [analyse](/docs/rules/analyse/types) (118).

**[compact-nullable](/docs/rules/format/types/compact-nullable)**

Remove extra spaces in a nullable type declaration.

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

**[declaration-spacing](/docs/rules/format/types/declaration-spacing)**

Ensure single space between a variable and its type declaration in function arguments and properties.

In the `format-laravel` preset. Safe fix.

**[nullable-for-null-default](/docs/rules/format/types/nullable-for-null-default)**

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

In the `format-laravel` preset. Safe fix.

**[nullable-syntax](/docs/rules/format/types/nullable-syntax)**

Nullable single type declaration should be standardised using configured syntax.

In the `format-laravel` preset. Safe fix.

**[ordered](/docs/rules/format/types/ordered)**

Sort union types and intersection types using configured order.

Not in any preset. Safe fix.

**[union-spacing](/docs/rules/format/types/union-spacing)**

A single space or none should be around union type and intersection type operators.

In the `format-laravel` preset. Safe fix.
