Home > Software design >  How can I remove a problem in the `problems` tab in vscode
How can I remove a problem in the `problems` tab in vscode

Time:06-23

I am working in python and have used exec(f'from {file} import myArray'). vscode then thinks that myArray is not defined later in code. Is there a way to simply hide this error?

CodePudding user response:

This may just be a warning for linting, add the following to your settings.json file to try and fix the problem.

"python.linting.pylintArgs": [
    "--disable=E1101",
    "--disable=W,C"
]

Among them, E1101 is the error code, which can be modified according to your situation. W, C are error levels.

refer to:

C: convention. Violating coding style standards

R: badly written code

W: some python specific question

E: Most likely a bug in the code

F: Error preventing pylint from running further

Or disable linting directly (CTRL SHIFT P -->Python: Enable/Disable Linting-->Disable).

  • Related