Fix lint: exempt storage test from no-restricted-globals, remove non-null assertion

This commit is contained in:
2026-04-15 00:50:46 +03:00
parent 5d041cc4c6
commit 59d5a7314e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -162,7 +162,7 @@ export default [
// window.localStorage / window.sessionStorage: only src/shared/storage.ts
{
files: ["src/**/*.{ts,tsx}"],
ignores: ["src/shared/storage.ts"],
ignores: ["src/shared/storage.ts", "src/shared/storage.test.ts"],
rules: {
"no-restricted-globals": [
"error",
+1 -1
View File
@@ -37,7 +37,7 @@ describe("cspMiddleware", () => {
middleware(req, res, vi.fn());
const csp = res.headers.get("Content-Security-Policy") ?? "";
const match = csp.match(/nonce-([^']+)/);
if (match) nonces.push(match[1]!);
if (match?.[1]) nonces.push(match[1]);
}
const unique = new Set(nonces);