felipeochoa / rjsx-mode

A JSX major mode for Emacs
https://github.com/felipeochoa/rjsx-mode
MIT License
639 stars 32 forks source link

Indent inside of JSX tags is always 2 spaces instead of user setting #106

Open ariataylor96 opened 5 years ago

ariataylor96 commented 5 years ago

This appears to be because of switching to js2-mode from js2-jsx-mode, as when I recompile the package using js2-jsx-mode everything goes back to normal and my editorconfig settings are respected.

felipeochoa commented 5 years ago

What versions of each package are you using? What version of emacs?

thornjad commented 5 years ago

Might be a duplicate of #85

hanzhixing commented 5 years ago

This appears to be because of switching to js2-mode from js2-jsx-mode, as when I recompile the package using js2-jsx-mode everything goes back to normal and my editorconfig settings are respected.

Could you share the workarround, please? It looks like it's going to take some time until next release.

guillaumebrunerie commented 3 years ago

The reason this is happening is because rjsx-mode uses sgml-basic-offset instead of js2-basic-offset to indent JSX. As a workaround you can set both of them to the same value and it should work.