Strings

Key Point

💡 Use double quotes "" for strings.

Quotes

  • Double quotes can be used for inline HTML.
  • Consistency to other style guides. Double quotes are used by many code styles like for example JavaScript.
  • Parallelism to the natural language. Double quotes are used to identify a passage of quoted text.

remark-lint: link-title-style

👍 Correct code for this rule:

"The winter is sparkling and frozen!"

👎 Incorrect code for this rule:

'The winter is sparkling and frozen!'

Line length

Strings that cause the line to go over 120 characters should not be written across multiple lines using string concatenation.

Broken strings are painful to work with and make code less searchable.

👍 Correct code for this rule:

"Cupcake ipsum candy pudding soufflé chocolate. Croissant muffin biscuit brownie caramels pudding toffee pie. Tiramisu cookie ice cream cake dessert icing donut."

👎 Incorrect code for this rule:

"Cupcake ipsum candy pudding soufflé chocolate. Croissant \
muffin biscuit brownie caramels pudding toffee pie. Tiramisu cookie ice cream \
cake dessert icing donut."
"Cupcake ipsum candy pudding soufflé chocolate. Croissant" +
 "muffin biscuit brownie caramels pudding toffee pie. Tiramisu cookie ice cream " +
 "cake dessert icing donut."
Last Updated: 6/20/2019, 9:58:27 AM