Inconsistent ending for type
See original GitHub issueI believe that the one we should have is what flow is outputting. Does someone have more context around why there’s a difference here?
Flow
--parser babel
export type Block = {
format: BlockFormat,
lang: BlockLanguage
}
Typescript
--parser typescript
type Block = {
format: BlockFormat;
lang: BlockLanguage;
};
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top Results From Across the Web
What does Visual Studio mean by normalize inconsistent line ...
Normalizing inconsistent line endings in Visual Studio means selecting one character type to be used for all your files. It could be:.
Read more >A little program to look for files with inconsistent line endings
The main program takes the files enumerated by EnumerateFiles , ignores certain known binary file types, and for the remaining files, counts the ......
Read more >Inconsistent Line Endings - YouTube
This is a video that goes over what inconsistent line endings are and how you can understand them as well as resolve them....
Read more >Solving inconsistent line endings within a Git repository
If you develop code on both Windows and Linux machines you might have run into inconsistent line endings. This might lead to "empty"...
Read more >inconsistent line endings - Unity Forum
There are inconsistent line endings in the 'someFileName.cs' script. ... I'm using VisualStudio 2012 to write my scripts and I used to get ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Object types in TS are anonymous interfaces. They can contain everything named interfaces can, e.g. method signatures, which look really strange with commas:
The relationship between object types and interfaces closely resembles the one between function expressions and function declarations. A function expression can be assigned to a variable (
let f = ...) to achieve almost the same effect a function declaration would have, but still function declarations have some extra behavior, namely hoisting. Same with object types and interfaces. If you assign an object type to an alias (type t = ...), it will be almost the same thing as an interface declaration, but it won’t have the extra behavior interface declarations have, namely declaration merging.The point I’m making is that using different formatting for object types and interfaces is very much like using different formatting for function expressions and function declarations. Not only inconsistent, it’d be also misleading, making object types and interfaces look more different than they actually are.
I didn’t read that before and now did.
I can say and confirm that this isn’t directly related to my use case. I’m simply referring is that Typescript has support for comma delimiter since 2015 and there is no enforcement that restricts us to use semicolon in type/interface definitions. We can agree there isn’t going to be a bug in both usages, am I right?
Btw. the tab width example is just to show that you there is no restriction between both usages, therefore, there shouldn’t be for delimiters.