summaryrefslogtreecommitdiff
path: root/lisp/progmodes/js.el
diff options
context:
space:
mode:
authorTheodor Thornhill <theo@thornhill.no>2022-12-14 21:23:33 +0100
committerYuan Fu <casouri@gmail.com>2022-12-14 14:39:29 -0800
commit2ca06aed7b39afdc00041ab7cd9c7a8cb50332f6 (patch)
treed227c62bf65f3e600f622b7e6f464dee1f8f4748 /lisp/progmodes/js.el
parenta54d5f500c1a9959b1f87c731aa9ac1b7eed27c9 (diff)
downloademacs-2ca06aed7b39afdc00041ab7cd9c7a8cb50332f6.tar.gz
Add indent rules to js/typescript/tsx-ts-mode (bug#60074)
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--indent-rules): Add in binary_expression and jsx_fragment. * lisp/progmodes/js.el (js--treesit-indent-rules): Add the same rules.
Diffstat (limited to 'lisp/progmodes/js.el')
-rw-r--r--lisp/progmodes/js.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 02990813ef4..8ec14cf7ad1 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3445,12 +3445,15 @@ This function is intended for use in `after-change-functions'."
((parent-is "pair") parent-bol js-indent-level)
((parent-is "arrow_function") parent-bol js-indent-level)
((parent-is "parenthesized_expression") parent-bol js-indent-level)
+ ((parent-is "binary_expression") parent-bol js-indent-level)
((parent-is "class_body") parent-bol js-indent-level)
((parent-is ,switch-case) parent-bol js-indent-level)
((parent-is "statement_block") parent-bol js-indent-level)
;; JSX
((parent-is "jsx_opening_element") parent js-indent-level)
+ ((match "<" "jsx_fragment") parent 0)
+ ((parent-is "jsx_fragment") parent js-indent-level)
((node-is "jsx_closing_element") parent 0)
((node-is "jsx_text") parent js-indent-level)
((parent-is "jsx_element") parent js-indent-level)