-
-
Notifications
You must be signed in to change notification settings - Fork 57
fix: enable nocomment glob option for rule no-unassigned-import's allow option
#352
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
Conversation
🦋 Changeset detectedLatest commit: 674a717 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 |
WalkthroughThe changes update the Changes
Sequence Diagram(s)sequenceDiagram
participant ESLint
participant Rule as no-unassigned-import Rule
participant Minimatch
ESLint->>Rule: Analyze import statement
Rule->>Minimatch: Match import path with allow list (nocomment: true)
Minimatch-->>Rule: Return match result
Rule-->>ESLint: Allow or flag import based on result
Assessment against linked issues
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
src/rules/no-unassigned-import.tsOops! Something went wrong! :( ESLint: 9.27.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/index.js' imported from /eslint.config.js test/rules/no-unassigned-import.spec.tsOops! Something went wrong! :( ESLint: 9.27.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/lib/index.js' imported from /eslint.config.js 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
⏰ Context from checks skipped due to timeout of 90000ms (20)
🔇 Additional comments (3)
✨ 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 addresses issue #347 by modifying the Changes
|
There was a problem hiding this 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 PR fixes literal path support for the no-unassigned-import rule by checking for an exact file path match in addition to glob matching. Key changes include:
- Adding new test cases in test/rules/no-unassigned-import.spec.ts to verify both literal and glob-based matching.
- Modifying src/rules/no-unassigned-import.ts to include a strict equality check for literal paths.
- Updating the changeset file to document the patch.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/rules/no-unassigned-import.spec.ts | Added test cases for exact literal and glob match scenarios |
| src/rules/no-unassigned-import.ts | Incorporated a literal equality check in the matching logic |
| .changeset/wise-tables-stop.md | Recorded the changeset entry for the patch |
|
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. |
There was a problem hiding this 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 65a6616 in 56 seconds. Click for details.
- Reviewed
48lines of code in3files - Skipped
0files when reviewing. - Skipped posting
3draft 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/wise-tables-stop.md:1
- Draft comment:
Changelog entry correctly documents the patch update. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. src/rules/no-unassigned-import.ts:24
- Draft comment:
Added literal equality check (filePath === glob) to allow exact matching of module paths like '#app/side-effects.js'. This change addresses the issue by short-circuiting glob matching when an exact literal is provided. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is purely informative, explaining the change made in the code. It does not provide a suggestion, ask for confirmation, or point out a potential issue. According to the rules, purely informative comments should be removed.
3. test/rules/no-unassigned-import.spec.ts:77
- Draft comment:
New test cases ensure that both an exact literal match and a minimatch-based (escaped) glob pattern correctly allow module paths with special characters. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_0km6Ir45NgVD5uhK
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #352 +/- ##
=======================================
Coverage 96.27% 96.27%
=======================================
Files 92 92
Lines 4836 4836
Branches 1825 1823 -2
=======================================
Hits 4656 4656
Misses 179 179
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
commit: |
… `allow` option close #347
65a6616 to
674a717
Compare
no-unassigned-import's allow optionnocomment glob option for rule no-unassigned-import's allow option
There was a problem hiding this 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 674a717 in 36 seconds. Click for details.
- Reviewed
54lines of code in3files - Skipped
0files when reviewing. - Skipped posting
3draft 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/wise-tables-stop.md:1
- Draft comment:
Changeset message is clear and concise; the patch version and commit message correctly indicate the change to support literal path matching. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. src/rules/no-unassigned-import.ts:24
- Draft comment:
Good update: both minimatch calls now include thenocomment: trueoption to correctly handle literal '#' paths (issue #347). - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
3. test/rules/no-unassigned-import.spec.ts:77
- Draft comment:
New test cases for literal '#' import paths and glob matching effectively validate the fix. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
Workflow ID: wflow_TJjBtyrFAc7mO9AH
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
close #347
Important
Enable
nocommentoption inminimatchforno-unassigned-importrule to support literal path matching.nocommentoption inminimatchforno-unassigned-importrule'sallowoption inno-unassigned-import.ts.no-unassigned-import.spec.tsfor exact path matching and glob pattern matching withnocommentoption.#app/side-effects.jsand glob patterns like\#app/side-effects.js.This description was created by
for 674a717. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit