solhint icon indicating copy to clipboard operation
solhint copied to clipboard

Drop requirement of double quotes in string literals

Open CodeSandwich opened this issue 4 years ago • 1 comments

Solidity allows double or single quotes in string literals. It's useful in cases where the string itself contains quotes, it removes the need for escaping them. Banning one flavor upfront doesn't seem reasonable, it fights usage of a genuine readability improvement tool. Single quotes aren't confusing for the readers and AFAIK don't pose any threat of introducing bugs.

If avoiding single quotes is important, maybe they could be allowed only if the string contains double quotes?

CodeSandwich avatar Nov 02 '21 13:11 CodeSandwich

JS has backtick but solidity don't. I have to escape every double quote or // solhint-disable-line everywhere.

Ding-Fan avatar May 30 '22 12:05 Ding-Fan