Skip to content

Setup lint / fmt + code cleanup#90

Merged
0xh3rman merged 7 commits intomainfrom
setup-lint-tooling
Feb 18, 2026
Merged

Setup lint / fmt + code cleanup#90
0xh3rman merged 7 commits intomainfrom
setup-lint-tooling

Conversation

@0xh3rman
Copy link
Collaborator

No description provided.

Add oxlint for linting, oxfmt for formatting, and knip for dead code
detection. Fix all existing lint issues and auto-format codebase.

- Add oxlintrc.json with sensible rules (eqeqeq, no-var, no-eval, etc.)
- Add .oxfmtrc.json for consistent formatting (4-space, double quotes, 120 width)
- Add knip.json for dead code detection
- Add just lint/format/format-check/dead-code/check commands
- Fix eqeqeq violations, unused imports, prefer-const, prefer-as-const
- Remove redundant console.error calls in provider catch blocks
- Exclude generated packages/types/src/primitives from all tools
@semanticdiff-com
Copy link

semanticdiff-com bot commented Feb 18, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  apps/api/package.json  100% smaller
  apps/api/src/error.ts  100% smaller
  apps/api/tsconfig.json  100% smaller
  packages/swapper/jest.config.js  100% smaller
  packages/swapper/package.json  100% smaller
  packages/swapper/src/cetus/bn_replacer.test.ts  100% smaller
  packages/swapper/src/cetus/bn_replacer.ts  100% smaller
  packages/swapper/src/cetus/index.ts  100% smaller
  packages/swapper/src/chain/solana/account.test.ts  100% smaller
  packages/swapper/src/error.ts  100% smaller
  packages/swapper/src/index.ts  100% smaller
  packages/swapper/src/okx/constants.ts  100% smaller
  packages/swapper/src/orca/model.ts  100% smaller
  packages/swapper/src/panora/move.ts  100% smaller
  packages/swapper/src/relay/index.ts  100% smaller
  packages/swapper/src/testkit/mock.ts  100% smaller
  packages/swapper/tsconfig.json  100% smaller
  packages/types/jest.config.js  100% smaller
  packages/types/package.json  100% smaller
  packages/types/src/asset.test.ts  100% smaller
  packages/types/src/asset.ts  100% smaller
  packages/types/src/index.ts  100% smaller
  packages/types/tsconfig.json  100% smaller
  packages/swapper/src/relay/provider.ts  98% smaller
  packages/swapper/src/chain/sui/tx_builder.ts  96% smaller
  packages/swapper/src/okx/provider.ts  96% smaller
  apps/api/src/index.ts  95% smaller
  packages/swapper/src/orca/provider.ts  92% smaller
  packages/swapper/src/chain/solana/tx_builder.ts  91% smaller
  packages/swapper/src/orca/provider.test.ts  90% smaller
  packages/swapper/src/relay/client.ts  90% smaller
  packages/swapper/src/mayan/solana.ts  86% smaller
  packages/swapper/src/okx/provider.test.ts  82% smaller
  packages/swapper/src/relay/model.ts  80% smaller
  packages/swapper/src/relay/provider.test.ts  79% smaller
  packages/swapper/src/orca/integration.test.ts  73% smaller
  packages/swapper/src/cetus/provider.ts  70% smaller
  packages/swapper/src/panora/provider.ts  69% smaller
  packages/swapper/src/mayan/sui.ts  68% smaller
  packages/swapper/src/orca/index.test.ts  67% smaller
  packages/swapper/src/chain/solana/account.ts  66% smaller
  packages/swapper/src/stonfi/integration.test.ts  62% smaller
  packages/swapper/src/chain/solana/constants.ts  59% smaller
  packages/swapper/src/orca/fee.test.ts  56% smaller
  apps/api/src/index.test.ts  50% smaller
  packages/swapper/src/okx/integration.test.ts  40% smaller
  packages/swapper/src/orca/fee.ts  26% smaller
  package.json  23% smaller
  packages/swapper/src/stonfi/index.ts  18% smaller
  packages/swapper/src/mayan/index.test.ts  9% smaller
  packages/swapper/src/bigint_math.ts  6% smaller
  pnpm-lock.yaml  2% smaller
  .editorconfig Unsupported file format
  .github/workflows/ci.yml  0% smaller
  .oxfmtrc.json  0% smaller
  AGENTS.md Unsupported file format
  apps/api/jest.config.js  0% smaller
  justfile Unsupported file format
  knip.json  0% smaller
  oxlintrc.json  0% smaller
  packages/swapper/src/mayan/error.ts  0% smaller
  packages/swapper/src/mayan/evm.ts  0% smaller
  packages/swapper/src/mayan/provider.ts  0% smaller
  packages/swapper/src/okx/README.md Unsupported file format
  packages/swapper/src/panora/provider.test.ts  0% smaller
  packages/swapper/src/referrer.js  0% smaller

