fix: try/catch enumerator.iterateFiles gracefully#360
Conversation
🦋 Changeset detectedLatest commit: 1e09f8b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
WalkthroughA new changeset was added documenting a patch for the "eslint-plugin-import-x" package. In the code, the function for listing files was renamed and enhanced to detect ESLint's flat config mode, improving error handling during file enumeration. Calls to the old function were updated to use the new implementation. Additionally, the comprehensive ESLint configuration file was removed and replaced with an empty config. New test fixtures and tests for ESLint v9 compatibility were added, along with updated documentation and dev dependencies. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Rule as no-unused-modules Rule
participant Enumerator as FileEnumerator
participant ESLint
User->>Rule: Invoke rule (resolveFiles)
Rule->>Rule: listFilesUsingFileEnumerator(src, extensions)
Rule->>ESLint: Check flat config (env var/API)
Rule->>Enumerator: Iterate files (try/catch)
alt Success
Enumerator-->>Rule: Return files
else Error (flat config detected)
Rule-->>User: Throw detailed flat config error
else Other error
Rule-->>User: Rethrow original error
end
Possibly related PRs
Poem
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
test/fixtures/eslint-v9/src/depth-zero.jsOops! Something went wrong! :( ESLint: 9.28.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/index.js' imported from /eslint.config.js .eslintrc.cjsOops! Something went wrong! :( ESLint: 9.28.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/index.js' imported from /eslint.config.js src/rules/no-unused-modules.tsOops! Something went wrong! :( ESLint: 9.28.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/index.js' imported from /eslint.config.js
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (12)
✅ Files skipped from review due to trivial changes (8)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code Graph Analysis (1)test/rules/no-unused-modules.spec.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms (21)
🔇 Additional comments (4)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
WalkthroughThis pull request introduces a try/catch mechanism around the Changes
|
There was a problem hiding this comment.
Pull Request Overview
This PR updates the file enumeration logic in the no-unused-modules rule to handle errors from FileEnumerator.iterateFiles more gracefully under ESLint flat config.
- Added detection for flat config via
shouldUseFlatConfigandESLINT_USE_FLAT_CONFIG - Wrapped
iterateFilescalls in try/catch to rethrow a clearer error when no configuration is found - Renamed
listFilesToProcesstolistFilesUsingFileEnumeratorfor clarity
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/rules/no-unused-modules.ts | Enhanced file enumeration with flat config detection and improved error handling |
| .changeset/curvy-swans-ring.md | Added changelog entry for the new graceful error handling |
Comments suppressed due to low confidence (1)
src/rules/no-unused-modules.ts:55
- This new try/catch branch for
iterateFilesshould have accompanying unit tests covering both the flat-config error path and the normal path to ensure correct behavior.
try {
|
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. |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #360 +/- ##
==========================================
- Coverage 96.16% 96.02% -0.14%
==========================================
Files 93 93
Lines 4879 4884 +5
Branches 1814 1834 +20
==========================================
- Hits 4692 4690 -2
- Misses 186 193 +7
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
commit: |
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 666a0ab in 1 minute and 47 seconds. Click for details.
- Reviewed
103lines of code in2files - Skipped
0files when reviewing. - Skipped posting
4draft 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/curvy-swans-ring.md:5
- Draft comment:
Changeset message is clear and concise. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. src/rules/no-unused-modules.ts:26
- Draft comment:
Destructure 'shouldUseFlatConfig' along with 'FileEnumerator'. Ensure its API is used correctly—if it's a function in ESLint v9, consider invoking it (e.g. shouldUseFlatConfig()) rather than using it directly. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The code already destructures shouldUseFlatConfig correctly. The comment suggests using it as a function call, but looking at lines 43-45, it's clear the code intentionally uses it as a boolean check with a ts-expect-error comment indicating this is the correct usage for ESLint v9. The comment seems to misunderstand the intended usage. Could there be documentation or ESLint v9 API specs that show shouldUseFlatConfig should be used as a function? Could the ts-expect-error be masking a real type issue? The code's usage matches the comments around it explaining ESLint v9 compatibility. The ts-expect-error is explicitly explained as handling the v9-only API. The boolean usage appears intentional and correct. The comment should be deleted as it incorrectly suggests changing working code that is already handling the API correctly for both v8 and v9 compatibility.
3. src/rules/no-unused-modules.ts:42
- Draft comment:
The try/catch block initializing 'isUsingFlatConfig' safely handles potential issues. Verify whether 'shouldUseFlatConfig' should be invoked as a function (e.g. shouldUseFlatConfig()) in ESLint v9 rather than accessed directly. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50% The code is specifically handling ESLint v9 compatibility. The comment suggests a potential bug where shouldUseFlatConfig might be a function rather than a property in v9. However, without being able to verify the ESLint v9 API directly, I can't be 100% certain if shouldUseFlatConfig is meant to be a function or property. The code has a @ts-expect-error suggesting some uncertainty about the types. I don't have direct access to ESLint v9's API documentation or source code to verify if shouldUseFlatConfig is definitely a function. The existing code may already be correct. While the comment raises a valid question about the API usage, without clear evidence that shouldUseFlatConfig is definitely a function in v9, we can't be certain the current code is wrong. Since we don't have strong evidence that the current code is incorrect, and the comment is speculative about how the API should be used, we should remove this comment.
4. src/rules/no-unused-modules.ts:68
- Draft comment:
The multi-line error message template includes a leading newline. Consider trimming it to avoid unintended formatting in the error output. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The leading newline is likely intentional to ensure the error message displays cleanly in the terminal. Error messages often benefit from starting on a new line for readability. The current format makes the message more readable and easier to distinguish from the stack trace. Removing the newline could make the error harder to read. The comment could be right that the newline is unintended. Maybe there are ESLint error message formatting conventions I'm not aware of. Even if there are conventions, the readability benefit of the newline likely outweighs strict adherence to a format. The current format serves a clear purpose in making the error more readable. The comment should be deleted. The leading newline appears intentional and beneficial for error message readability. This is a matter of style preference rather than a clear improvement.
Workflow ID: wflow_FwQtzr8LVeg163Jo
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.changeset/curvy-swans-ring.md(1 hunks)src/rules/no-unused-modules.ts(2 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
src/rules/no-unused-modules.ts
[warning] 49-49: src/rules/no-unused-modules.ts#L49
Added line #L49 was not covered by tests
[warning] 66-66: src/rules/no-unused-modules.ts#L66
Added line #L66 was not covered by tests
[warning] 68-68: src/rules/no-unused-modules.ts#L68
Added line #L68 was not covered by tests
[warning] 80-80: src/rules/no-unused-modules.ts#L80
Added line #L80 was not covered by tests
⏰ Context from checks skipped due to timeout of 90000ms (172)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Lint and Test with Node.js 18 and ESLint 9 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on ubuntu-latest
- GitHub Check: autofix
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Lint and Test with Node.js 22 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 22 and ESLint 9 on windows-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 8 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 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 9 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 8 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8.56 on ubuntu-latest
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Lint and Test with Node.js 18 and ESLint 9 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on ubuntu-latest
- GitHub Check: autofix
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Lint and Test with Node.js 22 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 22 and ESLint 9 on windows-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 8 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 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 9 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 8 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8.56 on ubuntu-latest
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Lint and Test with Node.js 18 and ESLint 9 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on ubuntu-latest
- GitHub Check: autofix
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Lint and Test with Node.js 22 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 22 and ESLint 9 on windows-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 8 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 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 9 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 8 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8.56 on ubuntu-latest
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Lint and Test with Node.js 18 and ESLint 9 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on ubuntu-latest
- GitHub Check: autofix
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Lint and Test with Node.js 22 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 22 and ESLint 9 on windows-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 8 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 20 and ESLint 8.56 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 18 and ESLint 8.56 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 18 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 24 and ESLint 8 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8.56 on ubuntu-latest
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Lint and Test with Node.js 18 and ESLint 9 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on ubuntu-latest
- GitHub Check: autofix
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Lint and Test with Node.js 22 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 22 and ESLint 9 on windows-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 8 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 20 and ESLint 8.56 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 18 and ESLint 8.56 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 18 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 24 and ESLint 8 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8.56 on ubuntu-latest
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Lint and Test with Node.js 18 and ESLint 9 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on ubuntu-latest
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Lint and Test with Node.js 22 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 22 and ESLint 9 on windows-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 8 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 20 and ESLint 8.56 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 18 and ESLint 8.56 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 18 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 24 and ESLint 8 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8.56 on ubuntu-latest
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Lint and Test with Node.js 18 and ESLint 9 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on ubuntu-latest
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Lint and Test with Node.js 22 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 22 and ESLint 9 on windows-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 8 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 20 and ESLint 8.56 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 18 and ESLint 8.56 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 18 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 24 and ESLint 8 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8.56 on ubuntu-latest
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Lint and Test with Node.js 18 and ESLint 9 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on ubuntu-latest
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Lint and Test with Node.js 22 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 22 and ESLint 9 on windows-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 8 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 20 and ESLint 8.56 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 18 and ESLint 8.56 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 18 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 24 and ESLint 8 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8.56 on ubuntu-latest
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Lint and Test with Node.js 18 and ESLint 9 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on ubuntu-latest
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Lint and Test with Node.js 22 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 22 and ESLint 9 on windows-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 8 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 20 and ESLint 8.56 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 18 and ESLint 8.56 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 18 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 24 and ESLint 8 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8.56 on ubuntu-latest
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Lint and Test with Node.js 18 and ESLint 9 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8 on ubuntu-latest
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Lint and Test with Node.js 22 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 22 and ESLint 9 on windows-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 8 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 20 and ESLint 8.56 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 18 and ESLint 8.56 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 18 and ESLint 8 on windows-latest
- GitHub Check: Lint and Test with Node.js 24 and ESLint 8 on ubuntu-latest
- GitHub Check: Lint and Test with Node.js 18 and ESLint 8.56 on ubuntu-latest
🔇 Additional comments (5)
src/rules/no-unused-modules.ts (4)
26-26: LGTM - Good addition ofshouldUseFlatConfigimport.The destructuring of
shouldUseFlatConfigfromeslintUnsupportedApiis correctly added to support the flat config detection logic.
28-31: Clear function naming and parameter documentation.The function renaming from
listFilesToProcesstolistFilesUsingFileEnumeratoris more descriptive and accurately reflects its implementation using FileEnumerator.
189-189: Function call correctly updated.The call to
listFilesUsingFileEnumeratorcorrectly replaces the old function name for source files enumeration.
192-195: Function call correctly updated for ignored files.The call to
listFilesUsingFileEnumeratorcorrectly replaces the old function name for ignored files enumeration, maintaining the same parameter structure..changeset/curvy-swans-ring.md (1)
1-6: Well-documented changeset for the error handling improvement.The changeset correctly documents this as a patch-level change and accurately describes the fix for graceful error handling around
enumerator.iterateFiles. The title aligns with the PR objective and the implementation changes.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed 1e09f8b in 1 minute and 27 seconds. Click for details.
- Reviewed
378lines of code in12files - Skipped
1files when reviewing. - Skipped posting
5draft 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. test/utils.ts:63
- Draft comment:
The default parserOptions set ecmaVersion to 9 which may be outdated for modern syntax. Consider updating it to a more recent ECMAScript version (e.g. 2018+) to support newer language features. - 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.
2. test/utils.ts:152
- Draft comment:
Avoid using the 'as never' cast when merging test case options. Using such a cast can mask type errors; prefer a more precise type assertion to maintain type safety. - 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.
3. test/utils.ts:32
- Draft comment:
Consider caching the result of requiring '@typescript-eslint/parser/package.json' to avoid repeated file system accesses if this function is called multiple times. - 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. test/utils.ts:28
- Draft comment:
Consider adding explicit return types for exported functions (e.g. tsVersionSatisfies) to improve readability and maintainability. - Reason this comment was not posted:
Comment was on unchanged code.
5. package.json:126
- Draft comment:
There appears to be a typographical error in the dependency name on line 126. It is written as "@unts/patch-package"; please double-check if this should be "@un-ts/patch-package" or the intended name. - 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.
Workflow ID: wflow_Oqhgh3TBFMRUGaiC
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Important
Improve error handling for
enumerator.iterateFilesinno-unused-modules.tswith try/catch and update documentation for flat config compatibility.listFilesUsingFileEnumerator()inno-unused-modules.tsto handle errors fromenumerator.iterateFiles..eslintrc.no-unused-modules.mdto clarify rule compatibility with flat config.@types/tmpandtmptopackage.json.no-unused-modules.spec.tsto verify error handling with ESLint v9.This description was created by
for 1e09f8b. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit