The {“extends”: “solhint:recommended”} property in a configuration file enables this rule.
Enforces the use of double or simple quotes as configured for string literals. Values must be ‘single’ or ‘double’.
This rule accepts an array of options:
Index | Description | Default Value |
---|---|---|
0 | Rule severity. Must be one of “error”, “warn”, “off”. | error |
1 | Type of quotes. Must be one of “single”, “double” | double |
{
"rules": {
"quotes": ["error","double"]
}
}
pragma solidity 0.4.4;
contract A {
string private a = "test";
}
pragma solidity 0.4.4;
contract A {
string private a = 'test';
}
string private constant STR = "You shall 'pass' !";
string private constant STR = 'You shall "pass" !';
pragma solidity 0.4.4;
contract A {
string private a = "test";
}
pragma solidity 0.4.4;
contract A {
string private a = 'test';
}
This rule was introduced in Solhint 1.4.0