Skip to content

no_empty_block not triggered in SwiftUI button #5762

Closed
@kacper1703

Description

New Issue Checklist

Bug Description

The following code does not trigger the no_empty_block rule:

@ViewBuilder
private var replyButton: some View {
    Button {

    } label: {
        Text("Reply")
    }
}

Environment

  • SwiftLint version: 0.56.1
  • Xcode version: Xcode 15.4 (15F31d)
  • Installation method used: Homebrew
  • Configuration file:
opt_in_rules:
- no_empty_block

no_empty_block:
  severity: error
  disabled_block_types: [initializer_bodies]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugUnexpected and reproducible misbehavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions