Skip to content

Commit ff17ba4

Browse files
deno lint -> oxlint (#1561)
* chore: update package scripts and dependencies - Replaced `deno lint` with `oxlint` for linting. - Adjusted script commands for consistency and clarity. - Updated `bun.lockb` to reflect changes in dependencies. - Refactored header merging logic in various components for improved readability. - Enhanced regex patterns in multiple files for consistency in path matching. These changes streamline the development process and improve code maintainability. * chore(lint): add .oxlintrc.json configuration and update error handling - Introduced a new `.oxlintrc.json` file to configure linting rules, specifically turning off the `no-unused-expressions` rule and ignoring certain patterns. - Refactored error handling in various components to remove unused error parameters, improving code clarity and consistency. - Updated `bun.lockb` to reflect dependency changes. These updates enhance the linting process and improve the overall readability of the codebase. * refactor(package): clean up package.json and improve error handling - Removed unused compiler options and lint configuration from package.json, streamlining the file for better clarity. - Updated error handling in the getAppUUID function to log the error object instead of a generic variable, enhancing debugging capabilities. These changes improve the maintainability and readability of the codebase. * fix(ai): improve metadata handling in AIAgent class - Updated the metadata assignment in the AIAgent class to ensure proper handling of timings. This change enhances the clarity and maintainability of the code by explicitly spreading the existing metadata before adding new properties. No functionality is broken; this update improves the robustness of the agent's context management. * chore(lint): update linting rules and ignore patterns - Added `no-explicit-any` and `ban-types` rules to `.oxlintrc.json` with warnings to improve type safety. - Updated ignore patterns to include `docs/*` for better linting coverage. - Replaced `deno-lint-ignore-file` comments with `oxlint-disable` for consistency across the codebase. These changes enhance the linting process and promote better coding practices throughout the project. * chore(lint): update lint ignore comments for consistency - Replaced `deno-lint-ignore` comments with `oxlint-disable-next-line` across multiple files to standardize linting practices. - This change improves code consistency and aligns with the updated linting rules established in previous commits. * chore(lint): introduce kebab-case filename enforcement plugin - Added a new linting rule to enforce kebab-case naming for filenames in the project, improving consistency in file naming conventions. - Updated `.oxlintrc.json` to include the new rule and associated plugin, enhancing the linting configuration. - Removed the old TypeScript implementation of the kebab-case rule in favor of the new JavaScript version for better compatibility with the current linting setup. These changes promote better coding practices and maintainability across the codebase. * chore(lint): reorganize linting rules in .oxlintrc.json - Moved the linting rules section within `.oxlintrc.json` to improve clarity and organization. - Retained existing rules such as `no-unused-expressions`, `no-explicit-any`, `enforce-kebab-case-file-names/kebab-case`, and `ban-types` to maintain code quality and consistency. These adjustments enhance the readability of the linting configuration while preserving the established linting practices. * chore(lint): remove Deno lint setup from CI workflow - Eliminated the Deno setup step from the GitHub Actions workflow as linting has been fully migrated to Biome. - Updated package.json to remove the deprecated Deno lint command, streamlining the linting process. These changes enhance the CI configuration by removing unnecessary steps and aligning with the current linting practices. * chore(lint): simplify handleLiteral function and update .oxlintrc.json - Refactored the `handleLiteral` function in `ensure-tailwind-design-system-tokens.js` to use a more concise parameter destructuring syntax, improving code readability. - Updated `.oxlintrc.json` to streamline the configuration by consolidating the `jsPlugins` array into a single line. These changes enhance the clarity of the code and maintain consistency in the linting configuration. * chore(lint): remove no-explicit-any rule from do-storage.ts - Eliminated the `no-explicit-any` linting directive from `do-storage.ts` to align with updated linting practices. - This change enhances code clarity by removing unnecessary linting comments and maintaining consistency across the codebase. * chore(release): bump versions for cli and workers-runtime packages - Updated the version of `deco-cli` from `0.22.4` to `0.22.5` to reflect recent changes. - Incremented the version of `@deco/workers-runtime` from `0.23.1` to `0.23.2` for consistency with the latest updates. These version bumps ensure that the packages are aligned with the latest developments in the codebase. * chore(package): rename package from @deco/chat to @decocms/admin - Updated the package name in package.json to reflect the new branding for the admin interface. - This change aligns the package with the overall project structure and naming conventions. * fix(spread): restore nullish coalescing in spread operations - Reintroduced nullish coalescing in multiple spread operations across various files to ensure safe handling of potentially undefined values. - Updated components and utility functions in `apps/web`, `packages/ai`, `packages/cli`, `packages/runtime`, and `packages/sdk` to maintain consistency and prevent runtime errors. These changes enhance the robustness of the code by ensuring that undefined values do not lead to unintended behavior. * refactor(spread): remove NULLISH_COALESCING_REMOVALS.md file - Deleted the `NULLISH_COALESCING_REMOVALS.md` file, which documented the nullish coalescing removals from spread operations. - This cleanup reflects the completion of the related refactoring work and helps maintain a tidy documentation structure. No further action is required as the relevant changes have been implemented in the codebase. * chore(lint): disable unicorn/no-useless-fallback-in-spread rule in .oxlintrc.json - Turned off the `unicorn/no-useless-fallback-in-spread` rule in the linting configuration to prevent unnecessary warnings during development. - This adjustment aligns the linting rules with current project needs and enhances the developer experience. No further action is required as this change is purely a configuration update.
1 parent 9abdd98 commit ff17ba4

127 files changed

Lines changed: 268 additions & 338 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ jobs:
1919
- name: Setup Bun
2020
uses: oven-sh/setup-bun@v2
2121

22-
# Remove when lint is migrated to Biome
23-
- name: Set up Deno
24-
uses: denoland/setup-deno@v2
25-
with:
26-
deno-version: v2.x
27-
2822
- name: Install dependencies
2923
run: bun install
3024

.oxlintrc.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"jsPlugins": ["./plugins/enforce-kebab-case-file-names.js"],
3+
"ignorePatterns": [
4+
"scripts/migrate-project-entity-table.ts",
5+
"packages/sdk/src/observability/otel/*",
6+
"docs/*"
7+
],
8+
"rules": {
9+
"unicorn/no-useless-fallback-in-spread": "off",
10+
"no-unused-expressions": "off",
11+
"no-explicit-any": "warn",
12+
"enforce-kebab-case-file-names/kebab-case": "warn",
13+
"ban-types": "warn"
14+
}
15+
}