@gemini-code-assist
Copy link

Summary of Changes

Hello @0xh3rman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes a robust set of linting and formatting tools, including oxlint, oxfmt, and knip, to enforce consistent code style and identify unused code throughout the monorepo. It updates development guidelines and integrates these tools into the build system, aiming to significantly improve code maintainability, readability, and overall quality.

Highlights

  • New Linting and Formatting Tools: Introduced oxlint for linting, oxfmt for code formatting, and knip for dead code detection to enhance code quality and consistency across the monorepo.
  • Updated Coding Style Guidelines: Modified AGENTS.md to reflect a standardized 4-space indent and included instructions for using the new formatting and linting tools.
  • Streamlined Development Workflow: Added new justfile commands for easily running linting, formatting, and dead code checks, integrating these processes into the build and test pipeline.
  • Codebase Refactoring and Cleanup: Applied automatic formatting across numerous TypeScript files and removed unnecessary console.error calls to align with new linting rules and improve code cleanliness.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .oxfmtrc.json
    • Added new OxFmt configuration file to define code formatting rules.
  • AGENTS.md
    • Updated coding style guidelines to specify 4-space indentation.
    • Added instructions for using pnpm oxfmt and pnpm oxlint for code formatting and linting.
  • apps/api/jest.config.js
    • Reformated the Jest configuration file for consistency.
  • apps/api/package.json
    • Reformated the package.json file for consistency.
  • apps/api/src/error.ts
    • Reformated the error handling logic for consistency.
  • apps/api/src/index.test.ts
    • Reordered import statements for better organization.
    • Reformated test descriptions for consistency.
  • apps/api/src/index.ts
    • Reordered import statements for better organization.
    • Reformated code for consistency.
  • apps/api/tsconfig.json
    • Reformated the TypeScript configuration file for consistency.
  • justfile
    • Added new lint, format, format-check, dead-code, and check commands for development workflow.
  • knip.json
    • Added new Knip configuration file for detecting unused files and exports.
  • oxlintrc.json
    • Added new OxLint configuration file with defined linting rules and overrides.
  • package.json
    • Added knip, oxfmt, and oxlint as dev dependencies.
    • Added new lint, format, format:check, and dead-code scripts.
  • packages/swapper/jest.config.js
    • Reformated the Jest configuration file for consistency.
  • packages/swapper/package.json
    • Reformated the package.json file for consistency.
  • packages/swapper/src/bigint_math.ts
    • Reformated string literals and arithmetic operations for consistency.
  • packages/swapper/src/cetus/bn_replacer.test.ts
    • Reformated string literals and test descriptions for consistency.
  • packages/swapper/src/cetus/bn_replacer.ts
    • Reformated string literals for consistency.
  • packages/swapper/src/cetus/index.ts
    • Reformated export statement for consistency.
  • packages/swapper/src/cetus/provider.ts
    • Reordered import statements for better organization.
    • Removed console.error calls.
    • Reformated arithmetic operations for consistency.
  • packages/swapper/src/chain/solana/account.test.ts
    • Reformated function call for consistency.
  • packages/swapper/src/chain/solana/account.ts
    • Reordered import statements for better organization.
  • packages/swapper/src/chain/solana/constants.ts
    • Updated DEFAULT_COMMITMENT type definition.
  • packages/swapper/src/chain/solana/tx_builder.ts
    • Reformated function signatures and array map calls for consistency.
    • Removed console.warn call.
  • packages/swapper/src/chain/sui/tx_builder.ts
    • Reordered import statements for better organization.
    • Reformated function signatures and array map calls for consistency.
  • packages/swapper/src/error.ts
    • Reformated conditional message assignment for consistency.
  • packages/swapper/src/index.ts
    • Reformated export statements for consistency.
  • packages/swapper/src/mayan/error.ts
    • Reordered import statements for better organization.
  • packages/swapper/src/mayan/evm.ts
    • Reordered import statements for better organization.
  • packages/swapper/src/mayan/index.test.ts
    • Reformated test descriptions for consistency.
  • packages/swapper/src/mayan/provider.ts
    • Reordered import statements for better organization.
    • Reformated object literals for consistency.
  • packages/swapper/src/mayan/solana.ts
    • Reordered import statements for better organization.
    • Reformated function signatures for consistency.
  • packages/swapper/src/mayan/sui.ts
    • Reordered import statements for better organization.
    • Reformated function signatures and conditional checks for consistency.
  • packages/swapper/src/okx/README.md
    • Reformated list items for improved readability.
  • packages/swapper/src/okx/constants.ts
    • Reformated array items for consistency.
  • packages/swapper/src/okx/integration.test.ts
    • Reordered import statements for better organization.
    • Reformated test logic for consistency.
  • packages/swapper/src/okx/provider.test.ts
    • Reordered import statements for better organization.
    • Reformated test descriptions for consistency.
  • packages/swapper/src/okx/provider.ts
    • Reordered import statements for better organization.
    • Reformated conditional checks and function calls for consistency.
  • packages/swapper/src/orca/fee.test.ts
    • Reordered import statements for better organization.
  • packages/swapper/src/orca/fee.ts
    • Reordered import statements for better organization.
    • Reformated arithmetic operations for consistency.
  • packages/swapper/src/orca/index.test.ts
    • Reordered import statements for better organization.
    • Reformated error expectation for consistency.
  • packages/swapper/src/orca/integration.test.ts
    • Reordered import statements for better organization.
    • Reformated constant declaration and conditional check for consistency.
  • packages/swapper/src/orca/model.ts
    • Reformated constructor for consistency.
  • packages/swapper/src/orca/provider.test.ts
    • Reordered import statements for better organization.
    • Reformated mock implementations for consistency.
  • packages/swapper/src/orca/provider.ts
    • Reordered import statements for better organization.
    • Reformated function calls and object literals for consistency.
  • packages/swapper/src/panora/move.ts
    • Reformated number parsing logic for consistency.
  • packages/swapper/src/panora/provider.test.ts
    • Reordered import statements for better organization.
  • packages/swapper/src/panora/provider.ts
    • Reordered import statements for better organization.
    • Reformated conditional assignments and function calls for consistency.
  • packages/swapper/src/referrer.js
    • Removed trailing newline character.
  • packages/swapper/src/relay/client.ts
    • Removed console.error call and simplified error handling.
  • packages/swapper/src/relay/index.ts
    • Reformated export statements for consistency.
  • packages/swapper/src/relay/model.ts
    • Reformated interface properties for consistency.
  • packages/swapper/src/relay/provider.test.ts
    • Reformated test descriptions and variable declarations for consistency.
  • packages/swapper/src/relay/provider.ts
    • Reformated conditional checks and error messages for consistency.
  • packages/swapper/src/stonfi/index.ts
    • Reordered import statements for better organization.
    • Reformated conditional checks and string literals for consistency.
    • Removed console.log call.
  • packages/swapper/src/stonfi/integration.test.ts
    • Reordered import statements for better organization.
    • Reformated constant declaration and function definition for consistency.
  • packages/swapper/src/testkit/mock.ts
    • Reformated object literals and function definitions for consistency.
  • packages/swapper/tsconfig.json
    • Reformated the TypeScript configuration file for consistency.
  • packages/types/jest.config.js
    • Reformated the Jest configuration file for consistency.
  • packages/types/package.json
    • Reformated the package.json file for consistency.
  • packages/types/src/asset.test.ts
    • Reformated test descriptions and string literals for consistency.
  • packages/types/src/asset.ts
    • Reformated string split and join operations for consistency.
  • packages/types/src/index.ts
    • Reformated export statements for consistency.
  • packages/types/tsconfig.json
    • Reformated the TypeScript configuration file for consistency.
  • pnpm-lock.yaml
    • Updated dependencies to include new linting and formatting tools and their related packages.
Activity
  • The pull request was created by 0xh3rman.
  • The pull request introduces new linting and formatting tools, along with updated coding style guidelines and development scripts.
  • No explicit human comments or reviews have been recorded in the provided context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces linting and formatting tools (oxlint, oxfmt, knip) to the project, which is a great step towards improving code quality and consistency. The configuration for these tools is well-defined, and many files have been reformatted accordingly.

My main feedback is about the removal of several console.warn and console.error calls, likely to satisfy the new no-console linting rule. While cleaning up console logs is generally good, in some cases, these logs provided important information for debugging failures (e.g., API errors, silent fallbacks to default values). I've left a few comments suggesting to re-introduce logging in critical error paths to maintain observability, possibly using lint-disable comments as a temporary measure.

@0xh3rman 0xh3rman changed the title Setup lint tooling Setup lint / fmt + code cleanup Feb 18, 2026
@0xh3rman 0xh3rman merged commit 6f75692 into main Feb 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant