         }
         return false
     }
+
+    private func provideViolationReason(for check: SyntaxProtocol) -> String {
+        switch check {
+        case is AvailabilityConditionSyntax:
+            return "Use #unavailable instead of #available with an empty body."
+        case is UnavailabilityConditionSyntax:
+            return "Use #available instead of #unavailable with an empty body."
+        default:
+            queuedFatalError("Unknown availability check type.")
+        }
+    }
 }

        ]
    )

    public func validate(file: SwiftLintFile) -> [StyleViolation] {
        let visitor = UnavailableConditionRuleVisitor(viewMode: .sourceAccurate)
        return visitor.walk(file: file, handler: \.availabilityChecks).map { check in
            StyleViolation(
                ruleDescription: Self.description,
                severity: configuration.severity,
                location: Location(
                    file: file,
                    byteOffset: ByteCount(check.positionAfterSkippingLeadingTrivia.utf8Offset)),
                reason: provideViolationReason(for: check)
            )
        }
    }

    private func provideViolationReason(for check: SyntaxProtocol) -> String {
        switch check {
        case is AvailabilityConditionSyntax:
            return "Use #unavailable instead of #available with an empty body."
        case is UnavailabilityConditionSyntax:
            return "Use #available instead of #unavailable with an empty body."
        default:
            queuedFatalError("Unknown availability check type.")
        }
    }
}

private final class UnavailableConditionRuleVisitor: SyntaxVisitor {
    private(set) var availabilityChecks: [SyntaxProtocol] = []

    override func visitPost(_ node: IfStmtSyntax) {
        guard node.body.statements.withoutTrivia().isEmpty else {
            return

import SwiftSyntax

public struct UnavailableConditionRule: ConfigurationProviderRule, SwiftSyntaxRule {
    public var configuration = SeverityConfiguration(.warning)

    public init() {}
