chore: use @eggjs/oxlint-config extends .oxlintrc.json
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-configas a dev dependency -
Upgraded oxlint: Updated from
^0.16.10to^1.11.1for latest v1 features and improvements -
Simplified configuration: Reduced
.oxlintrc.jsonfrom ~140 lines to 12 lines by extending the shared config -
Preserved project-specific settings:
-
env.node: trueandenv.mocha: truefor Node.js and test environment globals - Custom
ignorePatternsfor 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.jsonto.gitignore -
Removed from tracking:
package-lock.jsonis 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.jsonis 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.