From 9527b1b301f32a7d9c933bb61a26c78b43e6dffe Mon Sep 17 00:00:00 2001 From: Michael Molisani Date: Mon, 30 Sep 2024 20:35:42 +0100 Subject: [PATCH] chore: address eslint violations --- packages/core/tests/type-inference.spec.ts | 2 -- packages/create-app/tests/app.spec.ts | 9 ++++++--- packages/create-app/tests/baseline.ts | 2 ++ packages/create-app/tests/stream.ts | 2 ++ packages/create-app/tests/types.ts | 2 ++ 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/core/tests/type-inference.spec.ts b/packages/core/tests/type-inference.spec.ts index 5dcb99c..0fa6a9e 100644 --- a/packages/core/tests/type-inference.spec.ts +++ b/packages/core/tests/type-inference.spec.ts @@ -1,8 +1,6 @@ // Copyright 2024 Bloomberg Finance L.P. // Distributed under the terms of the Apache 2.0 license. -/* eslint-disable @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access */ - // The following tests exist to validate the type inference and type checking of the framework. // They do not test any runtime behavior and do not need to be executed as part of the test suite. diff --git a/packages/create-app/tests/app.spec.ts b/packages/create-app/tests/app.spec.ts index 3936df5..00126ad 100644 --- a/packages/create-app/tests/app.spec.ts +++ b/packages/create-app/tests/app.spec.ts @@ -1,10 +1,13 @@ +// Copyright 2024 Bloomberg Finance L.P. +// Distributed under the terms of the Apache 2.0 license. import { run } from "@stricli/core"; import { expect } from "chai"; import { createFsFromVolume, Volume, type DirectoryJSON } from "memfs"; import nodePath from "node:path"; import sinon from "sinon"; +import type { PackageJson } from "type-fest"; import { app } from "../src/app"; -import { type LocalContext } from "../src/context"; +import type { LocalContext } from "../src/context"; import { compareToBaseline, type BaselineFormat } from "./baseline"; import { FakeWritableStream } from "./stream"; import type { DeepPartial } from "./types"; @@ -70,8 +73,8 @@ const ApplicationTestResultFormat: BaselineFormat = { if (text) { yield `${FILE_ENTRY_PREFIX}${path}`; if (path.endsWith("package.json")) { - const obj = JSON.parse(text.toString()); - const dependencies = Object.entries(obj.dependencies); + const obj = JSON.parse(text.toString()) as PackageJson; + const dependencies = Object.entries(obj.dependencies ?? {}); obj.dependencies = Object.fromEntries(dependencies.map(([key]) => [key, ""])); yield JSON.stringify(obj, void 0, 2); } else { diff --git a/packages/create-app/tests/baseline.ts b/packages/create-app/tests/baseline.ts index 0be4d99..e915457 100644 --- a/packages/create-app/tests/baseline.ts +++ b/packages/create-app/tests/baseline.ts @@ -1,3 +1,5 @@ +// Copyright 2024 Bloomberg Finance L.P. +// Distributed under the terms of the Apache 2.0 license. import { expect } from "chai"; import assert from "node:assert"; import fs from "node:fs"; diff --git a/packages/create-app/tests/stream.ts b/packages/create-app/tests/stream.ts index e65b7d1..a154974 100644 --- a/packages/create-app/tests/stream.ts +++ b/packages/create-app/tests/stream.ts @@ -1,3 +1,5 @@ +// Copyright 2024 Bloomberg Finance L.P. +// Distributed under the terms of the Apache 2.0 license. export class FakeWritableStream { #text: string[] = []; write(str: string): void { diff --git a/packages/create-app/tests/types.ts b/packages/create-app/tests/types.ts index 93f9ee2..7aee21d 100644 --- a/packages/create-app/tests/types.ts +++ b/packages/create-app/tests/types.ts @@ -1,3 +1,5 @@ +// Copyright 2024 Bloomberg Finance L.P. +// Distributed under the terms of the Apache 2.0 license. export type DeepPartial = { [K in keyof T]?: T[K] extends object ? DeepPartial : T[K]; };