Skip to content

Add rule: frame_alignment_requires_dimensions #41

@kj6dev

Description

@kj6dev

Overview

Warn when using .frame(alignment: .top) without specifying width or height.

Rule Identifier

frame_alignment_requires_dimensions

Rationale

Frame alignment has no effect without dimensions - likely a mistake.

Example

// ❌ Warning - alignment has no effect
Text("Hello")
    .frame(alignment: .top)

// ✅ Correct - alignment works with dimension
Text("Hello")
    .frame(maxHeight: .infinity, alignment: .top)

Priority

Low - straightforward detection, prevents common mistake

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions