Skip to content
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

[api-extractor] Incorrect indentation #1239

Open
rudolf opened this issue Apr 16, 2019 · 2 comments
Open

[api-extractor] Incorrect indentation #1239

rudolf opened this issue Apr 16, 2019 · 2 comments
Labels
bug Something isn't working as intended effort: easy Probably a quick fix. Want to contribute? :-) help wanted If you're looking to contribute, this issue is a good place to start!

Comments

@rudolf
Copy link
Contributor

rudolf commented Apr 16, 2019

Source code:

export interface I18nSetup {
  Context: ({ children }: { children: React.ReactNode }) => JSX.Element;
}

src.d.ts:

export interface I18nSetup {
    Context: ({ children }: {
        children: React.ReactNode;
    }) => JSX.Element;
}

api documentation signature code block:

Context: ({ children }: {
        children: React.ReactNode;
    }) => JSX.Element;

This seems to be caused by stripping the indentation from . Context: ( in the d.ts file, but not stripping the same amount of indentation from the subsequent lines.

Ideally api-extractor/documenter should use 2-space indentation as this seems to be the most common convention for typescript source code.

@octogonz octogonz added bug Something isn't working as intended effort: easy Probably a quick fix. Want to contribute? :-) help wanted If you're looking to contribute, this issue is a good place to start! labels Apr 25, 2019
@octogonz
Copy link
Collaborator

This can probably be fixed up using Span.getIndent().

Longer term, I'd prefer to implement a lightweight pretty-printer that we could apply to the API signature snippets to allow more flexible indentation and word-wrapping.

@octogonz
Copy link
Collaborator

@natalieethell FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended effort: easy Probably a quick fix. Want to contribute? :-) help wanted If you're looking to contribute, this issue is a good place to start!
Projects
Status: AE/AD
Development

No branches or pull requests

2 participants