Skip to content

How to report unnecessary pyright: ignore comments, but not type: ignore ?Β #4243

@Avasam

Description

@Avasam

Is your feature request related to a problem? Please describe.
I would like pyright to report unecessary pyright: ignore comments. But completely leave alone type: ignore in libraries I'm validating against both mypy and pyright.

The following config still reports Unnecessary "# type: ignore" comment

"reportUnnecessaryTypeIgnoreComment": "error",
// Leave `type: ignore` comments to mypy
"enableTypeIgnoreComments": false,

With "enableTypeIgnoreComments": true, any # type: ignore[whatever] will disable all pyright errors for that line. And will also report if added to a line with a mypy-only error-code.

Describe the solution you'd like
A way for pyright to stop checking # type: ignore comments completely. (but not pyright: ignore)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions