[codex] Enforce canonical Node namespace imports#3238
Merged
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The installed Effect language-service namespaceImportPackages option was evaluated first. Its wildcard resolver supports node:*, but the import diagnostic only handles namespace re-exports from barrel modules, so it does not diagnose direct Node built-in imports. The Oxlint rule is therefore the enforcement source of truth.
Validation
Note
Low Risk
Mechanical import renames across many files with no intended runtime behavior change; risk is mainly merge noise or a missed call-site typo, not security or data handling.
Overview
This PR standardizes how the repo imports Node built-ins:
node:*modules must use namespace imports with canonical aliases likeNodeFS,NodePath,NodeChildProcess, andNodeProcess, instead of named or default imports (readFile,path,fs, etc.). Call sites are updated repo-wide in desktop scripts, server runtime/tests, mobile sync scripts, and related tooling.Macroscope guidance is aligned so
electronis no longer called out as requiring named imports alongside@t3tools/contracts; only non-Node packages keep named imports where appropriate.Behavior should be unchanged—this is import style and lint enforcement, with existing
// @effect-diagnostics nodeBuiltinImport:offescapes preserved where scripts intentionally touch Node at the boundary.Reviewed by Cursor Bugbot for commit b44c58d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Enforce canonical Node namespace imports across the codebase with a new
t3code/namespace-node-importslint rulenamespace-node-importsin thet3codeplugin that requires allnode:built-in imports to use namespace-style imports with canonical aliases (e.g.NodeFS,NodePath,NodeCrypto).node:imports acrossapps/,packages/,scripts/, and desktop scripts to the canonical namespace style.t3code/namespace-node-importsis now enforced as a lint error, so any future non-canonical Node built-in import will fail CI.Macroscope summarized b44c58d.