Non-external functions and state variables should start with a single underscore. Others, shouldn’t
This rule accepts an array of options:
Index | Description | Default Value |
---|---|---|
0 | Rule severity. Must be one of “error”, “warn”, “off”. | warn |
1 | A JSON object with a single property “strict” specifying if the rule should apply to ALL non state variables. Default: { strict: false }. | {“strict”:false} |
{
"rules": {
"private-vars-leading-underscore": ["warn",{"strict":false}]
}
}
--fix
optionfunction _thisIsInternal() internal {}
function _thisIsPrivate() private {}
uint256 internal _thisIsInternalVariable;
uint256 _thisIsInternalVariable;
function thisIsInternal() internal {}
function thisIsPrivate() private {}
uint256 internal thisIsInternalVariable;
uint256 thisIsInternalVariable;
This rule was introduced in Solhint 3.0.0-rc.3