Skip to content

can't seem to indent props in JSX expression #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
orzechowskid opened this issue Aug 18, 2020 · 1 comment
Closed

can't seem to indent props in JSX expression #138

orzechowskid opened this issue Aug 18, 2020 · 1 comment

Comments

@orzechowskid
Copy link

software versions:

  • emacs 27.1 ; also tried with emacs-snapshot 28.0.50 (latest snapshot from the ubuntu-elisp ppa)
  • typescript-mode 20200817.817

steps to reproduce:

  1. emacs -Q
  2. open a typescript file
  3. M-x typescript-mode
  4. write the following code:
  const MyComponent = () => {
    return (
      <div className="foo" />
    );
  };
  1. attempt to put the JSX prop on its own line.

desired output:

  const MyComponent = () => {
    return (
      <div
        className="foo"
      />
    );
  };

actual output:

const MyComponent = () => {
  return (
    <div
    className="foo"
      />
  );
};

possibly relevant info:

  • indent-tabs-mode is set to nil
  • typescript-indent-level is set to 2
  • setting typescript-expr-indent-offset to 2 appears to add 2 spaces of indentation to the closing /> but nothing else

does this mode derive from any other modes for which indentation-related variables exist? did I forget to configure something in a different customization-group?

thanks for any help you can provide.

@josteink
Copy link
Member

Please search existing issues. JSX/TSX is not yet actually supported:

#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants