Skip to content

Wrong indentation after arrow function with separate-line opening brace #11

New issue

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

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

Already on GitHub? # to your account

Open
vbraun opened this issue Jun 21, 2016 · 2 comments
Open

Comments

@vbraun
Copy link

vbraun commented Jun 21, 2016

Arrow functions should probably be indented like normal functions, though right now there is a difference:

    // OK
    function foofunc(param: string): void 
    {
        console.log('indented as expected');
    }

    // Double identation?
    const foo = (param: string): void =>
        {
            console.log('unexpected double indent');
        }

For me, expected output would be

    const foo = (param: string): void =>
    {
        console.log('Expect single indent');
    }
@stieg
Copy link

stieg commented May 30, 2018

@vbraun Do you still see this in typescript-mode v0.2? I reported a similar issue but was not able to reproduce your original behavior.

@lddubeau
Copy link
Collaborator

lddubeau commented Mar 8, 2019

Since we take tsserver's formatting as our guide for how indentation is performed in typescript-mode, those who want to use tide to check what tsserver does with the reproduction case provided above should remember that they need to set :placeOpenBraceOnNewLineForFunctions t in their tide-format-options variable.

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

No branches or pull requests

3 participants