Skip to content

Commit 02cde95

Browse files
committed
chore(tsconfig): turn off the Schema-over-JSON diagnostic in test files
Test files carried 219 exceptions to preferSchemaOverJson, mostly without a reason: fixtures and assertions read and write raw JSON on purpose. One override in tsconfig.base.json turns the rule off for *.test.ts(x), and those exceptions go. Source files and test helpers keep the rule, and tests keep every other diagnostic, including nodeBuiltinImport.
1 parent 9503155 commit 02cde95

34 files changed

Lines changed: 17 additions & 252 deletions

‎apps/mobile/src/features/cloud/linkEnvironment.test.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ describe("mobile cloud link environment client", () => {
293293
const bodies: Array<unknown> = [];
294294
const fetchMock = vi.fn((url: string | URL, init?: RequestInit) => {
295295
if (init?.body) {
296-
// @effect-diagnostics-next-line preferSchemaOverJson:off
297296
bodies.push(JSON.parse(requestBodyText(init.body)));
298297
}
299298
if (String(url).endsWith("/v1/client/environment-link-challenges")) {
@@ -348,7 +347,6 @@ describe("mobile cloud link environment client", () => {
348347
const bodies: Array<Record<string, unknown>> = [];
349348
const fetchMock = vi.fn((url: string | URL, init?: RequestInit) => {
350349
if (init?.body) {
351-
// @effect-diagnostics-next-line preferSchemaOverJson:off
352350
bodies.push(JSON.parse(requestBodyText(init.body)) as Record<string, unknown>);
353351
}
354352
if (String(url).endsWith("/v1/client/environment-link-challenges")) {

‎apps/server/src/cli/config.test.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,6 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => {
650650
yield* fs.makeDirectory(path.dirname(derivedPaths.settingsPath), { recursive: true });
651651
yield* fs.writeFileString(
652652
derivedPaths.settingsPath,
653-
// @effect-diagnostics-next-line preferSchemaOverJson:off
654653
`${JSON.stringify({
655654
observability: {
656655
otlpTracesUrl: "http://localhost:4318/v1/traces",
@@ -722,7 +721,6 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => {
722721
yield* fs.makeDirectory(path.dirname(derivedPaths.settingsPath), { recursive: true });
723722
yield* fs.writeFileString(
724723
derivedPaths.settingsPath,
725-
// @effect-diagnostics-next-line preferSchemaOverJson:off
726724
`${JSON.stringify({
727725
observability: {
728726
otlpTracesUrl: "http://localhost:4318/v1/traces",
@@ -774,7 +772,6 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => {
774772
yield* fs.makeDirectory(path.dirname(derivedPaths.settingsPath), { recursive: true });
775773
yield* fs.writeFileString(
776774
derivedPaths.settingsPath,
777-
// @effect-diagnostics-next-line preferSchemaOverJson:off
778775
`${JSON.stringify({
779776
observability: {
780777
otlpTracesUrl: "http://localhost:4318/v1/traces",
@@ -1073,7 +1070,6 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => {
10731070
yield* fs.makeDirectory(path.dirname(derivedPaths.settingsPath), { recursive: true });
10741071
yield* fs.writeFileString(
10751072
derivedPaths.settingsPath,
1076-
// @effect-diagnostics-next-line preferSchemaOverJson:off
10771073
`${JSON.stringify({ observability: { otlpLogsUrl: "http://settings:4318/v1/logs" } })}\n`,
10781074
);
10791075

@@ -1145,7 +1141,6 @@ it.layer(NodeServices.layer)("cli config resolution", (it) => {
11451141
yield* fs.makeDirectory(path.dirname(derivedPaths.settingsPath), { recursive: true });
11461142
yield* fs.writeFileString(
11471143
derivedPaths.settingsPath,
1148-
// @effect-diagnostics-next-line preferSchemaOverJson:off
11491144
`${JSON.stringify({ observability: { otlpLogsUrl: "http://settings:4318/v1/logs" } })}\n`,
11501145
);
11511146

‎apps/server/src/cli/pair.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ describe("t3 pair", () => {
173173
const listed = yield* captureStdout(
174174
runCli(["auth", "pairing", "list", "--base-dir", baseDir, "--json"]),
175175
);
176-
// @effect-diagnostics-next-line preferSchemaOverJson:off - CLI JSON output is decoded as a presentation DTO.
177176
const credentials = JSON.parse(listed) as ReadonlyArray<{ readonly label?: string }>;
178177
assert.equal(credentials.length, 1);
179178
assert.equal(credentials[0]?.label, "t3 pair");

‎apps/server/src/cloud/bootService.test.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ it.layer(NodeServices.layer)("boot service install", (it) => {
359359
current: true,
360360
installedVersion: "1.2.3",
361361
});
362-
// @effect-diagnostics-next-line preferSchemaOverJson:off - fixed launcher-owned test document.
363362
const pendingState = JSON.stringify({
364363
protocol: SERVICE_LAUNCHER_PROTOCOL,
365364
activeVersion: "1.2.3",
@@ -546,7 +545,6 @@ it.layer(NodeServices.layer)("boot service install", (it) => {
546545
Effect.gen(function* () {
547546
const { service, fs, statePath } = yield* makeHarness();
548547
yield* service.install();
549-
// @effect-diagnostics-next-line preferSchemaOverJson:off - fixed launcher-owned test document.
550548
const pendingState = JSON.stringify({
551549
protocol: SERVICE_LAUNCHER_PROTOCOL,
552550
activeVersion: "1.2.3",
@@ -647,7 +645,6 @@ it.layer(NodeServices.layer)("boot service install", (it) => {
647645
Effect.gen(function* () {
648646
const { service, fs, statePath, commands } = yield* makeHarness();
649647
yield* service.install();
650-
// @effect-diagnostics-next-line preferSchemaOverJson:off - fixed launcher-owned test document.
651648
const pendingState = JSON.stringify({
652649
protocol: SERVICE_LAUNCHER_PROTOCOL - 1,
653650
activeVersion: "1.2.3",
@@ -808,7 +805,6 @@ it.layer(NodeServices.layer)("boot service install", (it) => {
808805
const { service, fs, statePath, commands } = yield* makeHarness("darwin");
809806
yield* service.install();
810807
const plistPath = (yield* service.status).unitPath;
811-
// @effect-diagnostics-next-line preferSchemaOverJson:off - fixed launcher-owned test document.
812808
const pendingState = JSON.stringify({
813809
protocol: SERVICE_LAUNCHER_PROTOCOL - 1,
814810
activeVersion: "1.2.3",

‎apps/server/src/cloud/selfUpdate.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ const makeHarness = Effect.fn("test.make_self_update_harness")(function* (
8484
launcherProtocol: SERVICE_LAUNCHER_PROTOCOL,
8585
};
8686
return {
87-
// @effect-diagnostics-next-line preferSchemaOverJson:off - fake child-process stdout.
8887
stdout: JSON.stringify(result),
8988
stderr: "",
9089
code: ChildProcessSpawner.ExitCode(0),

‎apps/server/src/device/SshDeviceHost.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @effect-diagnostics preferSchemaOverJson:off - the external process fixture emits raw JSON over SSH stdout.
21
import { expect, it } from "@effect/vitest";
32
import * as NodeServices from "@effect/platform-node/NodeServices";
43
import * as Net from "@t3tools/shared/Net";

‎apps/server/src/device/sshDeviceScript.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// @effect-diagnostics nodeBuiltinImport:off globalFetchInEffect:off preferSchemaOverJson:off - verifies generated remote scripts using real shell and Node processes.
1+
// @effect-diagnostics nodeBuiltinImport:off globalFetchInEffect:off - verifies generated remote scripts using real shell and Node processes.
22
import * as Effect from "effect/Effect";
33
import { HostProcessPlatform } from "@t3tools/shared/hostProcess";
44
import { describe, expect, it } from "@effect/vitest";

0 commit comments

Comments
 (0)