Updated comments doc to talk about reportUnnecessaryTypeIgnoreComment.

This commit is contained in:
Eric Traut 2022-03-11 17:55:20 -07:00
parent 3a63481f5f
commit 2aeac06f5e

View File

@ -43,3 +43,5 @@ PEP 484 defines a special comment `# type: ignore` that can be used at the end o
Pyright also supports a `# pyright: ignore` comment at the end of a line to suppress all Pyright diagnostics on that line. This can be useful if you use multiple type checkers on your source base and want to limit suppression of diagnostics to Pyright only.
The `# pyright: ignore` comment accepts an optional list of comma-delimited diagnostic rule names surrounded by square brackets. If such a list is present, only diagnostics within those diagnostic rule categories are suppressed on that line. For example, `# pyright: ignore [reportPrivateUsage, reportGeneralTypeIssues]` would suppress diagnostics related to those two categories but no others.
If the `reportUnnecessaryTypeIgnoreComment` configuration option is enabled, any unnecessary `# type: ignore` and `# pyright: ignore` comments will be reported so they can be removed.