Our great sponsors
-
nvim
A non-minimal Neovim config built to work most efficiently with Frontend Development (by ecosse3)
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I experience same issue with my Ecovim config. Looks like it's the issue with treesitter TSX parser anyway.
I’ve always had issues with treesitter indent, not just with JSX, but for almost every language, so I just straight turn it off. What I do is enable regex highlighting in the treesitter options and use something like https://github.com/MaxMEllon/vim-jsx-pretty for JSX files, I doesn’t override treesitter highlighting but it does provides indentation.
This drives me nuts, too. The only solution I've found is to use vim-jsx-improve. I haven't managed to get it to set the filetype automatically, so I just throw the following comment at the top of my .jsx files:
Related posts
- Anyone have multiple language syntax highlighting with treesitter working?
- Even though I have plugins installed, syntax-highlighting isn't working well for JSX and TSX files
- Is their any good colorscheme for jsx file? because html tag color won't properly match.
- Why Neovim is My Text Editor of Choice
- I can't stand using VSCode so I wrote my own (it wasn't easy)