The {“extends”: “solhint:recommended”} property in a configuration file enables this rule.
Contract has “some count” states declarations but allowed no more than maxstates.
This rule accepts an array of options:
Index | Description | Default Value |
---|---|---|
0 | Rule severity. Must be one of “error”, “warn”, “off”. | warn |
1 | Maximum allowed number of states declarations | 15 |
{
"rules": {
"max-states-count": ["warn",15]
}
}
pragma solidity 0.4.4;
contract A {
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private constant TEST = 1;
uint private constant TEST = 1;
uint private constant TEST = 1;
uint private constant TEST = 1;
uint private constant TEST = 1;
uint private constant TEST = 1;
uint private constant TEST = 1;
uint private constant TEST = 1;
uint private constant TEST = 1;
uint private constant TEST = 1;
}
pragma solidity 0.4.4;
contract A {
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
uint private a;
}
This rule was introduced in Solhint 1.1.5