Skip to content

Commit 62e5c9e

Browse files
authored
block always breaks (#514)
1 parent 76943d3 commit 62e5c9e

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/nodes/Block.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const {
22
doc: {
3-
builders: { indent, line, softline }
3+
builders: { hardline, indent }
44
}
55
} = require('prettier/standalone');
66

@@ -15,11 +15,11 @@ const Block = {
1515
: [
1616
'{',
1717
indent([
18-
options.bracketSpacing ? line : softline,
18+
hardline,
1919
printPreservingEmptyLines(path, 'statements', options, print),
2020
printComments(node, path, options)
2121
]),
22-
options.bracketSpacing ? line : softline,
22+
hardline,
2323
'}'
2424
]
2525
};

tests/AllSolidityFeatures/__snapshots__/jsfmt.spec.js.snap

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,9 @@ contract Overrides {
10301030
BazQuxBazQuxBazQux,
10311031
Quuuuuuuuuuuuuux
10321032
) varName;
1033-
modifier onlyOwner() virtual {_;}
1033+
modifier onlyOwner() virtual {
1034+
_;
1035+
}
10341036
10351037
modifier onlyOwner() override {
10361038
require(msg.sender == owner(), "Ownable: caller is not the owner");
@@ -1116,7 +1118,9 @@ uint256 constant MULTIPLIER = 2**EXPONENT;
11161118
contract WithUncheckedBlock {
11171119
function f() public pure returns (uint256) {
11181120
uint256 x = 0;
1119-
unchecked {x--;}
1121+
unchecked {
1122+
x--;
1123+
}
11201124
return x;
11211125
}
11221126
@@ -1129,7 +1133,9 @@ contract WithUncheckedBlock {
11291133
}
11301134
11311135
function mul(uint256 x, uint256 y) internal pure returns (uint256) {
1132-
unchecked {return x * y;}
1136+
unchecked {
1137+
return x * y;
1138+
}
11331139
}
11341140
}
11351141

0 commit comments

Comments
 (0)