feat: migrate from eslint to oxlint#2130
Conversation
Greptile SummaryThis PR replaces ESLint (and its typescript-eslint / react-hooks plugin stack) with oxlint, adding a custom
Confidence Score: 4/5Safe 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).
|
| 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]
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
No description provided.