Skip to content

Conversation

@iiio2
Copy link
Contributor

@iiio2 iiio2 commented Nov 3, 2025

@danielroe , I've updated eslint config. if we run pnpm lint then it shows some error for process or performance if not explicitly imported.

@iiio2 iiio2 requested a review from danielroe as a code owner November 3, 2025 15:05
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link

coderabbitai bot commented Nov 3, 2025

Walkthrough

Adds a local ESLint rule in eslint.config.mjs that forbids implicit use of the process and performance globals in package source files (packages/**/*.ts, .mts, .js, .mjs excluding client variants), requiring explicit imports from node:process and node:perf_hooks. Numerous files across packages are updated to add explicit import process from 'node:process' or import { performance } from 'node:perf_hooks'. Additionally, packages/nitro-server/src/runtime/utils/cache.ts introduces new exported caches and in-flight promise tracking gated by import.meta.prerender and process.env.NUXT_SHARED_DATA.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Changes are mostly repetitive import additions and a single ESLint rule addition (low per-file complexity).
  • One file (packages/nitro-server/src/runtime/utils/cache.ts) introduces new exported cache objects and async coordination logic — requires focused review.
  • Pay extra attention to:
    • packages/nitro-server/src/runtime/utils/cache.ts (new shared cache/promises logic, correctness, concurrency, edge cases)
    • eslint.config.mjs (rule targets and file globs to ensure intended scope)
    • Any modules where imports of process/performance were added and then used (ensure named/default import semantics are correct).

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description is related to the changeset, explaining that the ESLint configuration was updated to enforce explicit imports of process and performance globals.
Title check ✅ Passed The title accurately summarises the main change: explicitly importing process and performance modules across multiple packages (kit, nitro, nuxt, schema, vite).
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
eslint.config.mjs (1)

150-184: Fix indentation and formatting.

The indentation throughout this rule block is inconsistent. Ensure consistent 2-space indentation and proper bracket alignment.

Note: This may be automatically fixed by running pnpm lint --fix if stylistic rules are enabled.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b5fa5d and 985438b.

📒 Files selected for processing (1)
  • eslint.config.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: nuxt/nuxt PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T16:46:07.446Z
Learning: Applies to **/*.{ts,tsx} : Follow standard TypeScript conventions and best practices
📚 Learning: 2025-07-18T16:46:07.446Z
Learnt from: CR
Repo: nuxt/nuxt PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T16:46:07.446Z
Learning: Applies to **/*.{ts,tsx} : Follow standard TypeScript conventions and best practices

Applied to files:

  • eslint.config.mjs
📚 Learning: 2024-11-28T21:22:40.496Z
Learnt from: GalacticHypernova
Repo: nuxt/nuxt PR: 29661
File: packages/kit/src/template.ts:227-229
Timestamp: 2024-11-28T21:22:40.496Z
Learning: In `packages/kit/src/template.ts`, when updating the `EXTENSION_RE` regular expression for TypeScript configuration, avoid using patterns like `(\.\w+)+$` as they can result in catastrophic backtracking.

Applied to files:

  • eslint.config.mjs
📚 Learning: 2025-07-18T16:46:07.446Z
Learnt from: CR
Repo: nuxt/nuxt PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-18T16:46:07.446Z
Learning: Applies to **/*.vue : Use `<script setup lang="ts">` and the composition API when creating Vue components

Applied to files:

  • eslint.config.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: code
  • GitHub Check: codeql (actions)
  • GitHub Check: build

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 3, 2025

Open in StackBlitz

@nuxt/kit

npm i https://pkg.pr.new/@nuxt/kit@33650

nuxt

npm i https://pkg.pr.new/nuxt@33650

@nuxt/rspack-builder

npm i https://pkg.pr.new/@nuxt/rspack-builder@33650

@nuxt/schema

npm i https://pkg.pr.new/@nuxt/schema@33650

@nuxt/vite-builder

npm i https://pkg.pr.new/@nuxt/vite-builder@33650

@nuxt/webpack-builder

npm i https://pkg.pr.new/@nuxt/webpack-builder@33650

commit: f6e32f8

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 3, 2025

CodSpeed Performance Report

Merging #33650 will not alter performance

Comparing iiio2:chore/update-eslint (f6e32f8) with main (1cc5393)1

Summary

✅ 10 untouched

Footnotes

  1. No successful run was found on main (0b5fa5d) during the generation of this report, so 1cc5393 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ecb7416 and ee01867.

📒 Files selected for processing (4)
  • eslint.config.mjs (2 hunks)
  • packages/nuxt/src/app/plugins/browser-devtools-timing.client.ts (1 hunks)
  • packages/nuxt/src/core/app.ts (1 hunks)
  • packages/vite/src/vite.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/nuxt/src/core/app.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • eslint.config.mjs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Follow standard TypeScript conventions and best practices

Files:

  • packages/vite/src/vite.ts
  • packages/nuxt/src/app/plugins/browser-devtools-timing.client.ts
🧠 Learnings (1)
📓 Common learnings
Learnt from: huang-julien
Repo: nuxt/nuxt PR: 29366
File: packages/nuxt/src/app/components/nuxt-root.vue:16-19
Timestamp: 2024-12-12T12:36:34.871Z
Learning: In `packages/nuxt/src/app/components/nuxt-root.vue`, when optimizing bundle size by conditionally importing components based on route metadata, prefer using inline conditional imports like:

```js
const IsolatedPage = route?.meta?.isolate ? defineAsyncComponent(() => import('#build/isolated-page.mjs')) : null
```

instead of wrapping the import in a computed property or importing the component unconditionally.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: code
  • GitHub Check: build
🔇 Additional comments (2)
packages/vite/src/vite.ts (2)

2-2: LGTM!

The import of performance from node:perf_hooks is correct for this server-side Vite configuration file. This aligns with the new ESLint rule requiring explicit imports of Node.js globals.


325-327: LGTM!

The usage of performance.now() for timing the build operations is appropriate and correctly implements high-resolution timing for the withLogs helper function.

@iiio2 iiio2 requested a review from danielroe November 4, 2025 04:16
@iiio2 iiio2 requested a review from antfu November 4, 2025 08:34
@danielroe danielroe changed the title chore: update eslint refactor(kit,nitro,nuxt,schema,vite): explicitly import process/performance Nov 4, 2025
@danielroe danielroe merged commit 26aaf83 into nuxt:main Nov 4, 2025
57 checks passed
@github-actions github-actions bot mentioned this pull request Nov 4, 2025
@iiio2
Copy link
Contributor Author

iiio2 commented Nov 4, 2025

Thanks @danielroe , @antfu . 😊

@iiio2 iiio2 deleted the chore/update-eslint branch November 4, 2025 10:12
@github-actions github-actions bot mentioned this pull request Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants