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 886
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
no-unnecessary-type-assertion: Don't check
!
if --strictNullChecks …
…is not enabled (#3724)
- Loading branch information
Andy Hanson
authored and
Josh Goldberg
committed
Jun 15, 2019
1 parent
484d429
commit b836f28
Showing
8 changed files
with
23 additions
and
2 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
6 changes: 6 additions & 0 deletions
6
test/rules/no-unnecessary-type-assertion/noStrictNullChecks/test.ts.lint
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
declare const x: string | undefined; | ||
x!; | ||
|
||
declare const y: string; | ||
y as string; | ||
~~~~~~~~~~~ [This assertion is unnecessary since it does not change the type of the expression.] |
1 change: 1 addition & 0 deletions
1
test/rules/no-unnecessary-type-assertion/noStrictNullChecks/tsconfig.json
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
5 changes: 5 additions & 0 deletions
5
test/rules/no-unnecessary-type-assertion/noStrictNullChecks/tslint.json
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rules": { | ||
"no-unnecessary-type-assertion": true | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.