Fully disable the linting
Here is a link that explain how to do it : Disable Linting on VsCode.
To do so, type Command + Shift + P (or Ctrl + Shift + P on PC) in VsCode. This will open a command prompt at the top of the window. Then type the command Python: Enable Linting, and select off.
Another option is to choose no linter. To do so, open the command prompt with Command + Shift + P (or Ctrl + Shift + P on PC), type Python: Select Linter, and choose the option Disable Linting.
Disable warnings, but keep errors :
If you want to keep the errors, but disable only the warnings, you can also configure pylint directly from VsCode. Go to the menu File -> Preferences -> Settings (Or open directly with Command + , or Ctrl + ,). Then in the search box at the top of the window, search for pylint Args. Click on the button Add item and add the line --disable=W.

So I'm trying not to rely on IDE's error checking and am wanting to disable linting entirely.
I include:
"python.linting.pylintEnabled": false,"python.linting.pylintUseMinimalCheckers": false,"python.linting.lintOnSave": false,"python.linting.enabled": false,
all in the settings.json file but even with these changed I am still getting error underlining in the editor.
Does anyone know how to get rid of all the error checking in the editor despite the language? I've heard that it's a good idea not to become reliant on IDE's for error checking and such so I would like to get rid of error checking entirely.
I'd also like to have it as an option that's easily accessible like the command >Python: Enable Linting: on/off but when I do that command nothing happens
Fully disable the linting
Here is a link that explain how to do it : Disable Linting on VsCode.
To do so, type Command + Shift + P (or Ctrl + Shift + P on PC) in VsCode. This will open a command prompt at the top of the window. Then type the command Python: Enable Linting, and select off.
Another option is to choose no linter. To do so, open the command prompt with Command + Shift + P (or Ctrl + Shift + P on PC), type Python: Select Linter, and choose the option Disable Linting.
Disable warnings, but keep errors :
If you want to keep the errors, but disable only the warnings, you can also configure pylint directly from VsCode. Go to the menu File -> Preferences -> Settings (Or open directly with Command + , or Ctrl + ,). Then in the search box at the top of the window, search for pylint Args. Click on the button Add item and add the line --disable=W.

