Skip to content

Commit cc0a9a8

Browse files
committed
fix: lints
1 parent b38aad8 commit cc0a9a8

4 files changed

Lines changed: 12 additions & 9 deletions

File tree

.github/workflows/contributors.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ jobs:
77
fetch-depth: 0
88
- uses: ./.github/actions/prepare
99
- uses: JoshuaKGoldberg/all-contributors-auto-action@944abe4387e751b5bbb38616cb25cf4a4ca998f2 # v0.5.0
10-
env:
11-
GITHUB_TOKEN: ${{ github.token }}
12-
10+
with:
11+
github-token: ${{ github.token }}
1312
name: Contributors
1413

1514
on:

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"automerge",
1515
"joshuakgoldberg",
1616
"markdownlintignore",
17+
"obug",
1718
"tseslint"
1819
]
1920
}

src/filePathToNamespace.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe("filePathToNamespace", () => {
4444
expect(actual).toBe("def");
4545
});
4646

47-
it("handles invalid package manfiest format", () => {
47+
it("handles invalid package manifest format", () => {
4848
mockUp.mockReturnValueOnce("abc/package.json");
4949
mockReadFileSync.mockReturnValue(`{}`);
5050

src/filePathToNamespace.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as path from "node:path";
2-
import * as fs from "node:fs";
31
import * as pkg from "empathic/package";
2+
import * as fs from "node:fs";
3+
import * as path from "node:path";
44

55
import { generateNamespace } from "./generateNamespace.js";
66

@@ -17,12 +17,15 @@ export function filePathToNamespace(filePath: string): string {
1717

1818
const packageContent = fs.readFileSync(packageUp, "utf-8");
1919

20+
/* eslint-disable no-var */
2021
try {
21-
var packageJson: { name?: unknown } | undefined =
22-
JSON.parse(packageContent);
22+
var packageJson: undefined | { name?: unknown } = JSON.parse(
23+
packageContent,
24+
) as unknown as undefined | { name?: unknown };
2325
} catch {
24-
var packageJson: { name?: unknown } | undefined = undefined;
26+
var packageJson: undefined | { name?: unknown } = undefined;
2527
}
28+
/* eslint-enable no-var */
2629
if (
2730
packageJson !== undefined &&
2831
"name" in packageJson &&

0 commit comments

Comments
 (0)