You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I realized as I was working through a backlog of basedpyright parity features and bugfixes that we don't currently have a system in place to make pyrefly --init behave well for basedpyright users.
I think we should try to work out heuristics for distinguishing basedpyright vs pyright setups, because the defaults are different and therefore the mapping to Pyrefly is different.
There's probably a bigger issue here, that our migration tooling has been less-maintained than we intended because we've been pulled into more bugfixing and feature work. I think in general we could use a big sweep for not only basedpyright but also pyright and mypy compatibility; I've recently noticed quite a number of error codes that could be mapped but aren't.
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
There are a number of tells we can use in the config to detect basedpyright, beyond what we do today.
Here's a list of potential heuristics, I'll aim to implement at least the highest-value ones; right now we only support one of them
Signal
Strength
A [tool.basedpyright] section in pyproject.toml
Definitive. We already use it.
"typeCheckingMode": "recommended" or "all" in pyrightconfig.json
Definitive, since pyright rejects these values.
Keys only basedpyright defines, such as reportAny, reportExplicitAny, reportIgnoreCommentWithoutRule, reportUnusedCallResult, failOnWarnings, baselineFile, allowedUntypedLibraries
Near-definitive. Pyright ignores or warns on them, so nobody would write them for pyright.
.basedpyright/baseline.json on disk
Strong.
basedpyright in dev dependencies or lock files (dependency groups, [tool.uv]/Poetry/PDM groups, requirements-dev*.txt, uv.lock/poetry.lock)
Strong, but you have to parse files beyond the config.
How the project runs its checker: basedpyright in .pre-commit-config.yaml (e.g. the basedpyright-pre-commit-mirror hook), CI workflows, tox/nox/Makefile
Strong for CI, but expensive to scan.
basedpyright.* keys in .vscode/settings.json
Weak. Someone may run basedpyright in the editor while CI runs pyright.
We may need to check that a Pyrefly config hasn't been used before, so that we don't treat a possible Pyright setup as BasedPyright here. I would assume pyrefly --init would skip running an init flow if a Pyrefly config is found on disk though.
Activity
stroxler commentedon Nov 24, 2026
There are a number of tells we can use in the config to detect basedpyright, beyond what we do today.
Here's a list of potential heuristics, I'll aim to implement at least the highest-value ones; right now we only support one of them
In terms of what to do, we should audit our current settings against https://detachhead.github.io/python-type-checker-comparison, which is probably better curated than anything on our side.
In the process, we might also discover some gaps relative to standard pyright and we should address those as well.
stroxler commentedon Nov 24, 2026
cc @DetachHead
connernilsen commentedon Nov 24, 2026
We may need to check that a Pyrefly config hasn't been used before, so that we don't treat a possible Pyright setup as BasedPyright here. I would assume
pyrefly --initwould skip running an init flow if a Pyrefly config is found on disk though.Migrate Pyright reportCallIssue
Add an explicit BasedPyright migration source