I had disabled pylint in the settings but was still getting pylint linting showing up in my code, until I noticed there was a "pylint" vscode extension installed. Disabling that extension finally silenced pylint!
Videos
For example __init__.py imports
Disabling language server works as answered by maxm. This will also disable other features.
Instead, just ignore the warnings and errors of pylance by setting below in settings.json of .vscode.
"python.analysis.ignore": [
"*"
]
The other features will be present with out disabling pylance.
You can disable the language server with:
"python.languageServer": "None"
I coach a robotics team of middle school kids and it is important that all of the laptops are configured the same. When we clone our repo, VS Code will prompt them to enable type checking. I'd rather keep type checking off for now, so I really much prefer the warning to not come up at all. The kids are kind of quick to hit the default "Yes", which enables type checking. I have in my pyproject.toml
```
[tool.pyright] typeCheckingMode = "off"
```
And that is included in the repo. And even so, I still get the warning/suggestion
"Pylance has detected type annotations in your code and recommends enabling type checking. Would you like to change this setting?"
Sure, I can click "No" at that point, and it seems to keep pylance happy and it doesn't ask again, but I'd rather it not ask at all in the first place. Ideally I'd like to figure out a way to suppress the warning at the project level, so I can push the setting to everyone as part of the repo.
Pylance supports PEP 484
A number of existing or potential use cases for function annotations exist, which are incompatible with type hinting. These may confuse a static type checker. However, since type hinting annotations have no runtime behavior (other than evaluation of the annotation expression and storing annotations in the _annotations_ attribute of the function object), this does not make the program incorrect -- it just may cause a type checker to emit spurious warnings or errors.
To mark portions of the program that should not be covered by type hinting, you can use one or more of the following:
a # type: ignore comment;
a @no_type_check decorator on a class or function;
a custom class or function decorator marked with @no_type_check_decorator.
Alternatively you can create a pyrightconfig.json for Pyright (as that's what Pylance is using underneath) or a pyproject.toml in project's root directory, and specify which types of errors to ignore. You can see the error type in the hover widget where error messages appear.
pyrightconfig.json example:
{
"reportGeneralTypeIssues": false,
}
pyproject.toml example:
[tool.pyright]
reportGeneralTypeIssues = false
See Type Check Diagnostics Settings for more.
The top-voted answer is great but it may not solve the problem (it just ignores the type checker, right?). My answer does not solve the problem either, but I think it's helpful.
I suggest you modify your .vscode/settings.json (Workspace settings or User settings) as described here and here and shown below. (Notice the use of "none" instead of false)
(Maybe this is preferable if you already have Workspace settings and you don't want to add another settings file as shown in the top-voted answer (like pyrightconfig.json or pyproject.toml))
{
"python.analysis.typeCheckingMode": "basic",
"python.analysis.diagnosticSeverityOverrides": {
"reportGeneralTypeIssues": "none"
}
}
I think the OP is correct with this comment, this error is not a reportGeneralTypeIssues type issue.
I've tried both solutions but the error still exists. Maybe it's not a reportGeneralTypeIssues?
If you reset your Pylance settings (flag all diagnostic codes as errors (remove settings.json, or use the "error" diagnostic setting)), and you type the OP's code below
def example() -> [str]:
return ["hi"]
VSCode/Pylance/Pyright shows an error squiggly, and when you hover it lists two error reasons.
- The first error says "List expression not allowed in type annotation Use List[T]..." and is tagged only as "
Pylance" (no diagnostic code) - The second error says "Expected type expression but received "list[Type[str]]" and is tagged as
Pylance(reportGeneralTypeIssues), (note there is a diagnostic code)

If you modify your settings.json as described above:
...
"python.analysis.diagnosticSeverityOverrides": {
"reportGeneralTypeIssues": "none"
}
...
... then the second Pylance(reportGeneralTypeIssues) type error goes away, but the original Pylance error (without the diagnostic code) is still there:

The top-voted answerer suggests trying other diagnostic codes, but it seems like this error is more a "core error" than any diagnostic code describes?
I think it's tempting to blame the editor (VSCode), but I don't think it's VSCode's fault, VSCode is just using Pylance, and Pylance is just trying to implement the Python standards/PEPs, right?
I still think [str] is invalid/nonstandard type hinting syntax, as this commenter said .
I agree with OP, [str] is "shorter and does the trick", but it's not standard is it? Not defined in any PEP? Not in PEP 484, not in PEP 585. Doesn't this mean PyCharm is supporting something nonstandard?
I am switching from Pycharm to VSC to try.
I forked a repo to try, and already Pylances is throwing me a lot of errors that would not be displayed in Pycharm. How can I calm down Pylance to have a similar error as in Pycharm?
I forked a repo to try, and already Pylances is throwing me a lot or errors that would not be displayed in Pycharm. How can I calm down Pylance to have a similar error as in Pycharm?
For example, in this snippet from VSC, the errors are bothering the eyes. The same code in Pycharm does not display anything particular.
For me, it's a little too much.
As others have said, you can provide a disable argument to disable a specific message. I wanted to elaborate on that.
Here is the syntax for disabling multiple messages and for providing multiple arguments, which was not immediately obvious to me from googling it:
"python.linting.pylintArgs": [ "--max-line-length=80", "--disable=W0142,W0403,W0613,W0232,R0903,R0913,C0103,R0914,C0304,F0401,W0402,E1101,W0614,C0111,C0301" ]You stated that you started seeing way more errors once you disabled that one message. That actually might make sense according to the documentation:
Python in Visual Studio code is configured by default to use a set of linting rules that are friendly to the largest number of Python developers:
- Enable all Error (E) and Fatal (F) messages.
- Disable all Convention (C) and Refactor (R) messages.
- Disable all Warning (W) messages except the following:
- unreachable (W0101): Unreachable code
- duplicate-key (W0109): Duplicate key %r in dictionary
- unnecessary-semicolon (W0301): Unnecessary semicolon
- global-variable-not-assigned (W0602): Using global for %r but no assignment is done
- unused-variable (W0612): Unused variable %r
- binary-op-exception (W0711): Exception to catch is the result of a binary "%s" operation
- bad-format-string (W1302): Invalid format string
- anomalous-backslash-in-string (W1401): Anomalous backslash in string
- bad-open-mode (W1501): "%s" is not a valid mode for open
These rules are applied through the following default arguments passed to Pylint:
--disable=all --enable=F,E,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-modeThese arguments are passed whenever the
python.linting.pylintUseMinimalCheckersis set totrue(the default). If you specify a value inpylintArgsor use a Pylint configuration file (see the next section), thenpylintUseMinimalCheckersis implicitly set tofalse.In other words, PyLint is supposedly pretty lax by default in VS Code, only showing you messages for errors and a few hand-picked warnings. But when you manually set
pylintArgsto something,pylintUseMinimalCheckersis ignored, opening the floodgates to all messages. That might be why disabling one message resulted in way more messages being shown. Then again, I'm not sure why you were seeing unused-import messages in the first place since it should have been suppressed by default according to the documentation.Actually, this currently doesn't work:
python.linting.pylintUseMinimalCheckers": true(for me, at this particular moment in time, but hopefully it works fine for you, future reader). To get the same effect, I had to manually setpylintArgsto the value it was supposed to be setting automatically:"python.linting.pylintArgs": [ "--disable=all", "--enable=F,E,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode" ]BONUS: Here's an explanation of the list of disabled messages I use, as shown above in point 1. It's mostly taken from here:
# Disabled messages # Pointless # W0142 = *args and **kwargs support # W0403 = Relative imports # W0613 = Unused argument # W0232 = Class has no __init__ method # R0903 = Too few public methods # R0913 = Too many arguments # C0103 = Invalid name # R0914 = Too many local variables # C0304 = Final newline missing # # PyLint's module importation is unreliable # F0401 = Unable to import module # W0402 = Uses of a deprecated module # E1101 = Module x has no y member # # Already an error when wildcard imports are used # W0614 = Unused import from wildcard # # Stricter messages that can be disabled until everything else has been fixed # C0111 = Missing docstring # C0301 = Line too long
"python.linting.pylintArgs": [
"--disable=C0111"
],
You can also disable by message type, e.g., --disable=W.
A good reference is www.pylintcode.info, with a list of message ids and message types.
