prefer-regex-literals Prefer regex literals for constant patterns and flags Constructing a regular expression from constant strings defers a fixed pattern to runtime and doubles string escaping. Instead, you SHOULD use a regular expression literal when both the pattern and flags are constant. - Category: style - Level: warning - Fix: suggestion - Scope: module Reported const word = new RegExp("\\w+", "u"); Accepted const word = /\w+/u; Prior art - ESLint ยท prefer-regex-literals language/linter/src/rules/style/preferregexliterals.rs:8