pyright vs-code add tag
Currently, my VS Code doesn't report typing problems until a file is opened in the editor.

I just changed my type-checking mode to something more strict and would like to run pyright against all files without having to manually open each one of them. How do I do this?
Top Answer
**A workaround** is to install the pyright CLI using [`npm`](

`npm install --global pyright`

-> % pyright
Loading configuration file at /my-project/pyrightconfig.json
Assuming Python version 3.8
Assuming Python platform Darwin
No include entries specified; assuming /my-project
Auto-excluding **/node_modules
Auto-excluding **/__pycache__
Auto-excluding .git
stubPath /my-project/typings is not a valid directory.
Searching for source files
Found 64 source files
  23:31 - error: Cannot access member "subjectLine" for type ...
    Member "subjectLine" is unknown (reportGeneralTypeIssues)
  13:17 - error: Argument of type ... cannot be assigned to parameter "replyTo" of type .. in function "__init__"
    ... is incompatible with ... (reportGeneralTypeIssues)
  23:14 - error: Cannot assign member "_html" for type ..
    Expression of type "None" cannot be assigned to member "_html" of class ...
      Type "None" cannot be assigned to type "str" (reportGeneralTypeIssues)

Since the terminal is already integrated in VS Code, installing the pyright CLI is an option. And because I don't plan to do this regularly, manually running it in the CLI works well.


I had to update `node` from 10 to 12 because I was getting an error `Cannot find module 'worker_threads'` when I try to run `pyright`. See [issue]( 

After updating node, I also installed the latest npm for node 12. I didn't have to reinstall `pyright`. I ran `pyright` again and it worked.

**Within VS Code**

Running linters like `pyright` against all files and having the output display in the "Problems" tab is an ongoing feature request in [vscode-python]( 

One can [create a task]( or use extensions like `` if it is needed to be run regularly; but the raw output is placed in the "Output" tab.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.