Skip to content

feat: migrate from eslint to oxlint#2130

Merged
jschwxrz merged 2 commits into
mainfrom
chore-migrate-eslint-to-oxlint
May 19, 2026
Merged

feat: migrate from eslint to oxlint#2130
jschwxrz merged 2 commits into
mainfrom
chore-migrate-eslint-to-oxlint

Conversation

@jschwxrz
Copy link
Copy Markdown
Collaborator

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 19, 2026

Greptile Summary

This PR replaces ESLint (and its typescript-eslint / react-hooks plugin stack) with oxlint, adding a custom emdash/no-tooling-imports plugin to preserve the @tooling import restriction. All eslint-disable-next-line comments in source files are updated to their oxlint-disable-next-line equivalents.

  • The .oxlintrc.json faithfully mirrors the rule set from the deleted eslint.config.ts, including per-directory overrides for type-aware rules and test-file relaxations.
  • Two react-hooks/incompatible-library suppressions are correctly dropped since oxlint has no equivalent rule.
  • The react-hooks/set-state-in-effect suppression in App.tsx is also cleanly removed.

Confidence Score: 4/5

Safe to merge; the migration is mechanical and the rule set is faithfully reproduced with only minor housekeeping items outstanding.

The tooling swap is straightforward and the oxlint configuration closely mirrors the old ESLint setup. The two minor issues have no impact on production behavior.

tooling/oxlint-plugin.js (message vs messageId inconsistency) and src/renderer/_legacy/useTerminalSelection.ts (removed suppression comments that may generate new lint warnings).

Important Files Changed

Filename Overview
.oxlintrc.json New oxlint configuration file matching the rule set from the deleted eslint.config.ts; overrides correctly mirrored.
tooling/oxlint-plugin.js Custom oxlint plugin implementing emdash/no-tooling-imports. Logic correct but meta.messages.restricted is never referenced.
package.json ESLint ecosystem packages removed, oxlint and oxlint-tsgolint added; lint script and lint-staged updated.
src/renderer/_legacy/useTerminalSelection.ts Two exhaustive-deps suppression comments removed without oxlint equivalents; will produce live warnings.
CONTRIBUTING.md Documentation updated from ESLint to oxlint references throughout.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Developer commits staged files] --> B[lint-staged runs]
    B --> C[prettier --write]
    B --> D[oxlint --fix]
    D --> E{Rule violations?}
    E -- error --> F[Commit blocked]
    E -- warn only --> G[Commit proceeds]
    E -- none --> H[Commit succeeds]
    I[pnpm run lint] --> J[oxlint .]
    J --> K[.oxlintrc.json]
    K --> L[Built-in rules]
    K --> M[tooling/oxlint-plugin.js]
    M --> N[emdash/no-tooling-imports]
    K --> O[Overrides per file glob]
Loading
Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
tooling/oxlint-plugin.js:23-26
**`meta.messages` definition is dead code**

The `messages` map defines a `restricted` key but `context.report()` uses `message:` (a direct string) rather than `messageId: 'restricted'`. The `messages` block is never actually referenced, so it currently has no effect. Either switch the `report()` call to `messageId: 'restricted'`, or remove the unused `messages` block from `meta`.

### Issue 2 of 3
tooling/oxlint-plugin.js:11-14
Use `messageId: 'restricted'` to reference the pre-defined message, so `meta.messages` isn't dead code and the message string is defined in one place.

```suggestion
  context.report({
    node,
    messageId: 'restricted',
  });
```

### Issue 3 of 3
src/renderer/_legacy/useTerminalSelection.ts:139-144
**Removed exhaustive-deps suppressions leave live warnings**

Two `eslint-disable-next-line react-hooks/exhaustive-deps` comments were removed without adding `// oxlint-disable-next-line react/exhaustive-deps` equivalents. Since `react/exhaustive-deps` is configured as `"warn"`, oxlint will now emit warnings for both of these dependency arrays on every lint run.

Reviews (1): Last reviewed commit: "feat: migrate from eslint to oxlint" | Re-trigger Greptile

Comment thread tooling/oxlint-plugin.js
Comment thread tooling/oxlint-plugin.js
Comment thread src/renderer/_legacy/useTerminalSelection.ts
@jschwxrz jschwxrz merged commit 60f4b59 into main May 19, 2026
1 check 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