Skip to content

Commit cdbaf1b

Browse files
authored
fix: resolve all lint errors and warnings (#154)
* fix: resolve all lint errors and warnings Fix 46 no-explicit-any errors, unused imports/params, require-yield, useless escapes, and useless fallback spreads across 32 files. Exclude generated .astro/ directory from linting. * fix: remove unused _ prefixed parameters instead of dangling them * style: format
1 parent a609217 commit cdbaf1b

33 files changed

Lines changed: 117 additions & 79 deletions

File tree

.oxlintrc.jsonc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"ignorePatterns": [".astro/"],
23
"rules": {
34
"typescript/no-explicit-any": "error",
45
},

apps/cli/src/build.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ const buildBinaries = async (targets: Target[], mode: BuildMode) => {
280280
entrypoints: [join(cliRoot, "src/main.ts")],
281281
minify: mode === "production",
282282
compile: {
283+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Bun compile target string is dynamically constructed
283284
target: bunTarget(target) as any,
284285
outfile: join(binDir, binaryName(target)),
285286
},
@@ -554,8 +555,8 @@ const repositoryUrl = typeof packageJson.repository === "string"
554555
? packageJson.repository
555556
: packageJson.repository && packageJson.repository.url;
556557
const githubBase = String(packageJson.homepage || repositoryUrl || "https://github.com/RhysSullivan/executor")
557-
.replace(/^git\+/, "")
558-
.replace(/\.git$/, "");
558+
.replace(/^git[+]/, "")
559+
.replace(/.git$/, "");
559560
const version = packageJson.version;
560561
561562
const platformMap = { darwin: "darwin", linux: "linux", win32: "windows" };

apps/cli/src/main.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@ if (typeof Bun !== "undefined" && (await Bun.file(wasmOnDisk).exists())) {
1414
const variant = {
1515
type: "sync" as const,
1616
importFFI: () =>
17-
import("@jitl/quickjs-wasmfile-release-sync/ffi").then((m: any) => m.QuickJSFFI),
17+
import("@jitl/quickjs-wasmfile-release-sync/ffi").then(
18+
(m: Record<string, unknown>) => m.QuickJSFFI,
19+
),
1820
importModuleLoader: () =>
19-
import("@jitl/quickjs-wasmfile-release-sync/emscripten-module").then((m: any) => {
20-
const original = m.default;
21-
return (moduleArg: any = {}) => original({ ...moduleArg, wasmBinary });
22-
}),
21+
import("@jitl/quickjs-wasmfile-release-sync/emscripten-module").then(
22+
(m: Record<string, unknown>) => {
23+
const original = m.default as (...args: unknown[]) => unknown;
24+
return (moduleArg: Record<string, unknown> = {}) =>
25+
original({ ...moduleArg, wasmBinary });
26+
},
27+
),
2328
};
29+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- quickjs-emscripten variant type is not publicly exported
2430
const mod = await newQuickJSWASMModule(variant as any);
2531
setQuickJSModule(mod);
2632
}
@@ -200,7 +206,7 @@ const callCommand = Command.make(
200206
}
201207
} else {
202208
console.log(result.text);
203-
const executionId = (result.structured as any)?.executionId;
209+
const executionId = (result.structured as Record<string, unknown> | undefined)?.executionId;
204210
if (executionId) {
205211
console.log(
206212
`\nTo resume:\n ${cliPrefix} resume --execution-id ${executionId} --action accept`,

apps/cloud/src/auth/workos.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const make = Effect.gen(function* () {
4040
cookiePassword,
4141
});
4242

43-
const result = yield* use((wos) => session.authenticate());
43+
const result = yield* use(() => session.authenticate());
4444

4545
if (result.authenticated) {
4646
return {
@@ -58,7 +58,7 @@ const make = Effect.gen(function* () {
5858
if (result.reason === "no_session_cookie_provided") return null;
5959

6060
// Try refreshing
61-
const refreshed = yield* use((wos) => session.refresh()).pipe(
61+
const refreshed = yield* use(() => session.refresh()).pipe(
6262
Effect.orElseSucceed(() => ({ authenticated: false as const })),
6363
);
6464

@@ -117,7 +117,7 @@ const make = Effect.gen(function* () {
117117
sessionData,
118118
cookiePassword,
119119
});
120-
const refreshed = yield* use((wos) =>
120+
const refreshed = yield* use(() =>
121121
session.refresh(organizationId ? { organizationId } : undefined),
122122
);
123123
if (!refreshed.authenticated || !("sealedSession" in refreshed)) return null;

apps/cloud/src/mcp.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import { env } from "cloudflare:workers";
66
import { createRemoteJWKSet, jwtVerify } from "jose";
77

8-
import type { McpSessionInit } from "./mcp-session";
9-
108
// ---------------------------------------------------------------------------
119
// Constants
1210
// ---------------------------------------------------------------------------

apps/cloud/src/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { HeadContent, Outlet, Scripts, createRootRoute } from "@tanstack/react-router";
2+
import { HeadContent, Scripts, createRootRoute } from "@tanstack/react-router";
33
import { AutumnProvider } from "autumn-js/react";
44
import { ExecutorProvider } from "@executor/react/api/provider";
55
import { AuthProvider, useAuth } from "../web/auth";

apps/cloud/src/routes/billing_.plans.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ function PlansPage() {
9595
const isCanceling = eligibility?.canceling ?? false;
9696
const isCurrent = status === "active" && !isCanceling;
9797
const isScheduled = status === "scheduled";
98-
const isActionable = action !== "none";
9998
const label = isCanceling ? "Resume" : (ACTION_LABELS[action] ?? "Select");
10099
const isUpgradeAction = action === "upgrade" || action === "activate";
101100

apps/cloud/src/web/shell.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Link, Outlet, useLocation } from "@tanstack/react-router";
22
import { useEffect, useRef, useState } from "react";
3-
import { useAtomRefresh, useAtomValue, Result } from "@effect-atom/atom-react";
4-
import { sourcesAtom, toolsAtom } from "@executor/react/api/atoms";
3+
import { useAtomValue, Result } from "@effect-atom/atom-react";
4+
import { sourcesAtom } from "@executor/react/api/atoms";
55
import { useScope } from "@executor/react/api/scope-context";
6-
import { Button } from "@executor/react/components/button";
6+
77
import { AUTH_PATHS } from "../auth/api";
88
import { useAuth } from "./auth";
99

@@ -169,9 +169,6 @@ function SidebarContent(props: { pathname: string; onNavigate?: () => void; show
169169
export function Shell() {
170170
const location = useLocation();
171171
const pathname = location.pathname;
172-
const scopeId = useScope();
173-
const refreshSources = useAtomRefresh(sourcesAtom(scopeId));
174-
const refreshTools = useAtomRefresh(toolsAtom(scopeId));
175172
const lastPathname = useRef(pathname);
176173
const [mobileSidebarOpen, setMobileSidebarOpen] = useState(false);
177174
if (lastPathname.current !== pathname) {

apps/desktop/scripts/bundle-cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Builds the executor CLI binary and copies it into the desktop app's
33
* resources/ folder so electron-builder can bundle it as a sidecar.
44
*/
5-
const { execSync, spawnSync } = require("node:child_process");
5+
const { spawnSync } = require("node:child_process");
66
const { existsSync, mkdirSync, cpSync, chmodSync } = require("node:fs");
77
const { resolve, join } = require("node:path");
88

apps/local/src/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { Outlet, createRootRoute } from "@tanstack/react-router";
2+
import { createRootRoute } from "@tanstack/react-router";
33
import { ExecutorProvider } from "@executor/react/api/provider";
44
import { Shell } from "../web/shell";
55

0 commit comments

Comments
 (0)