Skip to content

Conversation

Copy link

Copilot AI commented Aug 31, 2025

Refactored the oxlint configuration to extend from the shared @eggjs/oxlint-config package and upgraded to oxlint v1 with enhanced type-aware linting capabilities.

Configuration Simplification

  • Added dependency: @eggjs/oxlint-config as a dev dependency
  • Simplified configuration: Reduced .oxlintrc.json from 142 lines to 13 lines (90% reduction)
  • Used extends mechanism: Now extends from ./node_modules/@eggjs/oxlint-config/.oxlintrc.json
  • Project-specific overrides: Only override the minimal settings needed for this project:
    • Added mocha: true to environment (in addition to inherited node: true)
    • Set no-console to "warn" instead of default
    • Allow import/no-unassigned-import for type augmentation imports
    • Maintain project-specific ignore patterns

Oxlint v1 Upgrade with Type-Aware Features

  • Upgraded oxlint: From ^0.16.2 to ^1.14.0
  • Added type-aware dependency: oxlint-tsgolint for enhanced TypeScript linting
  • Enabled type-aware linting: Added --type-aware and --tsconfig=./tsconfig.json flags to CLI
  • Enhanced linting coverage: Type-aware rules now detect additional TypeScript issues using project's tsconfig.json
  • Consistent configuration: Updated both lint script and lint-staged to use type-aware features

Before

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "env": { "node": true, "mocha": true },
  "categories": { /* 7 categories */ },
  "plugins": [ /* 7 plugins */ ],
  "rules": { /* 100+ rules */ },
  "ignorePatterns": [ /* patterns */ ]
}

After

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "extends": ["./node_modules/@eggjs/oxlint-config/.oxlintrc.json"],
  "env": { "node": true, "mocha": true },
  "rules": {
    "no-console": "warn",
    "import/no-unassigned-import": "allow"
  },
  "ignorePatterns": ["index.d.ts", "test/fixtures/**", "__snapshots__"]
}

Benefits

  • Reduced maintenance: No need to manually sync rule changes across projects
  • Consistency: Ensures all EggJS projects use the same base linting rules
  • Enhanced type safety: Type-aware linting catches additional TypeScript issues
  • Clarity: Easy to see what's project-specific vs shared configuration
  • Auto-fixes applied: Fixed multiple linting violations automatically

The enhanced type-aware linting now detects additional code quality issues that were previously not caught, improving overall code quality and TypeScript type safety.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@socket-security
Copy link

socket-security bot commented Aug 31, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedoxlint-tsgolint@​0.1.5881005293100
Added@​eggjs/​oxlint-config@​1.0.0701007992100
Updatedoxlint@​0.16.12 ⏵ 1.14.090 -110084 +196 +1100

View full report

Copilot AI changed the title [WIP] use @eggjs/oxlint-config extends .oxlintrc.json use @eggjs/oxlint-config extends .oxlintrc.json Aug 31, 2025
Copilot AI requested a review from fengmk2 August 31, 2025 04:55
"@arethetypeswrong/cli": "^0.17.4",
"@eggjs/bin": "7",
"@eggjs/mock": "^6.0.5",
"@eggjs/oxlint-config": "^1.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot update oxlint to v1 and enable type-aware feature on cli

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated oxlint to v1.14.0 and enabled type-aware features. Added oxlint-tsgolint dependency and configured --type-aware and --tsconfig flags in CLI scripts. The enhanced type-aware linting now detects additional TypeScript issues using the project's tsconfig.json. (f81f26b)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 31, 2025

Open in StackBlitz

npm i https://pkg.pr.new/eggjs/redis/@eggjs/redis@51

commit: b71507b

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 31, 2025

Open in StackBlitz

npm i https://pkg.pr.new/eggjs/redis/@eggjs/redis@51

commit: b71507b

@codecov
Copy link

codecov bot commented Aug 31, 2025

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.64%. Comparing base (9900e87) to head (b71507b).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/lib/redis.ts 16.66% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master      #51   +/-   ##
=======================================
  Coverage   82.64%   82.64%           
=======================================
  Files           4        4           
  Lines         242      242           
  Branches       17       17           
=======================================
  Hits          200      200           
  Misses         42       42           

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

- Upgraded oxlint from ^0.16.2 to ^1.14.0
- Added oxlint-tsgolint dependency for type-aware linting
- Enabled --type-aware and --tsconfig flags in lint scripts
- Updated lint-staged configuration for consistent type-aware linting
- Type-aware linting now detects additional TypeScript issues

Co-authored-by: fengmk2 <[email protected]>
Copilot AI changed the title use @eggjs/oxlint-config extends .oxlintrc.json Use @eggjs/oxlint-config extends and upgrade to oxlint v1 with type-aware linting Aug 31, 2025
Copilot AI requested a review from fengmk2 August 31, 2025 05:41
@fengmk2 fengmk2 closed this Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants