Repository navigation
Conversation
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
On Windows,
teamai/mock-sourcesilently misses mocks of modules that only re-export another module.lintedPathreturns a drive-qualified path, butpath.posix.resolvetreats it as relative, so the rule looks for a nonexistent source file.Use native path operations to locate the mocked file and resolve relative re-exports. Normalize the suggested module specifier to forward slashes.
Type of Change
Test Plan
Verified on native Windows with Node 22.19.0 and Git 2.51.0.windows.1, based on
df433c61.node node_modules/vitest/vitest.mjs run oxlint-plugin-teamai/rules/mock-source.test.ts --retry 0: 7 failed / 4 passed before the fix; 11 passed after it. The existing cases covervi.mock,vi.doMock, extensionless and directory imports, named re-exports, relative suggestions, and allowed mocks.npm run typecheck— passed.node node_modules/oxlint/bin/oxlint --type-aware --deny-warnings --report-unused-disable-directives oxlint-plugin-teamai/rules/mock-source.js— passed.git diff --check— passed.npm run lint— blocked by 26teamai/family-factsdiagnostics, also reproduced on unmodifieddf433c61on this host. That separate Windows issue is covered by fix(lint): resolve family facts imports on Windows #1927.node scripts/check-docs.mjs— reports three driver-guide mismatches (Paseo, sandbox, T3), identically on the baseline and this branch.Full-suite and POSIX execution are left to CI. This lint-rule-only change does not require a real-CLI world run under the contribution guidelines.
Notes for Reviewers
One file, two changed lines. Existing tests supply the regression proof, including the forward-slash suggestion. The rule applies to linted tests independently of tool, driver, install scope, team mode, delivery layer, or run state. No existing docs or runtime skill guidance needs updating.
Prepared with Codex assistance for discovery, implementation, verification, and this description.