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

Union / intersection type formatting are inconsistent #38

Closed
vicb opened this issue Sep 11, 2016 · 4 comments
Closed

Union / intersection type formatting are inconsistent #38

vicb opened this issue Sep 11, 2016 · 4 comments
Assignees
Labels

Comments

@vicb
Copy link
Contributor

vicb commented Sep 11, 2016

On the angular repo:

export function getPluralCase(locale: string, nLike: number | string): Plural { ...

vs

export const Inject: typeof InjectMetadata&InjectMetadataCtor = ...

I find the readability in the later case much worse (@mpbrost seems prefer this way)

  • make it consistent,
  • make it configurable

/ref https://github.com/angular/angular/pull/11507/files#r78282320

@vicb
Copy link
Contributor Author

vicb commented Sep 11, 2016

FWIW the TS spec uses spaces, see https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3.4

@mprobst
Copy link
Contributor

mprobst commented Sep 19, 2016

I think you have an outdated version, the function type above formats w/o space around the |.

As for having spaces around the | in types, this is Working As Intended, to make Foo|null more readable. I think intersection types are very rare, and for union types there is enough whitespace around the | char. YMMV.

@mprobst mprobst closed this as completed Sep 19, 2016
@vicb
Copy link
Contributor Author

vicb commented Sep 19, 2016

WS have indeed been removed in the last version... but it's not configurable, is it ?

@mprobst
Copy link
Contributor

mprobst commented Sep 19, 2016 via email

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

No branches or pull requests

2 participants