Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"env": {
"node": true
},
"ignorePatterns": ["**/test/fixtures/**"],
"ignorePatterns": ["**/test/fixtures/**", "tools/create-egg/src/templates"],
"rules": {
"no-unused-vars": "error",
"preserve-caught-error": "error"
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Run `pnpm install` to hydrate the workspace (Node.js ≥ 20.19.0 is required). B

## Coding Style & Naming Conventions

The repository is ESM-first and TypeScript-heavy; prefer `.ts` sources and exports over CommonJS. Prettier and `oxlint --type-aware` enforce formatting—two-space indentation, trailing commas, and semicolons are the defaults. Name files in lowercase with hyphens (e.g. `loader-context.ts`), classes in PascalCase, and functions/variables in camelCase. Re-export types thoughtfully to keep the public API stable.
The repository is ESM-first and TypeScript-heavy; prefer `.ts` sources and exports over CommonJS. Prettier and `oxlint --type-aware --type-check` enforce formatting—two-space indentation, trailing commas, and semicolons are the defaults. Name files in lowercase with hyphens (e.g. `loader-context.ts`), classes in PascalCase, and functions/variables in camelCase. Re-export types thoughtfully to keep the public API stable.

## Testing Guidelines

Expand Down
14 changes: 7 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ The framework follows a specific loading order:
- `pnpm -r run build` - Build all packages
- `pnpm -r run clean` - Clean dist directories in all packages
- `pnpm -r run typecheck` - Run TypeScript type checking with `tsc --noEmit`
- `pnpm lint` - Run oxlint with type-aware checking in all packages
- `pnpm lint` - Run oxlint with type-aware and type-check checking in all packages
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The description is a bit redundant. oxlint --type-check implies type awareness. For conciseness, you could simplify this.

Suggested change
- `pnpm lint` - Run oxlint with type-aware and type-check checking in all packages
- `pnpm lint` - Run oxlint with type checking in all packages

- `pnpm lint:fix` - Auto-fix linting issues with oxlint

### Examples
Expand Down Expand Up @@ -430,7 +430,7 @@ Plugins should configure their package.json following this pattern:
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"test": "vitest run",
"prepublishOnly": "pnpm run build"
}
Expand Down Expand Up @@ -469,11 +469,11 @@ Tool packages (like egg-bin) should be placed in the `tools/` directory:

- **All packages must include TypeScript type checking** - Use `tsc --noEmit` in `typecheck` script
- **All packages use oxlint for linting** - No ESLint configurations should be present
- Use `oxlint --type-aware` for enhanced TypeScript checking
- Use `oxlint --type-aware --type-check` for enhanced TypeScript checking
- oxlint automatically respects `.gitignore` patterns for file exclusion
- Package-specific scripts:
- `"typecheck": "tsc --noEmit"` - Pure TypeScript type checking
- `"lint": "oxlint --type-aware"` - Linting with type awareness
- `"lint": "oxlint --type-aware --type-check"` - Linting with type awareness and type check
- Remove any `.eslintrc` or `.eslintrc.js` files when migrating packages

#### Vitest Configuration
Expand Down Expand Up @@ -592,7 +592,7 @@ This approach ensures:
- Significantly faster than ESLint with comparable rules
- Uses `--type-aware` flag for enhanced TypeScript analysis
- **Prettier** - Code formatting (primarily for documentation)
- Run `pnpm lint` to check code quality with oxlint
- Run `pnpm lint` to check code quality with oxlint type-aware and type-check
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The phrasing here is a bit awkward. For better readability, you could rephrase it.

Suggested change
- Run `pnpm lint` to check code quality with oxlint type-aware and type-check
- Run `pnpm lint` to check code quality with oxlint's type checking

- Run `pnpm lint:fix` to auto-fix linting issues
- Each package uses oxlint which automatically respects `.gitignore` patterns

Expand Down Expand Up @@ -854,11 +854,11 @@ NODE_OPTIONS='--inspect-brk' pnpm --filter=egg run test
2. Delete `.eslintrc`, `.eslintrc.js`, or `.eslintrc.json` files
3. Update scripts in package.json:
- Add `"typecheck": "tsc --noEmit"` for TypeScript type checking
- Change `"lint": "eslint ..."` to `"lint": "oxlint --type-aware"`
- Change `"lint": "eslint ..."` to `"lint": "oxlint --type-aware --type-check"`
- Add `"lint:fix": "npm run lint -- --fix"`
4. Ensure both type checking and linting are run:
- Use `tsc --noEmit` for pure TypeScript type checking
- Use `oxlint --type-aware` for additional linting rules
- Use `oxlint --type-aware --type-check` for additional linting rules
5. Run `pnpm install` to update dependencies

