close

no-multi-str

Configuration

rslint.config.ts
import { defineConfig, js } from '@rslint/core';

export default defineConfig([
  js.configs.recommended,
  {
    rules: {
      'no-multi-str': 'error',
    },
  },
]);

Rule Details

Disallows multiline strings created using a trailing backslash before a line break. This syntax was historically an undocumented feature of JavaScript and should be avoided.

Examples of incorrect code for this rule:

var x =
  'Line 1 \
         Line 2';

Examples of correct code for this rule:

var x = 'Line 1 ' + 'Line 2';

var x = `Line 1
         Line 2`;

Original Documentation