v2.4.0
What's Changed
Better Tests
Format changes
- Member access chained expressions now can have comments in the middle of the chain placed properly by @Janther in #1461
// Unformatted
contract Foo {
function bar() public {
// Comments in between the chain
game.
// CONFIG
// Do not touch
config. // Window
// Resolution 1000
resolveWindow = 1000;
begin
.// Comment 1
functionCall(/* Comment about parameter */ parameter)
.// Comment 2
end;
}
}
// prettier-plugin-solidity 2.4.0
contract Foo {
function bar() public {
// Comments in between the chain
game
// CONFIG
// Do not touch
.config // Window
// Resolution 1000
.resolveWindow = 1000;
begin // Comment 1
.functionCall(/* Comment about parameter */ parameter) // Comment 2
.end;
}
}// Original
contract Foo {
function bar() public {
for (initialize;;) {}
for (; condition;) {}
for (longInitialize; longCondition;) {}
}
}
// prettier-plugin-solidity 2.3.1
contract Foo {
function bar() public {
for (initialize; ; ) {}
for (; condition; ) {}
for (
longInitialize;
longCondition;
) {}
}
}
// prettier-plugin-solidity 2.4.0
contract Foo {
function bar() public {
for (initialize; ;) {}
for (; condition;) {}
for (
longInitialize;
longCondition;
) {}
}
}Dependencies
- This package was bundled with webpack 5.109.2 by @dependabot[bot] in #1659
- Supporting prettier 3.9.6 by @Janther in #1651
- Updating @nomicfoundation/slang 1.3.7 and supporting up to solidity 0.8.36 by @dependabot[bot] in #1643
- Updating semver to 7.8.5 by @dependabot[bot] in #1606
Internal changes
- Using the latest techniques to use prettier's printing functions allowed to trim a lot of now unnecessary code. by @Janther in #1500 and #1501
- General refactors improving clean code, performance, and file size.
Full Changelog: v2.3.1...v2.4.0