Open axelson opened 5 years ago
Nope, that's not possible currently, but PRs welcome
Do you have any pointers on implementing this type of indentation?
You may be able to get it done simply by editing `rjsx--indent-line-to-offset'
The indentation code works by tracking a parent JSX element, relative to which we indent children. This all happens here.
This becomes pretty unpleasant when formatting stateless components with arrow functions:
const Stuff = ({ value, children }) =>
<form>
{children}
<input
type="text"
value={value}/>
</form>
becomes
const Stuff = ({ value, children }) =>
<form>
{children}
<input
type="text"
value={value}/>
</form>
But "this" what @vaer-k is refering to is a bug in js2 (I think) /mooz/js2-mode/issues/526
I expect different indentation for the following code:
Actual:
Expected:
Basically I expect similar indentation with and without the parentheses. Is this something that is accomplishable in rjsx-mode?
js2-jsx-mode
seems to have broken indentation in this scenario as well but in a different way