forked from palantir/tslint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
no-angle-bracket-type-assertion: fixed replacement order (palantir#3301)
... and add parens when necessary Fixes: palantir#2957 Fixes: palantir#2955
- Loading branch information
1 parent
66bc91e
commit 742497e
Showing
3 changed files
with
42 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
var a = <any>5; | ||
~~~~~~ [Type assertion using the '<>' syntax is forbidden. Use the 'as' syntax instead.] | ||
~~~~~~ [0] | ||
|
||
var b = <number><any>5; | ||
~~~~~~~~~~~~~~ [Type assertion using the '<>' syntax is forbidden. Use the 'as' syntax instead.] | ||
~~~~~~ [Type assertion using the '<>' syntax is forbidden. Use the 'as' syntax instead.] | ||
~~~~~~~~~~~~~~ [0] | ||
|
||
var c = <number>(5 as any); | ||
~~~~~~~~~~~~~~~~~~ [Type assertion using the '<>' syntax is forbidden. Use the 'as' syntax instead.] | ||
~~~~~~~~~~~~~~~~~~ [0] | ||
|
||
var d = <any> 5 as number; | ||
~~~~~~~ [Type assertion using the '<>' syntax is forbidden. Use the 'as' syntax instead.] | ||
~~~~~~~ [0] | ||
|
||
var e = 5 as any as number; | ||
|
||
let f = <number><any>flag & value; | ||
~~~~~~~~~~~~~~~~~ [0] | ||
f = <number><any>flag | value; | ||
~~~~~~~~~~~~~~~~~ [0] | ||
|
||
let g = <A><any>a; | ||
~~~~~~~~~ [0] | ||
|
||
let h = <AsyncIterableIterator><any>a; | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [0] | ||
|
||
[0]: Type assertion using the '<>' syntax is forbidden. Use the 'as' syntax instead. |