apps/api/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// deno-lint-ignore-file no-explicit-any
1+
/* oxlint-disable no-explicit-any */
22
export * from "./src/actors.ts";
33
export { WorkspaceDatabase } from "./src/durable-objects/workspace-database.ts";
44
// DECONFIG DurableObjects (re-exported from SDK)

apps/api/src/api.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export const honoCtxToAppCtx = (c: Context<AppEnv>): AppContext => {
150150

151151
const mapMCPErrorToHTTPExceptionOrThrow = (err: Error) => {
152152
if ("code" in err) {
153-
// deno-lint-ignore no-explicit-any
153+
// oxlint-disable-next-line no-explicit-any
154154
const cause = (err as any as { detail?: unknown }).detail;
155155
const status = (err.code as ContentfulStatusCode | undefined) ?? 500;
156156
const message = err.message ?? "Internal server error";
@@ -472,9 +472,7 @@ const createMcpServerProxyForIntegration = async (
472472
policies: [{ statements }],
473473
});
474474
},
475-
headers: {
476-
...(callerApp ? { "x-caller-app": callerApp } : {}),
477-
},
475+
headers: callerApp ? { "x-caller-app": callerApp } : {},
478476
tools: integration.tools
479477
? { tools: integration.tools as ListToolsResult["tools"] }
480478
: undefined,

apps/api/src/auth/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const createMagicLinkEmail = async (ctx: AppContext) => {
120120
},
121121
});
122122
return { email };
123-
} catch (_) {
123+
} catch {
124124
return { error: "" };
125125
}
126126
};
@@ -202,7 +202,7 @@ appLogin.all("/magiclink", async (ctx: AppContext) => {
202202
},
203203
});
204204
return ctx.json({ email });
205-
} catch (_) {
205+
} catch {
206206
return ctx.json({ error: "" }, 400);
207207
}
208208
});

apps/api/src/durable-objects/workspace-database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class WorkspaceDatabase
1616

1717
constructor(
1818
// @ts-ignore: This is a workaround to fix the type error
19-
// deno-lint-ignore ban-types
19+
// oxlint-disable-next-line ban-types
2020
protected override ctx: DurableObjectState<{}>,
2121
protected override env: Bindings,
2222
) {

apps/api/src/email.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import PostalMime from "postal-mime";
1717

1818
const readContent = async (message: ForwardableEmailMessage) => {
1919
// Parse the MIME message to extract structured content
20-
// deno-lint-ignore no-explicit-any
20+
// oxlint-disable-next-line no-explicit-any
2121
const email = await PostalMime.parse(message.raw as any);
2222

2323
// Return the text content, fallback to HTML if text is not available
@@ -34,7 +34,7 @@ export function email(
3434
c: Constructor,
3535
) => StubFactory<InstanceType<Constructor>> = (c) => {
3636
return runtime instanceof ActorCfRuntime
37-
? // deno-lint-ignore no-explicit-any
37+
? // oxlint-disable-next-line no-explicit-any
3838
runtime.stub(c, env as any)
3939
: actors.stub(c.name);
4040
};

apps/api/src/middlewares/actors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const withActorsMiddleware: Handler<AppEnv> = async (ctx, next) => {
1919
ctx.set("immutableRes", true);
2020
startTime(ctx, "actor");
2121
return await actorsMiddleware(
22-
// deno-lint-ignore no-explicit-any
22+
// oxlint-disable-next-line no-explicit-any
2323
ctx as any,
2424
next,
2525
).finally(() => endTime(ctx, "actor"));

apps/api/tail.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// deno-lint-ignore-file no-explicit-any
1+
/* oxlint-disable no-explicit-any */
22

33
// Interface for trace events from tail
44
interface TailTrace {

apps/outbound/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export default {
9393
new Request(req.url, {
9494
method: req.method,
9595
headers: reqHeaders,
96-
body: req.body,
96+
...(req.body ? { body: req.body } : {}),
9797
redirect: req.redirect,
9898
}),
9999
);

0 commit comments

Comments
 (0)