graceful-process icon indicating copy to clipboard operation
graceful-process copied to clipboard

chore: use @eggjs/oxlint-config extends .oxlintrc.json

Open Copilot opened this issue 5 months ago • 3 comments

This PR simplifies the oxlint configuration by extending the shared @eggjs/oxlint-config instead of maintaining a comprehensive manual configuration, updates the project to follow Node.js library best practices by not tracking package-lock.json, and upgrades to the latest oxlint v1 for improved performance and features.

Changes Made

Oxlint Configuration:

  • Added dependency: @eggjs/oxlint-config as a dev dependency
  • Upgraded oxlint: Updated from ^0.16.10 to ^1.11.1 for latest v1 features and improvements
  • Simplified configuration: Reduced .oxlintrc.json from ~140 lines to 12 lines by extending the shared config
  • Preserved project-specific settings:
    • env.node: true and env.mocha: true for Node.js and test environment globals
    • Custom ignorePatterns for project-specific files (index.d.ts, test/fixtures/**, __snapshots__)
    • Override no-empty-function: "allow" to maintain current project behavior

Package Lock Management:

  • Updated .gitignore: Added package-lock.json to .gitignore
  • Removed from tracking: package-lock.json is no longer committed to the repository, following Node.js library best practices

Benefits

  • Latest oxlint: Now using oxlint v1.11.1 with improved performance and latest features
  • Maintainability: Configuration is now centrally managed in @eggjs/oxlint-config
  • Consistency: Aligns with other eggjs projects using the same shared configuration
  • Automatic updates: Future rule updates in the shared config will be automatically inherited
  • Reduced maintenance: No need to manually sync rule changes across projects
  • Better workflow: Library consumers can get the latest compatible dependency versions without lock file constraints

Validation

  • ✅ All existing tests pass
  • ✅ Linting works correctly with oxlint v1.11.1
  • ✅ Build and type checking continue to work without issues
  • ✅ Project-specific overrides are properly applied
  • package-lock.json is properly ignored by git

The configuration now extends from @eggjs/oxlint-config while preserving the minimal project-specific customizations needed for this repository.


💡 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 avatar Aug 09 '25 12:08 Copilot