For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt, and this page is available as Markdown at https://rslint.rs/rules/eslint/no-octal-escape.md.
close

no-octal-escape

Added in v0.4.2

Configuration

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

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

Rule Details

Disallows octal escape sequences in string literals.

As of the ECMAScript 5 specification, octal escape sequences in string literals are deprecated and should not be used. Unicode escape sequences should be used instead.

Examples of incorrect code for this rule:

var foo = 'Copyright \251';
var foo = '\1';
var foo = '\01';
var foo = '\08';

Examples of correct code for this rule:

var foo = 'Copyright \u00A9';
var foo = '\x51';
var foo = '\0';
var foo = '\\1';

Original Documentation