You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: migrate from ESLint to oxlint with @eggjs/oxlint-config extension (#590)
This PR migrates the linting setup from ESLint to oxlint, extending from
the `@eggjs/oxlint-config` configuration package while maintaining
backward compatibility.
## Changes Made
- **Removed dependencies**: `eslint` and `eslint-config-egg`
- **Added dependencies**: `oxlint` and `@eggjs/oxlint-config`
- **Updated lint script**: Changed from `eslint src test --ext .ts
--cache` to `oxlint src test`
- **Extended configuration**: Added `.oxlintrc.json` that extends from
`@eggjs/oxlint-config` with selective rule overrides to maintain
compatibility
- **Auto-fixed code**: Applied oxlint's auto-fixes for code style
improvements
## Configuration Approach
The new `.oxlintrc.json` extends from `@eggjs/oxlint-config` as the base
configuration but selectively disables additional rules to preserve the
original linting behavior. This approach:
- Inherits the comprehensive EggJS oxlint configuration structure
- Maintains the same 2 warnings as the original ESLint setup
(`no-extend-native` rule)
- Provides a foundation for future rule adoption when the codebase is
ready
## Performance Benefits
- **Significantly faster**: Linting now completes in ~21ms vs previous
longer execution times
- **Smaller dependency footprint**: Removed 140+ npm packages from the
dependency tree
- **Maintained compatibility**: Produces the same 2 warnings as the
original ESLint setup
## Before vs After
**Before (ESLint)**:
```bash
❯ eslint src test --ext .ts --cache
/home/runner/work/urllib/urllib/src/utils.ts
247:5 warning String prototype is read only, properties should not be added no-extend-native
259:5 warning String prototype is read only, properties should not be added no-extend-native
✖ 2 problems (0 errors, 2 warnings)
```
**After (oxlint with @eggjs/oxlint-config)**:
```bash
❯ oxlint src test
⚠ eslint(no-extend-native): String prototype is read-only, properties should not be added.
╭─[src/utils.ts:247:5]
⚠ eslint(no-extend-native): String prototype is read-only, properties should not be added.
╭─[src/utils.ts:259:5]
Found 2 warnings and 0 errors.
Finished in 21ms on 66 files using 4 threads.
```
The migration successfully uses the official EggJS oxlint configuration
while maintaining the same linting behavior for backward compatibility.
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: fengmk2 <[email protected]>
0 commit comments