Add analyzer and frontend lint guardrails

This commit is contained in:
2026-02-07 02:12:00 +01:00
parent 34d274d244
commit 5b06e279f3
19 changed files with 1313 additions and 53 deletions

View File

@@ -12,6 +12,11 @@ public static class PlayerIdentityExtensions
public const string PlayerCookieName = "player";
public const string AdminClaim = "is_admin";
public const string AdminPolicy = "AdminOnly";
private static readonly Action<ILogger, Exception?> LogUnhandledException =
LoggerMessage.Define(
LogLevel.Error,
new EventId(1001, nameof(LogUnhandledException)),
"Unhandled exception");
public static async Task SignInPlayerAsync(HttpContext ctx, Player player)
{
@@ -40,7 +45,7 @@ public static class PlayerIdentityExtensions
var logger = context.RequestServices.GetRequiredService<ILoggerFactory>().CreateLogger("GlobalException");
if (feature?.Error != null)
{
logger.LogError(feature.Error, "Unhandled exception");
LogUnhandledException(logger, feature.Error);
}
context.Response.StatusCode = StatusCodes.Status500InternalServerError;