Skip to content

Conversation

@TheCodeDestroyer
Copy link
Owner

@TheCodeDestroyer TheCodeDestroyer commented Nov 9, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Added missing Node.js globals to the ESLint Next.js configuration, improving linting accuracy for projects that use Node globals.
  • Chores

    • Added a changeset for a patch release and introduced the runtime dependency that provides Node global definitions.

@changeset-bot
Copy link

changeset-bot bot commented Nov 9, 2025

🦋 Changeset detected

Latest commit: 58073a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@tcd-devkit/eslint-config-next Patch
@tcd-devkit/eslint-preset-next Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Nov 9, 2025

📝 Walkthrough

Walkthrough

Adds Node.js globals to the ESLint Next.js configuration by importing the globals package and integrating ...globals.node into languageOptions. Adds a changeset documenting a patch release and updates package.json to depend on globals.

Changes

Cohort / File(s) Summary
Changeset Documentation
\.changeset/deep-snakes-win.md
New changeset file documenting a patch release for @tcd-devkit/eslint-config-next noting the addition of missing Node globals.
ESLint Configuration
packages/eslint/eslint-config-next/src/next.linter.ts
Imported globals and added languageOptions: { globals: { ...globals.node } } to the exported nextConfig.
Package Manifest
packages/eslint/eslint-config-next/package.json
Added dependency "globals": "16.5.0" to dependencies.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Spot-check: packages/eslint/eslint-config-next/src/next.linter.ts for correct import and placement of languageOptions.
  • Validate: packages/eslint/eslint-config-next/package.json for proper JSON syntax and dependency version.
  • Verify: .changeset/deep-snakes-win.md metadata aligns with release expectations.

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding missing Node globals to the eslint-config-next package, which matches the changeset documentation and code modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-eslint-next-config-2

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

@TheCodeDestroyer TheCodeDestroyer force-pushed the fix-eslint-next-config-2 branch from c3d9dbe to deca3f8 Compare November 9, 2025 18:55
@TheCodeDestroyer TheCodeDestroyer force-pushed the fix-eslint-next-config-2 branch from deca3f8 to 58073a3 Compare November 9, 2025 18:57
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 deca3f8 and 58073a3.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • .changeset/deep-snakes-win.md (1 hunks)
  • packages/eslint/eslint-config-next/package.json (1 hunks)
  • packages/eslint/eslint-config-next/src/next.linter.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .changeset/deep-snakes-win.md
  • packages/eslint/eslint-config-next/package.json
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: TheCodeDestroyer
Repo: TheCodeDestroyer/devkit PR: 5
File: packages/eslint/eslint-config-next/package.json:68-68
Timestamp: 2025-05-23T19:29:58.142Z
Learning: In packages/eslint/eslint-config-next/package.json, the dependency "next/eslint-plugin-next": "15.4.0-canary.45" is intentionally using a canary version for enhanced types support that isn't available in stable versions yet. The maintainer plans to switch to stable once these features are officially released.
Learnt from: TheCodeDestroyer
Repo: TheCodeDestroyer/devkit PR: 32
File: eslint.config.mjs:5-10
Timestamp: 2025-05-31T20:36:11.700Z
Learning: The NextJS ESLint plugin (next/eslint-plugin-next) exports a default named plugin that requires importing as a default export and then destructuring the needed configuration (e.g., flatConfig). This pattern triggers the `import-x/no-rename-default` rule, necessitating a global disable of this rule when using NextJS ESLint configurations.
Learnt from: TheCodeDestroyer
Repo: TheCodeDestroyer/devkit PR: 5
File: packages/internal-utils/package.json:55-55
Timestamp: 2025-05-23T19:27:10.314Z
Learning: Each individual ESLint config package in the tcd-devkit monorepo has its own "imports" field that maps "#*" to their source files, enabling alias imports like #react.linter within their own package scope. The internal-utils package doesn't need an "imports" field when it only contains one source file.
Learnt from: TheCodeDestroyer
Repo: TheCodeDestroyer/devkit PR: 5
File: packages/internal-utils/src/test.utils.ts:0-0
Timestamp: 2025-05-23T18:45:38.179Z
Learning: TheCodeDestroyer prefers consistent API design and likes to use unified interface names when functions share similar option patterns, even if some properties aren't used by all functions.
Learnt from: TheCodeDestroyer
Repo: TheCodeDestroyer/devkit PR: 5
File: packages/eslint/eslint-config-import-ts/package.json:65-67
Timestamp: 2025-05-23T19:34:31.271Z
Learning: TheCodeDestroyer prefers to use Renovate for automated dependency management rather than manual dependency version updates in package.json files.
Learnt from: TheCodeDestroyer
Repo: TheCodeDestroyer/devkit PR: 7
File: renovate.json:2-4
Timestamp: 2025-05-25T09:20:16.838Z
Learning: TheCodeDestroyer prefers using local Renovate presets with the "local>" syntax to avoid external fetches, rather than GitHub-based presets.
Learnt from: TheCodeDestroyer
Repo: TheCodeDestroyer/devkit PR: 5
File: package.json:13-16
Timestamp: 2025-05-23T18:52:37.598Z
Learning: TheCodeDestroyer uses Turbo for all development task orchestration in the monorepo, with proper commands defined in turbo.json rather than npm scripts. They prefer `turbo run` commands over direct npm script execution for development workflows.
📚 Learning: 2025-05-31T20:36:11.700Z
Learnt from: TheCodeDestroyer
Repo: TheCodeDestroyer/devkit PR: 32
File: eslint.config.mjs:5-10
Timestamp: 2025-05-31T20:36:11.700Z
Learning: The NextJS ESLint plugin (next/eslint-plugin-next) exports a default named plugin that requires importing as a default export and then destructuring the needed configuration (e.g., flatConfig). This pattern triggers the `import-x/no-rename-default` rule, necessitating a global disable of this rule when using NextJS ESLint configurations.

