Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 9, 2025

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):

❯ 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):

❯ 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.


💡 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 in the docs.

Copilot AI changed the title [WIP] use oxlient and @eggjs/oxlint-config instead of eslint Migrate from ESLint to oxlint and @eggjs/oxlint-config Aug 9, 2025
Copilot AI requested a review from fengmk2 August 9, 2025 07:20
Copilot finished work on behalf of fengmk2 August 9, 2025 07:20
@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 9, 2025

Open in StackBlitz

npm i https://pkg.pr.new/node-modules/urllib@590

commit: e2d80e3

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 9, 2025

Open in StackBlitz

npm i https://pkg.pr.new/node-modules/urllib@590

commit: bf20695

@codecov
Copy link

codecov bot commented Aug 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.27%. Comparing base (54aa22a) to head (e2d80e3).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #590   +/-   ##
=======================================
  Coverage   95.27%   95.27%           
=======================================
  Files          11       11           
  Lines        1377     1377           
  Branches      316      317    +1     
=======================================
  Hits         1312     1312           
  Misses         61       61           
  Partials        4        4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI changed the title Migrate from ESLint to oxlint and @eggjs/oxlint-config Migrate from ESLint to oxlint with @eggjs/oxlint-config extension Aug 9, 2025
Copilot AI requested a review from fengmk2 August 9, 2025 07:51
Copilot finished work on behalf of fengmk2 August 9, 2025 07:51
@fengmk2 fengmk2 changed the title Migrate from ESLint to oxlint with @eggjs/oxlint-config extension chore: migrate from ESLint to oxlint with @eggjs/oxlint-config extension Aug 9, 2025
@fengmk2 fengmk2 marked this pull request as ready for review August 9, 2025 12:01
@coderabbitai
Copy link

coderabbitai bot commented Aug 9, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Join our Discord community for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@fengmk2 fengmk2 merged commit 1ae3fd7 into master Aug 9, 2025
25 checks passed
@fengmk2 fengmk2 deleted the copilot/fix-ebec2c8d-3713-44ab-9fd1-bdb050f479d6 branch August 9, 2025 12:03
fengmk2 pushed a commit that referenced this pull request Aug 12, 2025
[skip ci]

## <small>4.8.2 (2025-08-12)</small>

* fix: enumerable WellFormed ([0b1e89d](0b1e89d))
* chore: ignore pnpm-lock.yaml ([3cc8971](3cc8971))
* chore: migrate from ESLint to oxlint with @eggjs/oxlint-config extension (#590) ([1ae3fd7](1ae3fd7)), closes [#590](#590)
* chore: typo fix on release task name ([54aa22a](54aa22a))
@github-actions
Copy link

🎉 This PR is included in version 4.8.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants