Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[no-unnecessary-type-assertion] false positive if referenced package has not been built #1973

Closed
@dinofx

Description

@dinofx

This simple repo shows the problem:
https://github.com/dinofx/bug-typescript-eslint

A type from a referenced package is being cast to any. If the referenced package has not been compiled with TSC, a false positive is reported. For some reason linting thinks the type is already any, and that the cast is redundant.

Repro

Clone the repo and yarn install dependencies. Don't build, just open main.ts in VS Code with eslint extension.

Expected

Should be able to resolve types from referenced packages using their original *.ts source, rather than relying on missing or stale *.d.ts files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting responseIssues waiting for a reply from the OP or another partypackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginworking as intendedIssues that are closed as they are working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions