fix(types): turn on noUnusedLocals and drop the unused declarations (12-12)
VD-01 decision 3 hands unused diagnostics to tsc and turns off ESLint's no-unused-vars for TS files, but tsconfig.base.json never enabled the tsc check (D-19). The flag found 46 unused imports, types and helpers across 22 files; none of them were read, so removing them changes no behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2c5e268bad
commit
49413af045
@@ -1,4 +1,4 @@
|
||||
import { access, readFile } from "node:fs/promises";
|
||||
import { readFile } from "node:fs/promises";
|
||||
|
||||
/**
|
||||
* GOV-03. Joins the machine-readable remediation dispositions against the prose
|
||||
|
||||
@@ -12,7 +12,6 @@ import type { InstalledContractPackageIdentity } from "../src/contracts/external
|
||||
import {
|
||||
parseReleaseArtifact,
|
||||
parseRuntimeConfigArtifact,
|
||||
type ReleaseArtifact,
|
||||
} from "../src/contracts/release-artifacts.ts";
|
||||
import { projectTelemetryEvent } from "../src/contracts/telemetry.ts";
|
||||
import { EXPECTED_CONTRACT_SET_PACKAGES } from "../src/features/installed-contract-contributions.ts";
|
||||
|
||||
@@ -66,10 +66,6 @@ async function jsonDocument(file: string): Promise<Document> {
|
||||
return documentValue(parsed, file);
|
||||
}
|
||||
|
||||
async function sha256File(file: string): Promise<string> {
|
||||
return createHash("sha256").update(await readFile(file)).digest("hex");
|
||||
}
|
||||
|
||||
async function optionalJson(file: string): Promise<Document | null> {
|
||||
try {
|
||||
const parsed: unknown = JSON.parse(await readFile(file, "utf8"));
|
||||
|
||||
@@ -4,7 +4,6 @@ import { constants } from "node:fs";
|
||||
import type { FileHandle } from "node:fs/promises";
|
||||
import {
|
||||
lstat,
|
||||
mkdir,
|
||||
open,
|
||||
readFile,
|
||||
readdir,
|
||||
|
||||
@@ -88,7 +88,6 @@ const fixturesDocument = parseFixturesDocument(
|
||||
const verifiedRuntime = await verifyReleaseArtifactsCoherence();
|
||||
const {
|
||||
release,
|
||||
runtime: runtimeConfig,
|
||||
coherence: artifactComparison,
|
||||
} = verifiedRuntime;
|
||||
const buildManifestDocument: unknown = JSON.parse(
|
||||
|
||||
@@ -5,7 +5,6 @@ import type {
|
||||
ImageCdnRuntime,
|
||||
ImageOutputFormat,
|
||||
ImagePresentationDescriptor,
|
||||
ImagePresetReference,
|
||||
ImageProbeReceipt,
|
||||
ImageRasterMediaType,
|
||||
ImageResourceProbePort,
|
||||
|
||||
@@ -17,7 +17,6 @@ import { RESUMABLE_UPLOAD_PROTOCOL } from "../../../application/ports/browser-tr
|
||||
import type {
|
||||
BrowserDataFailureCode,
|
||||
BrowserDataObserver,
|
||||
BrowserDataOperation,
|
||||
BrowserDataRecovery,
|
||||
BrowserDataResult,
|
||||
} from "../../../application/ports/browser-file-storage/shared.ts";
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import type {
|
||||
BeginOpfsJournalTransaction,
|
||||
OpfsCommittedObjectPage,
|
||||
OpfsJournalPage,
|
||||
OpfsJournalPort,
|
||||
OpfsJournalTransaction,
|
||||
OpfsPreparedObject,
|
||||
@@ -16,7 +14,6 @@ import {
|
||||
} from "../../../application/ports/browser-file-storage/shared.ts";
|
||||
import {
|
||||
browserDataFailure,
|
||||
browserDataSuccess,
|
||||
mapIndexedDbException,
|
||||
} from "../../browser-file-storage/result.ts";
|
||||
import { snapshotAbortTimers } from "../../platform/abortable-operation.ts";
|
||||
|
||||
@@ -42,7 +42,6 @@ import {
|
||||
INSTALLED_REST_AUTH_PROFILES,
|
||||
} from "../contracts/rest-profiles.ts";
|
||||
import type { ClockPort } from "../application/ports/clock-port.ts";
|
||||
import type { MutationIntent } from "../contracts/mutation-intent.ts";
|
||||
import { createInstalledFeatureInputs } from "../features/installed-feature-adapters.ts";
|
||||
import {
|
||||
INVALIDATION_REGISTRY,
|
||||
|
||||
@@ -18,7 +18,6 @@ import type {
|
||||
type ResourceInput = Readonly<{ resourceId: string }>;
|
||||
type ResourceWire = Readonly<{ id: string; title: string }>;
|
||||
type ResourceProblem = Readonly<{ code?: string }>;
|
||||
type Resource = Readonly<{ id: string; title: string }>;
|
||||
|
||||
function validator<T>(schemaId: string): RuntimeValidator<T> {
|
||||
return Object.freeze({
|
||||
|
||||
@@ -1716,33 +1716,6 @@ async function readCgroupPids(cgroupRoot: string): Promise<number[]> {
|
||||
.trim().split("\n").filter(Boolean).map(Number);
|
||||
}
|
||||
|
||||
async function waitForRecordedProviderTree(
|
||||
tree: ReturnType<typeof recordProviderProcessTree>,
|
||||
providerScript: string,
|
||||
): Promise<void> {
|
||||
for (let attempt = 0; attempt < 400; attempt += 1) {
|
||||
const children = tree.directChildArguments();
|
||||
const members = tree.cgroupArguments();
|
||||
// Every process the assertions below reason about. Returning as soon as
|
||||
// some of them are present is what left bubblewrap out of the recording:
|
||||
// it enters the scope a few milliseconds after the wrapper does.
|
||||
if (
|
||||
children.some((value) => value.includes("/usr/bin/systemd-run")) &&
|
||||
children.some((value) => value.includes("provider-raw-guardian.ts")) &&
|
||||
members.some((value) => value.includes("provider-scope-wrapper.ts")) &&
|
||||
members.some((value) => /\/usr\/bin\/(?:bwrap|prlimit)/u.test(value)) &&
|
||||
members.some((value) => value.includes(providerScript))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
await delay(10);
|
||||
}
|
||||
throw new Error(
|
||||
"the provider run never contained a systemd-run child, a guardian child, " +
|
||||
"a scope wrapper, a sandbox and the provider itself in its cgroup",
|
||||
);
|
||||
}
|
||||
|
||||
async function waitForDirectChildMatching(supervisorPid: number, pattern: string): Promise<number> {
|
||||
for (let attempt = 0; attempt < 120; attempt += 1) {
|
||||
const children = (await readFile(`/proc/${supervisorPid}/task/${supervisorPid}/children`, "utf8"))
|
||||
|
||||
@@ -21,7 +21,6 @@ import {
|
||||
streamProfile,
|
||||
unaryOperation,
|
||||
unaryProfile,
|
||||
type ResourceView,
|
||||
} from "./fixture.ts";
|
||||
|
||||
describe("Browser RPC provider-neutral runtime", () => {
|
||||
|
||||
@@ -8,7 +8,6 @@ import type {
|
||||
OpfsStorageScope,
|
||||
} from "../../src/application/ports/browser-file-storage/opfs-ports.ts";
|
||||
import type {
|
||||
BrowserDataResult,
|
||||
BrowserStoragePolicy,
|
||||
ByteSource,
|
||||
} from "../../src/application/ports/browser-file-storage/shared.ts";
|
||||
|
||||
@@ -9,23 +9,12 @@ import {
|
||||
type SaveFileHandle,
|
||||
} from "../../src/adapters/browser-files/download-delivery-adapter.ts";
|
||||
import {
|
||||
CHECKSUM_HEADER,
|
||||
CONTROL_ENDPOINT,
|
||||
DATA_ORIGIN,
|
||||
DIGEST_HEADER,
|
||||
DOWNLOAD_HREF,
|
||||
DOWNLOAD_PATH,
|
||||
NOW,
|
||||
POLICY_HEADER,
|
||||
REQUEST_BINDING_SHA256,
|
||||
UPLOAD_SESSION_ID,
|
||||
collect,
|
||||
createHarness,
|
||||
downloadCapabilityPayload,
|
||||
downloadResponse,
|
||||
jsonResponse,
|
||||
responseWithUrl,
|
||||
uploadCapabilityPayload,
|
||||
} from "./presigned-transfer-fixture.ts";
|
||||
|
||||
describe("presigned DownloadDelivery integration", () => {
|
||||
|
||||
@@ -4,10 +4,8 @@ import { PRESIGNED_TRANSFER_PROTOCOL } from "../../src/application/ports/browser
|
||||
import { createPresignedCapabilityVault } from "../../src/adapters/browser-transfer/presigned/presigned-capability-vault.ts";
|
||||
import { sha256Hex } from "../../src/adapters/browser-transfer/presigned/incremental-sha256.ts";
|
||||
import {
|
||||
CHECKSUM_HEADER,
|
||||
CONTROL_ENDPOINT,
|
||||
DATA_ORIGIN,
|
||||
DIGEST_HEADER,
|
||||
DOWNLOAD_HREF,
|
||||
DOWNLOAD_PATH,
|
||||
NOW,
|
||||
|
||||
@@ -5,11 +5,7 @@ import { sha256Hex } from "../../src/adapters/browser-transfer/presigned/increme
|
||||
import {
|
||||
CHECKSUM_HEADER,
|
||||
CONTROL_ENDPOINT,
|
||||
DATA_ORIGIN,
|
||||
DIGEST_HEADER,
|
||||
DOWNLOAD_HREF,
|
||||
DOWNLOAD_PATH,
|
||||
NOW,
|
||||
POLICY_HEADER,
|
||||
REQUEST_BINDING_SHA256,
|
||||
UPLOAD_SESSION_ID,
|
||||
|
||||
@@ -12,14 +12,12 @@ import {
|
||||
sha256Hex,
|
||||
} from "../../src/adapters/browser-transfer/presigned/incremental-sha256.ts";
|
||||
import {
|
||||
CHECKSUM_HEADER,
|
||||
CONTROL_ENDPOINT,
|
||||
DATA_ORIGIN,
|
||||
DIGEST_HEADER,
|
||||
DOWNLOAD_HREF,
|
||||
DOWNLOAD_PATH,
|
||||
NOW,
|
||||
POLICY_HEADER,
|
||||
REQUEST_BINDING_SHA256,
|
||||
UPLOAD_SESSION_ID,
|
||||
collect,
|
||||
|
||||
@@ -2,7 +2,6 @@ import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import type { ClockPort } from "../../../src/application/ports/clock-port.ts";
|
||||
import type {
|
||||
RealtimeFailureKind,
|
||||
RealtimeResult,
|
||||
} from "../../../src/application/ports/realtime/shared.ts";
|
||||
import {
|
||||
|
||||
@@ -5,19 +5,13 @@ import type {
|
||||
PresignedUploadPartPort,
|
||||
} from "../../src/application/ports/browser-transfer/presigned-transfer.ts";
|
||||
import type {
|
||||
ResumableUploadCheckpoint,
|
||||
ResumableUploadCheckpointStore,
|
||||
ResumableUploadControlPlane,
|
||||
ResumableUploadSource,
|
||||
UploadPartExecutor,
|
||||
UploadPartReceipt,
|
||||
UploadProviderResult,
|
||||
UploadSession,
|
||||
} from "../../src/application/ports/browser-transfer/resumable-upload.ts";
|
||||
import { RESUMABLE_UPLOAD_PROTOCOL } from "../../src/application/ports/browser-transfer/resumable-upload.ts";
|
||||
import type {
|
||||
BrowserDataObservation,
|
||||
BrowserDataResult,
|
||||
} from "../../src/application/ports/browser-file-storage/shared.ts";
|
||||
import {
|
||||
browserDataFailure,
|
||||
@@ -27,11 +21,6 @@ import { createIndexedDbResumableUploadCheckpointStore } from "../../src/adapter
|
||||
import { createPresignedUploadPartExecutor } from "../../src/adapters/browser-transfer/resumable-upload/presigned-upload-part-executor.ts";
|
||||
import { createResumableUploadRuntime } from "../../src/adapters/browser-transfer/resumable-upload/resumable-upload-runtime.ts";
|
||||
import { resolveResumableUploadRuntimePolicy } from "../../src/adapters/browser-transfer/resumable-upload/runtime-policy.ts";
|
||||
import type {
|
||||
UploadCancellationChannel,
|
||||
UploadCancellationListener,
|
||||
} from "../../src/adapters/browser-transfer/resumable-upload/upload-cancellation-channel.ts";
|
||||
import type { UploadMutationLock } from "../../src/adapters/browser-transfer/resumable-upload/upload-mutation-lock.ts";
|
||||
import { MemoryIndexedDbFactory } from "../helpers/memory-indexeddb.ts";
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { createHash } from "node:crypto";
|
||||
import { spawnSync } from "node:child_process";
|
||||
import {
|
||||
chmod,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
|
||||
import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
|
||||
@@ -172,7 +172,7 @@ describe("TanStack cross-context cache coordinator", () => {
|
||||
topicVersions: topicVersions(),
|
||||
crossContext: harness.transport,
|
||||
};
|
||||
const coordinator = createTanStackCacheCoordinator(dependencies);
|
||||
createTanStackCacheCoordinator(dependencies);
|
||||
|
||||
harness.deliver(TOPIC_A);
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
"allowImportingTsExtensions": true,
|
||||
"jsx": "react-jsx",
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"isolatedModules": true
|
||||
|
||||
Reference in New Issue
Block a user