basedpyright
basedpyright copied to clipboard
`strict` configuration key uses "recommended" type checking mode and not "strict"
Description
Folders listed under strict in the configuration appear to use the "recommended" type checking mode instead of "strict", resulting in different OOTB results when compared to Pyright. This also appears to be the case for # pyright: strict.
➜ basedpyright-demo nix shell nixpkgs#nodejs nixpkgs#uv
➜ basedpyright-demo cat pyrightconfig.json
{
"strict": [
"foo.py"
]
}
➜ basedpyright-demo cat foo.py
class Foo:
def do(self) -> None: ...
class Bar(Foo):
def do(self) -> None: ...
➜ basedpyright-demo npx -y pyright
0 errors, 0 warnings, 0 informations
➜ basedpyright-demo uvx basedpyright
/Users/dimitris/Code/basedpyright-demo/foo.py
/Users/dimitris/Code/basedpyright-demo/foo.py:5:9 - warning: Method "do" is not marked as override but is overriding a method in class "Foo" (reportImplicitOverride)
0 errors, 1 warning, 0 notes
➜ basedpyright-demo npx -y pyright --version
pyright 1.1.398
➜ basedpyright-demo uvx basedpyright --version
basedpyright 1.28.4
based on pyright 1.1.398
➜ basedpyright-demo uvx -- python --version
Python 3.13.2
Is this intentional?
oops, i had no idea you could set the type checking mode for individual files that way. it seems to just ignore the strict setting if typeCheckingMode is set to anything higher than "strict" (ie. "recommended" or "all")
as a workaround for now you can just set typeCheckingMode to "basic" or "standard" if you want it to behave the same as pyright:
{
"typeCheckingMode": "standard",
"strict": [
"foo.py"
]
}