Skip to content

Commit

Permalink
fix: Improving JSX and TSX indents (#3853)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbenja authored Sep 16, 2022
1 parent 111d2da commit 714db9c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ source = { git = "https://github.com/omertuc/tree-sitter-go-work", rev = "6dd9dd
name = "javascript"
scope = "source.js"
injection-regex = "(js|javascript)"
file-types = ["js", "jsx", "mjs", "cjs"]
file-types = ["js", "mjs", "cjs"]
shebangs = ["node"]
roots = []
comment-token = "//"
Expand Down Expand Up @@ -363,7 +363,7 @@ injection-regex = "jsx"
file-types = ["jsx"]
roots = []
comment-token = "//"
language-server = { command = "typescript-language-server", args = ["--stdio"], language-id = "javascript" }
language-server = { command = "typescript-language-server", args = ["--stdio"], language-id = "javascriptreact" }
indent = { tab-width = 2, unit = " " }
grammar = "javascript"

Expand Down
8 changes: 8 additions & 0 deletions runtime/queries/jsx/indents.scm
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
[
(jsx_fragment)
(jsx_element)
(jsx_self_closing_element)
] @indent

(parenthesized_expression) @indent

; inherits: ecma
2 changes: 1 addition & 1 deletion runtime/queries/tsx/indents.scm
Original file line number Diff line number Diff line change
@@ -1 +1 @@
; inherits: typescript
; inherits: typescript,jsx

0 comments on commit 714db9c

Please sign in to comment.