prettier-plugin-solidity
prettier-plugin-solidity copied to clipboard
about exponentiation
I want to format exponentiation symbols like in JavaScript. Also OpenZeppelin uses it like this:
Expected Behaviour
function foo(int x) public returns (int) {
return x ** x;
}
Actual Behaviour
function foo(int x) public returns (int) {
return x**x; // here
}
Maybe it should be changed in the config?
Hi,
We decided on #174 to not to use an option for this.
We try to use as few options as possible as this is easier for maintenance.
The only use of exponentiation I could find in the OpenZeppelin contracts was here.
Uhm, the fact that prettier formats it that way in javascript makes me think we might want to reconsider this. On the other hand, this plugin is already used by a lot of projects, and forcing a re-format without a good reason might not be a great idea.
I say we keep this issue open for now just in case. Thanks for the data point @emretepedev.
fwiw the solidity style guide only makes a distinction when used to denote precedence.
Hi,
We decided on #174 to not to use an option for this.
We try to use as few options as possible as this is easier for maintenance.
The only use of exponentiation I could find in the OpenZeppelin contracts was here.
Hi @Janther I saw in OpenZeppelin's Contracts Wizard, not in contract. Open in Remix (copied from the oz contract wizard). Also, I saw in ethernaut contracts.
Closing this, the exponentiation operator is now surrounded with spaces.