Skip to content

Conversation

JounQin
Copy link
Member

@JounQin JounQin commented Jun 20, 2025

Always use the file being linted as the "location" of the require when
loading a resolver for the file. This prevents an issue when the sourceFile
is in a dependency of the package being linted.
Add a fallback when loading a parser, the fallback uses the file being
linted as the location of the require.

Using the file being linted isn't perfect because a user might configure
the linter to lint files in other packages. However the approach is better
than what was before.

close #384


Important

Fixes Plug'n'Play issue in monorepos by improving module resolution and adding test configurations.

  • Behavior:
    • Use the file being linted as the context for moduleRequire in module-require.ts and parse() in parse.ts.
    • Add fallback for parser loading using context.physicalFilename in parse.ts.
    • Enhance resolver logic in resolve.ts to handle multiple source files and improve case sensitivity handling.
  • Testing:
    • Add test-package with ESLint and TypeScript configurations in yarn-pnp fixture.
    • Update yarn-pnp to Yarn 4.9.2 and ESLint 9.29.0.
    • Modify test scripts to include workspace linting.
  • Misc:

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


Summary by CodeRabbit

  • New Features

    • Added a new test package and configuration to improve Plug'n'Play (PnP) compatibility in monorepo setups.
    • Introduced additional test files and scripts for enhanced testing coverage with Yarn workspaces.
  • Bug Fixes

    • Improved module resolution logic for better compatibility with PnP environments and virtual filesystems.
  • Chores

    • Upgraded Yarn and ESLint dependencies to the latest versions.
    • Updated configuration files and scripts to support new testing scenarios.
  • Documentation

    • Added a changeset describing the PnP compatibility improvement.

@JounQin JounQin self-assigned this Jun 20, 2025
@JounQin JounQin added the bug Something isn't working label Jun 20, 2025
Copy link

changeset-bot bot commented Jun 20, 2025

🦋 Changeset detected

Latest commit: 4b1c73b

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

Copy link

coderabbitai bot commented Jun 20, 2025

Walkthrough

This change updates module resolution logic to improve Plug'n'Play (PnP) compatibility in monorepo setups. It modifies how modules and parsers are required, always using the file being linted as the resolution context, and introduces new test fixtures and configuration files to validate this behavior in a workspace environment.

Changes

