-
Notifications
You must be signed in to change notification settings - Fork 889
[bugfix] no-unsafe-any
: allow implicitly downcasting any
to unknown
#4442
Conversation
It looks like simply ignoring the errors doesn't work here, unfortunately. |
Moving the tests containing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM except for the unnecessary parameter. Another maintainer should take a look to be sure.
The issue has been adressed, this PR is ready for a review when you have the time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise
Thanks for the review! I have addressed your suggestions. I also removed the module imports as they didn't test anything that isn't tested by the other tests for this lint already. |
* master: (60 commits) Added tslint-brunch to the list of 3rd party tools (palantir#4251) Switch to tslint-plugin-prettier, clean up rule options config syntax (palantir#4488) Enable grouped-imports for ordered-imports rule in tslint:all config (palantir#4420) Ordered imports grouping (palantir#4134) trailing-comma: check for a closing parenthesis (palantir#4457) Update index.md (palantir#4473) [bugfix] `no-unsafe-any`: allow implicitly downcasting `any` to `unknown` (palantir#4442) Add v5.12.1 changelog Bump version to 5.12.1 Fix quotemark avoid-template issues (palantir#4408) Skip linting JSON files entirely (palantir#4001) Fix strict-type-predicate for unknown (palantir#4444) restrict increment-decrement fixer while fixing the postfix unary expressions (palantir#4415) Mention file names in script parse failures (palantir#4397) Revert breaking change to tslint:recommended, update tslint:latest (palantir#4404) Fix quotemark avoid-template issues (palantir#4408) Bump tslint dev dependency to 5.12.0 (palantir#4452) Skip linting JSON files entirely (palantir#4001) Fix strict-type-predicate for unknown (palantir#4444) [README] Update link for Webstorm (palantir#4450) ...
PR checklist
unknown
#4164Overview of change:
Downcasting
any
tounknown
is always safe. This PR fixes theno-unsafe-any
rule to reflect this.Is there anything you'd like reviewers to focus on?
I have copied from existing test cases and modified them to use
unknown
. I have tried to be exhaustive, but there might still be false positives.CHANGELOG.md entry:
[bugfix]
no-unsafe-any
: allow implicitly downcastingany
tounknown