Description
pnpm lint (and the pre-commit lint-staged hook) in apps/apollo has been failing at oxlint config load with:
Failed to load JS plugin: .../apps/apollo/oxlint-rules/require_v31_tool_route_plugin.js
SyntaxError: Cannot use import statement outside a module
Root cause: every file in apps/apollo/oxlint-rules/ uses ESM (import/export), but Node was loading them as CommonJS because:
- The nearest
package.json (apps/apollo/package.json) has no "type": "module".
- The plugin files have
.js extensions (not .mjs).
Fix: add a one-line package.json inside apps/apollo/oxlint-rules/ declaring { "type": "module" }. This scopes the ESM declaration to just that directory — no file renames, and the rest of Apollo continues to default to CJS with .mjs for its config files.
Because oxlint was never actually running, the project has been silently accumulating lint debt — re-enabling it surfaces real findings (1 warning, 3 errors on master, all pre-existing and unrelated to this PR) that should now be addressed separately.
How did I test this PR
- Reproduced the original failure on
master with pnpm --filter @composio/apollo lint — got the Failed to load JS plugin error.
- Applied the fix and re-ran
pnpm --filter @composio/apollo lint — now completes in ~12s across 1158 files and reports real findings instead of failing at config load.
- Verified the scoped
package.json does not affect anything outside apps/apollo/oxlint-rules/ (no other code in that directory; all 20 rule files already use ESM syntax).
🤖 Generated with Claude Code