The {“extends”: “solhint:recommended”} property in a configuration file enables this rule.
Variable names must be in mixedCase. (Does not check IMMUTABLES nor CONSTANTS (use inherent rules for that)
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 “prefixForImmutables” specifying the prefix to put to consider a variable as kind of immutable to allow it to be in all CAPS. | {“prefixForImmutables”:”IMM_”} |
{
"rules": {
"var-name-mixedcase": [
"warn",
{
"prefixForImmutables": "IMM_"
}
]
}
}
string public RST_VARIABLE_NAME
string public IMM_VARIABLE_NAME
string public VARIABLE_NAME
string public VARIABLE_NAME
string public IMM_VARIABLE_NAME
This rule was introduced in Solhint 2.0.0-alpha.0