Skip to content

fix: should only use context.physicalFilename as fallback instead of main source #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 27, 2025

Conversation

JounQin
Copy link
Member

@JounQin JounQin commented Jun 26, 2025

close #396
close #397
close #398

We're also resolving dependencies chain inside node_modules, for example:

eslint.config.js -> typescript-eslint -> ./config-helper (would be wrong resolved here if the original eslint.config.js used as sourceFile)


Important

Fix module resolution to prioritize sourceFile over context.physicalFilename unless the module is external.

  • Behavior:
    • Adjust fullResolve() in resolve.ts to prioritize sourceFile over context.physicalFilename unless the module is external.
    • Use isExternalLookingName() to determine if a module is external.
  • Functions:
    • Export isExternalLookingName() from import-type.ts.
  • Tests:
    • Add test in resolve.spec.ts to verify sourceFile takes priority over context.physicalFilename.

This description was created by Ellipsis for 5f684d2. You can customize this summary. It will automatically update as commits are pushed.


Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes

    • Improved module resolution behavior to prioritize source files correctly during import resolution.
  • Documentation

    • Updated changelog to reflect the fix in import resolution logic.

@JounQin JounQin requested a review from Copilot June 26, 2025 05:56
@JounQin JounQin self-assigned this Jun 26, 2025
@JounQin JounQin added bug Something isn't working regression labels Jun 26, 2025
Copy link

changeset-bot bot commented Jun 26, 2025

🦋 Changeset detected

Latest commit: 5f684d2

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

This PR includes changesets to release 1 package
Name Type
eslint-plugin-import-x 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

@JounQin JounQin changed the title fix: should not use context.physicalFilename as fallback instead of main source fix: should only use context.physicalFilename as fallback instead of main source Jun 26, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request fixes an issue with fallback priority when resolving source files and updates the version of the autofix CI workflow action.

  • Reorders the array to prioritize the main source file over the physical filename fallback.
  • Updates the autofix-ci/action version to v1.3.2 in the CI workflow.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/utils/resolve.ts Reorders fallback array to prioritize the main source file
.github/workflows/autofix.yml Updates the version of autofix-ci/action to v1.3.2
Comments suppressed due to low confidence (2)

src/utils/resolve.ts:309

  • [nitpick] Consider adding a comment to explain why the 'sourceFile' is prioritized over 'context.physicalFilename' to improve code clarity and maintainability for future reviewers.
        : [sourceFile, context.physicalFilename]

.github/workflows/autofix.yml:34

  • Ensure the upgraded autofix-ci/action version is compatible with the rest of the CI setup and update related documentation if necessary.
        uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27 # v1.3.2

Copy link

coderabbitai bot commented Jun 26, 2025

Walkthrough

This change updates the fallback behavior in the eslint-plugin-import-x resolution logic to use only context.physicalFilename as a fallback. It removes an explicit type cast in the fullResolve function's caching logic and adds a new test verifying that the sourceFile argument takes precedence over physicalFilename during resolution. A changelog entry documents the fix. The function isExternalLookingName was exported for use in resolution logic.

Changes

File(s) Change Summary
src/utils/resolve.ts, src/utils/import-type.ts Modified fullResolve to conditionally use [sourceFile, context.physicalFilename] fallback only if module path is not external-looking; exported isExternalLookingName function; removed explicit type assertion when caching resolved paths.
test/utils/resolve.spec.ts Added imports and a new test case verifying that sourceFile takes precedence over physicalFilename in module resolution.
.changeset/itchy-poets-rush.md Added changelog entry clarifying fallback behavior to use only context.physicalFilename in the plugin’s resolution logic.

Assessment against linked issues

