Skip to content

Commit b994774

Browse files
Janthermattiaerre
authored andcommitted
Solidity industry indents using 4 spaces and this opinionated code formatter should follow the industry. (#122)
1 parent 01739e0 commit b994774

File tree

17 files changed

+1405
-1371
lines changed

17 files changed

+1405
-1371
lines changed

src/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,15 @@ const printers = {
5555
}
5656
};
5757

58+
// https://prettier.io/docs/en/plugins.html#defaultoptions
59+
const defaultOptions = {
60+
// @TODO fix indentation in block comments
61+
tabWidth: 4
62+
};
63+
5864
module.exports = {
5965
languages,
6066
parsers,
61-
printers
67+
printers,
68+
defaultOptions
6269
};

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ contract AddressPayable {
1414
pragma solidity ^0.5.2;
1515
1616
contract AddressPayable {
17-
address payable[] hello;
18-
function sendSomeEth(address payable to, address payable[] memory world)
19-
public
20-
payable
21-
{
22-
address payable target = to;
23-
target.transfer(msg.value);
24-
}
17+
address payable[] hello;
18+
function sendSomeEth(address payable to, address payable[] memory world)
19+
public
20+
payable
21+
{
22+
address payable target = to;
23+
target.transfer(msg.value);
24+
}
2525
}
2626
2727
`;

0 commit comments

Comments
 (0)