solhint-community

style-guide-casing

Recommended Badge Category Badge Default Severity Badge warn

The {“extends”: “solhint:recommended”} property in a configuration file enables this rule.

Description

Check identifier and type name casing conforms to the style guide

Options

This rule accepts an array of options:

Index Description Default Value
0 Rule severity. Must be one of “error”, “warn”, “off”. warn

Example Config

{
  "rules": {
    "style-guide-casing": ["warn"]
  }
}

Examples

👍 Examples of correct code for this rule

immutable/constant var name is capitalized snake case

uint private immutable WAD_DECIMALS = 18

constant var name is capitalized snake case

uint private constant WAD_DECIMALS = 18

function/modifier name in mixedCase

function foo_bar() {}

contract/enum/struct name in CapWords

contract Foo {}

👎 Examples of incorrect code for this rule

immutable/constant var name in lowercase snake_case

uint private immutable wad_decimals = 18

function/modifier name in snake case

function foo_bar() {}

function/modifier name in upper snake case

modifier FOO_BAR() {}

mutable var name in upper snake case

uint private FOO_BAR;

contract name not in CapWords

contract foo {}

Version

This rule is introduced in the latest version.

Resources