Objective Addressed Explanation
Fix false positives in named, no-cycle, and no-duplicates rules due to resolution logic (#396, #397, #398) The change clarifies fallback behavior and adds a test for resolution precedence, but does not explicitly show fixes for false positives in these rules.

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes detected.

Possibly related PRs

Suggested labels

test

Suggested reviewers

  • SukkaW

Poem

🐇 Hopping through code with a flick and a dash,
The fallback now clear, no more clash.
SourceFile leads, physical fades away,
Tests confirm all is okay!
A rabbit’s cheer for fixes so bright,
In code’s green meadow, all is right! 🌿✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/utils/import-type.ts

Oops! Something went wrong! :(

ESLint: 9.29.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/index.js' imported from /eslint.config.js
at finalizeResolution (node:internal/modules/esm/resolve:274:11)
at moduleResolve (node:internal/modules/esm/resolve:859:10)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

src/utils/resolve.ts

Oops! Something went wrong! :(

ESLint: 9.29.0

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/index.js' imported from /eslint.config.js
at finalizeResolution (node:internal/modules/esm/resolve:274:11)
at moduleResolve (node:internal/modules/esm/resolve:859:10)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f80e90e and 5f684d2.

📒 Files selected for processing (2)
  • src/utils/import-type.ts (1 hunks)
  • src/utils/resolve.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/utils/resolve.ts
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: JounQin
PR: un-ts/eslint-plugin-import-x#386
File: src/rules/prefer-namespace-import.ts:41-46
Timestamp: 2025-06-18T15:22:38.532Z
Learning: In eslint-plugin-import-x, JounQin prefers to throw on invalid rule options rather than handling them gracefully with try/catch blocks and reporting configuration errors.
Learnt from: JounQin
PR: un-ts/eslint-plugin-import-x#271
File: test/rules/no-unused-modules.spec.ts:1528-1532
Timestamp: 2025-03-30T09:06:59.006Z
Learning: The import from 'eslint8.56/use-at-your-own-risk' has incorrect TypeScript types but works correctly at runtime, which is properly handled with a `@ts-expect-error` comment.
Learnt from: JounQin
PR: un-ts/eslint-plugin-import-x#378
File: src/rules/imports-first.ts:10-19
Timestamp: 2025-06-08T12:09:38.535Z
Learning: ESLint core ExternalSpecifier interface has optional name and url string properties. The current eslint-plugin-import-x implementation correctly uses this structure for the rule property within replacedBy arrays in DeprecatedInfo objects.
Learnt from: JounQin
PR: un-ts/eslint-plugin-import-x#378
File: src/rules/imports-first.ts:10-19
Timestamp: 2025-06-08T12:09:38.535Z
Learning: The current implementation in eslint-plugin-import-x uses the correct ESLint core DeprecatedInfo structure: deprecatedSince field and replacedBy array with objects containing rule properties that match the ExternalSpecifier type with name and url fields.
Learnt from: SukkaW
PR: un-ts/eslint-plugin-import-x#272
File: src/utils/resolve.ts:0-0
Timestamp: 2025-03-30T14:44:11.779Z
Learning: In eslint-plugin-import-x's node resolver, the `modules` parameter of `createNodeResolver` function accepts both string and string array types, making it flexible when passing values like `moduleDirectory`.
Learnt from: JounQin
PR: un-ts/eslint-plugin-import-x#362
File: src/utils/create-rule.ts:0-0
Timestamp: 2025-05-31T03:10:38.972Z
Learning: When `rewriteRelativeImportExtensions` is enabled in TypeScript configuration, using `.ts` extensions in import paths is correct and necessary for Node.js ESM compatibility. TypeScript will rewrite these to `.js` during compilation.
src/utils/import-type.ts (4)
Learnt from: JounQin
PR: un-ts/eslint-plugin-import-x#378
File: src/rules/imports-first.ts:10-19
Timestamp: 2025-06-08T12:09:38.535Z
Learning: ESLint core ExternalSpecifier interface has optional name and url string properties. The current eslint-plugin-import-x implementation correctly uses this structure for the rule property within replacedBy arrays in DeprecatedInfo objects.
Learnt from: JounQin
PR: un-ts/eslint-plugin-import-x#362
File: src/utils/import-declaration.ts:1-2
Timestamp: 2025-05-31T03:11:08.864Z
Learning: TypeScript type-only imports (using `import type`) are stripped during compilation and do not affect production dependencies or bundle size. Only runtime imports need to be considered when managing production dependencies in TypeScript projects.
Learnt from: JounQin
PR: un-ts/eslint-plugin-import-x#362
File: src/utils/create-rule.ts:0-0
Timestamp: 2025-05-31T03:10:38.972Z
Learning: When `rewriteRelativeImportExtensions` is enabled in TypeScript configuration, using `.ts` extensions in import paths is correct and necessary for Node.js ESM compatibility. TypeScript will rewrite these to `.js` during compilation.
Learnt from: JounQin
PR: un-ts/eslint-plugin-import-x#271
File: test/rules/no-unused-modules.spec.ts:1528-1532
Timestamp: 2025-03-30T09:06:59.006Z
Learning: The import from 'eslint8.56/use-at-your-own-risk' has incorrect TypeScript types but works correctly at runtime, which is properly handled with a `@ts-expect-error` comment.
⏰ Context from checks skipped due to timeout of 90000ms (21)
  • GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on windows-latest
  • GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on macos-latest
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Lint and Test with Node.js 22 and ESLint 9 on windows-latest
  • GitHub Check: Lint and Test with Node.js lts/* and ESLint 9 on ubuntu-latest
  • GitHub Check: Lint and Test with Node.js 24 and ESLint 8.56 on windows-latest
  • GitHub Check: Lint and Test with Node.js 20 and ESLint 9 on windows-latest
  • GitHub Check: Lint and Test with Node.js 22 and ESLint 8 on windows-latest
  • GitHub Check: Lint and Test with Node.js 20 and ESLint 8 on windows-latest
  • GitHub Check: Lint and Test with Node.js 18 and ESLint 9 on windows-latest
  • GitHub Check: Lint and Test with Node.js 20 and ESLint 8.56 on windows-latest
  • GitHub Check: Lint and Test with Node.js 18 and ESLint 8.56 on windows-latest
  • GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on windows-latest
  • GitHub Check: Lint and Test with Node.js 24 and ESLint 9 on ubuntu-latest
  • GitHub Check: Lint and Test with Node.js 20 and ESLint 9 on ubuntu-latest
  • GitHub Check: Lint and Test with Node.js 18 and ESLint 9 on ubuntu-latest
  • GitHub Check: Lint and Test with Node.js 22 and ESLint 8.56 on macos-latest
  • GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on ubuntu-latest
  • GitHub Check: Lint and Test with Node.js 18 and ESLint 8.56 on ubuntu-latest
  • GitHub Check: Lint and Test with Node.js 18 and ESLint 9 on macos-latest
  • GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on macos-latest
🔇 Additional comments (1)
src/utils/import-type.ts (1)

286-288: LGTM! Clean export of utility function.

The function export enables its usage in the resolution logic while maintaining the existing implementation and comprehensive documentation. This change correctly supports the main fix for module resolution fallback behavior.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codesandbox-ci bot commented Jun 26, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to c0a6fc9 in 26 seconds. Click for details.
  • Reviewed 25 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/autofix.yml:34
  • Draft comment:
    Upgrade to v1.3.2 looks good. Confirm that pinning to a commit hash is acceptable for stability.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. src/utils/resolve.ts:307
  • Draft comment:
    Swapping the order of [sourceFile, context.physicalFilename] correctly prioritizes the main source. This resolves the fallback issue noted in #397.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, explaining the reason behind a code change. It doesn't ask for any specific action or suggest any improvements. According to the rules, purely informative comments should be removed.

Workflow ID: wflow_4CLH8ntT715rJpBN

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link

pkg-pr-new bot commented Jun 26, 2025

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-import-x@399

commit: 5f684d2

Copy link

codacy-production bot commented Jun 26, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (34adb40) 3722 3561 95.67%
Head commit (5f684d2) 3722 (+0) 3561 (+0) 95.67% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#399) 2 2 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Copy link

codecov bot commented Jun 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.10%. Comparing base (34adb40) to head (5f684d2).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #399   +/-   ##
=======================================
  Coverage   96.10%   96.10%           
=======================================
  Files          96       96           
  Lines        4951     4952    +1     
  Branches     1836     1862   +26     
=======================================
+ Hits         4758     4759    +1     
  Misses        192      192           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JounQin JounQin force-pushed the fix/resolve_regression branch from 5c9afe7 to f82cb46 Compare June 26, 2025 07:15
Copy link
Collaborator

@SukkaW SukkaW left a comment

Choose a reason for hiding this comment

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

Do we have a unit test case to validate this?

@JounQin
Copy link
Member Author

JounQin commented Jun 26, 2025

Do we have a unit test case to validate this?

I don't know how to add that case easily.

The 3 issues reported confirm it's working as expected.


@SukkaW Here we go: 44744b7 (#399)

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 44744b7 in 1 minute and 58 seconds. Click for details.
  • Reviewed 64 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/utils/resolve.ts:307
  • Draft comment:
    The order of sourceFiles was reversed to [context.physicalFilename, sourceFile]. The PR title and test indicate that context.physicalFilename should only be a fallback, i.e. sourceFile must take priority. Please double-check if this order is correct when both resolutions succeed.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to double-check the order of sourceFiles, which violates the rule against asking the author to confirm their intention or to double-check things. The comment does not provide a specific suggestion or ask for a test to be written, which would have been acceptable.
2. src/utils/resolve.ts:358
  • Draft comment:
    Removal of the explicit type cast in fileExistsCache.set is minor; ensure that resolved.path is handled correctly when it’s null.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment suggests ensuring that a specific behavior is handled correctly, which is not allowed. It doesn't provide a specific code suggestion or ask for a test to be written. It also doesn't point out a specific issue or ask for confirmation of an intentional change.
3. src/utils/resolve.ts:307
  • Draft comment:
    The for‐loop reuses the variable name 'sourceFile', shadowing the function parameter. Consider renaming it for clarity.
  • Reason this comment was not posted:
    Comment was on unchanged code.
4. test/utils/resolve.spec.ts:836
  • Draft comment:
    Good new test for fallback behavior. Also consider adding a test case where both context.physicalFilename and sourceFile are valid to confirm that sourceFile takes priority as intended.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.

Workflow ID: wflow_saJn4pUJl4CxL5N0

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed f80e90e in 40 seconds. Click for details.
  • Reviewed 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/utils/resolve.ts:307
  • Draft comment:
    Switch candidate order so that the main sourceFile is prioritized and context.physicalFilename is used only as a fallback.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, explaining a change in the order of candidate selection. It does not provide a suggestion, ask for confirmation, or highlight a potential issue.

Workflow ID: wflow_NRwhsiY6uGHjmzBg

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@JounQin JounQin force-pushed the fix/resolve_regression branch from f80e90e to 5f684d2 Compare June 26, 2025 15:00
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed 5f684d2 in 1 minute and 5 seconds. Click for details.
  • Reviewed 39 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/utils/import-type.ts:286
  • Draft comment:
    Exporting 'isExternalLookingName' enables reuse in other modules. Confirm this export is intentional and covered by tests.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. src/utils/resolve.ts:308
  • Draft comment:
    The conditional now uses 'sourceFile' alone unless the module is external. Verify that the fallback order [sourceFile, context.physicalFilename] is intentional and that both scenarios are tested.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None

Workflow ID: wflow_q84Xsnh4LDOyZEFr

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@JounQin JounQin requested review from SukkaW and Copilot June 26, 2025 15:06
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@controversial
Copy link

controversial commented Jun 26, 2025

This PR appears to also fix a “maximum call stack size exceeded” error I encountered on the released version:

error
Oops! Something went wrong! :(

ESLint: 9.29.0

RangeError: Maximum call stack size exceeded
Occurred while linting /Users/luke/Developer/my-project/path/to/file.ts:3
Rule: "import/export"
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:592:24
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
    at file:///Users/luke/Developer/my-project/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:594:30
ERROR: command finished with error: command (/Users/luke/Developer/my-project/path/to) /Users/luke/.bun/bin/bun run lint exited (2)
command (/Users/luke/Developer/my-project/path/to) /Users/luke/.bun/bin/bun run lint exited (2)

the error disappears on this PR version

@JounQin JounQin merged commit 33f07b4 into master Jun 27, 2025
92 checks passed
@JounQin JounQin deleted the fix/resolve_regression branch June 27, 2025 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression
Projects
None yet
3 participants