Skip to content

chore: add eslint config and non-interactive lint checks#34

Open
arunabha003 wants to merge 1 commit into
StabilityNexus:mainfrom
arunabha003:orb-eslint-setup
Open

chore: add eslint config and non-interactive lint checks#34
arunabha003 wants to merge 1 commit into
StabilityNexus:mainfrom
arunabha003:orb-eslint-setup

Conversation

@arunabha003
Copy link
Copy Markdown

@arunabha003 arunabha003 commented Mar 26, 2026

Addressed Issues:

Fixes #33

Summary

  • add committed ESLint configuration for the Next.js app
  • install the missing lint dependencies
  • make npm run lint non-interactive with --no-cache
  • fix current lint-blocking issues so lint can run in CI and local development
  • keep existing warnings visible without failing the command

Validation

  • npm run lint
  • npm run build

Screenshots/Recordings:

Screenshot 2026-03-27 at 1 24 46 AM

Additional Notes:

AI Usage Disclosure:

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: TODO

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

  • Bug Fixes

    • Improved error messages displayed to users during failed transactions.
    • Fixed text rendering for apostrophes and quotation marks in UI components.
  • Chores

    • Added ESLint configuration and dependencies to enhance code quality tooling.
    • Updated lint script to run without cache.
  • Removed Features

    • Removed logo hover animation effect.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 26, 2026

📝 Walkthrough

Walkthrough

This PR establishes ESLint configuration to enable linting without interactive setup, improves error handling in contract interactions with stricter typing, removes unused component props and state, fixes HTML entity escaping in JSX text, and simplifies type definitions.

Changes

Cohort / File(s) Summary
ESLint Configuration & Dependencies
.eslintignore, .eslintrc.json, package.json
Added ESLint config files specifying ignored paths and Next.js presets (next/core-web-vitals, next/typescript). Updated lint script to disable caching and added eslint and eslint-config-next as pinned devDependencies.
Error Handling & Contract State Management
app/[oracleId]/InteractionClient.tsx, components/createOracle.tsx
Introduced describeError() helper for normalized error messaging. Changed catch blocks from any to unknown typing. Removed unused tokenAllowance state. Updated useOracle conditional wiring and added early validation guard.
Component Prop & State Cleanup
components/TokenSelector.tsx, components/PillNav.tsx
Removed optional label and required props from TokenSelectorProps. Removed logo-hover animation refs and handler (logoImgRef, logoTweenRef, handleLogoEnter) from PillNav.
HTML Entity & Text Escaping
components/KyaModal.tsx, app/explorer/page.tsx
Replaced plain apostrophes and quotation marks with HTML entities (', ") within JSX text content for correct rendering.
Type Definition Simplification
components/ui/use-toast.ts
Removed actionTypes constant and derived ActionType alias, replacing with direct string literal types (`'ADD_TOAST'
Import Cleanup
app/[oracleId]/page.tsx
Removed unused notFound import from next/navigation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through config files with glee,
ESLint now runs without prompts, wild and free!
Error-catching improved, apostrophes escaped,
Unused logic trimmed—the codebase reshaped!
Lint away, lint away, no setup in sight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objectives: adding ESLint configuration and making lint checks non-interactive.
Linked Issues check ✅ Passed All coding requirements from issue #33 are met: ESLint config added, lint dependencies installed, and --no-cache flag makes lint non-interactive.
Out of Scope Changes check ✅ Passed While the PR includes fixes for lint-blocking issues and code improvements beyond minimal configuration, these are justified as necessary to enable CI/local lint execution.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/`[oracleId]/InteractionClient.tsx:
- Line 154: The useOracle call is still triggering fallback-chain reads when
chainId is invalid; change the arguments so the oracle address is only passed
when chainIdValid is true. Specifically, update the call using the useOracle
symbol to something like: pass oracleAddress only if chainIdValid &&
oracleAddress are truthy, otherwise pass an empty string (or undefined per
useOracle's expected input), and continue to pass chainId only when chainIdValid
is true; apply the same gating wherever useOracle (and any other reads using
oracleAddress) are invoked (e.g., the other occurrences around the component
rendering invalid-params).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d25ce6db-e58a-464f-beeb-93040118a99b

📥 Commits

Reviewing files that changed from the base of the PR and between bb0bf2b and fe307d3.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (11)
  • .eslintignore
  • .eslintrc.json
  • app/[oracleId]/InteractionClient.tsx
  • app/[oracleId]/page.tsx
  • app/explorer/page.tsx
  • components/KyaModal.tsx
  • components/PillNav.tsx
  • components/TokenSelector.tsx
  • components/createOracle.tsx
  • components/ui/use-toast.ts
  • package.json
💤 Files with no reviewable changes (3)
  • app/[oracleId]/page.tsx
  • components/PillNav.tsx
  • components/TokenSelector.tsx

const { isLoading: isConfirming, isSuccess: isConfirmed } = useWaitForTransactionReceipt({
hash,
})
const { oracle, loading: oracleLoading, error: oracleError } = useOracle(oracleAddress ?? "", chainIdValid ? chainId : undefined)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Prevent fallback-chain reads when query params are invalid.

At Line 154, useOracle(oracleAddress ?? "", chainIdValid ? chainId : undefined) can still trigger reads on the connected chain when oracleAddress is valid but chainId is invalid, even though Line 971 renders the invalid-params state. Gate the address by chainIdValid too.

💡 Proposed fix
-  const { oracle, loading: oracleLoading, error: oracleError } = useOracle(oracleAddress ?? "", chainIdValid ? chainId : undefined)
+  const shouldLoadOracle = !!oracleAddress && chainIdValid
+  const { oracle, loading: oracleLoading, error: oracleError } = useOracle(
+    shouldLoadOracle ? oracleAddress : "",
+    shouldLoadOracle ? chainId : undefined
+  )

-  const hasInvalidParams = !oracleAddress || !chainIdValid
+  const hasInvalidParams = !shouldLoadOracle

Also applies to: 367-367, 971-997

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/`[oracleId]/InteractionClient.tsx at line 154, The useOracle call is
still triggering fallback-chain reads when chainId is invalid; change the
arguments so the oracle address is only passed when chainIdValid is true.
Specifically, update the call using the useOracle symbol to something like: pass
oracleAddress only if chainIdValid && oracleAddress are truthy, otherwise pass
an empty string (or undefined per useOracle's expected input), and continue to
pass chainId only when chainIdValid is true; apply the same gating wherever
useOracle (and any other reads using oracleAddress) are invoked (e.g., the other
occurrences around the component rendering invalid-params).

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.

[BUG]: npm run lint triggers interactive setup instead of running checks

1 participant