Applied to files:

  • packages/eslint/eslint-config-next/src/next.linter.ts
📚 Learning: 2025-05-23T19:27:10.314Z
Learnt from: TheCodeDestroyer
Repo: TheCodeDestroyer/devkit PR: 5
File: packages/internal-utils/package.json:55-55
Timestamp: 2025-05-23T19:27:10.314Z
Learning: Each individual ESLint config package in the tcd-devkit monorepo has its own "imports" field that maps "#*" to their source files, enabling alias imports like #react.linter within their own package scope. The internal-utils package doesn't need an "imports" field when it only contains one source file.

Applied to files:

  • packages/eslint/eslint-config-next/src/next.linter.ts
📚 Learning: 2025-05-23T19:29:58.142Z
Learnt from: TheCodeDestroyer
Repo: TheCodeDestroyer/devkit PR: 5
File: packages/eslint/eslint-config-next/package.json:68-68
Timestamp: 2025-05-23T19:29:58.142Z
Learning: In packages/eslint/eslint-config-next/package.json, the dependency "next/eslint-plugin-next": "15.4.0-canary.45" is intentionally using a canary version for enhanced types support that isn't available in stable versions yet. The maintainer plans to switch to stable once these features are officially released.

Applied to files:

  • packages/eslint/eslint-config-next/src/next.linter.ts
📚 Learning: 2025-05-23T19:25:15.891Z
Learnt from: TheCodeDestroyer
Repo: TheCodeDestroyer/devkit PR: 5
File: packages/eslint/eslint-config-a11y/src/typings/eslint-plugin-jsx-a11y.d.ts:1-14
Timestamp: 2025-05-23T19:25:15.891Z
Learning: In TypeScript module declaration files (.d.ts) using `declare module`, adding explicit import statements for types can cause TypeScript compilation crashes and prevent module declarations from being detected. Types like Linter.Config and Linter.LegacyConfig from ESLint are typically available as ambient types without explicit imports in this context.

Applied to files:

  • packages/eslint/eslint-config-next/src/next.linter.ts
📚 Learning: 2025-05-23T17:50:17.181Z
Learnt from: TheCodeDestroyer
Repo: TheCodeDestroyer/devkit PR: 5
File: packages/eslint/eslint-config-react/src/react.linter.ts:20-20
Timestamp: 2025-05-23T17:50:17.181Z
Learning: ESLint configuration packages in the tcd-devkit ecosystem are designed to be consumed by external projects, so they may include file patterns and extensions (like mjsx, mtsx) that aren't used in the current monorepo but might be needed by consuming projects.

Applied to files:

  • packages/eslint/eslint-config-next/src/next.linter.ts
📚 Learning: 2025-05-23T18:25:39.851Z
Learnt from: TheCodeDestroyer
Repo: TheCodeDestroyer/devkit PR: 5
File: packages/eslint/eslint-config-react/package.json:80-80
Timestamp: 2025-05-23T18:25:39.851Z
Learning: The tcd-devkit ESLint configuration packages (like eslint-config-react) are built from scratch specifically for ESLint v9+ using the flat config format, not migrated from older ESLint versions.

Applied to files:

  • packages/eslint/eslint-config-next/src/next.linter.ts
📚 Learning: 2025-05-23T17:49:36.376Z
Learnt from: TheCodeDestroyer
Repo: TheCodeDestroyer/devkit PR: 5
File: packages/eslint-presets/eslint-preset-node/src/node-preset.linter.ts:14-20
Timestamp: 2025-05-23T17:49:36.376Z
Learning: The tcd-devkit preset packages (like eslint-preset-node) are designed to be combinations of existing tcd-devkit config packages rather than introducing new external plugins or rules. They serve as "plug n play" bundles for convenience.

Applied to files:

  • packages/eslint/eslint-config-next/src/next.linter.ts
🔇 Additional comments (1)
packages/eslint/eslint-config-next/src/next.linter.ts (1)

3-3: LGTM! Import statement is correct.

The import of the globals package using the default import syntax is appropriate for adding environment-specific global variables to the ESLint configuration.

@TheCodeDestroyer TheCodeDestroyer merged commit 140c7bf into main Nov 9, 2025
3 checks passed
@TheCodeDestroyer TheCodeDestroyer deleted the fix-eslint-next-config-2 branch November 9, 2025 19:15
@github-actions github-actions bot mentioned this pull request Nov 9, 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