Skip to content

v2.5.0

Latest

Choose a tag to compare

@Janther Janther released this 01 Dec 22:05
e384e10

What's Changed

Requirements

  • Node.js 22 or newer is now required (was 20) by @Janther in #1708

Format changes

  • Comments in a deconstruction stay with the right value by @Janther in #1768
// Original
(
    /* uint80 roundID */,
    int answer,
    /*uint startedAt*/,
    /*uint timeStamp*/,
    /*uint80 answeredInRound*/
) = dataFeed.latestRoundData();

// prettier-plugin-solidity 2.4.1
(
    ,
    /* uint80 roundID */ int answer,
    , /*uint startedAt*/
    , /*uint timeStamp*/
) = /*uint80 answeredInRound*/ dataFeed.latestRoundData();

// prettier-plugin-solidity 2.5.0
(
    /* uint80 roundID */,
    int answer,
    /*uint startedAt*/,
    /*uint timeStamp*/,
    /*uint80 answeredInRound*/
) = dataFeed.latestRoundData();

An empty last slot in a deconstruction no longer adds an extra blank line when it breaks.

  • A line comment inside empty parameters or arguments no longer breaks the code, and a comment inside an empty struct no longer throws Comment not printed by @Janther in #1757
// Original
function reserved(
    // parameters will be added later
) public {}

// prettier-plugin-solidity 2.4.1
function reserved(// parameters will be added later) public {}

// prettier-plugin-solidity 2.5.0
function reserved(
    // parameters will be added later
) public {}
  • Comments between a while condition and its body are now the first comment of the block by @Janther in #1817
// Original
while(x < integers.length)    // the variable integers was initialized to length 10
{

// prettier-plugin-solidity 2.4.1
while (
    x < integers.length // the variable integers was initialized to length 10
) {

// prettier-plugin-solidity 2.5.0
while (x < integers.length) {
    // the variable integers was initialized to length 10
  • Comments in pragma versions by @Janther in #1758
  • Comments in string literals, Yul paths, Yul switch cases and Yul variable declarations by @Janther in #1755

Performance

Formatting is about 40% faster than in 2.4.1.

Performance

Formatting is about 40% faster than in 2.4.1. We now walk Slang's tree once and make far fewer calls into it, and files that allow the latest Solidity version are parsed only once. By @Janther in #1749, #1750, #1796, #1800, #1815 and #1819

Dependencies

Internal changes

  • Browser tests for the standalone build in Chromium, Firefox and WebKit by @Janther in #1715 and #1729

Full Changelog: v2.4.1...v2.5.0