Skip to content

fix(lint): resolve ESLint errors introduced by #1564#1634

Merged
cv merged 2 commits intomainfrom
fix/main-eslint-errors
Apr 8, 2026
Merged

fix(lint): resolve ESLint errors introduced by #1564#1634
cv merged 2 commits intomainfrom
fix/main-eslint-errors

Conversation

@cv
Copy link
Copy Markdown
Contributor

@cv cv commented Apr 8, 2026

Summary

Fixes the broken main build caused by two ESLint errors from #1564:

  • test/onboard.test.js:597__dirname is not defined in ESM. Replaced with import.meta.dirname.
  • bin/lib/onboard.js:424@typescript-eslint/no-require-imports rule doesn't exist in the CJS ESLint config. Removed the unnecessary disable comment (require is valid in CJS).

Test plan

  • CI checks job passes (ESLint CLI step)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved preflight error output for insufficient runtime version — clearer, multi-line removal instruction for easier copy/paste.
  • Chores

    • Minor internal formatting and cleanup with no behavioral changes.
  • Tests

    • Updated test harness and formatting to align with codebase style.

- test/onboard.test.js: replace __dirname with import.meta.dirname
  (test files are ESM, __dirname is CJS-only)
- bin/lib/onboard.js: remove @typescript-eslint/no-require-imports
  disable comment (rule doesn't exist in CJS ESLint config, require
  is valid in CJS)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fa6d26c1-52d8-432d-8eac-8f1ce26ebd01

📥 Commits

Reviewing files that changed from the base of the PR and between e4c03a0 and ad1aaf0.

📒 Files selected for processing (2)
  • bin/lib/onboard.js
  • test/onboard.test.js
✅ Files skipped from review due to trivial changes (1)
  • bin/lib/onboard.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/onboard.test.js

📝 Walkthrough

Walkthrough

Removed an inline ESLint disable in bin/lib/onboard.js, altered its preflight failure output to print a wrapped explanatory line plus a quoted rm command, and updated test/onboard.test.js to use import.meta.dirname (plus minor test formatting edits).

Changes

Cohort / File(s) Summary
Onboard script changes
bin/lib/onboard.js
Removed // eslint-disable-next-line ... before require("yaml"); changed preflight failure output from two single-line console.error calls to a multi-line message: first line prints the wrapped “Or remove…” text, second prints the command -v openshell && rm -f "$(command -v openshell)" instruction as a single-quoted JS string.
Test updates & formatting
test/onboard.test.js
Reformatted several fs.mkdtempSync/fs.writeFileSync call argument layouts; condensed one writeFileSync call; changed repo root resolution from path.resolve(__dirname, "..") to path.resolve(import.meta.dirname, "..").

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A lint line hopped away today,
Error lines now split and say,
Tests woke up with modern ways,
import.meta guides the maze—
I nibble change and twitch with play. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main objective: resolving ESLint errors introduced by PR #1564. Both key fixes (replacing __dirname with import.meta.dirname and removing an invalid ESLint disable comment) are correctly captured by this summary.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/main-eslint-errors

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

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cv cv enabled auto-merge (squash) April 8, 2026 22:04
Copy link
Copy Markdown
Contributor

@ericksoa ericksoa left a comment

Choose a reason for hiding this comment

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

LGTM — fixes broken main build. ESM __dirname → import.meta.dirname, removes stale eslint-disable comment, Prettier reformatting.

@cv cv merged commit 3b6f657 into main Apr 8, 2026
11 checks passed
@cv cv deleted the fix/main-eslint-errors branch April 8, 2026 22:08
TSavo added a commit to TSavo/NemoClaw that referenced this pull request Apr 8, 2026
`scripts/benchmark-sandbox-image-build.js` had line-length drift between
the source and the project's prettier config. `npx prettier --check`
would warn on it, and the prek pre-push hook auto-fixed it on every
contributor's machine — which then triggered the framework's
"Files were modified by following hooks" failure path, blocking the
push for any contributor whose own diff was unrelated.

This is the residual fix for NVIDIA#1636 after NVIDIA#1634 already cleaned up the
ESLint and prettier drift in `bin/lib/onboard.js` and `test/onboard.test.js`.
The benchmark script wasn't covered by NVIDIA#1634's sweep, so it's still the
last file failing `prettier --check` on stock `main`.

`prettier --write` produced a handful of `execFileSync(...)` and
`run(...)` argument wraps. No semantic change — same calls, same args,
same control flow, just line-broken to comply with the configured max
width.

Refs NVIDIA#1636.

Signed-off-by: T Savo <evilgenius@nefariousplan.com>
cv pushed a commit that referenced this pull request Apr 8, 2026
….js (#1637)

<!-- markdownlint-disable MD041 -->
## Summary

Residual fix for #1636 after #1634 cleaned up the ESLint and prettier
drift in `bin/lib/onboard.js` and `test/onboard.test.js`. The benchmark
script wasn't covered by that sweep, so it's the last file failing
`prettier --check` on stock `main`.

## Related Issue

Refs #1636 (#1634 already handled the other two findings — this closes
out the residual).

## Changes

- `scripts/benchmark-sandbox-image-build.js`: handful of
`execFileSync(...)` and `run(...)` argument wraps. No semantic change —
same calls, same args, same control flow, just line-broken to comply
with the configured prettier max width.

Diff: +26 / −6 in 1 file.

## Type of Change

- [x] Code change for a new feature, bug fix, or refactor.
- [ ] Code change with doc updates.
- [ ] Doc only. Prose changes without code sample modifications.
- [ ] Doc only. Includes code sample changes.

## Testing

- [x] `npx prettier --check scripts/benchmark-sandbox-image-build.js`
clean
- [x] `npx prettier --check bin/lib/onboard.js test/onboard.test.js
scripts/benchmark-sandbox-image-build.js` — all 3 files now clean (the
first two were fixed by #1634)
- [x] `node --check scripts/benchmark-sandbox-image-build.js` clean
- [x] Re-running the prek pre-push gate with `prettier-js,shfmt` no
longer surfaces any auto-fix in this file (verified by amending an
unrelated branch and re-pushing on a fresh clone)
- [ ] Upstream CI (will run on PR open)

## Checklist

### General

- [x] I have read and followed the [contributing
guide](https://github.com/NVIDIA/NemoClaw/blob/main/CONTRIBUTING.md).
- [ ] I have read and followed the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md).
(for doc-only changes — N/A)

### Code Changes

- [x] Formatters applied — this PR *is* the formatter output.
- [x] Tests added or updated for new or changed behavior — N/A,
formatting-only.
- [x] No secrets, API keys, or credentials committed.
- [ ] Doc pages updated for any user-facing behavior changes — N/A, no
behavior change.

### Doc Changes

- N/A (no doc changes)

---
Signed-off-by: T Savo <evilgenius@nefariousplan.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
  * Internal script formatting improvements with no functional changes.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: T Savo <evilgenius@nefariousplan.com>
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.

2 participants