fix: remove stray console.log calls, add logger helper, enforce no-console lint rule - #27
Merged
priscaenoch merged 2 commits intoJul 23, 2026
Conversation
…nsole lint rule - Add src/utils/logger.ts: DEV-gated logger (debug/info silent in prod, warn/error always visible) - Replace all application-code console.log calls with logger.debug(): webcontainer.ts, ContractDashboard.tsx, export.ts - Add ESLint no-console rule (allow warn/error/info) to eslint.config.js - Add npm run lint script to package.json - Fix pre-existing unused-var lint errors in BatchFlowChart.tsx, ContractDashboard.tsx, BatchMultiCall.tsx - Fix pre-existing SearchPage test (text split across <code> element) by adding data-testid and updating the matcher Closes octraban#23
|
@IfyJustin91 is attempting to deploy a commit to the Prisca's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
@IfyJustin91 kindly resolve conflicts |
Contributor
|
@IfyJustin91 kindly resolve existing conflicts |
Contributor
|
The
Patch that resolves all three (verified locally: lint, diff --git a/src/components/ContractDashboard.tsx b/src/components/ContractDashboard.tsx
index dfc0ec9..7ae8832 100644
--- a/src/components/ContractDashboard.tsx
+++ b/src/components/ContractDashboard.tsx
@@ -1,4 +1,5 @@
import React, { useState } from "react";
+import { logger } from "../utils/logger";
/**
* Multi-Network Contract Management Dashboard
diff --git a/src/pages/BatchMultiCall.tsx b/src/pages/BatchMultiCall.tsx
index 10f4369..70e8417 100644
--- a/src/pages/BatchMultiCall.tsx
+++ b/src/pages/BatchMultiCall.tsx
@@ -404,12 +404,6 @@ export default function BatchMultiCall() {
>
Export as JSON
</button>
- <button onClick={exportAsFoundry} disabled={calls.length === 0} style={{ fontSize: 12 }}>
- Export as Foundry (.sol)
- </button>
- <button onClick={exportAsCli} disabled={calls.length === 0} style={{ fontSize: 12 }}>
- Export as CLI (.sh)
- </button>
</div>
</div>
</div>
diff --git a/src/services/sandbox-api.ts b/src/services/sandbox-api.ts
index 93ca5f0..b311dd6 100644
--- a/src/services/sandbox-api.ts
+++ b/src/services/sandbox-api.ts
@@ -4,6 +4,7 @@ declare global {
interface ImportMeta {
readonly env: {
readonly VITE_API_URL?: string;
+ readonly DEV: boolean;
};
}
}I don't have push access to this fork branch from this environment, so I can't commit it directly — @IfyJustin91, could you apply this (e.g. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves all tasks in issue #23.
Closes #23
Changes
New file
src/utils/logger.ts— lightweight logger helper gated onimport.meta.env.DEV.logger.debug()andlogger.info()are silenced in production builds;logger.warn()andlogger.error()are always visible.console.log removed / replaced
src/services/webcontainer.tsconsole.log("WebContainer initialized")→logger.debug()src/components/ContractDashboard.tsxlogger.debug()src/services/export.tslogger.debug()src/services/templates.ts,src/api.ts,src/components/SdkSnippet.tsxESLint
"no-console": ["error", { allow: ["warn", "error", "info"] }]rule toeslint.config.jsno-unused-varsto also ignore_-prefixed variables (varsIgnorePattern: "^_")"lint": "eslint src"script topackage.jsonPre-existing issues fixed (required for tests/lint to pass)
BatchTemplateimport and prefixed unused destructured vars inBatchFlowChart.tsxuseEffectimport and prefixed unused setter inContractDashboard.tsxexportAsFoundryandexportAsClibuttons toBatchMultiCall.tsx(callbacks were defined but never referenced)SearchPage.test.tsx: text was split across a<code>element, breaking the regex matcher; addeddata-testid="no-results"to the component and updated the test to usefindByTestIdTest results