Prettier Plugin Solidity Versions Save

A Prettier plugin for automatically formatting your Solidity code.

v1.0.0-beta.19

2 years ago

Changes in this version:

  • 🔧 node 12 is no longer supported. #598 thanks @mattiaerre
  • 🐛 fixed bug for pragma statements containing multiple versions. #583 thanks @fvictorio
  • ✨ added support for user defined types. #607 thanks @zemse

v1.0.0-beta.18

2 years ago

Description

  • #565
  • #570
  • #575

v1.0.0-beta.17

2 years ago

This release contains 2 main improvements:

  • indentation in chained elements:
// v1.0.0-beta.16
uint foo = someLongFunction(
    foo,
    bar,
    baz
)
.someOtherFunctionA(
    foo,
    bar,
    baz
)
.someOtherFunctionB(
    foo,
    bar,
    baz
)

// v1.0.0-beta.17
uint foo = someLongFunction(
    foo,
    bar,
    baz
)
    .someOtherFunctionA(
        foo,
        bar,
        baz
    )
    .someOtherFunctionB(
        foo,
        bar,
        baz
    )
  • Bug fix for long variable declarations
// input
function isAuthorized(
    bytes32 serviceId,
    address client
) external view override returns (bool) {
    WhitelistStatus storage whitelistStatus = serviceIdToClientToWhitelistStatus[serviceId][client];
    return true;
}

// v1.0.0-beta.16
function isAuthorized(bytes32 serviceId, address client)
    external
    view
    override
    returns (bool)
{

        WhitelistStatus storage whitelistStatus
     = serviceIdToClientToWhitelistStatus[serviceId][client];
    return true;
}

// v1.0.0-beta.17
function isAuthorized(bytes32 serviceId, address client)
    external
    view
    override
    returns (bool)
{
    WhitelistStatus
        storage whitelistStatus = serviceIdToClientToWhitelistStatus[
            serviceId
        ][client];
    return true;
}

Special thanks to @acenolaza (#564) and @passabilities (#562) for their help.

v1.0.0-beta.16

2 years ago

This release contains a bug fix and an improvement in our opinionated standardised code.

  • (#557) We fixed a problem in our indentation in MemberAccess chains.
// input
int256 amount = SafeCast.toInt256(amount.mul(10**(18 - underlyingAssetDecimals))).neg();

// v1.0.0-beta.15
int256 amount = SafeCast
.toInt256(amount.mul(10**(18 - underlyingAssetDecimals)))
.neg();

// v1.0.0-beta.16
int256 amount = SafeCast
    .toInt256(amount.mul(10**(18 - underlyingAssetDecimals)))
    .neg();
  • (#555) We also made the decision to enforce parentheses in ModifierDeclarations without parameters,
// input
modifier onlyOwner {
    require(owner() == _msgSender(), "Ownable: caller is not the owner");
    _;
}

// v1.0.0-beta.15
modifier onlyOwner {
    require(owner() == _msgSender(), "Ownable: caller is not the owner");
    _;
}

// v1.0.0-beta.16
modifier onlyOwner() {
    require(owner() == _msgSender(), "Ownable: caller is not the owner");
    _;
}

and remove them from ModifierInvocations without arguments.

// input
function renounceOwnership() public virtual onlyOwner() {
    _setOwner(address(0));
}

// v1.0.0-beta.15
function renounceOwnership() public virtual onlyOwner() {
    _setOwner(address(0));
}

// v1.0.0-beta.16
function renounceOwnership() public virtual onlyOwner {
    _setOwner(address(0));
}

v1.0.0-beta.15

2 years ago

This release adds a runtime security check for Prettier's version. The printing process will throw if Prettier's version does not satisfy the range >=2.3.0

v1.0.0-beta.14

2 years ago

Release v1.0.0-beta.14 comes with a new option for the configuration file. You can use the compiler option to help prettier-plugin-solidity choose a appropriate formats.

along this mayor change the release includes these other minor changes:

  • internal changes #531, #532, #539, #540
  • improvements in the documentation #537, #548

v1.0.0-beta.13

2 years ago

Description

In v1.0.0-beta.12 we used a new feature provided by prettier 2.3.0 that allowed us to simplify our codebase drastically. However Prettier was declared as a dependency, thus nom did not enforce the installation of prettier v2.3.0 in existing projects. By declaring it as a peerDependency we hope to warn developers of the new requirement.

v1.0.0-beta.12

2 years ago

Description

  • #513

  • #514

  • #515

  • #516

  • #517

  • #518

  • #519

  • #520

  • #524

  • #527

Wow, huge release; thanks @Janther and @fvictorio

v1.0.0-beta.11

2 years ago

Description

  • #502

  • #499

v1.0.0-beta.10

3 years ago

Description

  • #478

  • #480