lang/javascript: don't look for import preact

Incorrect way to import preact.
This commit is contained in:
Henrik Lissner 2018-04-27 03:28:48 -04:00
parent 26eb33e36e
commit 5c49d9c7c0
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -50,7 +50,7 @@
"Detect React or preact imports early in the file." "Detect React or preact imports early in the file."
(and buffer-file-name (and buffer-file-name
(string= (file-name-extension buffer-file-name) "js") (string= (file-name-extension buffer-file-name) "js")
(re-search-forward "\\(^\\s-*import +\\(?:pr\\|R\\)eact\\|\\( from \\|require(\\)[\"']p?react\\)" (re-search-forward "\\(^\\s-*import +React\\|\\( from \\|require(\\)[\"']p?react\\)"
magic-mode-regexp-match-limit t) magic-mode-regexp-match-limit t)
(progn (goto-char (match-beginning 1)) (progn (goto-char (match-beginning 1))
(not (sp-point-in-string-or-comment))))) (not (sp-point-in-string-or-comment)))))