solhint

quotes

Recommended Badge Category Badge Default Severity Badge error

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

Description

Use double quotes for string literals. Values must be ‘single’ or ‘double’.

Options

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

Example Config

{
  "rules": {
    "quotes": ["error","double"]
  }
}

Examples

👍 Examples of correct code for this rule

String with double quotes


      pragma solidity 0.4.4;
        
        
      contract A {
        string private a = "test";
      }
    

👎 Examples of incorrect code for this rule

String with single quotes


      pragma solidity 0.4.4;
        
        
      contract A {
        string private a = 'test';
      }
    

Version

This rule was introduced in Solhint 1.4.0

Resources