Skip to content

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

@orzechowskid

Description

@orzechowskid

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions