Unused parameter only greyed out but not reported

Viewed 87

I use VS Code and the unused parameters of functions are only greyed out, but never reported.

How to report those greyed out warning in the problem explorer?

currently, thanks to the parameter reportUnusedVariable in pyright, we can report unused variables, but we cannot report unused parameters.

Thanks

1 Answers

If you're using Pylance or Pyright, seems like you can't mark unused parameters as errors. They're not always errors - sometimes you need them to conform to some interface.

If you want to prohibit unused parameters anyway, there are other tools such as the flake8-unused-arguments plugin for flake8.

Related