Files / Groups Change Summary
src/utils/module-require.ts, src/utils/parse.ts Updated moduleRequire to accept a sourceFile argument and use it for module resolution; updated call sites.
src/utils/resolve.ts Enhanced file existence checks and module resolution logic to consider multiple source files and improve PnP handling.
test/fixtures/yarn-pnp/.yarnrc.yml, test/fixtures/yarn-pnp/package.json Upgraded Yarn version, added workspaces, updated scripts and ESLint dependency.
test/fixtures/yarn-pnp/test-package/* Added new workspace package with ESLint config, test script, and dependencies for monorepo PnP testing.
test/fixtures/yarn-pnp/index.js Added import and log for a virtual module to test PnP scenarios.
.changeset/poor-dolls-move.md Added changeset documenting the PnP monorepo compatibility fix.

Sequence Diagram(s)

sequenceDiagram
    participant Linter
    participant ModuleRequire
    participant Parser
    participant FileSystem

    Linter->>ModuleRequire: moduleRequire(parserPath, sourceFile)
    ModuleRequire->>FileSystem: Try require relative to eslint
    alt fails
        ModuleRequire->>FileSystem: Try require relative to main entry
        alt fails
            ModuleRequire->>FileSystem: Try require relative to sourceFile
            alt fails
                ModuleRequire->>FileSystem: Fallback to cjsRequire
            end
        end
    end
    ModuleRequire-->>Linter: parser module
    Linter->>Parser: Parse file with resolved parser
Loading

Assessment against linked issues

Objective Addressed Explanation
Use the file being linted as the "location" of require when loading a resolver ( #384 )
Add a fallback for loading a parser using the file being linted as the require location ( #384 )

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Addition of a new Yarn workspace test package and related files (test/fixtures/yarn-pnp/...) These test fixtures and configuration files are supportive but not strictly required by the objective. However, they help validate the fix and are closely related.

Suggested reviewers

  • SukkaW

Poem

A rabbit hopped through monorepo land,
Ensuring modules resolve just as planned.
With PnP quirks now out of the way,
Parsers and resolvers know where to stay.
In workspaces wide, the tests all pass—
This bunny’s fix is first in class! 🐇✨

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/parse.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:201:49)

src/utils/module-require.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:201:49)

test/fixtures/yarn-pnp/index.js

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:201:49)

  • 3 others

📜 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 87d020b and 4b1c73b.

⛔ Files ignored due to path filters (2)
  • test/fixtures/yarn-pnp/.yarn/releases/yarn-4.9.2.cjs is excluded by !**/.yarn/**
  • test/fixtures/yarn-pnp/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (10)
  • .changeset/poor-dolls-move.md (1 hunks)
  • src/utils/module-require.ts (3 hunks)
  • src/utils/parse.ts (1 hunks)
  • src/utils/resolve.ts (3 hunks)
  • test/fixtures/yarn-pnp/.yarnrc.yml (1 hunks)
  • test/fixtures/yarn-pnp/index.js (1 hunks)
  • test/fixtures/yarn-pnp/package.json (1 hunks)
  • test/fixtures/yarn-pnp/test-package/eslint.config.mjs (1 hunks)
  • test/fixtures/yarn-pnp/test-package/package.json (1 hunks)
  • test/fixtures/yarn-pnp/test-package/test.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/poor-dolls-move.md
🚧 Files skipped from review as they are similar to previous changes (8)
  • test/fixtures/yarn-pnp/.yarnrc.yml
  • test/fixtures/yarn-pnp/test-package/test.ts
  • src/utils/parse.ts
  • test/fixtures/yarn-pnp/test-package/eslint.config.mjs
  • src/utils/module-require.ts
  • test/fixtures/yarn-pnp/test-package/package.json
  • test/fixtures/yarn-pnp/package.json
  • src/utils/resolve.ts
⏰ Context from checks skipped due to timeout of 90000ms (21)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Lint and Test with Node.js 22 and ESLint 8 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 18 and ESLint 9 on ubuntu-latest
  • GitHub Check: Lint and Test with Node.js 22 and ESLint 8.56 on ubuntu-latest
  • GitHub Check: Lint and Test with Node.js 20 and ESLint 8 on windows-latest
  • GitHub Check: Lint and Test with Node.js 22 and ESLint 8.56 on windows-latest
  • GitHub Check: Lint and Test with Node.js 24 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 18 and ESLint 9 on ubuntu-latest
  • GitHub Check: Lint and Test with Node.js 22 and ESLint 8 on ubuntu-latest
  • GitHub Check: Lint and Test with Node.js 22 and ESLint 9 on ubuntu-latest
  • GitHub Check: Lint and Test with Node.js 22 and ESLint 8.56 on ubuntu-latest
  • GitHub Check: Lint and Test with Node.js 24 and ESLint 8.56 on macos-latest
  • GitHub Check: Lint and Test with Node.js 20 and ESLint 8.56 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 20 and ESLint 9 on ubuntu-latest
  • GitHub Check: Lint and Test with Node.js 20 and ESLint 8 on macos-latest
  • GitHub Check: Lint and Test with Node.js 18 and ESLint 8.56 on macos-latest
  • GitHub Check: Lint and Test with Node.js 22 and ESLint 8 on macos-latest
  • GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on macos-latest
🔇 Additional comments (2)
test/fixtures/yarn-pnp/index.js (2)

5-5: LGTM! Virtual path import validates PnP resolution.

The import from ./__virtual__/whatever-123/0/add.js appropriately tests Yarn PnP's virtual filesystem resolution, which is exactly what this fixture should validate given the PR's objectives to fix PnP issues in monorepos.


7-8: LGTM! Console logs verify successful imports.

The console.log statements for both add and add2 are appropriate for a test fixture to verify that the imports resolve correctly under the new module resolution logic.

✨ 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

codacy-production bot commented Jun 20, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.01% (target: -1.00%) 95.24%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (14cb948) 3717 3556 95.67%
Head commit (4b1c73b) 3722 (+5) 3561 (+5) 95.67% (+0.01%)

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 (#390) 21 20 95.24%

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

codesandbox-ci bot commented Jun 20, 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

socket-security bot commented Jun 20, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​rolldown/​binding-darwin-arm64@​1.0.0-beta.11-commit.f051675781003798100
Added@​rolldown/​binding-darwin-x64@​1.0.0-beta.11-commit.f051675641003798100
Added@​rolldown/​binding-freebsd-x64@​1.0.0-beta.11-commit.f051675591003798100
Added@​rolldown/​binding-linux-arm-gnueabihf@​1.0.0-beta.11-commit.f051675591003798100
Added@​rolldown/​binding-linux-arm64-gnu@​1.0.0-beta.11-commit.f051675671003798100
Added@​rolldown/​binding-linux-arm64-musl@​1.0.0-beta.11-commit.f051675671003798100
Added@​rolldown/​binding-linux-x64-gnu@​1.0.0-beta.11-commit.f0516751001003798100
Added@​rolldown/​binding-linux-x64-musl@​1.0.0-beta.11-commit.f0516751001003798100
Added@​rolldown/​binding-win32-arm64-msvc@​1.0.0-beta.11-commit.f051675581003798100
Added@​rolldown/​binding-win32-ia32-msvc@​1.0.0-beta.11-commit.f051675591003798100
Added@​rolldown/​binding-win32-x64-msvc@​1.0.0-beta.11-commit.f051675761003798100
Addedindent-string@​5.0.0671008951100
Addedansis@​4.1.01001005294100
Addedjest-regex-util@​30.0.01001006093100
Added@​babel/​plugin-syntax-async-generators@​7.8.41001006081100
Added@​babel/​plugin-syntax-bigint@​7.8.31001006081100
Added@​babel/​plugin-syntax-import-meta@​7.10.41001006081100
Added@​babel/​plugin-syntax-json-strings@​7.8.31001006081100
Added@​babel/​plugin-syntax-logical-assignment-operators@​7.10.41001006081100
Added@​babel/​plugin-syntax-nullish-coalescing-operator@​7.8.31001006081100
Added@​babel/​plugin-syntax-numeric-separator@​7.10.41001006081100
Added@​babel/​plugin-syntax-object-rest-spread@​7.8.31001006081100
Added@​babel/​plugin-syntax-optional-catch-binding@​7.8.31001006081100
Added@​babel/​plugin-syntax-optional-chaining@​7.8.31001006081100
Added@​babel/​plugin-syntax-private-property-in-object@​7.14.51001006081100
Added@​jest/​get-type@​30.0.01001006192100
Added@​jest/​globals@​30.0.01001006195100
Added@​babel/​plugin-syntax-class-properties@​7.12.131001006181100
Added@​babel/​plugin-syntax-class-static-block@​7.14.51001006181100
Added@​babel/​plugin-syntax-top-level-await@​7.14.51001006181100
See 192 more rows in the dashboard

View full report

Copy link

codecov bot commented Jun 20, 2025

Codecov Report

Attention: Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.10%. Comparing base (14cb948) to head (4b1c73b).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/utils/resolve.ts 95.83% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #390   +/-   ##
=======================================
  Coverage   96.09%   96.10%           
=======================================
  Files          96       96           
  Lines        4944     4951    +7     
  Branches     1854     1857    +3     
=======================================
+ Hits         4751     4758    +7     
  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.

Copy link

pkg-pr-new bot commented Jun 20, 2025

Open in StackBlitz

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

commit: 4b1c73b

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.

Caution

Changes requested ❌

Reviewed everything up to 7676f9c in 2 minutes and 3 seconds. Click for details.
  • Reviewed 280 lines of code in 9 files
  • Skipped 2 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/rules/no-unresolved.ts:71
  • Draft comment:
    Bypassing the case‐sensitive check when PnP is active. Ensure that skipping case validation in PnP mode is the intended behavior.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the author to ensure that skipping case validation in PnP mode is intended. This falls under the rule of not asking the author to confirm their intention or ensure behavior. Therefore, this comment should be removed.
2. src/utils/module-require.ts:14
  • Draft comment:
    New parameter 'sourceFile' is added to moduleRequire and later used with createRequire for fallback. This helps resolve modules relative to the linted file in monorepo/PnP setups.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, explaining the purpose of a new parameter. It does not provide a suggestion, ask for confirmation, or point out a potential issue.
3. src/utils/module-require.ts:29
  • Draft comment:
    A fallback using cjsRequire.main!.require(p) is added. Note the use of the non-null assertion on main; ensure that require.main is always defined in the intended environments.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. src/utils/parse.ts:120
  • Draft comment:
    Passing context.physicalFilename to moduleRequire ensures the parser is resolved relative to the file being linted. This aligns with the monorepo/PnP fix.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, explaining why a change was made. It doesn't provide a suggestion or ask for clarification on the code itself.

Workflow ID: wflow_zUmAOvLvLGYIeOeU

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 6ed2092 in 1 minute and 38 seconds. Click for details.
  • Reviewed 58 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 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/rules/no-unresolved.ts:70
  • Draft comment:
    Removed the check for process.versions.pnp. Confirm that always checking case sensitivity (even in PnP) is intentional.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. src/utils/resolve.ts:78
  • Draft comment:
    The new 'leaf' parameter and nested ternary in fileExistsWithCaseSync are subtle. Verify the logic: if no exact match and not a leaf, the check returns true when no case‐insensitive match is found, which may be inverted.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
3. test/fixtures/yarn-pnp/index.js:5
  • Draft comment:
    Test changes import an additional module (add2); consider adding assertions to validate behavior rather than only using console.log.
  • Reason this comment was not posted:
    Confidence changes required: 40% <= threshold 50% None

Workflow ID: wflow_wX9nd2Xpiv5yicrQ

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 09b61e6 in 53 seconds. Click for details.
  • Reviewed 30 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. .changeset/poor-dolls-move.md:5
  • Draft comment:
    Changeset file looks good; the version and fix message match the PR title.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. src/utils/resolve.ts:80
  • Draft comment:
    Refactored file existence check now uses Array.some with a proper case‐insensitive comparison. Verify that comparing both sides in lowercase meets the intended behavior; consider rewriting nested ternaries for clarity and add tests covering case variations.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_PWvEr0O9LX3HxmQe

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

scytacki and others added 5 commits June 25, 2025 10:24
Always use the file being linted as the "location" of the require when
loading a resolver for the file. This prevents an issue when the sourceFile
 is in a dependency of the package being linted.
Add a fallback when loading a parser, the fallback uses the file being
linted as the location of the require.

Using the file being linted isn't perfect because a user might configure
the linter to lint files in other packages. However the approach is better
than what was before.
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 4b1c73b in 54 seconds. Click for details.
  • Reviewed 43 lines of code in 3 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/resolve.ts:80
  • Draft comment:
    Improvement: The revised check now correctly lowercases both values. Consider caching parsedPath.base.toLowerCase() to avoid repeated computation over large directory listings.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. test/fixtures/yarn-pnp/index.js:5
  • Draft comment:
    Minor style: Missing semicolon at end of import statement; ensure consistency with project style.
  • Reason this comment was not posted:
    Confidence changes required: 10% <= threshold 50% None

Workflow ID: wflow_KJYJMfSpzcKlXTqa

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

@JounQin JounQin merged commit 8ca9272 into master Jun 25, 2025
129 of 130 checks passed
@JounQin JounQin deleted the yarn-pnp-fix branch June 25, 2025 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants