This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 887
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
type-literal-delimiter: Prefer ';' instead of ',', and lint for trail…
…ing delimiter (#2787)
- Loading branch information
1 parent
f02ba21
commit ce4dbfe
Showing
10 changed files
with
56 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,30 @@ | ||
type T = { | ||
x: number | ||
~ [MISSING] | ||
y: string | ||
} | ||
|
||
type T = { | ||
x: number, | ||
// Doesn't care about missing final comma; trailing-comma will handle. | ||
~ [COMMA] | ||
y: string | ||
} | ||
~ [MISSING] | ||
}; | ||
|
||
// Does care about semicolon. | ||
type T = { | ||
x: number, | ||
y: string; | ||
~ [SEMI] | ||
} | ||
x: number | ||
~ [MISSING] | ||
y: string, | ||
~ [COMMA] | ||
}; | ||
|
||
type T = { | ||
x: number; | ||
~ [SEMI] | ||
y: string | ||
} | ||
y: string; | ||
}; | ||
|
||
type T = { x: number; y: string }; | ||
|
||
// Works even when there's extra whitespace | ||
type T = { x: number , y: number }; | ||
type T = { x: number ; y: number }; | ||
~ [SEMI] | ||
type T = { x: number , y: number ; }; | ||
~ [COMMA] | ||
~ [EXTRA] | ||
|
||
[MISSING]: Expected type literal to use ',' to separate members. | ||
[SEMI]: Expected type literal to use ',' instead of ';'. | ||
[MISSING]: Expected type literal to use ';' to separate members. | ||
[COMMA]: Expected type literal to use ';' instead of ','. | ||
[EXTRA]: Did not expect single-line type literal to have a trailing ';'. |