Incorrect indentation on JSX/TSX/React files

This page summarizes the projects mentioned and recommended in the original post on /r/neovim

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • nvim

    A non-minimal Neovim config built to work most efficiently with Frontend Development (by ecosse3)

  • I experience same issue with my Ecovim config. Looks like it's the issue with treesitter TSX parser anyway.

  • vim-jsx-pretty

    :flashlight: [Vim script] JSX and TSX syntax pretty highlighting for vim.

  • 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.

  • 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.

    InfluxDB logo
  • vim-jsx-improve

    Syntax and indent plugin for React jsx.

  • 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:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts