Variable: js-jsx-regexps

js-jsx-regexps is a variable defined in js.el.gz.

Value

("\\_<\\(?:var\\|let\\|const\\|import\\)\\_>.*?React")

Documentation

Case-sensitive regexps for detecting JSX in JavaScript buffers.

When js-jsx-detect-syntax is non-nil and any of these regexps match text near the beginning of a JavaScript buffer, js-jsx-syntax (which see) will be made buffer-local and set to t.

Probably introduced at or before Emacs version 27.1.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/js.el.gz
;; To make discovering and using syntax extensions features easier for
;; users (who might not read the docs), try to safely and
;; automatically enable syntax extensions based on heuristics.

(defvar js-jsx-regexps
  (list "\\_<\\(?:var\\|let\\|const\\|import\\)\\_>.*?React")
  "Case-sensitive regexps for detecting JSX in JavaScript buffers.
When `js-jsx-detect-syntax' is non-nil and any of these regexps
match text near the beginning of a JavaScript buffer,
`js-jsx-syntax' (which see) will be made buffer-local and set to
t.")