Skip to content

Dont-Concatenate-String-Literals

Documentation Index

Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt

Use this file to discover all available pages before exploring further.

Sourcery rule id: dont-concatenate-string-literals

Section titled “Sourcery rule id: dont-concatenate-string-literals”

Do not concatenate string literals

const errorMessage = 'This is a super long error that was thrown because \
of Batman. When you stop to think about how Batman had anything to do \
with this, you would get nowhere \
fast.';

String literals should not be written across multiple lines because this makes them harder to read, maintain and search for. Instead, let them be longer than the maximum line length.

From the Airbnb JavaScript Style Guide