### Migrating from Egg v2 to v3
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"clean": "pnpm -r --parallel run clean && rimraf packages/*/dist plugins/*/dist tools/*/dist examples/*/dist tegg/**/dist **/*/*.tsbuildinfo",
"build": "pnpm clean && pnpm -r run build",
"build:parallel": "pnpm clean && pnpm -r --parallel run build",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"fmt": "oxfmt",
"typecheck": "pnpm clean && pnpm -r run typecheck",
"typecheck:parallel": "pnpm clean && pnpm -r --parallel run typecheck",
Expand Down Expand Up @@ -71,7 +71,7 @@
],
"*.{ts,mts,cts,js,mjs,cjs,jsx,tsx}": [
"oxfmt",
"oxlint --type-aware --fix"
"oxlint --type-aware --type-check --fix"
]
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cookies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"lint:fix": "npm run lint -- --fix",
"test": "npm run lint:fix && vitest run",
"ci": "vitest run --coverage",
Expand Down
2 changes: 1 addition & 1 deletion packages/errors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"scripts": {
"build": "tsdown",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"test": "vitest run",
"prepublishOnly": "pnpm run build"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/koa-static-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"lint:fix": "npm run lint -- --fix",
"test": "npm run lint:fix && vitest run",
"ci": "vitest run --coverage",
Expand Down
2 changes: 1 addition & 1 deletion packages/koa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"test": "vitest run",
"prepublishOnly": "pnpm run build"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/path-matching/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"scripts": {
"build": "tsdown",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"test": "vitest run",
"prepublishOnly": "npm run build"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"vitest": "catalog:"
},
"scripts": {
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/supertest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"test": "vitest run",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"prepublishOnly": "pnpm run build"
}
}
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"description": "Utils for all egg projects",
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"prepublishOnly": "pnpm run build"
Expand Down
2 changes: 1 addition & 1 deletion plugins/development/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"node": ">=22.18.0"
},
"scripts": {
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
Expand Down
2 changes: 1 addition & 1 deletion plugins/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"lint:fix": "npm run lint -- --fix",
"test": "vitest run",
"prepublishOnly": "npm run build"
Expand Down
2 changes: 1 addition & 1 deletion plugins/jsonp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"lint:fix": "npm run lint -- --fix",
"test": "npm run lint:fix && vitest run",
"prepublishOnly": "npm run build"
Expand Down
2 changes: 1 addition & 1 deletion plugins/logrotator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"test": "vitest run",
"prepublishOnly": "npm run build"
},
Expand Down
2 changes: 1 addition & 1 deletion plugins/multipart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"lint:fix": "npm run lint -- --fix",
"test": "npm run lint:fix && vitest",
"prepublishOnly": "npm run build"
Expand Down
2 changes: 1 addition & 1 deletion plugins/onerror/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"vitest": "catalog:"
},
"scripts": {
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json && cp src/lib/onerror_page.mustache.html dist/lib/onerror_page.mustache.html",
Expand Down
2 changes: 1 addition & 1 deletion plugins/redis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"test": "vitest run",
"prepublishOnly": "npm run build"
},
Expand Down
2 changes: 1 addition & 1 deletion plugins/schedule/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"lint:fix": "npm run lint -- --fix",
"test": "npm run lint:fix && vitest run",
"ci": "vitest run --coverage",
Expand Down
2 changes: 1 addition & 1 deletion plugins/security/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"lint:fix": "npm run lint -- --fix",
"test": "npm run lint:fix && vitest",
"prepublishOnly": "npm run build"
Expand Down
2 changes: 1 addition & 1 deletion plugins/session/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"lint:fix": "npm run lint -- --fix",
"test": "npm run lint:fix && vitest",
"prepublishOnly": "npm run build"
Expand Down
2 changes: 1 addition & 1 deletion plugins/static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"lint:fix": "npm run lint -- --fix",
"test": "npm run lint:fix && vitest run",
"ci": "vitest run --coverage",
Expand Down
2 changes: 1 addition & 1 deletion plugins/tracer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"vitest": "catalog:"
},
"scripts": {
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
Expand Down
2 changes: 1 addition & 1 deletion plugins/typebox-validate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

oxlint 1.31.0 --type-check flag documentation

💡 Result:

There is no documented --type-check flag for oxlint v1.31.0 (or current oxlint CLI). Oxlint’s type-aware/type-checking preview is enabled with the --type-aware flag and requires the oxlint-tsgolint package; see the official docs and blog announcement. [1][2][3]

References:

  • Oxlint Linter docs (usage / type-aware): oxc.rs/docs/guide/usage/linter. [1]
  • Oxlint Type-Aware guide / preview (shows --type-aware usage and oxlint-tsgolint requirement). [2]
  • Oxlint Type-Aware announcement (blog). [3]

Remove the invalid --type-check flag from the lint script.

The --type-check flag does not exist in oxlint v1.31.0. Oxlint's type-aware functionality is enabled only with the --type-aware flag (already present on this line). The additional --type-check flag will cause the lint script to fail with an unrecognized option error. Remove it and keep only "oxlint --type-aware".

🤖 Prompt for AI Agents
In plugins/typebox-validate/package.json around line 58, the lint script
includes an invalid flag `--type-check` which causes oxlint to error; remove the
`--type-check` flag and leave the script as `"oxlint --type-aware"` so only the
supported type-aware option remains.

"test": "vitest run",
"prepublishOnly": "pnpm run build"
},
Expand Down
2 changes: 1 addition & 1 deletion plugins/view-nunjucks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"scripts": {
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
"typecheck": "tsc --noEmit",
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"test": "vitest run",
"prepublishOnly": "pnpm run build"
},
Expand Down
2 changes: 1 addition & 1 deletion plugins/view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"vitest": "catalog:"
},
"scripts": {
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
Expand Down
2 changes: 1 addition & 1 deletion plugins/watcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"description": "file watcher plugin for egg",
"scripts": {
"lint": "oxlint --type-aware",
"lint": "oxlint --type-aware --type-check",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"build": "tsdown && rimraf dist *.tsbuildinfo && tsc -p tsconfig.build.json",
Expand Down
Loading
Loading