Where Does Basedpyright Read Config From?
Basedpyright reads pyrightconfig.json at the project root, with pyproject.toml as the fallback for shared settings.
Last updated
Basedpyright follows the Pyright layout it forked from. It reads pyrightconfig.json at the project root first, then the tool.basedpyright section of pyproject.toml when you prefer one fewer file. No project file means builtin defaults plus whatever your editor sends.
That fallback order explains most surprises. A stray pyrightconfig.json above your code can silently set the environment for every file below it. Type checking options have shifted across Basedpyright releases, so confirm option names against the version pinned in your project.
Where Basedpyright stores this, by platform
[ProjectDir]/pyrightconfig.json
Primary config at the root. The tool.basedpyright table in pyproject.toml works as an alternative. Discovery walks up from each checked file.
[ProjectDir]/pyrightconfig.json
Same root file on Mac. Editors resolve it through the open workspace folder. Keep it beside pyproject.toml for predictable results.
[ProjectDir]\pyrightconfig.json
Same file on Windows. Execution environments and extra paths inside it use the project root as their base. Exact option names may vary by version.
Frequently asked questions
Which Basedpyright config wins?
The project file wins, then editor defaults apply for anything unset. Command line flags beat both for a single run. Keep pyrightconfig.json in git so the team shares one baseline.
Can I mix project config with editor settings?
Yes. Put shared rules in pyrightconfig.json and keep personal choices like inlay hints in the editor settings. The project file travels with the repo, while editor settings stay on your machine.
Notice an outdated path? Let us know.