diff --git a/README.md b/README.md index 05cf46d..a31400b 100644 --- a/README.md +++ b/README.md @@ -3677,6 +3677,34 @@ _You can enable the following settings in Xcode by running [this script](resourc +* (link) **Avoid using `()` as a type**. Prefer `Void`. + +
+ + ```swift + // WRONG + let result: Result<(), Error> + + // RIGHT + let result: Result + ``` +
+ +* (link) **Avoid using `Void()` as an instance of `Void`**. Prefer `()`. + +
+ + ```swift + let completion: (Result) -> Void + + // WRONG + completion(.success(Void())) + + // RIGHT + completion(.success(())) + ``` +
+ **[⬆ back to top](#table-of-contents)** ## File Organization diff --git a/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat b/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat index fbb010c..34fab1c 100644 --- a/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat +++ b/Sources/AirbnbSwiftFormatTool/airbnb.swiftformat @@ -109,6 +109,7 @@ --rules preferForLoop --rules conditionalAssignment --rules wrapMultilineConditionalAssignment +--rules void --rules blankLineAfterSwitchCase --rules consistentSwitchCaseSpacing --rules semicolons diff --git a/Sources/AirbnbSwiftFormatTool/swiftlint.yml b/Sources/AirbnbSwiftFormatTool/swiftlint.yml index b07e076..d60d6ea 100644 --- a/Sources/AirbnbSwiftFormatTool/swiftlint.yml +++ b/Sources/AirbnbSwiftFormatTool/swiftlint.yml @@ -6,7 +6,6 @@ only_rules: - legacy_constructor - legacy_nsgeometry_functions - unused_optional_binding - - void_return # TODO: Replace with SwiftFormat void rule - unowned_variable_capture - custom_rules