How to override diagnostic severity in Cursor IDE

I like setting the diagnostic level for some IDE hints from warning to error to make it easier to problems in my code. It took me a bit to figure out how to set these preferences in Cursor since the correct key is neither pyright or basedpyright, but Cursor's custom fork called cursorpyright.

Here are the global settings I use in ~/.config/Cursor/User/settings.json:

{
    "cursorpyright.analysis.diagnosticSeverityOverrides": {
        "reportUndefinedVariable": "error",
        "reportUnusedImport": "error",
        "reportMissingImports": "error",
        "reportImportCycles": "error",
        "reportUnusedVariable": "error",
        "reportUnusedFunction": "error",
        "reportUnusedClass": "error",
        "reportUnusedCoroutine": "error",
        "reportDuplicateImport": "error",
        "reportInvalidStringEscapeSequence": "error",
        "reportAssertAlwaysTrue": "error",
        "reportSelfClsParameterName": "error"
    }
}

Copyright Ricardo Decal. ricardodecal.com